-
Notifications
You must be signed in to change notification settings - Fork 0
Testing and Balance
Pan's Trial includes both automated regression testing and headless balance analysis. This page carries the evidence section of the written report into the wiki and links it back to the runnable project files.
The primary checked-in test file is:
tests/test_rules.py
The current checkout collects 118 tests from this file. They cover a mix of:
- core rule behavior
- phase transitions
- request resolution
- multiplayer flows
- room-server behavior
- UI smoke checks
- layout regressions
- browser bridge behavior
- rematch, leave, and reconnect-adjacent room flows
Run it with:
.\.venv\Scripts\python.exe -m pytest tests\test_rules.pyThe web-build environment can also run the same suite:
.\.venv-web\Scripts\python.exe -m pytest tests\test_rules.pyIf you only need to confirm the current collected count:
.\.venv-web\Scripts\python.exe -m pytest tests\test_rules.py --collect-only -qFor a quick non-UI sanity check of imports and basic setup:
python verify_foundation.pyThis verifies that the engine, UI package, and basic setup flow still initialize correctly.
The project includes a headless match simulator:
balance_testing.py
Run the default study:
python balance_testing.pyRun a custom-size study and save the results to a folder:
python balance_testing.py --games 200 --output-dir .\balance_runsBy default, the study writes:
Balancing_Testing_01.xlsxBalancing_Testing_01_Report.md
The written report cites a 100-game AI-vs-AI study:
| Metric | Result |
|---|---|
| Games simulated | 100 |
| Player 1 wins | 52 |
| Player 2 wins | 48 |
| Experienced profile | 51/67 wins, 76.12% |
| Amateur profile | 48/67 wins, 71.64% |
| Beginner profile | 1/66 wins, 1.52% |
| Average actions per game | 235.83 |
| Average final damage, Player 1 | 19.22 |
| Average final damage, Player 2 | 19.24 |
| Request uses | Plane Shift 124, Steal Life 88, Ignore Us 49, Restructure 49 |
| Appeasing Pan skips | 0 |
The main interpretation is that neither seat dominates and stronger AI profiles outperform weaker profiles. That supports the publication claim that Pan's Trial is tactical rather than only random.
The simulation is meant to answer questions like:
- Is there an obvious starting-seat advantage?
- Do stronger agents beat weaker ones consistently?
- How often is Appeasing Pan skipped after hands run out?
- Are request types showing up in a healthy mix?
- Are the final damage totals roughly close between seats?
Because the simulator runs on the same live engine rules as the playable game, it helps turn balance discussion into measurable evidence instead of guesswork.
That makes it useful for:
- rule tuning
- fairness checks
- AI evaluation
- documenting design decisions
When changing gameplay behavior:
- Update or add engine-level tests.
- Run
tests/test_rules.py. - If the change affects fairness, run at least a small balance study.
- Rebuild the browser package if the change affects web behavior or assets.