Model Data Formats

I’m thinking of updating a 3D game engine I wrote back in 2005. It used wavefront .obj models and allowed animation of the groups within the model. There was a bespoke model editor to do the animating. I’d like to replace this editor with blender, but will need to write a new loader to use a more standard animation scheme using a file format that has it built in. Blender has quite a few export scripts built in (e.g. MD2), but lacks later one’s such as MD3. There’s also 3ds export support.

I need to choose a format that:

  1. I can get from blender and contains meshes, bones (if used), textures and animation of bones or meshes
  2. Has a published file format I can use for writing the loader

Currently my game engine chooses the animation based on object AI state. When AI state changes, the animations of the individual groups transition into the new animation parameters smoothly. There is no glitch in the visual representation. If I use animated Meshes (e.g. MD2) I assume that I must start and end each animation in the same ‘at-rest’ state and only switch animations, when they cycle round to the beginning; thus glitches are avoided. Using models with bones, I could probably continue to use my current technique. The animations would now control joints, rather than the rotations of wavefront .obj groups. I’m a bit concerned about the complexity though. The MD5 format seems suitable, but isn’t a blender export format. However I’ve found 3rd party tools - but don’t know if they export all the information needed.

So, suggestions on file formats gratefully received.

Incidentally, I would rather continue to use my own game engine rather than a scenegraph engine, as mine has portal based rendering order, which essentially means it doesn’t slow down with world size. Similarly objects are linked to the room they are in, so avoiding n^2 complexity growth. The AI also uses the portals for pathfinding, which I’m assuming (naively?) doesn’t come with scenegraphs.

I’m probably stuck with the level editor. It works on convex ‘rooms’ linked by automatically generated portals. Sloping floors and ceilings are allowed. Walls can have a single hole in them, forming navigable doors and windows. There is some basic ambient lighting control. Maybe one of the doom or quake editors might be useful, but then again maybe not.

I really like the MD5 format, its really easy, simple and text based. Also has support for skeletal animations.

COLLADA is the other popular option these days, its supports the entire kitchen sink but from what I’ve heard its a nightmare to fully implement.

I would like to think that they would all be text based unless your putting textures in the file too.

It has been a long time problem. You mainly just want a vertex list then 80 other people want to make their own special format for the other stuff that probably shouldn’t even be in the same file. Oh well.

MD5 looks promising. COLLADA is interesting, being XML, since java has library support, but looks somewhat complex. Admittedly I only need to read a subset, so it’s worth a bit more attention. I think I’ll make or find a model in blender and then make a java view application for one of the above and see how I get on.