a501a932237bb5079853d6a73cf7cae40c103e6b
c3 showed use_rollout_value=false alone is not the fix: without the heuristic rollout safety net the random-init network value gives bad MCTS Q early on, the agent plays more (PA 0.10 -> 0.22+) but eats more -20 expedition penalties (score worsened from -57 to -97 avg). Mathematical intuition: in Lost Cities, opening an expedition is a 20-point commitment. Break-even requires rank-sum × (handshakes+1) >= 20. The model has to learn: - which colors to open (based on hand handshake/high-rank holdings) - when to commit vs discard - card-ordering constraints (ascending only) This is a moderately rich value function. 512x3 (~800k params, ~290 input dim) might be undersized. Test capacity hypothesis with 768x4 (~2M params) while keeping the rollout safety net so MCTS Q stays competent. Other params from c1 kept: c_puct=5, virtual_loss=5, dirichlet α=0.3/ε=0.4, parallel_simulations=64, n_simulations=50.
coolrl-lost-cities
Focused Lost Cities extraction from the legacy coolrl repository.
The current implementation starts with the classic two-player card game:
- classic 5-expedition rules by default
- Python/Cython game engine
- env wrapper
- random, discard-only, and safe-heuristic bots
- core rule, scoring, mask, env, canonical-state, bot, and GUI smoke tests
Training code, Deep CFR, learned-policy evaluation, GUI, and web client are intentionally outside the first port.
Development
uv run pytest tests/games/classic
uv run lost-cities-classic
For future GUI work, install the optional GUI dependencies:
uv sync --extra gui
Run the classic pygame GUI:
uv run lost-cities-classic-gui --mode pvc --bot safe-heuristic
The GUI uses the in-process Cython game engine.
Basic Usage
from coolrl_lost_cities.games.classic import GameState, build_bot, classic_config
state = GameState.new_game(classic_config(seed=1))
bot = build_bot("random", seed=1)
while not state.terminal:
state.apply_action(bot.act(state))
print(state.total_score(0), state.total_score(1))
See classic port notes for the current direction.
Languages
Python
73.3%
Cython
21.7%
Julia
4.8%
Shell
0.2%