Sign in to follow this  

Effective Level Storage

This topic is 4727 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

My game levels are to be constructed out of multiple cuboids of different dimensions. I was wondering how I could effectively store my levels as binary files. Are there any tutorials on the internet that focus on creating unique file formats? I had the idea of creating a Cuboid class (im using C++) and having my map files simply be an array of cuboid classes each object containing specific deatils of the cuboid such as position and dimensions. This doesn't seem on paper to be very efficient but i could be wrong! What should I look into, in order to make the outcome as fast as possible and not be to greedy with processing power or required storage size.

Share this post


Link to post
Share on other sites
Depending on how your cubes are different from eachother (size, textures, color, etc.) you can either make a class/structure where you specify each cube attributes, and then save that list (list as in an array of that structure) to the disk.
For example, you need the following attributes:

x,y,z position
x,y,z rotation
lenght
face_1 texture
face_1 color
....
face_6 texture
face_6 color


You can also go the 'raw' way, where you just save the vertices/normals/u,v/etc. in a file. If you don't have that many cubes this way would be faster.

Share this post


Link to post
Share on other sites
There would be quite a few cuboids, several hundred in most complex levels.

However there would be no texture data to store, so would saving an array of these cuboid objects to disk be the best bet and use some form of culling when it comes to sending specific cuboids to the rendering process?

Thanks for the reply

Share this post


Link to post
Share on other sites
Well, storing on disk and storing in memory (for rendering purposes) is two different things.
However, in your case, if you have under 1K untextured cubes, there is little need to do any culling and such, since this is very little geometry and fillrate even for low end video cards.

Share this post


Link to post
Share on other sites

This topic is 4727 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this