Connecting maps

*For other ways of moving between two maps, see Map transfers.*
This page describes how to **connect maps together** seamlessly, so that the player can walk from one to the other.

## Map connections

While standing on a map (the current map), any other maps which are directly connected to the current map will be loaded and shown as well. This allows seamless and continuous movement from one map to another.

Only connected maps which are "in range" will be loaded. A map is considered "in range" if any part of it is sufficiently close to what the game screen is showing. That is, if the player is just a few tiles away from being able to see the connected map, it is "in range".

Note that if the loaded connected maps are large and/or have lots of events in them, they may make the game lag. For this reason, it is recommended that you optimise your maps by keeping them smaller and with fewer events on them.

Maps are connected by making their edges touch. The "Edit map\_connections.txt" debug feature will only save a connection between two maps if they are touching each other at any point (but are not overlapping).

## When to make maps connected

Most outdoor maps are connected to each other, to allow the player to walk seamlessly from a route to a town, and so forth.

If you have a large map, you may want to divide that map up into "chunks" to help reduce lag by having less map/event data loaded at once. You can also take advantage of this possibility to have different wild encounters in different parts of the same location.

As the location signpost shows up when stepping onto any new outdoor map, this will (normally) happen when moving from one map to another. If you have split one large location into several maps, this could potentially happen as you pass from one part of the location to another, which would be undesirable. However, the location signpost will not show up if the names of the old map and the new map are the same (the names are defined in the PBS file "map\_metadata.txt"). Because of this, you should give each part's map the same name. For example, you could have two "Route 42" maps, even though one is the eastern half and the other is the western half.

### PBS file map\_connections.txt

A map connection is defined by selecting one point on each of the two connecting maps, and saying that they touch.

Map connections are stored in the PBS file "map\_connections.txt", or a PBS file named "map\_connections\_XYZ.txt" (where "XYZ is any text). Each connection between two maps is listed in a single line, which consists of 6 comma-separated elements as follows:

1. Map 1's ID number
2. Map 1's edge (one of N, North, S, South, E, East, W or West)
3. Map 1's connecting point (a positive integer)
4. Map 2's ID number
5. Map 2's edge (one of N, North, S, South, E, East, W or West)
6. Map 2's connecting point (a positive integer)

Note that you can only connect north to south, and east to west. The connecting points are distances from the top (for east-west connections) or from the left (for north-south connection) of the respective maps.

```
24,E,3,25,W,8

```

This example connects maps 24 and 25. The connection will be east-west, with map 24 on the left and map 25 on the right (because map 24's east side touches map 25's west side). Where the two maps join, the 3rd tile from the top of map 24 will be connected directly to the 8th tile from the top of map 25 (so the top of map 25 is 5 tiles further up than the top of map 24).

```
37,N,0,38,S,0

```

This example connects maps 37 and 38. The connection will be north-south, with map 37 below map 38. Where the two maps join, the left-most tile of map 24 will be connected directly to the left-most tile of map 25.

### Non-bordering connected maps

It is possible to connect two maps together even if they don't have sides that touch. In this case, rather than choosing a side and a distance along that side for each map, you should instead use two coordinates. For example:

```
24,0,0,25,21,14

```

The top left corner tile (0,0) of map 24 will be at coordinates (21,14) when compared to map 25 (i.e. map 24 is to the bottom-right of map 25).

These "connections" will not be saved by the "Edit map\_connections.txt" debug feature. You will need to create them manually, preferably in an extra PBS file such as "map\_connections\_extra.txt" (because the "Edit map\_connections.txt" debug feature only rewrites "map\_connections.txt" so the "extra" file will retain the non-bordering connections).

Uses for this kind of map connection include overlapping maps, maps divided by non-traversable blackness, opposite corners of a large city spanning multiple maps, and so on. Despite this, it is unlikely you will ever need to connect non-bordering maps.

## Creating map connections

There are two ways to connect two maps together: edit the PBS file "map\_connections.txt" (or a "map\_connections\_XYZ.txt" file) directly using the above guidelines, or use the Debug mode's "Edit map\_connections.txt" feature. The latter is by far the easier method. The screenshot above is taken in the "Edit map\_connections.txt" feature.

The "Edit map\_connections.txt" feature is accessed from the Debug menu. In it, you can load maps to the canvas and drag them around to connect them with each other. Make sure that they are connected by their very edges, and that they don't overlap, otherwise their connections will not be saved.

The controls are as follows:

* Up/Down/Left/Right - Move around the canvas (you can also click and drag an empty part of the canvas to scroll around)
* Click on a map and drag it around to move the map
* S - Choose a map to start with
* A - Add another map to the canvas
* Delete - Remove a selected map from the canvas
* Double click on a map - Edit the clicked map's map metadata
* D - Show a help screen listing these controls
* Esc - Exit (allows you to save the changes)