Trees moving in the wind
Moderator: Moderators
Trees moving in the wind
I'm not sure if this has already been suggested, I did a quick search without any result so I decided to post this idea:
I think trees moving in the wind would be a great way to make maps look more alive. Maybe tree movement could be linked to the current wind speed/direction to get an even more realistic feeling. I cant judge on the amount of work required to implement this, it does not sound very difficult to me (for someone who's more familiar with the engine - I would try to codeit myself but I think I better spend my time on AAI)
What do other ppl think?
I think trees moving in the wind would be a great way to make maps look more alive. Maybe tree movement could be linked to the current wind speed/direction to get an even more realistic feeling. I cant judge on the amount of work required to implement this, it does not sound very difficult to me (for someone who's more familiar with the engine - I would try to codeit myself but I think I better spend my time on AAI)
What do other ppl think?
Re: Trees moving in the wind
I think it's a bit useless for an RTS engine. It sounds more an extra feature than a needed one actually.
I'm more interested by a new shield shader and a new shadow engine like Argh said
I'm more interested by a new shield shader and a new shadow engine like Argh said

Re: Trees moving in the wind
I'm more interested in a better grass shader
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: Trees moving in the wind
The answer my friend, is trees moving in the wind.
Re: Trees moving in the wind
This could be done if features (trees, and other things too) could have COB scripts running for them. As it is now, features are static, and can only change while taking damage (I'm not sure about the default trees however, many maps use custom tree features instead anyway).
This also means that moving trees are already possible if using something like Argh's World Builder (or some other piece of lua that spawns them), when they are actually neutral units that can have scripts and so can react to many things including wind.
This also means that moving trees are already possible if using something like Argh's World Builder (or some other piece of lua that spawns them), when they are actually neutral units that can have scripts and so can react to many things including wind.
Re: Trees moving in the wind
The trees have the feature names tree1- tree16, thus a lua gadget could replace all instances of the trees with neutral tree units.
Re: Trees moving in the wind
Do realize that anything which needs any update function being run at all is a lot more CPU intensive then anything which doesn't.
Normal trees only get in the list of features that require update when they start burning or falling down, and until that they are only rendered. (ie. feature update loop only goes through geos then I think)
IOW, I don't think putting 5000 moving trees on a map would be good idea
Normal trees only get in the list of features that require update when they start burning or falling down, and until that they are only rendered. (ie. feature update loop only goes through geos then I think)
IOW, I don't think putting 5000 moving trees on a map would be good idea

Re: Trees moving in the wind
I'm not very familiar with all these new LUA capabilities, maybe moving trees can be done via LUA scripting but that was not what i meant. Having 1000s of trees as units is not what I was talking about, I was rather thinking about updating the orientation of trees according to current wind every few frames hardcoded in the engine. It is not that performance hungry, is it?
Re: Trees moving in the wind
Only the trees currently onscreen need to move and only those close enough for it to be noticed
Re: Trees moving in the wind
Which means you need to build entire new infrastructure to allow for mod/map defined unsynced animation that's only executed when on screen and close enough to camera 
Or hardcode it for built in trees but that's against general spirit of making things mod-definable
Shouldn't be too hard tho to just glRotate() every built in tree thats rendered a bit in wind direction, if someone is bored.

Or hardcode it for built in trees but that's against general spirit of making things mod-definable

Shouldn't be too hard tho to just glRotate() every built in tree thats rendered a bit in wind direction, if someone is bored.
Re: Trees moving in the wind
That's what I wanted to do...Tobi wrote: Shouldn't be too hard tho to just glRotate() every built in tree thats rendered a bit in wind direction, if someone is bored.
Re: Trees moving in the wind
I think that spring needs multiple lights support with shadows(very good for night maps) and allowing mod defined terrain & water shader
Re: Trees moving in the wind
Mods/maps can already override shaders atm cause they are also loaded through the VFS.
Re: Trees moving in the wind
Can't you have multiple features inside one looped code instead of having multiple features with each one having a unique code dedicated to it?
Re: Trees moving in the wind
Can't we just allow MoveCtrl be applied to features as well? That way we could set orientation, move features around, have rockslides, etc.