• Advertisement
Sign in to follow this  

2D tile-based game, determining drawable tiles

This topic is 3740 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'm developing a 2d, tile-based RPG. I have a world, and inside the world I have maps. Right now my idea would be to load an entire maps worth of tiles at once. Then periodicially, based on location of the character, move tiles around so that the vector of currently processing tiles gets modified to remove old ones that the character is no longer near, and it includes the ones that are closer to him. When tiles are removed from the currently processing list, they are moved to another list that isn't processed. And that list is also where the new tiles come from that may be near the character and are put into the currently processed list. This process would continue to occur periodically (length hasn't been decided yet) as the character moves. Maybe the process occurs based on distance from the location the character was at when the process occured previously. What I want to know is whether or not this is a good method. If I may have a vast land as an entire map, is it even practical to do this? What other approaches are there that I need to know about? Edit: I just read this article on quad trees and I'm wondering if I can somehow incorporate some style such as that into my tile scenario... http://www.gamedev.net/reference/programming/features/quadtrees/page2.asp [Edited by - feti on October 28, 2007 10:46:29 PM]

Share this post


Link to post
Share on other sites
Advertisement
Thank you for the reply. That is just about the same conclusion I came upon before I went to bed last night. It helps realize the entire situation quite a bit. I do have a question on management of the tiles over a vast land.

Here's a scenario and I'm wondering if somebody can help break it into pieces on to how the players computer can micro manage what tile information needs to be stored into memory.

Facts:

1. The viewable screen dimensions may be 1/500th of the actual walkable area. (just a fairly large number to work with)

2. The players computer needs to have a buffer of proximity tile information loaded so the smooth scrolling will work.

3. I know how to render what is in the viewable area for the character on the screen.

Questions:

1. Do I need to store all world NPC and other movable data into the users system at once, or can I load that when I get near to it? And if I load it when I get near to it, how does it keep state and how can the world interact with it if it's not always loaded?

2. Do I need to micro manage all tiles, or is loading information on a million tiles feasible for todays computers?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement