Custom map format for large maps

Started by
0 comments, last by Jason Z 12 years, 8 months ago
I program in C# SlimDX, but this might be more of a generic game programming question, so move if if it's appropriate.

Anyway, I'm creating a world editor, and I've gotten stuck on how I should save the map to a file. Tehcnically this wouldn't be a problem if the maps weren't so large. But the maps will be larger than I expect will fit in memory all at once, so I need to know where the patches/quads are located in the file.

I first saved the ground information (height and texture-weights of each vertex) of each patch just after each other, and I knew were the patches were located. But now I realized that I won't be able to load information about static meshes and objects at the same time either, cause it's just gonna be too much. So now I don't know where to store the data about static meshes and objects in the file. I could just add an extra gap in the file between each patch that this information will be at, but I'm assuming it's gonna be a lot of un-used space in the file for the patches that barely have any objects or static meshes.

Anyone has any tips on how to store this much detail in a file but still know where exactly to find the data of each patch?

Thanks in advance!

// Anton
Advertisement
I would just store the terrain in one section, and then either use another file for the object location / state data, or append it to the end of the file. Typically the terrain is considered a static data file, while the object state would be part of something like a save game file since it changes from one run to the next - so I would suggest having separate files.

This topic is closed to new replies.

Advertisement