4 Hugues Ross - Blog: RPG Project - 02 - Map Loading
Hugues Ross

9/2/12

RPG Project - 02 - Map Loading

Seriously, I don't know why I even bother trying to say when I'll upload things.

That said, here's a quick explanation of how maps in my as of yet unnamed RPG work.


The map of the game world is made up of many small map files each representing a 25x24 set of map tiles. Since I plan on making the entire game world one map, these files need to be loaded as necessary.

First, we have a 3x3 array of maps, and the player. The "corners" in the array are not loaded at first.
The red squares represent loaded map sections.
The center bit contains the player. 
 Suppose the player's view reaches the map section to the right, as below:
 In the array containing the sections, the adjacent loaded portions are moved left...
...and the remaining section is removed.
 Afterwards, the empty horizontally and vertically adjacent sections are loaded.
The red and grey bits are the ones that have been moved.
The red ones have been occupied by the player, and the green ones are newly loaded.
Right now, I'm only at the part where the sections are loaded initially. I'm working on it. Slowly.

No comments: