Skip to content

Tilemap Editor - Technical Reference ​

Level: ⭐⭐⭐ Advanced


Quick Index


Engine Limits ​

⚠️ Limits Table ​

ParameterLimitDescription
MAX_TILE_WIDTH32 pxMaximum tile size
MAX_TILE_HEIGHT32 pxMaximum tile size
MAX_MAP_DIM255 tilesMaximum map dimension
MAX_UNIQUE_TILES256Unique tiles per project
MAX_LAYERS8Layers per scene
MAX_SCREEN_WIDTH320 pxScreen width
MAX_SCREEN_HEIGHT240 pxScreen height
MAX_ANIMATIONS64Animations per scene
MAX_ANIMATION_FRAMES256Total frames
MIN_FRAME_COUNT1Minimum frames
MAX_FRAME_COUNT255Maximum frames
MIN_FRAME_DURATION1Minimum duration (ticks)
MAX_FRAME_DURATION255Maximum duration (ticks)

Enforcement: Tile size, layer count, and animation limits are validated at edit time (project creation, add-layer, add-animation). At save, animations and player spawn positions are re-validated.

Screen Resolutions ​

Landscape:

  • Maximum: 320×240 px
  • Aspect ratio: 4:3

Portrait:

  • Maximum: 240×320 px
  • Aspect ratio: 3:4

File Formats ​

Project File ​

The editor stores projects in a single binary format (.pr32scene.bin, version 9). There is no human-readable JSON writer; the JSON object used inside the serializer only carries project metadata and per-tile attributes embedded in the binary container.

The "Use Binary Format" preference in File → Preferences only affects the file extension written to disk (.pr32scene.bin vs .pr32scene). The on-disk content is the same binary v9 container either way.

ExtensionContent
.pr32scene.binBinary v9 container (default)
.pr32sceneLegacy extension accepted for open; still binary v9 when saved

Binary Format ​

The .pr32scene.bin format is a big-endian binary container (current version 9). Layout:

FieldSizeNotes
MAGIC4 BPR32 (big-endian 0x50523332)
VERSIONu16Current: 9
FLAGSu16Bit 0: COMPRESSION_ZLIB
tileSizeu8Project default tile size in px
reserved3 BPadding
Metadatau32 len + JSONProject metadata (JSON embedded)
Tilesetsu16 count + entriesPer-tileset data, including each sheet's own tileWidth/tileHeight
Scenesu16 count + entriesPer-scene data; optional zlib-compressed layers

The serializer targets byte-for-byte compatibility with the engine's binary project format (big-endian layout). Layer payloads can be zlib-compressed (flag bit 0).

Scene record, by version ​

Every block below sits inside a scene entry, after width/height and before layerCount. Each version appends to the previous one, so the order is the order they were added:

VersionBlockSize
v6+hasSpawn u8 + optional player spawn x/y u161 or 5 B
v7+roomCount u16 + roomCount × 16-byte room records2 + 16·n B
v8+projection u8 + cellWidth u16 + cellHeight u165 B, fixed
v9+originAuthored u8 + originX i16 + originY i165 B, fixed

A room record is originCol, originRow, cols, rows (u16 each) followed by four u16 connection targets in Up, Down, Left, Right order, where 0xFFFF means "no connection".

Reading these blocks is not optional

A reader that skips an unknown block desynchronizes the stream. layerCount and the compressed layer payload that follow would then be parsed from the wrong offset, which does not reliably fail — it can produce a plausible, corrupt project. The editor refuses the whole file instead. Any third-party parser should do the same.

Why projection is per scene ​

projection, cellWidth and cellHeight live in the scene record rather than in the header, even though the header still has three spare reserved bytes that would have held them for less. One project can pair an isometric dungeon with an orthogonal menu, and a header field would have made that impossible.

cellWidth and cellHeight of 0 mean inherit the project's tileSize, which is what every pre-v8 file meant implicitly. That is why legacy files load correctly: their defaults — orthogonal, both extents inheriting — are exactly what they always were.

An unrecognized projection ordinal comes from a file written by a newer editor. It falls back to orthogonal, which keeps the scene loadable and visibly wrong rather than rejecting a file whose tiles are all still readable.

Size & Performance ​

The binary format keeps projects compact and fast to load (single-format; there is no alternative JSON serialization to compare against).


Project Structure ​

File Structure ​

my_project/
├── my_project.pr32scene.bin  # Project file (binary v9, default)
├── tile_flag_rules.json   # Custom rules (optional)
└── assets/
    └── tilesets/
        ├── tileset1.png
        └── tileset2.png

The file is stored as .pr32scene.bin by default. With "Use Binary Format" disabled it is written as .pr32scene instead (still binary v9 content). Only the extension changes.

Exported Files ​

output/
├── my_scene.h              # Declarations + animations + palettes (multi-palette)
├── my_scene.cpp            # Data (palettes, tiles, indices)
└── {namespace}_tilemap_palette.h  # Shared palette (single palette mode)

Animations are embedded in my_scene.h alongside their layer (<LAYER>_TILE_ANIMATIONS[]). There are no separate *_animations.h/.cpp files.


Application Architecture ​

The Tilemap Editor is a native desktop application built with C++17 on SDL2 + ImGui + OpenGL 3.3. There is no Python/Tkinter runtime. The editor is distributed as a compiled binary within the Tool Suite.

Core Services ​

The editor's logic is organized into the following internal services (C++):

ServiceFile (source)Responsibility
ProjectServicetools/tilemap_module/project_service.{h,cpp}Create / load / save projects, validate project name, manage tile flag rules
BinarySerializertools/tilemap_module/binary_serializer.{h,cpp}Read/write .pr32scene.bin (v9, big-endian, optional zlib compression)
HistoryManagertools/tilemap_module/history_manager.{h,cpp}Bounded (100 entries) undo/redo stack with optional compression
AnimationValidatortools/tilemap_module/core/animation_validator.{h,cpp}Validate animations against engine limits (bounds, overlap, count, duration)
ExporterServicetools/tilemap_module/exporter_service.{h,cpp}Gate C++ export behind a valid license; coordinate the native export pipeline
ExportOrchestratortools/tilemap_module/native_export/export_orchestrator.{h,cpp}Multi-palette detection, image processing, palette analysis, tile dedup, C++ code generation
AutosaveServicetools/tilemap_module/autosave_service.{h,cpp}Interval-based autosave
ToolManagertools/tilemap_module/tool_manager.{h,cpp}Active tool registry (Brush, Eraser, Rectangle, Pan, Pipette, Attribute, Anim)

Note: These services are internal C++ modules compiled into the Tool Suite binary. They are not a public Python API and cannot be imported by external scripts. Automation should use the file formats described below or the external pr32-sprite-compiler CLI (Sprite Compiler module).

Runtime Environment ​

ItemDetail
Language / standardC++17
GUI frameworkDear ImGui (v1.92.8)
Windowing / GPUSDL2 + OpenGL 3.3 (single window, DockSpace layout)
JSONnlohmann/json v3.11.3
SVG rasterizationlunasvg v3.1.0
Native file pickersportable-file-dialogs
Compressionzlib (.pr32scene.bin layer payloads)
CryptoOpenSSL (SHA-256 checksum + AES-256-CBC)
Build systemCMake ≥ 3.20

C++ Export ​

Requirements ​

⚠️ Important: C++ export requires a valid license (Ed25519 v3 key, machine-bound). See License & Activation for full details.

  • Without license, the Upgrade Required dialog appears when attempting to export
  • Other features work without license

Export Options ​

OptionDescriptionRecommended
C++ NamespaceNamespace for codeProject name
Color Depth (BPP)Read-only; auto-detected (1/2/4)Auto-detect
Store in Flash (ESP32)Save to PROGMEM✅ Always
Legacy FormatWithout Flash attributesCompatibility only
Install palette in init()None (default), Background or Dual (background + sprites): which palette bank init() fills with the scene paletteBackground when sprites have their own palette

Export options are not saved in the project file; the dialog starts from its defaults on every export.

Install palette in init() adds one call at the top of init(): setBackgroundCustomPalette(P) for Background, setDualCustomPalette(P, P) for Dual. P is CUSTOM_PALETTE_DATA in single-palette mode and the lowest slot's palette in multi-palette mode, installed before the per-slot calls so those still win. None emits exactly the previous init(). 1bpp has no RGB565 palette, so every option emits what None does.

Export Mode ​

ModeTriggerGenerated
Single PaletteAll layers use P0Shared palette
Multi-PaletteAny layer P1-P7Per-slot palettes

Generated Files ​

Single Palette ​

cpp
// level1.h
static const uint16_t TILEMAP_PALETTE_DATA[] = { /* RGB565 */ };
extern pixelroot32::graphics::TileMap4bpp layer_foreground;

// level1.cpp
static const pixelroot32::graphics::Sprite4bpp TILESET_SPRITES[] = { /* tiles */ };
static const uint8_t LAYER_FOREGROUND_INDICES[] = { /* indices */ };

The palette array is declared in the header; tiles and index data live in the .cpp. The layer struct is TileMap, TileMap2bpp, or TileMap4bpp depending on the auto-detected BPP.

Multi-Palette ​

cpp
// level1.h
static const uint16_t PLATFORMS_PALETTE[16] = { /* RGB565 */ };
static const uint16_t STAIRS_PALETTE[16] = { /* RGB565 */ };

// level1.cpp
void init() {
    setBackgroundCustomPaletteSlot(1, PLATFORMS_PALETTE);
    setBackgroundCustomPaletteSlot(2, STAIRS_PALETTE);
}

Isometric Projection ​

Emitted only when the scene's projection is isometric. An orthogonal scene's projection is the identity, so naming one would be dead weight in flash on every existing target — an orthogonal export is byte-for-byte what it always was.

cpp
// level1.h
#include <math/Projection.h>

namespace level1 {
    inline constexpr uint8_t TILE_WIDTH  = 32;
    inline constexpr uint8_t TILE_HEIGHT = 16;

    inline constexpr pixelroot32::math::ProjectionSpec ISO_PROJECTION{
        120, 88,    // where cell (0,0)'s diamond CENTRE lands
         16,  8,    // +1 cellX steps right and down
        -16,  8};   // +1 cellY steps left and down
    // three static_asserts, see below

    inline constexpr uint8_t TILESET_MAX_TILE_HEIGHT = 40;
}

#ifdef PIXELROOT32_ENABLE_4BPP_SPRITES
namespace level1 {
    inline constexpr uint16_t TILESET_TILE_COUNT = 7;
    extern const pixelroot32::graphics::Sprite4bpp TILESET_SPRITES[TILESET_TILE_COUNT];
    extern const uint8_t TILESET_FOOT_Y[TILESET_TILE_COUNT];
    // layer maps, room maps, init(), animations
}
#endif
The depth guard and linkage ​

The isometric header is two blocks of the same namespace:

BlockHoldsGuard
GeometryTILE_WIDTH/TILE_HEIGHT, MAP_WIDTH/MAP_HEIGHT, ISO_PROJECTION and its static_asserts, TILESET_MAX_TILE_HEIGHT, spawn, room metadata, attributes and behaviour layersnone (room metadata keeps its own PIXELROOT32_ENABLE_GAMEPLAY_ROOM)
Tile datamulti-palette palettes, TILESET_TILE_COUNT, TILESET_SPRITES, TILESET_FOOT_Y, layer and room maps, init(), animations#ifdef PIXELROOT32_ENABLE_4BPP_SPRITES at 4bpp, PIXELROOT32_ENABLE_2BPP_SPRITES at 2bpp, none at 1bpp (the engine has no 1bpp switch)

The .cpp wraps its whole body in the same guard. Gameplay places actors on cells where no tile is drawn, so a build without the depth switch must still compile the geometry.

Every constant is inline constexpr, and TILESET_SPRITES (and <LAYER>_TILESET_SPRITES in multi-palette mode) has external linkage: the .cpp defines it without static, so every translation unit sees one array in flash. This shape applies to isometric scenes only; an orthogonal export keeps its static const arrays.

TILESET_MAX_TILE_HEIGHT is the height of the tallest tile in the pool (in multi-palette mode, in any layer's pool). A tile overhangs its cell by up to TILESET_MAX_TILE_HEIGHT - TILE_HEIGHT pixels.

TILE_WIDTH and TILE_HEIGHT are the cell STRIDE

They are not the tileset's bitmap extents. An isometric tile is usually taller than its cell — a 32×40 wall standing on a 32×16 diamond — and the difference is exactly what TILESET_FOOT_Y records.

In an orthogonal export the two happen to coincide, which is why the distinction never came up before.

TILESET_FOOT_Y[i] is the bitmap row of tile i that lands on its cell's diamond centre. It is parallel to TILESET_SPRITES, and it is what lets the renderer stand a tall sprite on a short cell. The orthogonal export has no analogue: its art fills its cell, so there is no anchor to record.

init() assigns it — background.tileFootY = TILESET_FOOT_Y; — so a consumer that calls init() and then draws through ISO_PROJECTION needs to wire nothing by hand.

One table per layer in multi-palette mode ​

A scene that gives each layer its own palette slot also gives each layer its own tileset, so the export names one table per layer instead of one shared table:

cpp
inline constexpr uint16_t BACKGROUND_TILESET_TILE_COUNT = 13;
inline constexpr uint16_t LAYER_1_TILESET_TILE_COUNT = 4;

extern const uint8_t BACKGROUND_TILESET_FOOT_Y[BACKGROUND_TILESET_TILE_COUNT];
extern const uint8_t LAYER_1_TILESET_FOOT_Y[LAYER_1_TILESET_TILE_COUNT];

tileFootY must be parallel to the tiles[] array it anchors, and those are three different arrays of three different lengths. A single flat table could not be parallel to more than one of them.

The count is the deduplicated pool's, not the tilesheet's

The exporter collapses identical tiles, so the tileset you imported and the TILESET_SPRITES array it becomes have different lengths and a different order. Every count and every table above is sized to the pool — the same number init() writes to tileCount, which footYFor() bounds-checks against. A third-party writer of these headers has to do the same remapping.

Each sprite carries its own extents ​

Tileset records its own tileWidth and tileHeight, and a project may mix them: 32×16 floors and 32×40 walls in one scene is the ordinary isometric case, and the two sheets pack to 256 and 640 bytes at 4bpp.

So TILESET_DATA_POOL is not a fixed-stride array. Each entry occupies exactly the bytes its own extents need, laid end to end, and each sprite records where its own bytes begin:

cpp
const pixelroot32::graphics::Sprite4bpp TILESET_SPRITES[TILESET_TILE_COUNT] = {
    { nullptr, PALETTE, 0, 0, 9},                          // empty slot 0
    { &TILESET_DATA_POOL[0],   PALETTE, 32, 16, 9,         // floor
      &TILESET_SPAN_MIN_X[0],  &TILESET_SPAN_MAX_X[0]},
    { &TILESET_DATA_POOL[256], PALETTE, 32, 40, 9,         // wall
      &TILESET_SPAN_MIN_X[16], &TILESET_SPAN_MAX_X[16]},
};

(The fifth field is the palette's colour count; the last two are the span tables described below.)

Slot 0 ​

Index 0 is the empty tile the export reserves for erased cells, and drawTileMap never draws it. In an isometric export it is zero-extent: { nullptr, PALETTE, 0, 0, … }, no bytes in TILESET_DATA_POOL (tile 1 starts at offset 0), no span rows, and TILESET_FOOT_Y[0] == 0. It still has to exist and be readable, because the projected path scans tiles[0 .. tileCount) for the worst-case extent before it draws; a zero-extent slot does not widen that scan. See obligation 2 in Projected Tilemap: Producer Obligations.

An orthogonal export keeps its full-size blank tile at index 0, byte for byte as before.

Span tables ​

Isometric 4bpp and 2bpp exports precompute each tile's opaque run per row and store it in flash:

cpp
static const uint8_t PIXELROOT32_SCENE_FLASH_ATTR TILESET_SPAN_MIN_X[] = { /* ... */ };
static const uint8_t PIXELROOT32_SCENE_FLASH_ATTR TILESET_SPAN_MAX_X[] = { /* ... */ };

Row y of tile i covers [MIN_X, MAX_X), and a fully transparent row is 0/0 — exactly what the engine's computeSpanTable writes. Each tile's rows follow the previous tile's, so a descriptor points at the running sum of the heights before it. Multi-palette scenes get one pair per layer (<LAYER>_TILESET_SPAN_MIN_X/_MAX_X). The renderer uses them to skip transparent padding, so a game draws straight from the const descriptors: no RAM copy, no computeSpanTable at startup. Slot 0 has no rows and leaves the fields nullptr. Orthogonal and 1bpp exports emit no span tables (Sprite has no span fields).

Engine version

A 2bpp tile's precomputed table matches the 2bpp blit's bit order (pixel 0 in the low bits). The engine's own computeSpanTable(Sprite2bpp&) has read that order since engine 1.15.0; earlier releases read the bits in the opposite order, so a table they precomputed does not match today's blit. The exported tables do not depend on it.

Do not index the pool by TILE_WIDTH * TILE_HEIGHT

A third-party writer of these headers has to accumulate the offsets, not compute them. A stride is right only while every tile in the project is the same size — and the moment a wall sheet is taller than a floor sheet, it is right for no tile but the first.

The three static_asserts ​

The header states its own invariants rather than trusting the exporter, because a plain aggregate cannot assert its own initializers under -fno-exceptions:

AssertWhat breaks if it fails
projectionSpecIsValid(ISO_PROJECTION, MAP_WIDTH, MAP_HEIGHT)The basis exceeds Scalar's fixed-point range for this map size
projectionDet(ISO_PROJECTION) == NThe determinant stopped being a power of two, so screenToCell loses its strength reduction to a shift
rowMajorIsPainterOrder(ISO_PROJECTION)Row-major iteration is no longer back-to-front, and the projected drawTileMap has no depth sort — walls would draw in front of what stands behind them

These fire at your compile, not at export time. That is deliberate: a projection the engine cannot use should stop the build that would ship it.

Room Metadata ​

Optional. Emitted only when the project defines rooms; a project without them exports exactly as before, so this is additive to the format, not a new version.

cpp
// level1.h
static const pixelroot32::gameplay::RoomData LEVEL1_ROOMS[] = {
    // originCol, originRow, cols, rows, { Up, Down, Left, Right }
    {  0, 0, 20, 15, { 0xFFFF, 0xFFFF, 0xFFFF,      1 } },
    { 20, 0, 20, 15, { 0xFFFF, 0xFFFF,      0, 0xFFFF } },
};

static const pixelroot32::gameplay::RoomLayer LEVEL1_ROOM_LAYER = {
    LEVEL1_ROOMS, 2, 16, 16   // rooms, roomCount, tileWidth, tileHeight
};

Both arrays are const so the linker parks them in flash — a room layer costs 0 bytes of SRAM. The structs are declared in include/gameplay/RoomLayout.h, behind PIXELROOT32_ENABLE_GAMEPLAY_ROOM, and the generated header wraps the block in #if PIXELROOT32_ENABLE_GAMEPLAY_ROOM. The symbol prefix is the scene file's name in upper case (level1.h → LEVEL1_ROOMS, iso_dungeon_rooms.h → ISO_DUNGEON_ROOMS_ROOMS).

Rooms in an isometric scene ​

An isometric scene with rooms differs in three ways:

  • ROOMS and ROOM_LAYER are inline constexpr instead of static const.
  • ROOM_LAYER's tileWidth/tileHeight are the cell stride (TILE_WIDTH/TILE_HEIGHT, e.g. 32, 16), not the project's tile size. Room origins stay in scene cells.
  • The export adds one map per room, inside the depth guard:
cpp
// --- Room Maps ---
extern pixelroot32::graphics::TileMap4bpp tiles_room0;   // <layer>_room<r>
extern pixelroot32::graphics::TileMap4bpp tiles_room1;

inline constexpr uint8_t NUM_ROOM_LAYERS = 2;            // = number of rooms
extern pixelroot32::graphics::TileMap4bpp* const ROOM_LAYERS[NUM_ROOM_LAYERS];
SymbolMeaning
<layer>_room<r>Room r of layer <layer>: width×height = the room's cols×rows, local cells from (0, 0), indices in <LAYER>_ROOM<r>_INDICES[]
NUM_ROOM_LAYERSNumber of rooms; ROOM_LAYERS is indexed like ROOMS
ROOM_LAYERS[r]Room r's map (the bottom layer's, when there are several)
LAYERS_PER_ROOMOnly with several layers: the layer count
<LAYER>_ROOM_LAYERS[r]Only with several layers: room r's map of that layer. Draw room r as one drawTileMap per layer, bottom to top

Room maps share the deduplicated tileset, tileCount, TILESET_FOOT_Y and the span tables with the whole-scene map, which is still exported. In multi-palette mode each uses its layer's pool and gets its own <LAYER>_ROOM<r>_PALETTE_INDICES; animated layers share the layer's AnimManager. init() wires every room map. Behaviour and attribute layers are not cropped: they stay in scene cells, so add the room origin when querying them.

An orthogonal scene, or an isometric one without rooms, emits no room maps.

Engine Integration ​

Single Palette:

cpp
#include "level1.h"

level1::init();
renderer.drawTileMap(level1::layer_foreground, x, y);

Multi-Palette:

cpp
#include "level1.h"

level1::init();  // Registers palettes
renderer.drawTileMap(level1::background, 0, 0);
renderer.drawTileMap(level1::platforms,  0, 0);

Attributes/Flags:

cpp
// Query attributes
const char* type = level1::get_tile_attribute(0, x, y, "type");

// Query flags
uint8_t flags = level1::getTileFlags(0, x, y);  // layer index, x, y
if (flags & TILE_SOLID) { /* collision */ }

Animations:

cpp
level1::getForegroundAnimManager().step();
renderer.drawTileMap(level1::layer_foreground, x, y);

Rooms:

cpp
#include "level1.h"

// In Scene::init() — rects and connections both come from the export.
pixelroot32::gameplay::RoomGraph<8> rooms;
if (pixelroot32::gameplay::buildRoomGraph(level1::LEVEL1_ROOM_LAYER, rooms) > 0) {
    setRoomGraph(&rooms);
    rooms.enterRoom(0, &camera);
}

buildRoomGraph() returns how many rooms it added. Fewer than roomCount means the graph's capacity N truncated the layer; 0 means the layer was rejected (see Room Layer). Check it — enterRoom() on an empty graph is a silent no-op, so a rejected layer otherwise leaves the scene running with no camera bounds and no current room.

Isometric rooms (engine 1.15.0: PIXELROOT32_ENABLE_GAMEPLAY_ROOM and PIXELROOT32_ENABLE_TILEMAP_PROJECTION):

cpp
#include "level1.h"
namespace gp = pixelroot32::gameplay;

// Camera rect per room = screen box of its cell diamonds (what its floor draws).
if (gp::buildRoomGraph(level1::LEVEL1_ROOM_LAYER, rooms,
                       level1::ISO_PROJECTION) > 0) {
    setRoomGraph(&rooms);
    rooms.enterRoom(0, &camera);
}

// draw(): the room map's local cells land where the room sits in the scene.
const uint16_t r = rooms.currentRoomIndex();
renderer.drawTileMap(*level1::ROOM_LAYERS[r], 0, 0,
                     pixelroot32::graphics::LayerType::Static,
                     gp::roomProjection(level1::ISO_PROJECTION,
                                        level1::LEVEL1_ROOMS[r]));

An optional fourth argument to buildRoomGraph, one graphics::ScreenBounds per room (from expandProjectedMapBounds over each room map), widens each camera rect by the art's overhang. A game whose rooms are one screen each can instead draw *ROOM_LAYERS[r] through ISO_PROJECTION and call enterRoom(r, nullptr) — that works on the current release. See Isometric Guide — Rooms.

Each animated layer exposes a <LayerName>AnimManager(). A legacy getAnimManager() alias maps to the Details layer when present.


Data Formats ​

Palette ​

  • Format: RGB565
  • Size: 16 colors max
  • Index 0: Transparent (multi-bpp)

Tiles ​

BPPPer RowColorsBit order
1 bppone uint16_t (width ≤ 16)2bit width - 1 = leftmost pixel
2 bpp(width * 2 + 7) / 8 bytes4pixel 0 in the low bits of each byte
4 bpp(width * 4 + 7) / 8 bytes16pixel 0 in the low nibble
  • Every 2bpp/4bpp row is padded to whole bytes, the engine's stride, so widths that do not fill a byte (an odd 4bpp width, a 2bpp width that is not a multiple of 4) draw correctly.
  • Transparent pixels (alpha below 128) export as index 0 (2bpp/4bpp) or as "off" (1bpp).
  • A 1bpp tile wider than 16 px does not fit an engine Sprite. In an isometric scene the export warns before writing files when a used tile is that wide.

Index Map ​

  • 1 byte per cell (uint8_t)
  • Value -1 (editor) = Index 0 (export) = Empty

Room Layer ​

Optional metadata describing a graph of connected rooms inside a single scene. Coordinates are in tiles (cells), not world units. The orthogonal buildRoomGraph(layer, graph) multiplies them by the layer's tile size; the projected buildRoomGraph(layer, graph, projection) (engine 1.15.0) projects each room's cell block instead, and there tileWidth / tileHeight are the cell stride.

RoomData — one room, 16 bytes on every target:

FieldTypeMeaning
originCol / originRowuint16_tTile coordinates of the room's top-left corner
cols / rowsuint16_tRoom size in tiles
connections[4]uint16_tTarget room index per direction, indexed 0=Up, 1=Down, 2=Left, 3=Right. 0xFFFF = wall

RoomLayer — the array header:

FieldTypeMeaning
roomsconst RoomData*Pointer to the exported array
roomCountuint16_tNumber of entries
tileWidth / tileHeightuint8_tTile size in world units (orthogonal) or cell stride (isometric), both >= 1

Emitter rules:

  • Connection targets are indices into this same array, so a room may reference one declared after it — the engine resolves connections in a second pass.
  • Connections are directed. A two-way door needs both halves (A.Right = B and B.Left = A).
  • A room's far edge ((originCol + cols) * tileWidth, likewise for rows; under a projection, every corner of its projected box) must stay within ±32767. Scalar is Fixed16 on FPU-less targets and would wrap past that. The engine rejects the whole layer if any room exceeds it, rather than building a partially-correct map — including rooms the consuming graph's capacity would have truncated away. A broken export fails closed.
  • Emit at most 4 connections per room. There is one slot per cardinal direction; diagonal or multi-door connections are out of scope for v1.

BPP Auto-Detection ​

Real Colors (excl. transparency)BPPMaximum
≤ 11 bpp2
2-4 total slots (incl. optional transparency)2 bpp4
otherwise4 bpp16

totalSlots = realColors + (hasTransparency ? 1 : 0). 1bpp requires ≤1 real color; 2bpp when total slots ≤ 4; otherwise 4bpp.


Compatibility ​

Runtime ​

The Tilemap Editor is distributed as a pre-built native binary (part of the Tool Suite). No Python, Tkinter, or Pillow installation is required.

RequirementDetail
Operating systemWindows, Linux, macOS (per release)
GPU / WindowingOpenGL 3.3 capable GPU; SDL2-based window
Storage~tens of MB for the app + generated assets
LicenseA valid Tool Suite license is required for C++ export

Target Hardware ​

  • ESP32 (PixelRoot32 engine)
  • Flash: 4MB minimum recommended
  • RAM: 520KB minimum

Glossary ​

TermDefinition
ENGINE_LIMITSEngine limit constants
ProjectModelProject class
SceneModelScene model
LayerModelLayer model
TileAnimationTile animation model
RGB565Color format (5+6+5 bits)
BPPBits per pixel
PROGMEMESP32 flash storage
Sprite4bpp4bpp sprite
TileMapExported tilemap structure

Released under the MIT License.