Train Doc Index
Overview
Use this skill as the entry point to pick the right train workflow and avoid mixing unrelated concerns.
Reuse-First Rule
- Before introducing new helper logic, search existing train/rail code first.
- Prefer established
Game.Trainlogic over ad-hoc duplicate implementations. - If duplication is unavoidable, record
WHY_NEW_IMPLEMENTATIONin code/PR notes. - Recommended pre-check:
rg --line-number "TickUnifiedId|TickSequenceId|RailPosition|Snapshot|SaveLoad" moorestech_client/Assets/Scripts moorestech_server/Assets/Scripts
Current Operation (Must Assume)
- Train structural sync is snapshot-first:
- per-unit event:
va:event:trainUnitSnapshot - full resync API:
va:getTrainUnitSnapshots
- per-unit event:
- Tick simulation trigger remains
va:event:trainUnitTickDiffBundle. - Ordering key remains
TickUnifiedId = ((ulong)ServerTick << 32) | TickSequenceId. TickSequenceIdis server-managed and reset per tick.
Routing Rules
- Use
rail-network-syncfor end-to-end train/rail synchronization flow ownership. - Use
train-rail-event-implementationfor event tags, payload schema, and client/server handler changes. - Use
train-tick-simulationfor tick/hash progression and gate/order behavior. - Use
train-rail-save-loadfor persistence schema, load order, restore correctness. - Use
train-system-notesfor rail topology, front/back semantics, RailPosition invariants. - Use
train-test-implementation-prioritiesfor risk-based test planning.
Workflow
- Classify the request into one primary category.
- Pick one primary skill and at most one secondary skill.
- State explicit invariants before edits.
- For TrainUnit/TrainCar mutations, confirm snapshot-first policy before proposing packet changes.
- Implement and verify against chosen invariants.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.