feat/world-terrain #121

Merged
marco merged 12 commits from feat/world-terrain into main 2026-07-21 23:00:20 +02:00
Owner

Summary

Adds terrain types to the world map. TileMap now stores a TerrainType per cell (Grass / Marsh / Tree) instead of a plain walkable flag:

  • Grass — walkable ground.
  • Marsh (~) — impassable but transparent to line of sight (can't stand on it, can see/target across it).
  • Tree (#) — impassable and opaque (blocks movement and LoS), drawn as a tall obstacle.

Walkability and LoS stay server-authoritative (TileMap.IsWalkable / HasLineOfSight, shared by server and client). The world map gains a marsh region. No protocol change (the map is a content file, not sent over the wire).

Rendering

Land uses the documented UO model — 44×44 iso-diamond tiles drawn 1:1, a few variants per terrain (grass_0..3, marsh_0..3) picked deterministically per cell so it tessellates edge-to-edge without repeating. The diamonds are derived from a uniform seamless grass/marsh texture (flips for subtle variety) with a gapless diamond mask, so the ground reads as continuous — no dark seams, no light/dark checkerboard. Marsh keeps decorative scatter (reeds / lily / sedge) folded into the depth-sorted pass.

How it was tested

  • New TileMapTests: marsh is impassable but open to sight; TerrainAt classifies each char; off-map reads as a tree edge.
  • Whole solution builds, just lint clean (0 warnings), dotnet test green, CI green.
  • Ran locally (just dev) and eyeballed grass + marsh + scatter.

Notes for review

  • Land art conforms to docs/asset-authoring.md (44×44 diamonds, transparent corners, 1:1, variants). Earlier revisions of this branch shipped 256×256 blocks + a scaled 128×128 seamless tile + a grass bush scatter (which caused a harsh checkerboard) — all removed.
  • Repack touches only the land entries; every other asset is byte-identical (no unrelated art drift). Pack: 10.4 MB → ~8.2 MB.

Checklist

  • just lint passes (CSharpier + analyzers, zero warnings)
  • just test is green
  • The whole solution builds (client and tools included)
  • Multi-platform preserved (pure .NET / MonoGame, no OS-specific APIs)
  • Tests added/updated for this change (TileMapTests)
  • Screenshot attached (map confirmed good locally; a client screenshot tool is a follow-up)
## Summary Adds **terrain types** to the world map. `TileMap` now stores a `TerrainType` per cell (Grass / Marsh / Tree) instead of a plain walkable flag: - **Grass** — walkable ground. - **Marsh (`~`)** — impassable but **transparent** to line of sight (can't stand on it, can see/target across it). - **Tree (`#`)** — impassable **and** opaque (blocks movement and LoS), drawn as a tall obstacle. Walkability and LoS stay **server-authoritative** (`TileMap.IsWalkable` / `HasLineOfSight`, shared by server and client). The world map gains a marsh region. No protocol change (the map is a content file, not sent over the wire). ## Rendering Land uses the documented UO model — **44×44 iso-diamond tiles drawn 1:1**, a few variants per terrain (`grass_0..3`, `marsh_0..3`) picked deterministically per cell so it tessellates edge-to-edge without repeating. The diamonds are derived from a **uniform seamless grass/marsh texture** (flips for subtle variety) with a gapless diamond mask, so the ground reads as continuous — no dark seams, no light/dark checkerboard. Marsh keeps decorative scatter (reeds / lily / sedge) folded into the depth-sorted pass. ## How it was tested - New `TileMapTests`: marsh is impassable but open to sight; `TerrainAt` classifies each char; off-map reads as a tree edge. - Whole solution builds, `just lint` clean (0 warnings), `dotnet test` green, **CI green**. - Ran locally (`just dev`) and eyeballed grass + marsh + scatter. ## Notes for review - Land art conforms to `docs/asset-authoring.md` (44×44 diamonds, transparent corners, 1:1, variants). Earlier revisions of this branch shipped 256×256 blocks + a scaled 128×128 seamless tile + a grass bush scatter (which caused a harsh checkerboard) — all removed. - Repack touches **only** the land entries; every other asset is byte-identical (no unrelated art drift). Pack: 10.4 MB → ~8.2 MB. ## Checklist - [x] `just lint` passes (CSharpier + analyzers, zero warnings) - [x] `just test` is green - [x] The whole solution builds (client and tools included) - [x] Multi-platform preserved (pure .NET / MonoGame, no OS-specific APIs) - [x] Tests added/updated for this change (`TileMapTests`) - [ ] Screenshot attached (map confirmed good locally; a client screenshot tool is a follow-up)
fix(client): reproducible terrain ground art + formatting
All checks were successful
ci / Lint & Test (pull_request) Successful in 1m40s
656f8ffa7e
The ground tiles were committed as art/land/grass_seamless.png /
marsh_seamless.png, but the client loads them by key grass_ground /
marsh_ground — so a 'just pack' rebuild would produce the wrong keys and the
ground would fall back to flat coloured diamonds. Rename the source PNGs to
match the keys the code and the committed pack use, so the pack is reproducible
from source. Also apply CSharpier formatting to GridRenderer.cs / IsoGame.cs
(the missing format was failing 'just lint' / CI).
fix(client): conform land tiles to the documented 44x44 diamond format
All checks were successful
ci / Lint & Test (pull_request) Successful in 1m43s
28c42f1b73
Per docs/asset-authoring.md, land tiles must be 44x44 iso-diamonds (transparent
corners), drawn 1:1, with a few variants per terrain so the ground doesn't repeat.
The branch had shipped 256x256 square 'blocks' + a scaled 128x128 grass_ground
seamless tile + a grass bush scatter to fake ground detail — none of which match
the format.

- Reformat the own-art land tiles to 44x44 diamonds (grass_0..3, marsh_0..3) and
  drop the seamless grass_ground/marsh_ground tiles.
- Ground now draws a per-cell variant (deterministic) 1:1, so 44x44 diamonds
  tessellate edge-to-edge — the documented UO-native model.
- Remove the grass bush scatter (it existed only to detail the flat seamless
  ground). Marsh plants (reeds/lily/sedge) stay as decorative scatter.
- Repack: only the land entries change (grass/marsh 256->44, ground tiles gone);
  every other asset is byte-identical. Pack shrinks 10.4MB -> 8.2MB.
fix(client): even, seamless-derived land diamonds (no checkerboard)
All checks were successful
ci / Lint & Test (pull_request) Successful in 1m28s
235d6e93eb
The 44x44 diamonds were derived from the 256x256 detail blocks, whose directional
shading (bright on one side, dark on the other) tiled into a harsh light/dark
checkerboard with dark seams. Regenerate grass_0..3 / marsh_0..3 from the uniform
seamless grass/marsh texture instead, with a gapless (1px-bleed) diamond mask, so
the ground reads as continuous while staying 44x44 per the docs. The four variants
are flips of the same texture — subtle variety without breaking continuity.
marco merged commit f6911ba3a0 into main 2026-07-21 23:00:20 +02:00
marco deleted branch feat/world-terrain 2026-07-21 23:00:20 +02:00
marco referenced this pull request from a commit 2026-07-21 23:00:22 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marco/IsoMmo!121
No description provided.