Skip to content

Maps, Hexes & Tactical Boards ​

Elthoria separates overland hex exploration, tactical battle grids, ANTLR map DSLs, and revision-checked persisted boards into explicit, auditable tools so map state never drifts between GM narration and what the players see.

TIP

Looking for the TTRPGMap.g4 and HexMap.g4 grammar sections, cell symbol legends, and how ANTLR maps embed into WorldSimState? Read ANTLR Map DSLs & World Simulator Data Format.


Procedural hex worlds & locations (HexMcpTools, EncounterGenerationMcpTools) ​

Hex campaign maps ​

ToolPurpose
generate_world_mapProcedurally generate a full hex campaign map (terrain, hydrology, settlements, factions, roads, POIs, dungeons, encounter tables) via HexWorldGeneratorService and persist it
list_hex_campaign_maps / get_hex_campaign_map / search_hex_campaign_mapsBrowse, load, or search saved hex campaign maps
save_hex_campaign_map / delete_hex_campaign_mapPersist or remove a hex campaign map
update_hex_terrainChange a hex's single-character terrain code (P plains, F forest, M mountain, etc.) without touching tactical grids
update_hex_location_dataUpdate a hex's inline metadata (name, description, POI type, danger level, NPCs, services, faction control, quests, rumors, explored flag)
parse_hex_map_text / generate_hex_map_text / get_hex_map_antlr_textRound-trip between structured hex map JSON and the HexMap.g4 ANTLR DSL (elthoria-map-dsl)

Hex locations & linking tactical encounters ​

ToolPurpose
create_hex_location / update_hex_location / delete_hex_locationAuthor individual hex locations with coordinates, terrain, and metadata
list_hex_locations / get_hex_location / get_hex_location_by_coords / search_hex_locationsQuery hex locations by act, terrain, exploration status, ID, or (x, y) coordinates
generate_encounter_for_hexGenerate 3 tactical grid proposals tailored to a hex's terrain and danger level
link_grid_to_hexBind an existing saved tactical grid to a campaign hex so entering that hex loads the linked battle map

Tactical battle grids & map DSL (GridMcpTools, MapMcpTools) ​

ToolPurpose
generate_grid / generate_procedural_layoutGenerate a tactical battle grid or procedural dungeon layout (rooms, passages, traps, loot, flow analysis) with full ASCII preview
save_grid / load_grid / list_saved_gridsPersist, load, or list saved tactical grids with their current board revisions
get_grid_info / get_grid_ascii / get_grid_antlr_text / get_grid_textInspect grid dimensions, ASCII visualization, and structured TTRPGMap.g4 ANTLR DSL
parse_antlr_grid / generate_ttrpg_mapParse ANTLR grid DSL text into a live grid or emit full TTRPG map text (including encounters/statblocks)
get_grid_cell / update_grid_cell / update_grid_cells_batchInspect or edit individual cells or rectangular regions in one call
add_entity_to_grid / move_entity_on_grid / remove_entity_from_grid / list_grid_entitiesPlace, reposition, remove, or enumerate tokens/entities on a tactical grid
list_saved_maps / get_saved_map / search_maps_by_title / search_maps_by_author / search_maps_by_campaign / delete_saved_map / get_map_antlr_contentManage general saved map configurations

Persisted revision-checked boards (HexBoardMcpTools, TacticalBoardMcpTools) ​

Persisted boards enforce optimistic concurrency (expected_revision) and idempotency (command_id), preventing stale overwrites when a GM or UI updates the same board.

Hex board (HexBoardMcpTools) ​

ToolPurpose
get_hex_boardRead a player-safe persisted campaign hex board by explicit map_id and campaign_id
apply_hex_board_commandApply a revision-checked GM terrain edit (requires map_id, campaign_id, expected_revision, command_id). GM editing only — not rules-validated travel.

Tactical board (TacticalBoardMcpTools) ​

ToolPurpose
get_tactical_boardRead a persisted trusted-local GM tactical board by saved_grid_id and campaign_id (audience: GM, playerSafe: false)
apply_tactical_board_commandActivate a GM board, reposition a subject (editor move), or configure explicit square perception/movement profiles (configure-movement with square-single-cell-ground.v1 or .v2, feetPerCell: 5, traversableCells, and explicit difficultCells in v2 where entering difficult terrain costs 10 ft orthogonal / 15 ft diagonal)
show_tactical_boardRead-only inline display request for an already-activated persisted GM tactical board (not player-safe; never mutates, activates, or moves pieces)

WARNING

Critical board invariants

  1. Never leak GM snapshots to players. Any payload with audience: GM or playerSafe: false must stay strictly in GM views.
  2. A view intent is not canon. Calling show_tactical_board never saves or moves anything. Always verify mutation success with get_tactical_board / get_hex_board and get_play_dashboard.
  3. Never silently rebase conflicts. If a command fails with a revision conflict, re-read the current board and confirm the intended edit before issuing a new command. For uncertain network retries of the exact same operation, keep the identical request body, original expected_revision, and original command_id.
  4. Board editing ≠ legal combat movement. Use execute_combat_command (adjudicate_npc_move / adjudicate_pc_move) for rules-validated combat movement; apply_tactical_board_command moves are GM setup/editing.

Same-runtime local UI attachment (PlayConnectionMcpTools) ​

ToolPurpose
get_play_connectionRead local same-runtime UI attachment metadata (status, apiBaseUrl, runtimeId). Takes no arguments, starts no UI, and mutates nothing.

When status is READY and apiBaseUrl is non-null, a local GM UI can attach to that exact running Elthoria process (avoiding a second H2 database owner or a second Kompile backend). Remember that a private stdio child's URL expires when the stdio process exits, and runtimeId is correlation metadata — not authentication.


Zero-Angular browser board views (frontend/) ​

elthoria-harness ships framework-neutral DOM renderers and managed web play apps under frontend/ so you can inspect and GM-edit persisted boards without Angular:

  • elthoria-play-panels (frontend/apps/elthoria-play-panels) — the managed iframe UI staged into elthoria web (-Delthoria.web), supporting:
    • Tactical Board (<elthoria-tactical-board-view> from @elthoria/tactical-grid-view): read-only by default, with explicit GM opt-in for revision-bound entity move proposals and a strictly read-only #inline-board fragment view.
    • Hex Board tab (<elthoria-hex-board> from @elthoria/hex-board-view): displays the confirmed persisted campaign hex map when scope.mapId is attached, with explicit GM opt-in for revision-checked terrain edits.
    • World Inspection: read-only narrative candidates and decision workbench views powered by @elthoria/world-simulation-api and @elthoria/world-simulation-http.
  • hex-board-host (frontend/apps/hex-board-host) — standalone local browser host for connecting directly to a trusted local Elthoria server (http://127.0.0.1:8083) to inspect, poll, and GM-edit a persisted campaign hex map.

See Walkthrough 4: Hex Crawls, Dungeons & Persisted Boards for a complete map-to-board play sequence, and Installation, Builds & Spin Packaging for staging the web panels into elthoria web.

Built on the upstream Kompile harness. Released under the MIT License.