Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 984 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Reusable animation scenes between entities #82141
07/19/06 05:57
07/19/06 05:57
Joined: Jul 2005
Posts: 366
eleroux Offline OP
Senior Member
eleroux  Offline OP
Senior Member

Joined: Jul 2005
Posts: 366
I don't know if this has been requested. I think there should be a way to reuse skeletal (bones) animations, or to store animations separatedly in a way that these scenes can be used by more than one model.

The easiest way I imagine this to be implemented (just a suggestion), is simply to have this function:

ent_animate(ENTITY* entity,STRING* scene,var percent,var mode)

to have an overdriven version as:

ent_animate(ENTITY* entity, ENTITY* source_ent, STRING* scene,var percent,var mode)

In the later case, the animated scene would be 'borrowed' from the second "source_ent" entity. So, I could create, say, a new enemy soldier, with the same skeleton, but no animations - and animate it using scenes from an already animated model, or simply from a model called 'soldier_animations', given it is loaded as an entity.

I think this would not mess current 3dgs programming structure, but would allow to animate lots of models with the same skeleton. Of course it implies that the target entity shares the same skeleton as the source_ent entity, but that would be up to the user. Bones that share the same name would be rotated, scaled etc. exactly as in the source_ent, and the other bones would be ignored.

The uses for this are obvious. Yet let me tell you:

1) I often find myself animating the same scenes again, even if I am making one more pirate, soldier, or zombie model variation. It would be far easier if I could use the animation stored in a single model.

2) If I decide to tweak some common scene like attack or walk cycle, I would not need to edit every single model for this.

3) Model files could be smaller (?)


Of course it doesn't apply to all cases. But, in many scenarios, you would probably have lots of different models with the same phisycal structure and skeleton!

I don't know the drawbacks - if it would be slow or something. I was thinking on creating a _dll plugin for this, but not only it would be a lot of work (practically rewriting ent_animate in c++) but also it wouldn't take so many parameters.


Regards,

Re: Reusable animation scenes between entities [Re: eleroux] #82142
07/19/06 08:23
07/19/06 08:23
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Although sometimes you can't avoid to re-animate characters, its pretty useful if you have one-size-fits-all characters so that you practically need only one animation set - and because you have multiple characters with the same proportions, its easy. Oblivion does this also, though, the characters are assembled meshes. Nevertheless they apply the same boneset to every character, or let us say character class, an org or an elve are a bit different than humans in movement, of course.

Technically, it is somehow complicated, because when you use another skeleton, the skeleton information in your model file has to 100% to the skeleton you are referencing to. That means: bone names, bone amount, etc.pp. So it would be better if you have an animated skeleton file which the model is referencing to, and in the model, the vertex assignement have to stored in a new chunk extra for this bone referencing. This would require, though, very much work I think.

Regarding speed issues I could imagine that using one referenced model with this technique could be as slow/fast as that model with inherited bone set. Though, I could imagine that when the screen is flooded with one dozen or more characters that are using one skeleton, it could be faster, of course.

Nevertheless, I would like that, too.

Re: Reusable animation scenes between entities [Re: HeelX] #82143
07/19/06 13:23
07/19/06 13:23
Joined: Jul 2005
Posts: 366
eleroux Offline OP
Senior Member
eleroux  Offline OP
Senior Member

Joined: Jul 2005
Posts: 366
You reminded me of another situation, which is character clothes! If I have a character and a set of armor, if I add a new animation scene to the character, I have to add it to all the armors too!

Well, I don't know the "inners" of 3dgs, and the mdl7 format isn't public, but, as in most model formats, I would think that bones animation frames are simply values for rotation, translation and scaling of named bones. So, as easy as it would be to have models with 100% the same structure, I don't see the need for that. If a model has a 'head' bone, this bone will follow the frame values from the source 'head' bone. If either source or target entities have an extra 'nose' and 'hair' bones, they would be ignored.

And isn't the vertex assignment a specific model chunk already? I could have a source entity that is a simple skeleton with no geometry, or another meshed entity with geometry and assignments. The vertex assignments on the source model don't matter, as they would hardly be the same as the target entity.

Well, that's all speculation, since I am no expert. Anyway, my hopes is that this would not be a lot of work really, and is interesting enough to be implemented in future versions..

Cheers,

|Emilio|

Re: Reusable animation scenes between entities [Re: eleroux] #82144
07/19/06 13:41
07/19/06 13:41
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
You can use the same animation for all your models. Just save and load the bones across models.

Re: Reusable animation scenes between entities [Re: jcl] #82145
07/19/06 14:07
07/19/06 14:07
Joined: Jan 2004
Posts: 2,013
The Netherlands
E
Excessus Offline
Expert
Excessus  Offline
Expert
E

Joined: Jan 2004
Posts: 2,013
The Netherlands
Yes but that doesn't take away these advantages of such a system:
Quote:

2) If I decide to tweak some common scene like attack or walk cycle, I would not need to edit every single model for this.

3) Model files could be smaller (?)



I think this would be a really great improvement.

It could be implemented like this:
The bone animations are saved to an external file. This file contains the bone names and their rotations/translations for every frame.
For every model, a skeleton with the same bone names as in the animation file is created or imported and then the vertices are attached.
You then use ent_animate to animate an entity with the given scene from the given animation file. Bones that don't exist in the skeleton are ignored.

A similar system is used by 3ds max (Biped system) and it works very well.

Re: Reusable animation scenes between entities [Re: Excessus] #82146
07/19/06 14:16
07/19/06 14:16
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
You're right. I'll consider this and will check with which effort this can be implemented.

Re: Reusable animation scenes between entities [Re: jcl] #82147
07/19/06 14:38
07/19/06 14:38
Joined: Jul 2005
Posts: 366
eleroux Offline OP
Senior Member
eleroux  Offline OP
Senior Member

Joined: Jul 2005
Posts: 366
Thanks Jcl!

I insist in that perhaps it would not be necessary to have a specific 'external file' format. Any entity/model file will do, with or without geometry, as far as it has a skeleton. This way entities can benefit from animations contained in any other entity, and also use their own as usual.

In the best case this wouldn't need to mess in the mdl7 format at all. Just the new ent_animate() function that could take info from one mdl7 to animate another mdl7's bones.

Re: Reusable animation scenes between entities [Re: eleroux] #82148
07/19/06 14:51
07/19/06 14:51
Joined: Jul 2005
Posts: 366
eleroux Offline OP
Senior Member
eleroux  Offline OP
Senior Member

Joined: Jul 2005
Posts: 366
*just another idea would be to append animation scenes to entities at runtime time. SOmething like

ent_appendframes(ENTITY* entity, STRING* filename)

For example:

you = ent_create("soldier.mdl", position.x, soldier_action);
ent_appendframes(you, "soldier_animations.mdl"); //appends all scenes to entity

Yet the former suggestion may be simpler to implement?

Re: Reusable animation scenes between entities [Re: eleroux] #82149
07/19/06 15:15
07/19/06 15:15
Joined: Jan 2004
Posts: 2,013
The Netherlands
E
Excessus Offline
Expert
Excessus  Offline
Expert
E

Joined: Jan 2004
Posts: 2,013
The Netherlands
Thanks JCL! Please let us know when you have made a decision regarding the implementation of this feature (but take your time )

Re: Reusable animation scenes between entities [Re: jcl] #82150
07/25/06 15:39
07/25/06 15:39
Joined: Jul 2005
Posts: 366
eleroux Offline OP
Senior Member
eleroux  Offline OP
Senior Member

Joined: Jul 2005
Posts: 366
Quote:

You can use the same animation for all your models. Just save and load the bones across models.





In the meantime, I could use any help to make this easier.
How can I accomplish the line above? Save Bones... Load bones..

My target models are already rigged - with a skeleton - I only need the animation frames from another model.

Page 1 of 2 1 2

Moderated by  aztec, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1