• Advertisement

Archived

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

My own file format

This topic is 6382 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 looking for a way to include multiple files into my own file type(I.E bitmaps, world geometry 3d formats). Like the way the game Everquest has its own .s3d format, as do most commercial games. Is this relatively easy to do? What books would you recommend me reading to get started in doing so? Thanks!!

Share this post


Link to post
Share on other sites
Advertisement
that one book, the title is something like 3D File Formats or something to that extent. try searching amazon. thats the best place i can think of to start.

Share this post


Link to post
Share on other sites
I''ve never read the book mentioned, but I would assume it covers existing file formats, rather than making your own. But really, making your own file format is pretty easy to do, so it wouldn''t require a book. It''s basically just a matter of figuring out what kind of information you''ll need to describe each file, and then putting all that information into a header. Then you''ll just need one function to write the header, followed by the image(s) data, to create files of your new type; and one function to read in the data, to load files of your new type. Sorry if I''m not being specific enough...?

-Ironblayde
 Aeon Software

Share this post


Link to post
Share on other sites
I THINK I know what you''re getting at. So I would put info like my different bitmaps'': height, width, colors, etc...and for 3d geometry: hehe . Does anyone have any sample code for doing this?

Thanks!

OH and btw, I''ll check on that book you mentioned at amazon.com right now.

Share this post


Link to post
Share on other sites
umm...it would have much to do with file i/o.

let''s say you have a bitmap (.bmp) file and a audio(.wav) file.
And the you have your own file( .myf). You would save the audio to the first part of your file and the .bmp as an add on to that file. You just have to make sure you know the byte location of where each file (.wav, .bmp, and whatever else you''re saving) is. Then later, you would open that file and read certain bytes to your program data. For example:

let''s say your .wav file starts at byte 0 and ends at byte 99 and the .bmp starts at 10 and ends at 199 or so. You would open the .myf and read the first 100 bytes and read it into a "Wav Handle" and the last 100 bytes to a "Bitmap Handle."

hope that helps

Share this post


Link to post
Share on other sites
I actually worked on something like this once , the way I did it was set up a header at the begining of the file...like this:
__GOOEY__
Start.wav 0000
Game.bmp 2340
and the numbers just corresponded to the byte that the file started at.
Ps - 0000 was a reference point to the first byte past the header, so my program just did HEADER_BYTES + location to find the true starting point for the file.

Share this post


Link to post
Share on other sites
You could just separate each different file with an index, a name, and a type. e.g.:

    
<1 BMP TITLEPICTURE>
001001011
111111 bitmap stuff etc.
</1>

<2 WAV ENTRYSOUND>
568y0Ë45kgÄ wav stuff etc.
¶,Q¤0n7t51051‰}‹£© §4
</2>


so when you input the file just use a struct containing data about name index and type.

Lucas

Share this post


Link to post
Share on other sites

  • Advertisement