One model, several parts. How?

Started by
8 comments, last by ASL 18 years, 8 months ago
Hi, I'm working on how to warn the game-engine user that a specific part of the entity was hit (like head, right leg, left wing). So far, the game developer has to create a different entity for each different part and change the parts of the same element together to keep the animations synchronized. I wanted to make this whole process easier for the developer. And I'm looking for ideas, tips, papers, websites, etc to help me figure out the best way to do it. So far, I'm considering something like a scene node (don't know if I should use scene nodes without any change or make a special scheme for entities). The developer will add models to the entity and then use the entity as just one object. When a collision is detected (for example), it will return the object and the sub-object to the user. I also thought that I could have just one visualization model and several other very very simple overlaping models for physics and collision detection computations moving along with the one used for visualization. Performance is a major concern. So... Any ideas? Anyone knows how the big, famous, expensive game-engines work? Thanks
Advertisement
in halflife you could attack bodygroups submeshes which could be activated when needed

in quake3d i think these bodygroups are attached to "tags"

search for the md3 modelformal specification these plenty of information about this topic

basically its just a submesh/model which is enabled when you decide to display it

http://www.8ung.at/basiror/theironcross.html
if you are speaking about skinned meshes(players) than you can check for collision with the bone bounding boxes.

regards,
m4gnus
"There are 10 types of people in the world... those who understand binary and those who don't."
Quote:Original post by Basiror
in quake3d i think these bodygroups are attached to "tags"

search for the md3 modelformal specification these plenty of information about this topic


Just FYI: You are correct in that Quake 3 Models we're tied together by tags, but they had nothing to do with hit-detection, just positioning information. Sadly, Quake 3 (and oddly enough even Doom 3) had no locational damage. Shooting someone in the foot did just as much damage as shooting them in the head. Doesn't matter much if you're blasting away with a rocket launcher, I suppose...

In any case, like m4gnus said: if you're animations are skeletal based, just use that for hit detection. There's a nice visual example of this kind of system Here. With something like this, and if you're artist named the bones, it should be relatively easy to return the bone name that the hit was associated with. "Head", "Upper_Left_Arm", "Tail"... Whatever.

// The user formerly known as Tojiro67445, formerly known as Toji [smile]
I don't know much about models. My engine is currently using md2 models, which, as far as my knowledge is concerned, do not have skeletal information. I suppose I could export the skeleton in a sepparate file? md3 models include skeleton information?
I'd second the bone method. I'd think the best way to do it would be to either directly check the bones bounding boxes if you're not too fussed about accuracy, or otherwise to check which face has been hit and either apply damage to all sections (bones) that influence the face, perhaps proportionally to the influence, or you could simply apply damage to the bone with the largest influence.

Using this method you'd simply have to come up with a way of assigning body areas to the bones so you know what to do with the resultant damage (headshot = insta-kill or leg shot = movement reduced, etc).

Cheers,

Steve
Cheers,SteveLiquidigital Online
Hummm.... Ok. In a few days I should start coding this, let's see how it goes. If I have any problems, I'll post again.

Thanks.
Quick note before you jump into it: The md3 format from Quake 3 does not use skeletal animation! It's basically an updated version of the Quake 2 format. The first ID game to use skeletal animations is Doom 3 (the md5 format). I think there was an md4 somewhere in between, but it's pretty obscure.
// The user formerly known as Tojiro67445, formerly known as Toji [smile]
you could use the .mdl format from halflife its pretty easy and uses bones but it does not support vertex weighting
http://www.8ung.at/basiror/theironcross.html
I use the Blitz3D b3d-format. Its small, compact and it supports just about anything - skeletal animations included!
But I should warn you, skeletal animation is a tricky thing to learn! I my self am struggling to get a working implementation goin at the moment.

If you are not too comfortable with the subject, take a look at my thread: Problems with skeletal animation.
And you should look into matrix and vector math aswell! Its complex stuff...

Good luck!

This topic is closed to new replies.

Advertisement