Model formats?

Started by
8 comments, last by Buckeye 13 years, 2 months ago
I'm about to start making my first serious game and i was wondering how do people handle Models (including animated meshes)?

1) What's a good Model format? I was using .x but i heard it's deprecated?

2) Is creating my own format recommended?
"Spending your life waiting for the messiah to come save the world is like waiting around for the straight piece to come in Tetris...even if it comes, by that time you've accumulated a mountain of shit so high that you're fucked no matter what you do. "
Advertisement
Don't create your own format. That is a lot of work for no real gain. What graphics engine/API are you using? If your graphics engine/API has a native format, you should probably stick to that. Most 3D modeling programs can export to all the common formats.
well, a binary format is easy to make. Just save all the data you want in an sequence in any order you want and read back them in the same order. (for example: vertex count then all the vertices then face count then all the faces etc)
The problem with own formats that either you have to convert from a conventional format (that means reading that format), or writing an exporter to the editor you use. So in the end, it's not really easier...

So just go for any conventional format you like and easy to use.

[size="1"]Who the hell cares about deprecated formats?? It's your game with your assets anyway. If the model editor of your choice is able to export in that format, then who cares if no other person can read the file on the planet? Your program CAN read it. Deprecation only matters if you want to communicate with something that's not in your control, like 3D drivers)
I'm not using an engine. API is DX9.

Yeah, i guess writing an exporter/importer is just an unnecessary pain in the ass.

szecs: I just thought that there's a reason it's deprecated. ie: Other formats are somehow better.. Anyway i'll Google a format that'll do the job.

Thanks :)
"Spending your life waiting for the messiah to come save the world is like waiting around for the straight piece to come in Tetris...even if it comes, by that time you've accumulated a mountain of shit so high that you're fucked no matter what you do. "
Alright so i decided to export into a simple text or maybe xml format like .obj and then convert it into my own custom binary format, taking only the information i need.

Just one question though, what's a simple/clean format that supports animation and skinning? fbx?
"Spending your life waiting for the messiah to come save the world is like waiting around for the straight piece to come in Tetris...even if it comes, by that time you've accumulated a mountain of shit so high that you're fucked no matter what you do. "
obj is too limited for just about everything. fbx supports most everything, but is anything but simple and clean, If you think it is then you need to play around with the different versions coming from different software packages and the different versions of the plugins those software packages use, the warnings they produce depending on whats exported.
COLLADA is similar to fbx with respect to features, its human readable xml, but In my experience export writers for COLLADA dont adhere to the spec as closely as they should, producing files that simply cant be loaded or crash because of encountering unexpected data, although it seems to be getting better with time.
Id say study the larger formats, fbx, COLLADA, see how they do things and make your own binary format, write a converter from these files to your own that can act as a guard against these errors. Better still export directly to your own format. Pulling what you need directly from the modeling package is the cleanest way.
what's a simple/clean format that supports animation and skinning?[/quote]
If you're using DX9, as szecs mentions, you can just use the x-file format (either or both text/binary format). It supports skinned animation through the D3DX mesh/controller classes. Many modeling programs export x-files (either directly or through plugins).

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

Yea fbx does seem too bloated. So does COLLADA..

Anyway, i know that using the .x format would be MUCH easier (I already have all the code for skinned meshes w/ multiple animations written) but i think i'd get a lot of experience out of creating my own file format.

So my options are:

1- Use .x and be done with it

2- Custom Format by:
a- Exporting to a format like fbx/COLLADA and reading whatever i need into my format (binary i guess for speed)
b- Cut out the middle man and write an exporter to my format. However that would require learning python since i'm using Blender. Also learning how to actually script the exporter.

2b it is! (who needs sleep anyway eh?)
"Spending your life waiting for the messiah to come save the world is like waiting around for the straight piece to come in Tetris...even if it comes, by that time you've accumulated a mountain of shit so high that you're fucked no matter what you do. "

Yea fbx does seem too bloated. So does COLLADA..

Anyway, i know that using the .x format would be MUCH easier (I already have all the code for skinned meshes w/ multiple animations written) but i think i'd get a lot of experience out of creating my own file format.

So my options are:

1- Use .x and be done with it

2- Custom Format by:
a- Exporting to a format like fbx/COLLADA and reading whatever i need into my format (binary i guess for speed)
b- Cut out the middle man and write an exporter to my format. However that would require learning python since i'm using Blender. Also learning how to actually script the exporter.

2b it is! (who needs sleep anyway eh?)


I wrote my export scripts for blender in a weekend (and I didn't know python that well, either). It's actually fairly straightforward, I wouldn't worry too much about losing sleep :).
2b it is! (who needs sleep anyway eh?) [/quote]
Sounds like a viable alternative. Anticipating my own eventual migration away from Dx9, having written my own animation controller, I wrote my own format importer (compatible with my animation controller and mesh loader), and a utility to convert (at the present) 2 formats (x-files and SMD files) to that format. It could be sort of fun, if you're a masochist and into sleep deprivation, and an excellent learning experience.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

This topic is closed to new replies.

Advertisement