Skip to content

feat(production): units spawn at the footprint and walk to rally (#46, Sprint 16.2) - #69

Merged
cubetribe merged 5 commits into
mainfrom
feat/16-2-spawn-at-building
Aug 9, 2026
Merged

feat(production): units spawn at the footprint and walk to rally (#46, Sprint 16.2)#69
cubetribe merged 5 commits into
mainfrom
feat/16-2-spawn-at-building

Conversation

@cubetribe

Copy link
Copy Markdown
Collaborator

Was

Sprint 16.2 (Beta-Issue #46): ProductionSystem.TryFindSpawnCell verankert die Ring-Suche am Footprint-Zentrum des Produktionsgebäudes statt an der Rally-Zelle. Die fertige Einheit erhält sofort nach dem Spawn einen stehenden Bewegungsbefehl auf den Sammelpunkt — direkter SetTarget-Schreibzugriff, dieselbe Schreibklasse wie der Push-out im ConstructionSystem (Präzedenz im selben Sprint, 16.1): kein CommandRecord, kein neuer CommandKind; das MovementSystem fährt den Weg.

Konkret:

  • Spawn: Chebyshev-Ringe 0..8 ab Gebäudezentrum; der Footprint verliert immer gegen die Belegungsregel, also landet die Einheit auf dem ersten Ring außerhalb — sie verlässt das Gebäude, statt am Sammelpunkt zu erscheinen.
  • Sammelpunkt: ist wieder ein Ziel, kein Teleporter. Fällt die Spawn-Zelle mit der Rally-Zelle zusammen, wird gar kein Ziel gesetzt (kein sinnloser IsMoving-Zustand).
  • Unverändert: Pausen-Pfade (Entity-Store voll, keine freie Zelle), Queue-Semantik, Snapshot-Layout (kein Format-Feld berührt).

Betroffene Bereiche

  • Simulation/Production/ProductionSystem.cs (Netzstrang)
  • Tests beider Lanes, synchron gehalten: ProductionSystemTests, ProductionConstructionIntegrationTests, BarracksSpawnMatchConfigTests (nur .NET-Lane)
  • CHANGELOG: eine Zeile unter [Unreleased]

Test-Umbauten, die dazugehören: Rigs mit MovementSystem (ProductionConstructionIntegrationTests, BarracksSpawnMatchConfigTests) können keine exakten Endpositionen mehr asserten — dort prüfen die Tests jetzt die Footprint-Nachbarschaft (Chebyshev ≤ 2 bzw. 3 vom Zentrum) plus GoalGridPos/IsMoving. Der Pausen-Test MatchConfig_NoFreeSpawnCell mauert den Suchbereich neu: der Anker ist das Zentrum (22,22), die Mauer deckt jetzt x-Ursprünge 12..30 ab. Die Unit-Lane ohne Movement assertiert weiterhin exakte Zellen.

Baseline-Erwartung (wichtig)

Das Determinism10000-Drehbuch queued Harvester an der Raffinerie — Spawn-Position und Order-Felder ändern den Zustand. Golden-Byte-Tests werden erwartbar rot. Die Baseline-Neusetzung kommt als eigener PR mit altem/neuem Wert und braucht eine SDK-8-Umgebung (global.json pinnt 8.0.318, diese Maschine hat 10.0.302).

Nachweis (ehrlich)

  • Kein lokaler dotnet test-Lauf möglich — Nachweis über die CI. Die geänderten Tests dokumentieren den neuen Vertrag: Spawn-Zelle am Footprint-Ring, Sammelpunkt als GoalGridPos, belegte Zellen deterministisch übersprungen.
  • Spiel-Sicht (steht aus): „Einheiten fahren aus der Fabrik heraus" ist Presentation-Verhalten und braucht eine gespielte Runde. Nebenwirkung, die zum Paket gehört: Durch das Herausfahren sieht man durch die hohlen Gebäude-Assets (Gebäude-Assets sind durchsichtig und innen hohl #57) — Art-Arbeit, ausdrücklich nicht dieser Sprint; Befund gehört in den GrayboxLog.

Changelog

Eine Zeile unter [Unreleased] → „#46: Produzierte Einheiten verlassen das Gebäude".

@cubetribe
cubetribe requested a review from travelhawk as a code owner August 9, 2026 16:44
Sprint 16.2: TryFindSpawnCell anchors its ring scan at the producing
building's center cell instead of the rally cell; the footprint always
loses to the occupancy rule, so units spawn on the first ring outside
the building and immediately receive a standing move order to the rally
point (direct SetTarget write, same class as the construction push-out
- no command record, no new command kind). The rally point is a
destination again, not a teleporter.

Tests updated to the new contract in both lanes (kept in sync):
- ProductionSystemTests: spawn cell (9,9) from center (11,11), rally as
  order target, occupied-cell skip shifted to the ring scan.
- ProductionConstructionIntegrationTests: footprint neighbourhood plus
  GoalGridPos/IsMoving instead of exact end positions (movement runs in
  these rigs).
- BarracksSpawnMatchConfigTests: same assert shift; the pause-path wall
  now covers the centre-anchored search square (x origins 12..30).

Expected: golden-byte baselines move (the Determinism10000 scenario
queues Harvesters at the Refinery; spawn position and order fields
change). Baseline reset lands in a SEPARATE PR per the standing rule
and needs an SDK-8 environment (this machine has 10.0.302 against the
8.0.318 pin).

Side effect to note in the GrayboxLog, not in code: units driving out
of the building make the hollow building assets (#57) more visible.
@cubetribe
cubetribe force-pushed the feat/16-2-spawn-at-building branch from 4a44791 to 817549b Compare August 9, 2026 17:53
Seit 16.2 schickt die fertige Einheit sich per SetTarget zum Sammelpunkt.
GridPos2D liegt in Nova.Simulation.Pathfinding, und das using fehlte - die CI
brach mit CS0246 ab, bevor ein einziger Test lief.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
cubetribe and others added 3 commits August 9, 2026 21:05
… Ziel pruefen

Zwei Tests hielten das Verhalten vor 16.2 fest und wurden nach der Umstellung
an der falschen Stelle rot.

BarracksSpawnMatchConfigTests lief 110 Ticks weiter und pruefte dann, dass der
Soldat NICHT am Sammelpunkt steht. Nach 110 Ticks ist er dort angekommen - das
ist der Zweck der Aenderung. Die Schleife haelt jetzt am Erscheinungstick an;
dort greift die Aussage, und die Ankunft bleibt erlaubt.

ProductionSystemTests pruefte die Endposition gegen den Sammelpunkt. Der
Fixture registriert kein MovementSystem, die Einheit bleibt also am Footprint
stehen. Geprueft wird jetzt der stehende Befehl auf (30,30) - genau das, was
belegt, dass der abgelehnte Sammelpunkt den alten nicht ueberschrieben hat.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Einheiten erscheinen seit 16.2 am Footprint und laufen zum Sammelpunkt, statt
dort zu materialisieren. Die kanonische KI-Partie entscheidet dadurch zwei
Ticks frueher und endet in einem anderen Zustand.

Entscheidungstick: 2548 -> 2546
Endzustand: 0x8C0B54F31F2986B7 -> 0x9F93097AD526B6F7

AiBehaviorId bleibt r5.779A1B5B - es hat sich die Simulation bewegt, nicht die
KI (D-101).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@cubetribe
cubetribe merged commit e80ccf2 into main Aug 9, 2026
7 checks passed
@cubetribe
cubetribe deleted the feat/16-2-spawn-at-building branch August 9, 2026 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant