feat: map editor — paint terrain + statics on the iso grid (#113) #147
No reviewers
Labels
No labels
alpha:wave-0
alpha:wave-1
alpha:wave-2
alpha:wave-3
area:assets
area:combat
area:ecology
area:infra
area:render
area:scripting
area:ui
area:world
enhancement
epic
migration
post-alpha
roadmap
tech-debt
type:bug
type:chore
type:design
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
marco/IsoMmo!147
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/map-editor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
A minimal, cross-platform map editor (#113) — paint terrain + statics on the iso grid instead of hand-editing text — built on the #89 static layer and the #143
tiledata/IMapFormatseam.tools/IsoMmo.MapEditor.Core, refs Shared only, unit-tested):MapModel(mutable grid + statics + spawn, edits validated againstTileData,ToTileMap/FromTileMap) +Brush(N×N square, rectangle, flood-fill). 14 tests.tools/IsoMmo.MapEditor, MonoGame DesktopGL +MonoGame.ImGuiNet): reuses the game'sGridRenderer/Camera2D/IsoProjectionso the canvas is WYSIWYG with the client. All UI is off-the-shelf ImGui (owner's call: internal tool, zero bespoke UI). Pan (right-drag / WASD / arrows), zoom (wheel), tool = Terrain/Static/Erase/Spawn, brush = Single (+size) / Rect / Fill, palette auto-populated fromTileData, red blocking indicator, yellow spawn marker, path + Open/Save.IMapFormat(WriteMap/ReadMap, round-trip tested in #143) — the editor never parses the format itself. The palette is data-driven for free: it lists the terrains/statics fromtiledata.txt, so anything paintable is loadable, and a new kind is one tiledata row + art (no code).1.0Camera2D.Zoom(backward-compatible; the game never sets it) and an internalTileMap.Createfactory (editor builds a renderable/saveable map from its model without exposing the grid or duplicating format logic —InternalsVisibleTothe editor core).just map-editor,docs/map-editor.md, and a smalltools/IsoMmo.MapEditor/CLAUDE.mdwith the editor's agent guardrails.Notes / decisions
Ankhworld items (world.sav), not map content; set in-game via/place ankh.MonoGame.ImGuiNet1.0.5 ships its dll at the package root (nolib/); referenced portably viaGeneratePathProperty+ the generated package-path property, so it restores on any machine/OS.Screenshots / recording
Captured headlessly via the editor's
--screenshothook (loadsworld.map, renders, writes the PNG, exits). The Tools window (tool/brush/palette/path), the File menu, the iso canvas rendering the world map with biome bands + trees from the static layer, red blocking indicators on solid statics, and the yellow spawn marker (24,18):Command:
dotnet run --project tools/IsoMmo.MapEditor -- --screenshot mapeditor.png.How it was tested
IsoMmo.MapEditor.Core.Tests, 14):MapModel(fill, set terrain/static, clear, spawn bounds, unknown-id rejection, snapshot isolation,FromTileMapround-trip) +Brush(square size 1/3, rectangle any-order inclusive, flood-fill stops at different terrain / out-of-bounds empty).just lint(CSharpier + analyzers, zero warnings) andjust test(421 tests) green; whole solution builds incl. client + tools.MapModel/IMapFormatcoverage.Checklist
just lintpasses (CSharpier + analyzers, zero warnings)just testis greenRelease artifact (now included)
.forgejo/workflows/release.yamlnow publishes the map editor as a self-contained artifact (isommo-map-editor-<tag>-{win-x64,osx-arm64}.zip) alongside the client/servers/asset-editor, with the pack + tiledata + maps bundled so it runs standalone. Verified locally:dotnet publish --self-containedbundles the ImGuiNet dll + nativelibcimgui, and the published build runs and screenshots headlessly. Closes #146.Closes #113.