ash10Ashton S
Galaxy
View
measuring…: show what served this page

Served just now

Measured by this page's request to /api/status: server time per service on the internal network, and the round trip from your browser. A service that isn't answering is left out.

D&D battle map

A battle-map editor for tabletop sessions: paint terrain, place tokens, undo and redo, export the map as JSON. Ported here from its Next.js app to a client-side island.

2025 · TypeScript · React · Next.js · Socket.IO

A still of D&D battle map.
React island · in your browsernot running
The dndbm editor, ported to a React island: everything runs in your browser and nothing is saved to a server. Multiplayer is described below, not run.

What it is

The editor paints a grid by dragging, with six terrain types and an eraser, and places four kinds of tokens. Undo and redo use the command pattern with a 100-step history, and each step carries a readable description, so the buttons say what they will undo. Keyboard shortcuts cover the common actions, and the map exports as JSON in the app’s own BattleMapData shape, holding the grid size, the painted cells and the tokens.

The engineering

The multiplayer design is described here, not run. Sessions use 6-character join codes without look-alike characters, checked for uniqueness with retries and expired after 24 hours. A Socket.IO protocol carries presence, cursors, map sync, initiative and turns, chat, dice and game-master-only role changes. For this page the editor was ported from its Next.js app to a React island that runs only in the browser.

In the Lab

The Lab runs the ported editor: everything happens in your browser and nothing is saved to a server. Paint, place tokens, undo and redo, then export the map as a JSON file. The grid works by keyboard as well as by pointer: the arrow keys move a cursor cell and Space or Enter applies the current tool. The server, session and Socket.IO code from the original app is not part of this port, so nothing here connects to anything.

Everything in the Lab