feat(oecs): improve serialization and add snapshot tests

Enhance the OECS framework to support more robust component
deserialization during world serialization. This includes adding
boxed component support and a runtime fallback for component
discovery.

Additionally, introduces snapshot testing patterns for Blackjack
and TicTacToe to allow for manual verification of world state and
reactivity logs.
This commit is contained in:
2026-07-20 17:05:17 +08:00
parent b4661e714e
commit e1fb197474
13 changed files with 729 additions and 99 deletions
+14 -2
View File
@@ -1,7 +1,19 @@
# Testing games
1. Games are dlls. Use a standalone test project to test a game.
2. Create baseline game snapshots in textual format.
3. Create baseline logs via the r3 observable api.
2. Create baseline game snapshots in textual format. Save to files.
3. Create baseline logs via the r3 observable api. Save to files.
4. Read the snapshot/logs manually to identify issues.
5. Make sure serialization roundtrip works.
## Play tests
Playtests are games executed with AI players who give unexpected play commands.
AI players are not LLMs here; they are typically common game AI implementations.
Create static functions that analyze the game state and return a command. Each such function is an agent. Each AI player routes its decisions to a random agent in a pool of weighted agents.
Agents to consider:
- Random: evenly chooses every move randomly.
- Greedy: uses a specific way to score actions. Always chooses the onewith highest score. There can be multiple Greedy agents wtih different scoring.