feat: terrain Z server walkability + editor Z tools + docs (Slice C of #224) #228
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!228
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/terrain-z-editor-server"
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?
Slice C of #224 (UO heightfield) — server walkability + editor Z authoring + docs. Completes the 3-slice plan (Slice A #225 and Slice B #227 are merged to
main).Summary
GameOptions.MaxStepZ(typed, default 2). A step is rejected when|GroundZAt(into) − GroundZAt(from)| > MaxStepZviaTileMap.CanStep, enforced for players and creatures.Program.csnow loads theworld.zmapsidecar so the server reasons on the same Z the client renders (absent ⇒ all-Z0, unchanged). Teleport and spawn stay direct placements (no step-delta, per the design). The move intent is a bareDirection, so a client can't forge Z — the server reads it from the shared map.MapModelcarries per-cell Z:ZAt,SetZ(range-checked, rejects out-of-range with a readable error),RaiseZ(clamps at ±limits, no wrap);ToTileMap/FromTileMapround-trip it. The editor gains Raise / Lower / Set-Z tools (single/rect/fill brushes) + a hover-Z readout, and load/saves the.zmapsidecar so authoring persists.docs/architecture.mdgains the durable "Terrain elevation (Z)" section (the model, the vertical scale, the sidecar, server walkability, authoring).*.zmapadded to the client/server content-copy globs so a future authored sidecar ships.No wire change (
ProtocolVersionuntouched).Screenshots / recording
MapModel(Raise/Lower/Set + clamp + round-trip), and save/reopen preservation is proven by composing tested units (MapModelround-trip →IMapFormat.zmapround-trip). The heightfield itself is verified in the client in Slice B (#227).How it was tested
StepHeightTests(againstWorld): a step of exactlyMaxStepZaccepted; above it rejected; a steep descent rejected by the same absolute rule; teleport places onto a Z100 tile (no step-delta); a creature ringed by over-MaxStepZdrops stays put (same gate).MapModelZTests:ZAtdefaults 0;SetZstores + accepts-225/0/255, rejects-226/256;RaiseZclamps at both limits without wrapping;ToTileMap/FromTileMapround-trip; out-of-bounds is a no-op.dotnet testall green (GameServer 276, MapEditor.Core 26, Shared 122, Client.Core 178, …).Deferred (documented follow-ups, not regressions)
GridRenderer(so its flat picking is correct for its flat view); pointing it at the client's windowed Z-mesh is a larger render integration, deferred.EditorGame.RebuildRenderMap()rebuilds fromToTileMap()(a full clone) per stroke — pre-existing, not introduced here; the Z change does not worsen it (a small z-grid rides the same clone). The live-view fix is deferred with the WYSIWYG work.Checklist
just lintpasses (CSharpier + analyzers, zero warnings)just testis green