parallel animation with different (random) start-frame

Talk among developers, and propose and discuss general development planning/tackling/etc... feature in this forum.
Post Reply
pontiac
Elite
Elite
Posts: 1454
Joined: Sun Jan 12, 2003 6:24 pm
Location: Far out in the uncharted backwaters of the unfashionable end of the western spiral arm of the Galaxy
Contact:

parallel animation with different (random) start-frame

Post by pontiac »

I haven't found a way to define a random start frame for animations.
So the same animation used several times in the same unit/whatever will NOT be synchron.
Is this (easy) possible with the VS-engine?

practical example:

* photon torpedo
* several (~4) animated "sparks" (getting bigger and smaller)
* unfortunately the animations all start at the same time/frame

Is there more use for this feature?

Pontiac
hellcatv
Developer
Developer
Posts: 3980
Joined: Fri Jan 03, 2003 4:53 am
Location: Stanford, CA
Contact:

Post by hellcatv »

I could prolly make it start at a random frame if you specify a tag...
why not, eh? :-)

usually starting at frame 0 is a big advantage
Vega Strike Lead Developer
http://vegastrike.sourceforge.net/
pontiac
Elite
Elite
Posts: 1454
Joined: Sun Jan 12, 2003 6:24 pm
Location: Far out in the uncharted backwaters of the unfashionable end of the western spiral arm of the Galaxy
Contact:

Post by pontiac »

hellcatv wrote:I could prolly make it start at a random frame if you specify a tag...
why not, eh? :-)
So something like this will be possible (The animation starts at the beginning without the 'random' tag.)?

Code: Select all

10 10
20 0.1 random

textureframe1.xxx alphaframe1.png
textureframe2.png alphaframe2.png
.. ..
But mind, that this is meant for using one and the same animation several times but with different starting frames. I don't know how animations (start/end) are handled in the engine.
usually starting at frame 0 is a big advantage
But not always intended. Just think of animations which are scaled bigger and smaller all the time. (see photon example)
So when i put some of them in the same place they will animate synchon......looking very odd ;-)

Pontiac
hellcatv
Developer
Developer
Posts: 3980
Joined: Fri Jan 03, 2003 4:53 am
Location: Stanford, CA
Contact:

Post by hellcatv »

well now you can specify a startframe in the mesh tag

and if you make it RANDOM then it'll choose a random one

if you make it ASYNC then each mesh will start on a random frame instead of the whole unit starting together :-)

sound good?

I'll commit a binary soon
Vega Strike Lead Developer
http://vegastrike.sourceforge.net/
pontiac
Elite
Elite
Posts: 1454
Joined: Sun Jan 12, 2003 6:24 pm
Location: Far out in the uncharted backwaters of the unfashionable end of the western spiral arm of the Galaxy
Contact:

Post by pontiac »

hellcatv wrote:well now you can specify a startframe in the mesh tag

and if you make it RANDOM then it'll choose a random one

if you make it ASYNC then each mesh will start on a random frame instead of the whole unit starting together :-)

sound good?

I'll commit a binary soon
Whoot, that was a fast coding-response :shock: 8)
Just to make things clear (at least for me)... are we talking mesh- or picture-animation now?
$me meant picture-animations in the first post (-> the scaling effect of the sparks is created by a picture animation).


Pontiac
hellcatv
Developer
Developer
Posts: 3980
Joined: Fri Jan 03, 2003 4:53 am
Location: Stanford, CA
Contact:

Post by hellcatv »

oh--I thought you meant mesh animations.... hmm picture animations... I'll have to think about that....
Vega Strike Lead Developer
http://vegastrike.sourceforge.net/
pontiac
Elite
Elite
Posts: 1454
Joined: Sun Jan 12, 2003 6:24 pm
Location: Far out in the uncharted backwaters of the unfashionable end of the western spiral arm of the Galaxy
Contact:

Post by pontiac »

hellcatv wrote:oh--I thought you meant mesh animations....
My bad, should have written more clearly what i meant.
Thanks anyway for the mesh-animation features, I think they will be as usefull as the one for picture animations.
hmm picture animations... I'll have to think about that....
If they all point to one animation/picture I think it would be a pain to code this :?

Pontiac
hellcatv
Developer
Developer
Posts: 3980
Joined: Fri Jan 03, 2003 4:53 am
Location: Stanford, CA
Contact:

Post by hellcatv »

any given mesh must have the same texture active at a given time ....
but if you want to make that mesh start at a random frame then you can do
<Meshfile texturestarttime="RANDOM" file="nova.xmesh"/>

or specify a concrete time...
but if you have 2 novas or 2 photons then you're outta luck--unless you make 2 similar meshes with the photon animation--the reason is that we need all the meshes to have the same texture so that drawing speed may be improved to the maximum (save memory bandwidth)


if you want animated meshes to start at a random frame this is how:
<Meshfile startframe="RANDOM" file="nova.xmesh"/>

hope that helps...it's not perfect but it'll have to do...
if you want you can make the geometry animate...2 frames of that...then each one can have its texture in a different place :-)
or something....
Vega Strike Lead Developer
http://vegastrike.sourceforge.net/
peteyg
Elite
Elite
Posts: 1465
Joined: Thu Jan 02, 2003 12:01 pm
Location: Seattle, WA
Contact:

Post by peteyg »

I think it would be fine that way, Dan. It looks fine when all parts of a single torpedo are in sync... but having each individual torpedo in a spread look a bit different would definately be a good thing.

It'll work that way, right?
pontiac
Elite
Elite
Posts: 1454
Joined: Sun Jan 12, 2003 6:24 pm
Location: Far out in the uncharted backwaters of the unfashionable end of the western spiral arm of the Galaxy
Contact:

Post by pontiac »

PeteyG wrote:I think it would be fine that way, Dan. It looks fine when all parts of a single torpedo are in sync... but having each individual torpedo in a spread look a bit different would definately be a good thing.

It'll work that way, right?
Not sure, but unfortunately I can't use this method for the existing photon torpedo (i think).
The reason is: I used the accessory-method (no mesh-frames needed) instead of the mesh-animation method.
And to simulate the growing/pulsing of the "spikes" I just used an animated texture.

When using the accessory-method the only thing in synch is the texture-animation of the torpedos.
The rotating part is started exactly when the torpedo is launched (shifted in time).

But i may be wrong .... it's a bit late (after midnight here)...had a long day ..... must go to beeeeee....*yawn*...eeed.

@hellcatv:
Updated the wiki entry about editing unit files (VsHowtoEditUnitFiles).
I hope I got it right.


Pontiac
Post Reply