Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

So I'm a brand new noob to the world of game dev and I'm starting off by trying to write my own game using C++ and openGL. I'm getting into loading models etc and while searching around for "the best format" I'm finding that most of the common formats are intended for porting between modelling applications and not necessarily for final representation of data when loading into a game environment. I'm being told through various sources that ultimately you want to use formats like collada etc and convert them into a custom binary format optimized for your game. Is this absolutely necessary? I understand the idea, that parsing a large XML or some other ASCII format is going to be slower than reading a binary file type but is it really going to be THAT big of a performance hit if I don't? I can't see it, but before I go and fill the assets directory of my game with dae or fbx files I thought I'd ask.

share|improve this question
2  
What's wrong with existing formats? They do perfectly fine for 99.9% of people. –  The Communist Duck Jun 18 '11 at 11:01

1 Answer 1

up vote 6 down vote accepted

What I believe these people are saying is that you want to load your COLLADA file into your in-game structure. You can then save the contents of this structure into a binary file ready for loading at runtime.

This can have advantages like the ones you said, but also has disadvantages, typically during the development stage.

Whether the load-time performance gain you get is necessary for your game is for you to decide. If you have a few non-complex models, the difference is probably negligable, and it is up to you to decide what to go with.

If for development purposes you prefer to use COLLADA and parse the XML at load time then go with it! I would recommend you make sure that your loading code is abstract enough so that you can easily replace it with binary files if the loading becomes too long.

share|improve this answer
1  
So basically just do what I was doing and if I find it necessary I can use the SDK's for these formats to convert them to a final format for my game. Thanks for the clarification, it's hard sometimes to separate opinion. I've read a lot of criticism of using these formats (especially ascii) basically slamming them as something that would never be used in "professional" games but last I checked ID software has been using plain text models for the last 10-15 years. –  Digital Architect Jun 18 '11 at 19:35
    
How about deciding on a vertex layout and then storing this info in a file? Once you have this worked out you can work out what other similarities your meshes have. The problem I think you will face at first is the overwhelming number of slight differences each of your meshes has in it's requirements within the game world. Some of this information can be generated on model load however and may not be worth storing in the mesh 'data' file. –  Jay Jun 28 '11 at 12:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.