Page 1 of 1

Trees moving in the wind

Posted: 20 Oct 2008, 22:35
by submarine
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?

Re: Trees moving in the wind

Posted: 21 Oct 2008, 00:40
by Cremuss
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 :-)

Re: Trees moving in the wind

Posted: 21 Oct 2008, 03:00
by FLOZi
I'm more interested in a better grass shader

Re: Trees moving in the wind

Posted: 21 Oct 2008, 07:39
by CarRepairer
The answer my friend, is trees moving in the wind.

Re: Trees moving in the wind

Posted: 21 Oct 2008, 10:15
by yuritch
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.

Re: Trees moving in the wind

Posted: 21 Oct 2008, 11:42
by AF
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

Posted: 21 Oct 2008, 14:31
by Tobi
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 :-)

Re: Trees moving in the wind

Posted: 21 Oct 2008, 15:02
by submarine
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

Posted: 21 Oct 2008, 16:24
by AF
Only the trees currently onscreen need to move and only those close enough for it to be noticed

Re: Trees moving in the wind

Posted: 21 Oct 2008, 17:40
by Tobi
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 :-P

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

Posted: 21 Oct 2008, 17:47
by submarine
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.
That's what I wanted to do...

Re: Trees moving in the wind

Posted: 21 Oct 2008, 17:50
by tizbac
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

Posted: 22 Oct 2008, 16:48
by Tobi
Mods/maps can already override shaders atm cause they are also loaded through the VFS.

Re: Trees moving in the wind

Posted: 22 Oct 2008, 23:12
by Noruas
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

Posted: 23 Oct 2008, 06:34
by REVENGE
Can't we just allow MoveCtrl be applied to features as well? That way we could set orientation, move features around, have rockslides, etc.