Planetside Software Forums

General => Terragen Discussion => Topic started by: Mohawk20 on April 04, 2008, 12:12:07 PM

Title: Dogs of War *Finished*!
Post by: Mohawk20 on April 04, 2008, 12:12:07 PM
I have a problem you can probably help me with...

I had an idea for an animation when hearing a song (Pink Floyd - Dogs of War), and it involved having an army and battlefield.
So I got to work in Poser to make me some knights.

Here comes the problem: the population is too random, there's no order in the ranks. Besides that, instead of only using 1 knight 3000 times, I made 5 different ones. All knights have 34 materials, so I cut them in 3 pieces. For every knight population, I have to create 3 pops. For the whole army I would need 15 populations... my system doesn't handle that all to well, so I brought it down to 3 knight, or 9 populations.

How can I randomly place 9 different populations in a nice orderly grid without overlapping?


Initial discussion and renders are found here: http://www.ashundar.com/index.php?topic=4293.0


Thanks very much for any input...
Title: Re: Dogs of War
Post by: rcallicotte on April 04, 2008, 12:24:31 PM
Have you seen this? - http://forums.planetside.co.uk/index.php?topic=3733.0
Title: Re: Dogs of War
Post by: Mohawk20 on April 04, 2008, 01:46:42 PM
There are some references to those node systems in the ashundar thread... it is very conveniant, and I will certainly use it.

The main problem is how to get 3 to 5 different populations in the same area without overlapping, but together filling up the whole grid.
Title: Re: Dogs of War
Post by: rcallicotte on April 04, 2008, 03:54:57 PM
I haven't tried this, Mohawk.  Experimentation might be the best way, unless someone who has tried that can join in here.
Title: Re: Dogs of War
Post by: gregsandor on April 04, 2008, 05:48:42 PM
Multiple populations, masked to keep them all on the road.  You can also mask individual populations to order by types of soldier. 
Title: Re: Dogs of War
Post by: rcallicotte on April 04, 2008, 05:56:12 PM
Pretty cool.  Did you use that link (above) to get started or come up with another solution?
Title: Re: Dogs of War
Post by: gregsandor on April 04, 2008, 06:02:56 PM
I rendered it about a year ago, with masked populations.
Title: Re: Dogs of War
Post by: Mohawk20 on April 04, 2008, 06:13:17 PM
What kind of masks did you use?
Title: Re: Dogs of War
Post by: gregsandor on April 04, 2008, 06:16:08 PM
Each type is a population set to use Compute Terrain so it stands on the ground.  The pupulations all are constrained by dimensions and then further by a mask to keep them where I want them -- there is some randomness within the constraints.
Title: Re: Dogs of War
Post by: Mohawk20 on April 05, 2008, 05:28:08 PM
I managed to get the pops not overlapping by using a different pop seed alongside the different densityshader seeds.
http://www.ashundar.com/gallery/displayimage.php?pos=-5184

Still only 3 figures in total 9 populations...
I had to drasticly resize a lot of the textures and save them at lower quality, because in previous renders the bumpmaps were not used. These maps were quite large around 1500x1500... The biggest problem is that every figure has the same textures, so every texmap has to be loaded atleast trice, but in some cases multiple material groups use the same texture, so some texturemaps have to be loaded 12 times.

My question: why not load a map once in the program and apply it to all objects that need them, instead of loading the same map so many times, clogging the renderbucket?
Title: Re: Dogs of War
Post by: gregsandor on April 05, 2008, 07:01:28 PM
Quote from: Mohawk20 on April 05, 2008, 05:28:08 PM
I managed to get the pops not overlapping by using a different pop seed alongside the different densityshader seeds.
http://www.ashundar.com/gallery/displayimage.php?pos=-5184

Still only 3 figures in total 9 populations...
I had to drasticly resize a lot of the textures and save them at lower quality, because in previous renders the bumpmaps were not used. These maps were quite large around 1500x1500... The biggest problem is that every figure has the same textures, so every texmap has to be loaded atleast trice, but in some cases multiple material groups use the same texture, so some texturemaps have to be loaded 12 times.

My question: why not load a map once in the program and apply it to all objects that need them, instead of loading the same map so many times, clogging the renderbucket?

Look closeley at the node setup I posted.  All of the Aztecs share textures (of course your models must be properly mapped to be able to do this).  After you load the models, go into the model and remove the shaders and rest them to use the same external shaders.  The maps I use on the figures are 1024x.  There is no need to reload the same texture multiple times.
Title: Re: Dogs of War
Post by: rcallicotte on April 05, 2008, 07:22:03 PM
This would work for Poser figures, then.  Correct?  Instead of loading Hip, Abdomen, Chest maps...I could just load the torso.  Is this what you're saying? 


Quote from: gregsandor on April 05, 2008, 07:01:28 PM
...go into the model and remove the shaders and rest them to use the same external shaders.  The maps I use on the figures are 1024x.  There is no need to reload the same texture multiple times.
Title: Re: Dogs of War
Post by: gregsandor on April 05, 2008, 07:40:48 PM
Quote from: calico on April 05, 2008, 07:22:03 PM
This would work for Poser figures, then.  Correct?  Instead of loading Hip, Abdomen, Chest maps...I could just load the torso.  Is this what you're saying? 


Quote from: gregsandor on April 05, 2008, 07:01:28 PM
...go into the model and remove the shaders and rest them to use the same external shaders.  The maps I use on the figures are 1024x.  There is no need to reload the same texture multiple times.

Those are all Poser figures from http://www.3dcommune.com/3d/store/display.mv?vs_mura_pcloth , posed and exported as single objects.
Title: Re: Dogs of War
Post by: rcallicotte on April 05, 2008, 09:32:35 PM
Cool. So am I correct in understanding what you're saying about just loading the head map once and the torso map once, rather than all of the various sub-mappings which use the same head map and same torso map?
Title: Re: Dogs of War
Post by: gregsandor on April 05, 2008, 10:20:57 PM
If I understand you, yes.  Theres no reason to have fifteen different copies of the same shader.  Plug all the refs into it once.  Why duplicate it?
Title: Re: Dogs of War
Post by: Mohawk20 on April 06, 2008, 03:20:19 AM
So in the default shaders image nodes I select an image function, instead of an imagemap, is that it?
Title: Re: Dogs of War
Post by: gregsandor on April 06, 2008, 05:17:15 AM
Keep it simple to start until you get the hang of it.  Use a simple image map and plu it in to see how it goes together.  Later you can use functions and fractals and all the complicated jazz.
Title: Re: Dogs of War
Post by: Mohawk20 on April 06, 2008, 06:27:51 AM
No, I mean how do I get an external imageshader connected to the internal input?


[Edit:] Nevermind, found it. The settings of the objectloader has a tab for the surface shader, and there it can be assigned. So now I can use more populations, without filling the render bucket!

Back to the first problem, setting the populations to only use a random part of the grid formation without overlapping... [/Edit]
Title: Re: Dogs of War
Post by: Mr_Lamppost on April 06, 2008, 04:23:39 PM
This may be a little confusing as I am responding to a specific post I made on the Ashundar counterpart to this thread but this is part of what you are after. Five objects distributed in one population; yes we all know you can't do that so what is needed is five populations all using the same settings and seed to control the points where the instances are placed.  That part is easy, the hard part is masking the distribution of five populations so that each instance point is only used once.

Well this appears to work.  Sorry I had to set the quality of the jpeg so low but I needed a file small enough to be able to upload, you should still be able to see that while some of the soldiers are standing suspiciously close together there are no actual overlaps.  These would be easy to spot as the flanges on the stand in peg objects are at different heights for  each population.
Title: Re: Dogs of War
Post by: Mr_Lamppost on April 06, 2008, 04:24:32 PM
The nodes to create the five masks from a single Power Fractal are fairly simple; see screen grab.

There is also a zip containing the tgd and the soldier pegs.

Yes I know you also want the soldiers lined up in formations using an array of spots.  I'm working on that.
Title: Re: Dogs of War
Post by: Mohawk20 on April 06, 2008, 05:50:51 PM
Dude, you're the best... If I was a girl you would get a kiss  :-* :P
But I'm not that kind of man, so you'll have to do with 'thanks a lot!' ;)

I did fix the texture problem, so I'm now rendering a fairly simple shot of the 15 populations, with different pop seeds only minimal overlapping...



I promise all of you to do a nice animation with fitting music when we get this working.
Title: Re: Dogs of War
Post by: rcallicotte on April 06, 2008, 05:58:25 PM
Mr. Lamppost, this is brilliant!  Thank you.
Title: Re: Dogs of War
Post by: Mr_Lamppost on April 06, 2008, 07:05:34 PM
The node network is a little more complex and I may not be using the most efficient method of generating the array of dots but it is fairly simple to multiply them with each of the masks and so create a set of distributions.  While the masking of the separate populations still works there is the problem of populating all the dots, without doubling up.  Making the spacing so small that some of the dots contain more than one instance. 

The tgd uses the same stand in pegs as the first version.
Title: Re: Dogs of War
Post by: Mohawk20 on April 07, 2008, 06:59:19 AM
I'm rendering with these settings now!

[Edit:]And this is the result: 5 figures in 3 parts = 15 populations. With centeralized textures ind complex distribution. Waddayathink?[/Edit]
Title: Re: Dogs of War
Post by: Mr_Lamppost on April 07, 2008, 03:31:22 PM
That is starting to look more like an army.  I can see at least one instance where there are two soldiers overlapping, this can happen if your object spacing is too small allowing two soldiers on one grid dot. Even is the object spacing is large enough to prevent the doubling up a dot that is on the boundary of the mask can get used twice if you use different seed values.  I am working on a solution to this just now.
Title: Re: Dogs of War
Post by: nvseal on April 07, 2008, 03:59:25 PM
That's looking pretty good.  8)
Title: Re: Dogs of War
Post by: Mohawk20 on April 07, 2008, 05:18:27 PM
Thanks nvseal...

I'll check the seeds again, and set the object spacing from 15 to 20...



[Edit:] When all populations have the same seed they will all use the same spot... If I change the seed they go apart. Strange. I am using your distribution functions. I had to set them to invert otherwise the objects would disappear from inside the populations bounding box...[/Edit]
Title: Re: Dogs of War
Post by: Mr_Lamppost on April 07, 2008, 05:41:36 PM
This is only a concept preview, I will post the final implementation shortly. 

This version uses a completely different way of generating the masks for the populations, in this demo I have used them as blend controllers for five surface layers to make the grid of coloured squares.  I have overlaid the grid of dots so that you can see that once they are combined it will be absolutely guaranteed that each dot will only be present in one of the masked populations.  This should allow the different populations to use different seed values and even object spacing hopefully making it easier to populate every dot in the grid.

Title: Re: Dogs of War
Post by: Mr_Lamppost on April 07, 2008, 07:05:08 PM
Here it is; The random square masks applied to the populations, all of which are using different seed values. None of the dots are used twice.

I have left the dots and squares faintly visible.  Just remove the six surface layers from the shaders to get rid of this and make the node network a little less complex. 

As the squares and dots are closely linked there are two master control nodes, both Constant Scalars, which have been labelled Dot Spacing and Dot Size.  These have been placed outside any of the groups.  The way each of the square cell is assigned to the population masks is controlled by the four Colour Adjust shaders, as before. However as the distribution is now based on a Perlin Noise function rather than a power fractal the values needed are less obvious. 

This is only a quick render to show the setup working, there are lots of unpopulated dots, I have made no effort to adjust the population setting to try to cover these. 
Title: Re: Dogs of War
Post by: Christopher on April 07, 2008, 10:28:43 PM
This is pretty interesting stuff here. Does this mean we can make trees and bushes different colors like what you guys had done with the examples here.
Title: Re: Dogs of War
Post by: jo on April 07, 2008, 10:38:56 PM
Hi,

Quote from: Mr_Lamppost on April 07, 2008, 03:31:22 PM
I can see at least one instance where there are two soldiers overlapping,

They're just good friends.

Seriously though, this stuff you're doing is why TG2 has a node network - so there is the opportunity to extend it's capabilities beyond what we support directly.

Regards,

Jo
Title: Re: Dogs of War
Post by: Mohawk20 on April 08, 2008, 02:54:03 AM
Quote from: Christopher on April 07, 2008, 10:28:43 PM
This is pretty interesting stuff here. Does this mean we can make trees and bushes different colors like what you guys had done with the examples here.

No, this is purely for positioning in a grod instead of random placement. The colours are just different populations...

Thanks Mr L! I'm gonna try it now, and render while I'm away.
Title: Re: Dogs of War
Post by: mogn on April 08, 2008, 04:54:29 AM
Another implementations for avoiding conditonals. This tgc implements 6 masks, each selecting a different diagonal in a grid.

Title: Re: Dogs of War
Post by: Will on April 08, 2008, 06:09:04 AM
Reminds me of shots from the Total War series of games.
Title: Re: Dogs of War
Post by: Mohawk20 on April 08, 2008, 06:29:21 AM
Quote from: mogn on April 08, 2008, 04:54:29 AM
Another implementations for avoiding conditonals. This tgc implements 6 masks, each selecting a different diagonal in a grid.



Nice in itself, but for this situation still a bit too uniform... I will keep this in mind though!
Title: Re: Dogs of War
Post by: Mohawk20 on April 08, 2008, 11:39:04 AM
It's not working I'm afraid...

No overlapping, but no grid either... I've played with the constant scalars 'dot size' and 'dot spacing', but no grid. My figures are resized by 10 and spaced by 15, but that shouldn't make a difference.

The one thing that is really different is that I have to Invert the density shaders to get the objects to show up...
Title: Re: Dogs of War
Post by: Mr_Lamppost on April 08, 2008, 06:10:29 PM
Quote from: Mohawk20 on April 08, 2008, 11:39:04 AM
It's not working I'm afraid...

No overlapping, but no grid either... I've played with the constant scalars 'dot size' and 'dot spacing', but no grid. My figures are resized by 10 and spaced by 15, but that shouldn't make a difference.

The one thing that is really different is that I have to Invert the density shaders to get the objects to show up...

I don't get that, it should work for your figures as well as my stand in pegs.  The only thing I can think is that it is an issue of scale.  The base of the pegs has a radius of 0.25m, making the base 0.5m across, the same size as the little grid square.  The object spacing of the populations is 0.8m, which gives a peg on around 60% of the grid without doubling up.  If you are inverting the density shaders you are placing soldiers everywhere except on the grid points.

Quote from: jo on April 07, 2008, 10:38:56 PM
Seriously though, this stuff you're doing is why TG2 has a node network - so there is the opportunity to extend it's capabilities beyond what we support directly.

Regards,

Jo

It is also interesting to see that in many instances there is more than one solution; or at least a different way of constructing similar solutions.  Is anyone counting haw many ways there are to define that array of dots? 
Title: Re: Dogs of War
Post by: Mohawk20 on April 08, 2008, 07:30:20 PM
Quote from: Mr_Lamppost on April 08, 2008, 06:10:29 PM

If you are inverting the density shaders you are placing soldiers everywhere except on the grid points.


Yeah, but otherwise they won't be placed anywhere... I'll download one of those measuring boxes, to see how big I made my soldiers, maybe then we can resize the grid.

I've just spent 3 hours cutting the background music, and mainly creating the camera path accordingly. It's easyer to make the camera path if you have allready defined the final length and start and end, and some main checkpoints. Still a lot of work, certainly with TG chrashing every once in a while...

[Edit:]Just tried the 10M one, and I found out my Knights are about 7 meters tall! Beneath is the resulting render... So what should be the grid settings now?[/Edit]
Title: Re: Dogs of War
Post by: rcallicotte on April 09, 2008, 09:35:58 AM
Used Mr. Lampost's file from this thread with 5 different species of trees - http://forums.planetside.co.uk/index.php?topic=3789.0
Title: Re: Dogs of War
Post by: Mohawk20 on April 09, 2008, 01:27:51 PM
I promised to do an animation when the scene was done... my question is, should I render the animation with or without the grid formation. Because I got a lot of positive comments on the current formation...
Title: Re: Dogs of War
Post by: Mr_Lamppost on April 09, 2008, 05:58:15 PM
As your warriors are about three times the size of my stand in pegs try:

Grid Size = 12
Dot Size = 1.5

And set the Object Spacing in the populations to 2.4

I have just rendered a low quality test with the pegs and these settings work.  I also tried Grid Size = 8 for a more closely packed formation. 
Title: Re: Dogs of War
Post by: Mohawk20 on April 10, 2008, 03:45:33 AM
Grid size is 'dot spacing'?

With those settings, especially the 2.4 object spacing, all figures overlap, making a heavily packed box in the pop area...
Title: Re: Dogs of War
Post by: Mohawk20 on April 10, 2008, 06:48:20 AM
OK, appearently some things are not quite working the same way here....

I've zipped all files need, and the TGD into a file of 146.6 Mb.
So if you have the time and the bandwith, you can download it here: http://mikel.hbyte.net/files/Battle Knight.zip (http://mikel.hbyte.net/files/BattleKnight.zip), and play with it until it does what your pegs do.
Title: Re: Dogs of War
Post by: Mr_Lamppost on April 10, 2008, 02:23:55 PM
I am actually just off out for the evening but I have set your file to download, if I cat back at a sensible time I'll have a look when I get In, if not tomorrow. 

Assuming that you remembered to stop inverting the density shader; it sounds as if the dots have become disconnected somewhere.

Title: Re: Dogs of War
Post by: Mohawk20 on April 10, 2008, 03:05:58 PM
Well, to be honest, I tried to turn that off, but the boundingboxes started to disappear again...

[Edit:]After trying again, I feel ashamed to admit it does work when the Density Shader isn't inverted. However, it's good you take a look at the files, because while I fixed the doubles I got with Object spacing of 2.4 by changing to 3, I still have some empty spots. How do I increase the coverage?

But it does work, so you may slap me in the face for frustrating you unneededly!
You made a great set of nodes we should all keep close by! [/Edit]
Title: Re: Dogs of War
Post by: Mr_Lamppost on April 11, 2008, 09:14:56 PM
Quote from: Mohawk20 on April 10, 2008, 03:05:58 PM
Well, to be honest, I tried to turn that off, but the boundingboxes started to disappear again...

[Edit:]After trying again, I feel ashamed to admit it does work when the Density Shader isn't inverted. However, it's good you take a look at the files, because while I fixed the doubles I got with Object spacing of 2.4 by changing to 3, I still have some empty spots. How do I increase the coverage?

But it does work, so you may slap me in the face for frustrating you unneededly!
You made a great set of nodes we should all keep close by! [/Edit]

I am pleased you got it to work; even with some dot not covered.  This is mostly because I can't load your project.  I did fix all the file links so I am guessing that I am running out of memory. 

Even with the stand in pegs I was not getting all the dots covered.  Because the distribution of instances in a population is very random, with the object spacing being a general guide only getting dots covered is always going to be a hit and miss affair.  At least being able to use different seeds for each population without having to worry that any dots being be used twice lets you try different seed values until an optimal combination of distributions is found.
Title: Re: Dogs of War
Post by: Mohawk20 on April 12, 2008, 03:25:33 AM
Ohw well, at least you now have a knight figure to play with...

I'll try to optimize the seed for max coverage. In the mean time, I just rendered frame 39 of the animation.
It has 1920 frames, but the army isn't visible in the first half, so I have enough time to change the army.
Title: Re: Dogs of War
Post by: Mohawk20 on April 16, 2008, 01:54:17 PM
By changing the settings of the Masks 'colour adjust shaders', I managed to get the whole pop area filled, more or less. A few doubles, but it looks pretty good.

Here's the tgd to look at, and a screenshot of the preview window...

[Edit:]And a nice li'll render is here: http://www.ashundar.com/gallery/displayimage.php?pos=-5203[/Edit]
Title: Re: Dogs of War
Post by: Mohawk20 on April 21, 2008, 11:56:02 AM
As promised, the first small bit of video.
It turns out it's not how the final will look, because I made some midway modifications.
I'm actually still editing the camera path a few hundred frames ahead...

Not rendered at full quality anyways so not really final anyhow.
This clip is avery raw cut with no fade-ins or -outs, and it just cuts off.
It's only an impression.
http://mikel.hbyte.net/files/Dogs%20of%20War%20Pre-test.avi 13 Mb, encoded with the XVid codec.

Here's also the next frame in the animation, to point out the differences.
Title: Re: Dogs of War
Post by: RedSquare on May 13, 2008, 09:55:58 PM
Short but sweet, tho' tis on the dark side and quite a fast camera.  But I wish you all the best.   ;D
Title: Re: Dogs of War
Post by: Mohawk20 on May 14, 2008, 04:34:33 AM
Thanks, but it's gonna take a while longer... The current memory leak makes it not fun to let the pc go on on it's own. Every 20 frames the renderbucket is full, and the 5 frames before that are only half rendered!

Patiently waiting for the fix...
Title: Re: Dogs of War
Post by: RedSquare on May 14, 2008, 06:43:44 AM
QuoteThe current memory leak makes it not fun to let the pc go on on it's own. Every 20 frames the renderbucket is full, and the 5 frames before that are only half rendered!

Really, I haven't touched to my shame TG for over a year so I'm somewhat out of touch.  But that must be sooooo  frustrating  my heart bleeds for you.
Title: Re: Dogs of War
Post by: Mohawk20 on August 24, 2008, 03:24:46 AM
Hmmm, it's been quiet on this topic for a long time...

HOWEVER... I got some frames rendered!
(Actually, the one pc that's been rendering for the last 2 weeks has gone from frame 721 to 1211!)

And having 1200 odd frames I decided to put the video and audio together I got so far, and see what happens.
I know there are some artifacts in the animation, like black spots, but those are faulty renders (bucket issues) that just have to be re-rendered in the latest build (in which the latest have been done).

No matter, here is the link to the 82 Mb XVid avi: http://mikel.hbyte.net/files/Dogs of War Pre-test 2.avi (http://mikel.hbyte.net/files/DogsofWarPre-test2.avi)

(Edit: Fixed the url codes around the link, should work fine now...)
Title: Re: Dogs of War
Post by: cyphyr on August 24, 2008, 07:36:38 AM
sweet :)

Richard
Title: Re: Dogs of War
Post by: Seth on August 24, 2008, 02:24:31 PM
nice !
i would like to see more animations with TG2...
damn i wish to have a biiiig computer so i could try it :(
Title: Re: Dogs of War
Post by: Mohawk20 on September 25, 2008, 11:20:13 AM
And finally it's finished!!
There are some bugs in the objects in a few frames, but let's not dwell on that.

The anim is 138 Mb in .wmv format.
You can download it here: Dogs of War.wmv (http://mikel.hbyte.net/Files/Dogs%20of%20War.wmv)
(Put it on full screen, it looks pretty good actually.)

Or you could look it up on youtube, but it's low quality and very dark... http://uk.youtube.com/watch?v=3n_ixJZEXds (http://uk.youtube.com/watch?v=3n_ixJZEXds)
Title: Re: Dogs of War *Finished*!
Post by: Mohawk20 on September 26, 2008, 02:51:27 AM
I got some comments on a ashundar that it was to dark, so here are the light versions:
Dogs of War Light.wmv (http://mikel.hbyte.net/Files/DogsofWarLight.wmv). It's 124 Mb, a bit smaller than the previous version because I downgraded the audio from 48KHz to 44KHz, but nobody will hear the difference anyway.

This is the youtube link to the lighter version: http://www.youtube.com/watch?v=vF95mTzVtxs (http://www.youtube.com/watch?v=vF95mTzVtxs).
You can select the High quality version in a small link beneath the video, but it's still darker...
Title: Re: Dogs of War *Finished*!
Post by: dandelO on September 26, 2008, 05:56:31 AM
I think it's really nice, everything seems smooth in the camera transition. The surfacing is good enough, the only crit' I have is what you've already pointed out, there seems to be some flickering and 'doubled' models in there.

Lovely animation, nice atmo. Now, animate the battle! ;)

* Maybe your guys can go up against Hannes' guys...? http://forums.planetside.co.uk/index.php?topic=4812.0 ;)
Title: Re: Dogs of War *Finished*!
Post by: Mohawk20 on September 26, 2008, 06:26:31 AM
Quote from: dandelO on September 26, 2008, 05:56:31 AM
Lovely animation, nice atmo. Now, animate the battle! ;)

* Maybe your guys can go up against Hannes' guys...? http://forums.planetside.co.uk/index.php?topic=4812.0 ;)

Nah, his guys are low poly. My guys would win even if outnumbered 1000 to 1!  ;)

Animating a battle would require software like Massive, and if I could use a free version (which I can't legally), then I still would need another app to render in, namely Maya. That's a lot of extra software... to buy ánd to learn!