Bullet File Format?

grizzley90
Posts: 3
Joined: Sun Apr 29, 2007 1:34 pm

Bullet File Format?

Post by grizzley90 »

Not a really brilliant question, but I wanted to know if you use only collada as the physics format or is there a specialized bullet file format that is loadable, preferably binary?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Bullet File Format?

Post by Erwin Coumans »

grizzley90 wrote:Not a really brilliant question, but I wanted to know if you use only collada as the physics format or is there a specialized bullet file format that is loadable, preferably binary?

Right now, Bullet supports COLLADA Physics. In the future, dependent on feedback, a contribution for binary (zlib) compressed files will be supported.
User avatar
Dragonlord
Posts: 198
Joined: Mon Sep 04, 2006 5:31 pm
Location: Switzerland

Post by Dragonlord »

You can simply bzip2 the XML file. I made some tests some time ago comparing binary file formats with equivalent XML files both compressed and uncompressed. The compressed XML file won in nearly all cases. Has the advantage that once you have a file reader you simply have to make a wrapper for bzip2 decoding and plug it in between resulting in nearly zero programming overhead and fully compatible.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

Zipping XML would be one possibility.

But many developers don't want to include libxml and COLLADA-DOM just to load some data into a run-time / game. So a light-weight serialization or perhaps memory dump of the classes might be better for them.
I expect that most game engines already have a serialization mechanism for other data (graphics etc), so perhaps not too much demand for this binary file format feature.
grizzley90
Posts: 3
Joined: Sun Apr 29, 2007 1:34 pm

Post by grizzley90 »

So I guess there is none at the moment.

I am always for a custom speedy binary file format solution. The file format can probably be optimized to physics only, like ogre's mesh format is optimized for graphics.
User avatar
Dragonlord
Posts: 198
Joined: Mon Sep 04, 2006 5:31 pm
Location: Switzerland

Post by Dragonlord »

Binary formats always have the caveat of byte order dependency and other troubles. The good news about XML and company is that they are ASCII only which is easy to export and import and very error proof. Many say binary files are smaller and quicker. The smaller argument doesn't hold as I noticed some time ago with my compression tests where ASCII files under compression ( which is usually the case in game content like PAK files ) had been much smaller. What goes for speed this is correct that you can read the files quicker but if you want to read a binary dump that quick you need to adapt your program to expose the exact memory layout as in the file. This on the other hand requires overhead for re-processing data in memory to fit your internal layout. Usually the game code is already done to a large extend, especially what goes for the internal API hence parsing an ASCII format is much easier than having to deal/convert a binary format. Granted if you can design your code from the beginning with a given format in mind this problem can be worked around but then you are locked to one file format and using others becomes a pain. Due to those reasons in my opinion I would stick to XML files or other ASCII files. This has been just my humble experience and of course does not have to mean anything in the end.