Archived

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

amemorex

How to store level data for this particular kind of game?

Recommended Posts

amemorex    122
(Pre-info: I didn''t cross post, I deleted the post from Game Programming forum, and re-posted it back in these forums, hoping to get better responses, and more related to OpenGL.) I''m going to be trying to write a simplified clone of the Playstation game "Intelligence Qube". For any who haven''t played the game, I''ll brief you in on what I''m talking about.. Each level is a giant block structure, which you can see here.. See those blocks on top? They basically roll toward you, and your goal is to "destroy" them before they knock you off the edge. The block structure you''re on is deformable, in that the blocks you''re standing on can be destroyed accidentally if you do something wrong, and the block structure also reduces in size after time (the last row+columns fall off).. I can easily write a simple map format to hold the block information (position, whether they roll or not, etc), but my question is how to store it in the game? I don''t think a matrix would be suitable, since it would require alot of resizing and removing of items, which may be a bit too slow..but I''m not sure. What method or combination of methods would you guys advise for storing the map data?

Share this post


Link to post
Share on other sites
LockePick    707
Make a 3 dimensional array of classes/structs that contain all the data needed for a block.
BlockClass blocks[max_height][max_width][max_depth]
I don''t think it would go very slow, unless you start dealing with a structure thousands across/high/deep. Then you might take a toll just by looping too much.

------------
aud.vze.com - The Audacious Engine <-- Newbie alert, look at your own risk. Can induce severe laughing fits and other variations of hysterical outburst.
MSN: nmaster42@hotmail.com, AIM: LockePick42, ICQ: 74128155

Share this post


Link to post
Share on other sites
a person    118
also, you dont really need to "delete" old blocks. just mark them "dead" and treat them as non-existent (dont draw, dont collide, etc).

Share this post


Link to post
Share on other sites