Jump to content
  • Advertisement
Sign in to follow this  
luke101

Scrolling and maps

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

I have a question on scrolling and maps. I am creating a RPG game 2D. When I load my map do I load a very large picture or what. I am not sure how this would go. If I load a large picture that will take alot of memory right? Is there any technigue you guys use to scroll large maps?

Share this post


Link to post
Share on other sites
Advertisement
sorry but i am in a bitt of a rush but i could at least get you started, im not sure how you load your maps but since its 2D i would sugest using tiles, so try to google or check the article section here at gamedev for anything about 2D tiles, sorry if you dont understand but PM me i you dont.

Share this post


Link to post
Share on other sites
Quote:
Original post by luke101
If I load a large picture that will take alot of memory right?


Yep! and you don't want to do that. If you google for "side scroller tutorial" and other such terms, you will find a lot of info. The techniques used in side-scrollers is almost exactly what you will want to use, you will just be applying the same techniques to an extra dimension, as I am assuming you are making a top-down RPG (similar to the first few Zeldas).

You know your player's position within the world, and his position on your large bitmap. With that info, you can select a subsection of the texture (covering the entire window) and just blit that. The subsection should be slightly larger than the extent of the viewing window so that it is not jumpy as the player moves to new areas.

As the above poster also suggested, tiles are an option. This allows you to focus on creating more detailed bitmaps, which are reusable. You will need to design on a map format, but this format would be a lot more forgiving than a large bitmap should you decide to change a certain area of it.

Share this post


Link to post
Share on other sites
One of the last things I was doing on my game engine before I burnt out was the mapping, and there are many different ways you can have your map. For me, the character stayed dead center of screen and the map moved under him. One thought to pass on is, don't load all maps squares into memory when you load your maps, only load the map squares which are just out side the bounds of your view. And remove any extra squares from memmory as they go two squares beyond your current view window.

Oh and be prepared to get fancy to allow for the map to be dynamic for reuse in other games you write.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!