Jump to content
  • Advertisement
Sign in to follow this  
dopplex

Putting together a binary model file format

This topic is 3538 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 busy building my first real game project, and have hit the point where I realize I need more control over my workflow than I currently have. I'm currently developing a game for the iPhone, using Wolfgang Engel's Oolong Engine as my base platform. I've been trying to use the following for my workflow: 1. Create in Blender 2. Export to Collada using exporter that comes with Blender 3. Convert to PowerVR .pod format using PowerVR's converter The two problems I'm having are that a) this process is behaving rather unpredictably - likely due to the number of "moving parts" involved b) the tools support a lot of functionality that I don't think I'll ever need (for example the lighting and camera data included in the .pod scene files) What I'd like to do is create my own workflow and use that instead of the .pod handling capabilities currently within Oolong. I think I have a decent idea of how to do this Engine-side, but I need some guidance when it comes to the modeling package side of things. Question 1: I'm currently using Blender - am I going to run into problems? I'm not sure if this choice will hold up to extended use - but all of the legit modeling packages are way out of my price range (<$750) - and seeing that Softimage was just acquired by them, they ALL now seem to be owned by Autodesk. Do I have any choices other than Blender? (I would very much like to move to a commercial package - but I feel like I'm getting priced out of it) Question 2: How do I go about writing a useful binary file format for model and animation data? What information do I need to include to support unforeseen future needs? Here's the data I currently see needing to be contained in the model file: Vertex Data: Position Normal UV (How many UV channels do I need?) Color? Bitangent Tangent bone weights array (optional - only if skinning) Mesh Part: Part Name/ID Material Name/ID Vertices Indices Primitive Format (list/strip) parent bone array (size 1 if not skinning) Bone: Name/ID Location //in parent's object space Rotation //in parent's object space Parent Armature: Bone array Keyframe: Time Val List of bone transformations Animation: Animation Name/ID List of keyframes ordered by Time Val Naively, it seems to me that all I have to do is assemble a class containing all of this data within the modeling packages scripting environment, and then serialize the data to a file. I think I could do this trivially (if inefficiently) for triangle lists - to at least get a base version working - and then can worry about things like optimizing the mesh at a later point. Does my approach to this seem sound? Am I neglecting any significant data? (I'm planning on handling materials in an entirely seperate file - since I'm working without use of shaders on the iPhone, I want my model format to be agnostic as to the rendering system used) Thanks for any advice, and apologies for being longwinded in my question/explanation! -Dan

Share this post


Link to post
Share on other sites
Advertisement
What exactly do you mean with 'unpredictable'? Also, did you find out what step in your current workflow introduces this unpredictability?

As for unwanted data, perhaps it's possible to just strip that out of the .pod files, so you only need to modify your loading code somewhat (besides writing a script or program to strip the data)? Would that actually save you a lot of space, or would it save too little compared to the amount of work it costs?


Creating your own format is certainly possible, but it means writing your own exporter (or a converter, for example one that accepts Collada files), as well as your own loading code. If you're not exactly sure about what you need, it's pretty easy to mess things up here by spending a lot of time to support a custom format, only to find out that you missed some important details.

Share this post


Link to post
Share on other sites
By unpredictable I mean that I'm not entirely sure which portions of the Blender model geometry will actually export.

Specifically, I had one which exported with all of the animation data intact, but no mesh data at all. Another file exported with the same settings retained its mesh data with no problems. (I'm testing this both by loading the mesh into my engine and by trying to view the mesh in PVRShaman, PowerVRs shader previewing tool)

I checked the file at each stage in the process and while there appears to be vertex data in the Collada file, once it gets converted to .pod its gone. I'm not sure if this is due to a bug in the Collada to POD converter or due to a problem in the Collada exporter for Blender (I see vertices, but I don't know if they constitute a proper description of the geometry)

Unfortunately, a problem in the .pod converter leaves me with a problem I can't necessarily do much about, and Collada is a complex enough format that I'm not sure I really want to try to muck around with the exporter in the vague hope of fixing it...

I've heard from a number of places that Collada support in Blender is lacking, so I'm inclined to blame things on the Collada exporter, at least for the moment. If the converter works well, it would open up my options to other packages which export well to Collada, but I'm not sure what packages fit the bill.

Share this post


Link to post
Share on other sites
As a related aside, does anyone know how well modo works for game asset creation?

It's affordable, does everything I need from a modeling package (and a lot more), is very scriptable (supporting all three Python, Perl, and Lua), and looks to have a very strong library of 3d party scripts already (including exporters for Collada and DirectX. Also, it really seems that Luxology has some legit engineering prowess behind the product.

I'd never heard of it before today, but it really does look very impressive, especially for the price.

Share this post


Link to post
Share on other sites
Quote:
Original post by dopplex
By unpredictable I mean that I'm not entirely sure which portions of the Blender model geometry will actually export.

Sounds like a problem with the exporter indeed. Did you check if others have found solutions or workarounds for this issue?

Otherwise, you can perhaps export to another format, using an exporter that does work as it should, and then convert that format to Collada, so you can keep using the .pod converter (assuming it only accepts Collada files).

Share this post


Link to post
Share on other sites
Quote:
Original post by Captain P
Quote:
Original post by dopplex
By unpredictable I mean that I'm not entirely sure which portions of the Blender model geometry will actually export.

Sounds like a problem with the exporter indeed. Did you check if others have found solutions or workarounds for this issue?

Otherwise, you can perhaps export to another format, using an exporter that does work as it should, and then convert that format to Collada, so you can keep using the .pod converter (assuming it only accepts Collada files).


Unfortunately, the .pod converter is Collada only.

I think I've settled on a solution that doesn't involve writing my own file format though:

Do modeling, texturing, and materials in modo (baking the textures for future use)
transfer to Blender via one of the mutually well supported formats (.fbx, perhaps)
Rig and animate in Blender
transfer back to modo
Export to Collada via modo
Convert to .pod via Collada2POD

Provided the file conversions all function decently, this seems to get me what I want without writing my own format.

While it requires the purchase of modo, modo seems to be an excellent modelling tool and should probably be worth it, long term

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!