Sign in to follow this  
blackgame

data structure of maps in Castlevania

Recommended Posts

blackgame    122
first, i am a super fan of Castlevania(one famous game presented by Konami if u ask what it is). my question is about the map in this game. i've made some games like ACT, RPG ones. with all of those type of games if needed i built a 2D array which saves data for the map, such as accessible or not. now i have a question on map data structure about Castlevania(eg. Circle of The Moon for GBA). i wanna know how it constructs and handle its map data. the map is wide and has a very complex structure, so it seems impossible to save data with 2D arrays like be4, any help ?

Share this post


Link to post
Share on other sites
Kris_A    182
Not sure exactly how Castlevania does it but you could split your level into smaller blocks, of say, 1 screen each (let's say 20x15 tiles). Then you'd have a function that determines which blocks are currently onscreen, and only handle those ones. If the window is scrolling then it will most likely be drawing 2 blocks at a time, otherwise just 1.

Edit: To make complex shapes of level without wasting memory, have a flag (e.g. 1 byte long) at the beginning of a block which says whether it exists or not. If the flag is zero then it can skip the whole block, and you won't even have to store it in memory.

Edit 2: Another method you could use is storing an array of pointers to 20x15 blocks. If the pointer is NULL then the block doesn't exist. This is probably a lot faster and cleaner than the other method.

Share this post


Link to post
Share on other sites

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