Archived

This topic is now archived and is closed to further replies.

specjava

[java] Fileformat ideas

Recommended Posts

Hi, I''m thinking of a fileformat for a map file (for a 2D tank game: 1/2/MultiNet Player), and here is a couple of ideas: - binary, not too easy to mess with the map - people should use the map editor - checksum at the end, very crude integrity check, file format version info in the beginning of the file - consists of items: xxxxyyyymydatagoeshere (xxxx is a number code identifying the type of this item, like 0001 would mean hitpoints...yyyy tells the length of the following data...then the actual data), I don''t want to use delimeters, as I want the data to be totally free of restrictions. - idea is to provide backward and forward compatibility (old exe reads new file skipping the new unknown items, new exe reads old file as usual) - file would contain all needed resources (bitmaps, animated bitmaps, sounds, ...) - background music I would leave out of the file though - possibility to include some programming/scripting language (so that one can create some AI for e.g. a gun turret), just for future use - of course also a possibility to link script to certain items / locations - ini-file for the game and editor: identifying the possible item codes? This I haven''t thought much yet. I''m not so worried about the size of the map file nor the complexity of the file interpretation at the moment, more I''m worried that I haven''t thought & prepared for some important issue. :-) Comments are appreciated...also you can argue against the ideas (I might have too complex/impossible ideas there). Cheers, Petri

Share this post


Link to post
Share on other sites
Anything wrong with using an XML file format? Nodes that aren''t recognized by an old version of the software will be skipped. Very easy for other programs to implement. XML text can be compressed (zip) to stop people from playing with it.

Share this post


Link to post
Share on other sites
specjava, your file-format is pretty similar to the IFF/RIFF family of formats. IFF was originally created by Electronic Arts, and RIFF was created by Microsoft to be a little-endian IFF-like format. They are used in, for example: .wav (RIFF); Lightwave Object Files, .lwo/.lwob (IFF); and many other types of files.

You can find a lot of IFF descriptions/resources by searching, e.g. google.

Share this post


Link to post
Share on other sites