New animation system is finally in

Improving the artwork in Warzone2100 - not for mod discussions
User avatar
astorian
Trained
Trained
Posts: 154
Joined: 29 Jun 2009, 12:26

Re: New animation system is finally in

Post by astorian »

Great work Per :) I am excited to see progress in the pie animation system.
If i read the instructions and comments correctly, the export data from the blender script can be used.
It seems the pie has to be constructed manually from mesh, textures and animation data.
Even i do not understand: "Each level can now have separate animation framerates and cycle counts (how many times to run an animation, zero for infinity)." - is time the only constant here to sync all object animations?

P.S. It would be awesome to have blender support again to import and export pie with textures and animations in one (export) go.
But since you can reference different pie model for animation i see it would be tricky.

My regards,
Astorian
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: New animation system is finally in

Post by Per »

Currently you would export the PIE as normal, then add in some animation afterward. Yes, animation support in the blender plugin would be awesome, if someone could add that.

What other ways to sync animations would/should there be except time?
User avatar
astorian
Trained
Trained
Posts: 154
Joined: 29 Jun 2009, 12:26

Re: New animation system is finally in

Post by astorian »

Per wrote:Currently you would export the PIE as normal, then add in some animation afterward. Yes, animation support in the blender plugin would be awesome, if someone could add that.
I meant to use the data from blender animtrans export viewtopic.php?f=5&t=12053&p=131265&hili ... rt#p131265.
Per wrote:What other ways to sync animations would/should there be except time?
Well frames per second should be the constant for all objects animated together.
For example if you animate one part of a model 100fps and other 20 fps, you will see that one animation is fluent and the other seems to be lagging a bit.
But i guess that has to be tested.
User avatar
astorian
Trained
Trained
Posts: 154
Joined: 29 Jun 2009, 12:26

Re: New animation system is finally in

Post by astorian »

Hello, i wanted to put some time into animation testing, however i am not able to find the documentation.
the link https://github.com/Warzone2100/warzone2 ... n.markdown is not working.
Can you please let me know where i can find the actual information about the current supported animation system?
Thank you
Astorian
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: New animation system is finally in

Post by NoQ »

Seems that all .markdown files were renamed to .md, but links were not updated.
User avatar
astorian
Trained
Trained
Posts: 154
Joined: 29 Jun 2009, 12:26

Re: New animation system is finally in

Post by astorian »

Thank you NoQ :)
User avatar
astorian
Trained
Trained
Posts: 154
Joined: 29 Jun 2009, 12:26

Re: New animation system is finally in

Post by astorian »

Reading through the documentation i have question regarding:
EVENT

EVENT type filename.pie
An animation event associated with this model. If the event type is triggered, the model is replaced with the specified model for the duration of the event. The following event types are defined:

1 - Active event. What this means depends on the type of model. For droids this means movement, while for power generators it means they are linked to a power source.
2 - Firing. The model is firing at some enemy.
3 - Dying. The model is dying. You (almost) always want to make sure animation cycles for this model is set to 1 for the specified model - if it is zero, it will never die!

AND
ANIMOBJECT

ANIMOBJECT time cycles frames
If the mesh is animated, this directive will tell the game how to animate it. The values are the total animation time (of all frames), the number of cycles to render the animation, where zero is infinitely many, and finally the number of animation frames that follows.

Animation frame

frame xpos ypos zpos xrot yrot zrot xscale yscale zscale
Each animation line starts with the serially increasing frame number, followed by three (x, y, z) vectors, one for position, one for rotation, and one for scaling.

If the scaling values are negative, they indicate that the animation is a legacy keyframe animation sequence. Do not use this in future content.
If i define EVENT - do i have to point to another PIE file for the model and animation, or can i target the same (itself) PIE file? (as default/rest pose for example)
As i do not see the pointer in ANIMOBJECT to which an EVENT it belongs to, should every PIE have only one ANIMOBJECT defined?
My best regards,
Astorian
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: New animation system is finally in

Post by Per »

For EVENT, you need to specify another file. The first PIE file (not referenced by any EVENT directives) would be the default/rest pose case.

Each mesh/level may have its own ANIMOBJECT directive. The event that a model/PIE file belongs to is defined by EVENT directives pointing to that file from elsewhere.

Hope that is more clear.
User avatar
astorian
Trained
Trained
Posts: 154
Joined: 29 Jun 2009, 12:26

Re: New animation system is finally in

Post by astorian »

Per wrote: Hope that is more clear.
Hello Per, That is clear now :)
You mentioned, that there could be a problem when both Event 1 (propulsion) and Event 2 (firing) where triggered at the same time.
Can you please clarify?
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: New animation system is finally in

Post by Per »

We can only do one animation event at a time, and the same event applies to the whole model. If one event triggers while another is active, there is no general rule about what should happen, ie if the second one should replace the first or if the second one should be ignored. There is some logic in the code to handle it on a case by case basis that I hope is correct but is not much tested.

If you see any such issues, let me know.
User avatar
astorian
Trained
Trained
Posts: 154
Joined: 29 Jun 2009, 12:26

Re: New animation system is finally in

Post by astorian »

Thank you, i will try to make a test asap and get back with results. Do i have to download the latest executable?
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: New animation system is finally in

Post by Per »

The latest stable release should do.
Methuselas
New user
Posts: 1
Joined: 29 Nov 2017, 22:49

Re: New animation system is finally in

Post by Methuselas »

Sorry to necro an old thread.

I'm looking for an engine to recreate the old Mechcommander 2 game. I used to do art for Mechcommander Omnitech an in so far, this seems to be the best engine to use for such purposes.

I tried to look at the documentation on the new animation system, but can't find it, as the link is dead. Can anyone point me to the documentation and explain a few things for me?

1. I'm unfamiliar with the ".pie" format. I'm assuming it was proprietary, like MC2's tgl (known as ASE) format. Does it save the static model and keep the animation files separately?

2. I see that this engine supports bones. Is it limited to FK or can it use IK? I am a character modeler, so I work exclusively in Maya, but would you be able to reuse the same skeleton to reuse animations over and over again?

3. Does the Engine support LOD? If not, what's the typical poly count per Unit and Prop. Do meshes have a limit?

4. I see there is possibly shader support. Could anyone tell me what shaders are allowed, what file formats can be used and what's the maximum file size per texture?

5. How would one export models and animations in the ".pie" format. The link to the blender plugin was also dead.

TIA and sorry for raising the dead thread.

-M
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: New animation system is finally in

Post by NoQ »

I don't know much, but here are some answers.
NoQ wrote:Seems that all .markdown files were renamed to .md, but links were not updated.
https://github.com/Warzone2100/warzone2 ... imation.md
https://github.com/Warzone2100/warzone2 ... doc/PIE.md

PIE is a local format that is a plain-text list of polygon coordinates, with some metadata. Berg would probably be able to undig the correct obj2pie link, but this looks familiar: https://sourceforge.net/projects/wzgrap ... s/obj2pie/ and see also /tools/ in the game sources.

I guess you won't be able to re-use the same skeleton animation for different models. There are just 2 (two) walking people models in the base game (did you try glest? - seems a lot more walking people characters, you might prefer that).

Polycount for most models in the current game is very low, on the order of 10-20, i.e. a pair of bricks is typical (however each tank is built of 3 models - body, propulsion, weapon, so it looks kinda fine). There's no level-of-detail as far as i know (there used to be level-of-detail for terrain textures, which doesn't make sense anymore if ever). This accounts for 11 players with 150 units each. However, ArtRevolution mod contains models with much higher polycount, which seems to work quite well anyway.
User avatar
astorian
Trained
Trained
Posts: 154
Joined: 29 Jun 2009, 12:26

Re: New animation system is finally in

Post by astorian »

Hi Methuselas,
as far i understand the animation ANIM3DTRANS type, all the mesh you want to animate has to be split up to separate objects.
Why? because the animation does not support mesh deform.
Since the animation is working by reading the animation rotation,location and scale, you can use your skeleton/bones/armature rig, but the animation is aplpyed to objects only.
Together with Jorzi i have investigated the animation and we made an export script for blender.
Here viewtopic.php?f=6&t=12032&hilit=animation+ani is the development thread,
and here viewtopic.php?f=5&t=12053&p=135808&hili ... ni#p135808 is the final script.
I am working in Blender only but i try to explain.
You can take your model, and break the mesh into separate objects - one object for every animated part.
For example lets take upper leg, lower leg and foot. Every object has to have its origin/pivot point at 0.0.0 space coordinates.
Use your armature/skeleton to move and rotate the individual objects - by parenting upper leg to upper leg bone, lower leg to lower leg bone and foot to foot bone.
Check animation if all objects are behaving as you want them to.
Then export the location rotation and scale of the objects only.

best regards,
Astorian
Post Reply