Skip to Content
The Alchemy Project

Maps & Tilesets

This page is a guide to the games/tbs/src/map/ folder of the Alchemy project, where every town, dungeon, house interior, and outdoor path in Golden Sun: The Broken Seal is stored as tab-separated map data.

This folder holds 182 map directories, each storing its tile layouts, terrain heights, and treasure locations in open .tsv grids. All of them are listed in ROM order in maps.tsv and wired into the game through the 186-row MapsWork table in resources.s.

When Isaac walks behind a Vale roofline, climbs a staircase, or watches a waterfall rush past, those rules come from these tables. The sections below cover how three GBA layers fit into one grid, plus tile animations, World Map chunks, and runtime unpacking. How maps drive movement and height collision is described in World, Scenes & Maps.

Three layers in one .tsv grid

Vale in front of the Sanctum split into its ground, walls, actors, and roof layers
Vale in front of the Sanctum split into its ground, walls, actors, and roof layers

Each map is a 128×128 grid of 16×16-pixel metatiles. Inside the .tsv files, the three GBA background layers (ground, walls, and roofs) sit side by side in one grid. Their column offsets, scroll ratios, and independent drift rates, such as that of blowing desert haze, live in layers.tsv.

FileContents
grid_picture.tsvMetatile appearance indices into metatile_tiles.tsv
grid_behavior.tsvMetatile behaviour IDs (0 = plain ground, 240+ = universal behaviours, lower values = scene cue triggers)
grid_shape.tsvGround height shape indices into shapes.tsv
grid_actors.tsvMetatiles overriding an actor's BG layer or OAM priority (for walking behind roofs with no script code)
metatile_tiles.tsv, shapes.tsv2×2 tile definitions and per-pixel terrain height profiles
spots.tsvCandidate coordinates for chests and Psynergy Stones (spawned only if the active scene has a matching cue row)
tileset_anims.tsv, blend.tsvTimer-driven VRAM tile replacement animations and alpha-blend scripts
header.tsv, layers.tsv, contents.tsv, tilesets.tsvMap metadata, layer offsets and drift, and referenced palette and tileset resources

Chests live in spots.tsv rather than the tile grid so multiple scenes sharing one map can carry different treasure. Language-specific overrides sit beside the base files (e.g., grid_picture_es.tsv).

Tile animations, World Map chunks, and runtime unpacking

A spot in Vale beside its tileset: watch the red outline mark each group of tiles at the moment the animation repaints it
A spot in Vale beside its tileset: watch the red outline mark each group of tiles at the moment the animation…
  • Tileset animation (tileset_anims.tsv) and blend scripts (blend.tsv): Waterfalls and rivers repaint VRAM tiles on timers without altering metatiles, updating every square that uses those tiles at once. Blend scripts step layer alpha weights on timers the same way.
  • World Map chunks: The World Map spans four times a town's grid in each direction, cut into compressed 512×512-pixel squares. Only the four squares around the party stay unpacked in EWRAM, unpacking at most one new square per tick.
  • Runtime unpacking (field/map_grid_convert.s): Unpacks the three compressed planes of map.grid.lz with ARM code in IWRAM and weaves them into one 32-bit word per metatile. Each word packs metatile_tiles in the low 16 bits and behavior and shape in the high 16 bits.
  • Folder naming: Folders are named after the scene or place that uses them. empty_map/ is row 0 of MapsWork for the Title, File Screen, and World Map, and two unnamed maps keep their resource numbers. Map-reading code lives in Field engine and tileset PNGs live in Graphics assets.