Custom Model Format

Started by
3 comments, last by MJP 13 years, 5 months ago
I just finished a lengthy tutorial on loading .x files and animating them, only to find out from Dragonion's recent thread that .x files are old and not really used any more. Some people said it would be a good idea to make a custom model format. I need the standard stuff, like vertices (duh), materials, textures, normals, animation and if I feel like it, I might add more complicated stuff later. I have no idea how to do that though. Even more so, I don't know how to make models in my model format, is there a way I could convert other formats to it or something? Would it be worth it? I use Cinema 4d for modeling, and it can export to a decent number of formats. How would I actually read the file? I know how to use fstream to read simple files, but what about something more complicated? Thanks for any help.
Advertisement
Consider using an existing file format, such as Collada, Obj, 3DS whatever suits your needs. Also, nothing speaks against the .X format if you have a working exporter and importer for it - after all, it's just your data pipeline. As long as it works, no one cares how old your file formats are.

I recommend using a library such as http://assimp.sourceforge.net to do the model loading for you.
If you go with a custom format you will not be able to export anything into that format from anything. You will need to develop your own parser, as well as any converters you will need. The OBJ format is dead easy to parse(with many examples online), and you will learn a lot by implementing your own parser. It lacks animation, however, so a better option would be to use Collada(which i intend to do at one point myself)
In the end, you will probably want to write your own model format.

The game specific formats (Quake, half-life, etc.) are legally questionable to use, at best. And, the interchange formats aren't optimized for game usage, so loading and processing the formats will dramatically increase the time it takes to load levels. Not to mention, you will need custom formats when you start adding space partitioning (octree, etc.) data. And, many effect systems rely on assigning special properties to vertices, faces, or materials.

Check out Super Play, the SNES inspired Game Engine: http://www.superplay.info

If you have to ask whether you should make a custom model format, then you don't need one. I don't mean this is in condescending way, I just mean that if you don't have any obvious ways in which your engine/game will benefit from a custom format then there's no point.

This topic is closed to new replies.

Advertisement