Jump to content
  • Advertisement
Sign in to follow this  
blackgame

data structure of maps in Castlevania

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

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!