How can I store all my level data in a single file instead of spread out over many files?

Posted by Jon on Game Development See other posts from Game Development or by Jon
Published on 2012-01-20T19:01:26Z Indexed on 2012/06/30 3:25 UTC
Read the original article Hit count: 242

Filed under:
|
|
|

I am currently generating my level data, and saving to disk to ensure that any modifications done to the level are saved.

I am storing "chunks" of 2048x2048 pixels into a file. Whenever the player moves over a section that doesn't have a file associated with the position, a new file is created.

This works great, and is very fast. My issue, is that as you are playing the file count gets larger and larger.

I'm wondering what are techniques that can be used to alleviate the file count, without taking a performance hit. I am interested in how you would store/seek/update this data in a single file instead of multiple files efficiently.

© Game Development or respective owner

Related posts about XNA

Related posts about c#