Skip to main content
edited title
Link
user1430
user1430

Level Data - Procedurally Generated Content How can I store all my level data in a single file instead of spread out over many files?

Tweeted twitter.com/#!/StackGameDev/status/160458509006274560
Source Link
jgallant
  • 8.4k
  • 7
  • 34
  • 46

Level Data - Procedurally Generated Content

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.