Seamless scroll tilemaps

I am working on downstream rpg and want to implement seamless scroll maps. That is, when a player explores the world, there is no loading screen between the cards and the “door” to the next area.

I have two ways to destroy the world. At the top level, I have “zones” that are just a collection of 9 “maps” (these zones are represented only by catalogs). Within the zone, 9 cards are organized in a 3x3 grid. I have not figured out the best way to present these cards, either by index or by relative coordinate with the parent zone. These cards are actually displayed on the user's screen. Given the size of each map and the size of the viewport, I know that a user will be able to see a maximum of four maps when they are on the corner of the map.

My problem is, how do I track the cards and their corresponding offsets in the code when a player explores the world? I thought that map<Point, Map*>with 0,0 is the card the current player is in. If the player was in the lower left corner of the map, then the east map will be stored as 1.0, the south map will be 0.1, and the southeast map will be 1.1. The problem that I foresee with this, I am not sure that the points are mutable, and if you rebuild the list every time a player moves to another card or another section of the map, this will cause a problem.

+3
source share
4 answers

, , , FreeBASIC. , , , , , .

1024 ^ 2 ( ). ( ), . 128 ^ 2, 256 ^ 2. , 2-3 ( - , ).

256 ^ 2 ZONE, 2x2 512 ^ 2. , .

3x3 , .

+2

deque of deques. , 4 .

+1

, 3x3- , 0,0 , , , - maps[1,1] = maps[1,0]; .

! , !

+1

: viewport.

GPS, , . ( ) ( ).

The concept is similar to a 3x3 grid. The viewport starts in the center. Move left, change address for display memory.

Hope this helps.

By the way, it was an embedded system in which the application could take 100% control over all hardware devices (and not share them with other applications).

+1
source

Source: https://habr.com/ru/post/1772324/


All Articles