Game theory simulator — AI agents compete in a public goods game with dynamic economics.

A fun side project, no ambition to prove anything — just curiosity and the pleasure of watching algorithms and LLMs try to outsmart each other in a toy economy.
I love board games — especially semi-cooperative ones where trust is a resource. I wanted to see what happens when you throw classic game theory strategies (Tit-for-Tat, Pavlov, Rancunier...) into a public goods dilemma with real economic dynamics: synergy that grows or decays, lobbying on redistribution rules, and endogenous erosion that punishes free-riders through the economy itself, not external rules.
Then I added LLM-powered players (via pydantic-ai) to see how they fare against algorithmic strategies.
Champions compete turn by turn, choosing how much to contribute to a common pot. The pot is multiplied by a dynamic synergy factor then redistributed via a tunable ratio between equal and proportional shares.
The public goods dilemma is a real dilemma — even with erosion, pure defectors still win in large groups. The interest is in finding the conditions where cooperation emerges: small groups, repetition, tournaments.
Lobbying turned out to be a resource trap: aggressive lobbyists ruin themselves in a tug-of-war while passive strategies quietly accumulate capital.
The most interesting finding was with LLM players. In a single game, every model I tested (Mistral, GPT, etc.) cooperates relentlessly — 100% contribution, every turn, no matter what. But when you give them long-term memory (they can write a file at the end of each game with what they learned about their score and earnings), everything flips. Within 1 to 5 games, every single model converges to pure defection — zero contribution, every turn, crashing the economy entirely. Stateless optimism to jaded free-riding in a few rounds.
Playable. Algorithmic champions, LLM bot support, round-robin tournaments, JSON replay export with web viewer.