Sign in to follow this  

Model formats?

This topic is 2495 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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)[/size]

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[quote]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).

Share this post


Link to post
Share on other sites
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?)

Share this post


Link to post
Share on other sites
[quote name='Waaayoff' timestamp='1298071028' post='4776126']
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?)
[/quote]

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 :).

Share this post


Link to post
Share on other sites
[quote]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.

Share this post


Link to post
Share on other sites

This topic is 2495 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this