Which model format?

Started by
8 comments, last by Jiia 18 years, 10 months ago
I'm looking to make an adventure game. The kind where you crawl through dungeons, picking up all sorts of crazy items as you progress through the game. I'm looking to allow someone to put on a Platemail Vest, Chain Gloves and Leather Boots all at the same time. I also need you to be able to put a sword in your hand, or an axe, or anything. So basically any item has to work with any animation (for that type). This leads me to believe that skeletal animation is the way to go. What file format should I be looking to use? I have no interest in using .X, as the loader functions are always becoming drastically different with every release of DX. I'm thinking that 3DS might be the way to go here (it seems like the best to me atleast). Will 3DS be able to have 'swappable' items? Maybe even removable limbs or something? That'd be sweet. Any advice here is totally welcome. I'm working with C#, .NET 1.1 and Managed DirectX if that makes a difference.
"Where genius ends, madness begins."Estauns
Advertisement
Your game sounds fun already. But I don't think the model format is going to limit your ability to include those features. I have seperated wearable skinmesh clothing and armor, static props like helmets, static weapons like swords, and dynamic weapons like bow & arrows. It's all currently running with the x format. But the mesh or format had nothing to do with how I had to program the features.

It's just all about linking abjects together in your code.
hi there, I would suggest going with any model format you feel comfortable with. If you can reformat it to build a mesh in DirectX all the better.

With regards to the body parts... I would suggest have a different number of body parts so that when you pick up an item that is viewable on the model itself that you swap out that body part with another with that particular item.

Good luck.
hi all
I believe using X files is not the best solutions, although they generally provide widespread solutions, as skeletal animation but as you had mentioned the way to use them changes very often. So that's better to look for something more advanced, like MD2 or even MD3 if you can handle it, also consider designing a unique format for yourself (something I've done recently and now am using it freely). In this way you can incoporate all your capabilities without the garbages...
Visit galaxyroad.com which soon will have english contents too
X files or the way you use x files is not changing. Only the API helper methods used to load the format changes. Which would usually mean a small change in your code. Not exporting all of your meshes again.

Most changes in API's will require changing code. So I don't see where this is a disadvantage with the x format at all.
Does anyone have more information on how to go about 'swapping out pieces'? I'm rather confused on how to go about it. Do you use the same base skeleton, then export every model to a different file, then just load up the seperate files as you need them? Or is there something else to it?

I'm trying to get as much information as possible before diving straight in.
"Where genius ends, madness begins."Estauns
There are probably a bunch of ways to achieve it, but here's one that makes sense to me. I'll use weapons as the 'swap piece' example.

You have your weapon models - a sword, a shield, and a bow say. You also have a separate character model, and it has a bunch of different poses - one for holding a bow, one for a sword and one for a sword & a shield.

Now, you can invent and place special 'tag' polygons in the model at key locations - such as the character's hands, and you can put the same on the weapon models - you can then match up these points of reference when positioning/orienting the weapon they are holding. It's up to you how the tag polygons are designated and identified etc.

That's the basic outline of how something like that might work, and I think Quake3 did something similar - I believe it seperated the torso, head and legs as well and used tags to orient them all, so as you can see it can be extended as much as you want. Although Q3 didn't use skeletal animation, but hopefully that gives you some idea :)

Good luck,

-Mezz
You don't actually have to use skeletal animation for this, if you don't want to. I think you're probably better off with it, but don't feel forced to because of this.

What you want is the ability to correctly position and orient each submodel (sword, chainmail, etc) from frame to frame. So, what you want to do is build into your animation some kind of marker point (center of a particular face like Mezz suggests, or a particular vertex, or an entirely seperate thing) that you can track from frame to frame. If you put something similar in the submodel, you can figure out a matrix that will map the marker point in the submodel to the marker point on the main model, thus positioning it correctly. Orientation is a little more difficult but can be achieved in a similar way.

This is the approach that Half-Life 1 used, btw.

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

As superpig said for weapons, etc you really want to use a tagpoint type of system.

For swapping armor, etc what I do is have the modellers create two seperate torsos on the model and I hold a list of the renderable parts of the current model.
There are easier, less clumbsy ways to position weapons and objects onto characters. In most cases, you're going to need special animations for different weapons, so you could easily use a prop in your animation program/editor. This allows you to animate the weapon independently from character bones. Much more important for swords and shields than it is for guns.

Even if you don't have special animations for every weapon, you can have partial bone setups which animate only the bones required to hold the weapon. In my engine, two handed rifle postures use an animation which only targets the arms and weapon prop. So I use normal animations for standing, walking, and running, but I override the arm movement with that rifle-hold animation. Things like knives and pistols would really only need one hand. You're most likely going to find yourself splitting up the animations anyway. For example, a character firing a bow as he walks. He needs to animate his arms, and perhaps head and chest, independently from his lower body. Providing this kind of flexibility allows any weapon type to target and isolate specific bones, allowing other bones to default animating with the unarmed posture.

I have this stuff working, so I can give you info along the way if you need it.

This topic is closed to new replies.

Advertisement