fix(gameserver): marsh move-cost parity — charge creatures the entry step (#182) #204
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
marco/IsoMmo!204
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/marsh-creature-parity"
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
Fixes #182: marsh (and any
MoveCost > 1terrain) was charged asymmetrically to creatures vs players. A grounded creature got one free fast step when stepping from dry ground into slow terrain — only slowing once already standing in it — so a chasing creature gained ground on a fleeing player at every slow-terrain edge, contradictingCreatureSystem's own "no mob-favoured trap" comment.Cause
MovementSystem(players) gates onMoveCostTicks(cooldown, from, target)=Max(cost(from), cost(into)), so the entry step is charged.CreatureSystemgated onMoveCostTicks(base, creature.Position, creature.Position)= the current tile only — it charged leaving/standing but never entering.Fix
Kept the eligibility gate on the current tile (the leaving cost) and added the entry cost in the
Movecase, once the AI's target tile is known:MoveCostTicks(baseCadence, creature.Position, target). This is exactly the player'sMax(from, into)rule.Deliberately did not move
Ai.Thinkbefore the gate:Thinkhas side effects (advances the wander RNG, clearsCombatTarget), so calling it more often would change behaviour and break the seeded tests. The two-phase gate keepsThink's call frequency unchanged, and on uniform terrain the entry cost equals the outer gate — so nothing changes there (the existing marsh/flying tests stay green). Flying kinds (IgnoresTerrainMoveCost) remain exempt.How it was tested
GroundedCreature_EnteringMarsh_IsChargedTheEntryStepagainstWorldwith a deterministic east-walking creature: the grass→marsh entry step now costs the marsh cadence, not the grass one. Verified red before the fix (entering marsh (2) should cost more than a grass step (2)), green after.GroundedCreature_MovesLessInMarshThanOnGrassandFlyingCreature_IsNotSlowedByMarshunchanged and green.Closes #182.
Correct, minimal parity fix — Move now gated on Max(from,into) exactly like MovementSystem; two-phase gate preserves Think frequency on uniform terrain; red-before/green-after test. CI green.