Author Topic: Sharing animations between units  (Read 3894 times)

Bloodwurm

  • Guest
Sharing animations between units
« on: 29 March 2012, 14:31:01 »
Hi all,

My end goal would be to be able to have certain animations applied to any type of unit that could potentially "support" it.

What I was thinking:

I'd like to create a humanoid skeleton
Animate that skeleton (so have say walk/run/jump/one handed melee attack/idle animations etc...)
Have several units that use the same skeleton but with different textures.

Where I see it might not work:

Texture reference is done in the G3D file, can it be removed?
Code would obviously need to change if textures are not specified within the G3D file anymore and said texture would need to be specified in unit's xml

So many gameplay features can be developped from this that I'm tempted in dropping them all in this request, but I'll start with these questions :)

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: Sharing animations between units
« Reply #1 on: 29 March 2012, 14:49:39 »
Would it be easier to adopt a skeletal format like md5?

wciow

  • Behemoth
  • *******
  • Posts: 968
    • View Profile
Re: Sharing animations between units
« Reply #2 on: 29 March 2012, 15:14:36 »
Currently it is possible to have a skeleton and animations in Blender and simply change the model and re-export each time. If you just want to change the texture (same model and skeleton) its simple to re-reference the texture file and re-export. The textures are referenced in the G3D file, but for some reason changing the name seems to break the G3D file  :confused: So currently you have to re-export all the animations from within Blender to change the texture of a model. This is a time consuming PITA!

So there are really two options here.

1) Fix the export script/engine so texture names can be manually changed without breaking the model file. This will help alot with textures but models will still need to rexport if you want the same skeletal animations on multiple different meshes. 

2) Move GAE to a full skeleton/mesh/shader based system like MD5. 
Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

Bloodwurm

  • Guest
Re: Sharing animations between units
« Reply #3 on: 29 March 2012, 15:48:48 »
It would effectively be imperative that I don't have to reexport all the anims for every unit.
I would like to have it be more modular.

One of the use case I was thinking about was something in those lines:

Imagine a soldier armed with a sword. We can imagine several animations for that sword wielding unit: stab, swipe, block, dodge, etc...
Now imagine a special attack, the soldier takes the sword two handed and does a powerful downward slash.

Now imagine another soldier, armed with a club instead of a sword. He could reuse the exact same animations, having to re-export them would just be a pain.

Also, adding a new type of attack for the melee single weapon wielding unit would mean reexporting the animation for every unit using the animation. Pain.....

Imagine the sword wielding soldier dying, dropping his weapon to the ground. Imagine a peasant go by and pick up that weapon. Possibilities become endless.....

(Yeah I know the different weapon themselves are another topic entirely! I guess it would need to be attached to the unit in some way and separately animated...)

I guess it would be a rather huge undertaking to go towards skeleton/md5 system? Besides more versatility, would there be other benefits to support MD5? What would be the drawbacks?

wciow

  • Behemoth
  • *******
  • Posts: 968
    • View Profile
Re: Sharing animations between units
« Reply #4 on: 30 March 2012, 09:54:12 »
I think you need the opinion of an experienced coder as to whether it would be easier to create a seperate skeletal animation system for G3D or plug in an existing file format with pre-made code/libraries. 
Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

Bloodwurm

  • Guest
Re: Sharing animations between units
« Reply #5 on: 30 March 2012, 13:21:33 »
Experienced coder as in "not on these forums"?

I was hoping someone from the glest/gae/megaglest teams could help evaluate the task...

ChupaReaper

  • Guest
Re: Sharing animations between units
« Reply #6 on: 30 March 2012, 21:34:45 »
Would it be easier to adopt a skeletal format like md5?
This is the best option, has been a request for a long time, only its a lot of work to implement so may be quite a long time until we see md5. Would be useful to mix animations too, like make a run animation then add a sword swing animation on top that doesn't affect the leg bones, this would allow for running attacks. Also rag-doll death animations!

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: Sharing animations between units
« Reply #7 on: 31 March 2012, 01:18:01 »
I was hoping someone from the glest/gae/megaglest teams could help evaluate the task...
Nobody's seen an original Glest team member in eons, and the GAE guys have been pretty busy elsewhere.  Your best bet may be to pick some MegaGlest brains on IRC.

 

anything