AI players for the board game Saint Petersburg (Bernd Brunnhofer, Hans im GlΓΌck, 2004), a card-drafting Euro game with a
random market: a class agent that won 1st place in 2025, then an AlphaZero-style agent in 2026 that is now the subject
of a paper with Prof. Todd Neller. Both cover the two-player game.
Now: the paper (Sep 2026 β present)
Planning Through Chance: Expert Iteration for Saint Petersburg, and What the Agent Reveals About the Game.
S. D. Nguyen and T. W. Neller, manuscript in preparation, 2026. An arXiv preprint is planned for about December 2026, followed by
submission to IEEE Transactions on Games. Read the draft (PDF).
- The agent: expert iteration over 38 generations, with PUCT search and a 458k-parameter policy/value network
(424 inputs β 256 β 256, a value head and a policy head over 1,100 action slots), written in plain NumPy. Generation 0
was trained by imitating the rule-based BlueBlooded player.
- Strength: it wins 93.2% of timed games against BlueBlooded, the strongest of the project's rule-based players,
and 96.2% with 3,200 simulations per move. It beats plain MCTS in every game.
- Planning through chance: chance nodes keep K = 4 sampled outcome children, each tied to a replayed seed. That adds
+54 Elo at 200 simulations and +123 at 800, and it is what made extra search keep paying off. K = 8 adds nothing.
- Why self-play plateaued: the network reaches a fixed point with its own search, its policy within about 0.10 nats of
the search targets. More data, a longer replay window, a lower learning rate, SWA, search-value targets and a 2Γ wider
network all failed to help. Only a stronger teacher, the better search, did: +65 Elo (generation 38 vs generation 15).
- Promotion: a sequential-test (SPRT) gate promoted new networks, and strength was tracked on a BradleyβTerry Elo
ladder. Training and analysis ran on Google Cloud VMs.
- What the agent reveals about the game: in two-player games, the round-1 starting-marker deal decides about
77% vs 23% between equal players, and about +3 rubles of compensation evens the average deal, but not every deal.
Removing mechanics costs β320 Elo with no hand, β568 with no aristocrats and β174 with no trading aristocrats.
- Limitations: there is no human baseline, so the agent is strong relative to rule-based and search players, not to
people. The rule-variant results come from a network trained on the original rules, so they show the direction of an
effect, not its exact size. There was one training run, with one seed.
- Engineering on the shared codebase: I rebuilt the tournament harness to run seat-swapped games in parallel, with
clock-safe time budgets, forfeits and Wilson confidence intervals, and wrote a connector that lets local agents play on
the live web dashboard.
- Credits: Prof. Todd Neller (Gettysburg College) is co-author and advisor. Taylor Neller built the game engine and the
website the agents play on. The BlueBlooded player is a port of a hand-written strategy by another contributor, and other
contributors worked on the project repository.
2025: Class agent (1st place)
- Monte-Carlo Tree Search with UCT selection (C = 2.0) and 4-ply early-terminated rollouts to handle the game's large branching factor.
- Learned evaluation: logistic-regression and random-forest win predictors over 56 engineered state features (points, rubles, aristocrats, interaction terms), designed with a classmate.
- Game-length model: a CatBoost regressor estimating rounds remaining, cutting learn-set RMSE from 2.20 to 0.62.
- Game balance analysis: ~10,000 Monte Carlo games on an 11β15 thread pool identified over- and under-powered cards, summarized in a balance-change report.
- Stack: Java (core logic, Maven), Python + scikit-learn + CatBoost (training).