Simulations of Cities, Economies, and Societies
PolisEngine is an open-source simulation library for modelling cities, economies and societies. It can answer questions such as what happens if the state raises taxes, nationalises businesses or the supply of goods is cut off. It is being built as a backend for city-building strategy games, but it can be used anywhere a society needs to be simulated without a game and a user interface around it.
PolisEngine is a simulation library written in C# for .NET 10. It simulates the economy, population, society, transportation, and infrastructure, with all these systems influencing one another—a shortage of goods lowers satisfaction, declining trust undermines the government’s legitimacy, and economic collapse triggers migration.
The engine is intentionally headless. It knows the state of the world and the simulation rules, but it doesn’t handle how things look—all visual aspects are handled by the front end, which the engine connects to as a dependency. The same simulation can thus power a 3D game, a web interface, and a console application.
No dependency on a game engine or UI
The same input always produces the same result
Both content and behavior can be extended without modifying the code
The content is defined in data files
PolisEngine models several interconnected domains. Each of them operates independently, but the true dynamics emerge only through their interactions across simulation ticks.
Markets, prices, businesses, taxes, the national budget and debt, the central bank, privatization and nationalization, capital flows, and the planned economy. Economic models are interchangeable—a capitalist implementation can be replaced by another without altering the core.
Residents as individual agents or as aggregated groups, depending on the required level of detail. Demographics, education, needs, social classes, and migration.
Trust in the government, legitimacy, social indicators and their feedback loops, cultural values and norms. The indicators are calculated using a dependency graph, so they can be linked in any way.
Buildings, transportation networks, vehicles and schedules, supply chains, warehouses, and detection of supply disruptions.
A grid world divided into simulation chunks, with terrain, natural resources and zones. The level of simulation detail is controlled per chunk, so large maps can be computed without losing performance.
The modding API allows you to add new types of buildings, goods, and social indicators, register custom economic models, and write game logic in Lua.
The engine isn't designed just for games. Since it has no connection to graphics or user input, it can be run anywhere where a society or economy needs to be simulated.
The front end sends commands and receives events, while the engine runs the entire simulation in the background.
A comparison of how different economic systems respond to the same external shock.
A deterministic headless loop that allows the agent to operate at full hardware speed.
Simulating economic and social transitions and observing the outcomes.
PolisEngine is in the early stages of development and is not yet ready for use. The basic infrastructure is still being built, and most of the simulation systems do not yet exist. The public API is not stable and is subject to change without notice. Therefore, it is not yet ready for deployment.
Early stage of developmentPolisEngine is being developed openly on GitHub. The code, architectural documentation, and development plan are all public—available for review, use, and feedback.
Current status: early stage of development
PolisEngine is an open-source project. The terms of use can be found in the license in the repository.