Design and evidence
Which tests establish unique crystal ownership despite concurrency and server replacement?
The final design reuses the complete runtime topology from step 6. Test markers connect key decisions to expected results and earlier steps to revisit. The following items form a test plan; measured evidence is still outstanding.
Starting point Count server-side rule violations and provide evidence to moderation.
Assumptions for the example case
A fictional example design: one session with at most 32 players, server-authoritative movement, one-time pickup of world items, reconnection within the same session and durably confirmed rewards. Figures and quality goals are illustrative test assumptions. A shared global game world, player trading, paid items and comprehensive fraud detection are outside the scope.
Overall architecture with evidence
Runtime Architecture · Authority per session and generation
- 1 · Join
- 2 · Order inputs
- 3 · Simulate ticks
- 4 · Confirm the record
Platform
The game process simulates the world; the reward datastore and checkpoints provide different durability guarantees.
Test plan with review loops
| Validation | Expected result | Return to an earlier step |
|---|---|---|
| Concurrency in both orders | P-21 and P-22 send valid pickup commands for G-21 in the same tick. Test both server-side input orders: the first valid command in that order wins; the other receives already allocated. Exactly 1 crystal is awarded in total. | Steps 3 and 5 |
| Identical and changed retries | The same input sequence for G-21 is sent twice and returns the same winning record. The same sequence with a different item identifier is rejected as a protocol conflict. An old server generation may not write a second record even with a new key. | Step 4 |
| Exact value or time limit | The pickup radius includes 2,000 mm: allow server-side distances of 1,999 and 2,000 mm; reject 2,001 mm. All distances in this example are integer millimetres. | Steps 2 and 5 |
| Lost response and restart | The server persists the winning record and crashes before responding. The new authority generation reads the record and confirms the same winner. Unconfirmed movement may revert to the last checkpoint; confirmed crystal ownership survives. | Steps 7 and 9 |
Concurrency in both orders
- Expected result
- P-21 and P-22 send valid pickup commands for G-21 in the same tick. Test both server-side input orders: the first valid command in that order wins; the other receives already allocated. Exactly 1 crystal is awarded in total.
- Return to an earlier step
- Steps 3 and 5
Identical and changed retries
- Expected result
- The same input sequence for G-21 is sent twice and returns the same winning record. The same sequence with a different item identifier is rejected as a protocol conflict. An old server generation may not write a second record even with a new key.
- Return to an earlier step
- Step 4
Exact value or time limit
- Expected result
- The pickup radius includes 2,000 mm: allow server-side distances of 1,999 and 2,000 mm; reject 2,001 mm. All distances in this example are integer millimetres.
- Return to an earlier step
- Steps 2 and 5
Lost response and restart
- Expected result
- The server persists the winning record and crashes before responding. The new authority generation reads the record and confirms the same winner. Unconfirmed movement may revert to the last checkpoint; confirmed crystal ownership survives.
- Return to an earlier step
- Steps 7 and 9
First end-to-end validation
- End-to-end path
- Build an end-to-end test with two clients, competing item pickups and a server handover. One winner remains recorded after response loss and a new authority generation.
- Open decision
- After the item-award tests pass, add further interactions one at a time. A shared global game world, player trading, paid items and comprehensive fraud detection require a separate follow-up design.
Validate the crystal pickup flow first
Build an end-to-end test with two clients, competing item pickups and a server handover.
The design must preserve a shared world through failures.
One winner remains recorded after response loss and a new authority generation.
- Alternative considered
- A movement-only test does not verify ownership.
- Trade-off
- The first prototype requires controlled server outages.
- Reassess
- After the item-award tests pass, add further interactions one at a time.
Terms in this step
- Validate the crystal pickup flow first
- One winner remains recorded after response loss and a new authority generation.
Try it yourself
For crystal contention and server replacement, specify a test, expected result and step to revisit.
A hint for your attempt
Use the specific entities and conditions from this step. The two solution parts distinguish the decision from its evidenced outcome.
Compare with a possible solution
- First part of the solution
- Test P-21 and P-22 in both input orders: exactly the first valid command wins. On failure, revisit input ordering and the data rule in steps 4/5.
- Second part of the solution
- Crash after storing the record and start a new generation: reject the old writer and preserve the winner. On failure, revisit the architecture and sequence in steps 6/7.
Apply to your project
Which corresponding assumption would you test first in your project? Consider this trigger: After the item-award tests pass, add further interactions one at a time.
Start your own design
Choose a small case from your project. The template collects the ten design tasks and leaves space for your sketches, decisions, and open assumptions. You can edit it in your text editor or note-taking app.
Download design template (.md)Compare the ten tasks with the example case
Purpose and boundary
Which corresponding assumption would you test first in your project? Consider this trigger: The game requires offline progress with later reconciliation.
In the example: Let the game server decide ownership. Only the server's position state and input order establish a shared winner.
Requirements
Which corresponding assumption would you test first in your project? Consider this trigger: The game design requires fully reproducible movement.
In the example: Show predictions and confirm rewards only after a durable record exists. Resetting a movement snapshot does not lose a confirmed crystal.
Scale estimates
Which corresponding assumption would you test first in your project? Consider this trigger: Tick processing regularly exceeds 50 ms in the load test.
In the example: Measure per-session capacity and concurrent session count separately. An overloaded world does not automatically benefit from additional idle servers.
Interfaces
Which corresponding assumption would you test first in your project? Consider this trigger: Very long sessions require a defined sequence rollover procedure.
In the example: Validate input sequence numbers within the player and session identity. A duplicate pickup returns the same record; a changed payload is explicitly rejected.
Data and states
Which corresponding assumption would you test first in your project? Consider this trigger: The game rules require multiple writers for one world.
In the example: Bind every durable record to the current authority generation. The datastore rejects old generations even while their clients remain connected.
Overall architecture
Which corresponding assumption would you test first in your project? Consider this trigger: A few very small sessions justify a simpler deployment.
In the example: Scale the game process and durable reward store separately. The snapshot data path avoids unnecessary ledger access.
Critical flow
Which corresponding assumption would you test first in your project? Consider this trigger: World interactions become more complex than one-time item awards.
In the example: After a restart, load the durable record before awarding again. Both clients eventually see the same winner.
Bottlenecks and trade-offs
Which corresponding assumption would you test first in your project? Consider this trigger: Rapid changes in the area of interest cause visible gaps.
In the example: Measure visibility range and snapshot rate, then transmit only relevant characters. 640 KiB/s is a separate assumption before overhead and must be verified on the transport.
Operations and security
Which corresponding assumption would you test first in your project? Consider this trigger: A proven pattern of abuse allows graduated automated measures.
In the example: Count server-side rule violations and provide evidence to moderation. Radius checks provide immediate protection; moderation evaluates suspicious behaviour.
Final design
Which corresponding assumption would you test first in your project? Consider this trigger: After the item-award tests pass, add further interactions one at a time.
In the example: Build an end-to-end test with two clients, competing item pickups and a server handover. One winner remains recorded after response loss and a new authority generation.