Kingdom.py is a strategy indie casual simulation game for PC that blends kingdom building with hands-on Python programming. Players write real code to direct workers, manage resources, and expand an island settlement into a self-sustaining realm. The experience centers on automation rather than direct control, turning script writing into the primary gameplay loop.
Gameplay
The core loop involves typing Python scripts that control up to four workers. A loop or function runs while the game highlights each line in sequence, showing a tiny builder or worker carrying out the exact instructions. Variables store data, loops repeat tasks, conditionals handle decisions, and lists or dictionaries organize resources. When an error occurs the window displays the problematic line and explanation, allowing immediate fixes before running the script again.
Building begins with basic structures such as houses, farms, bakeries, mines, smithies, and libraries. The island expands across four stages, unlocking new space for production. Fields ripen on schedule but rot without timely harvesting scripts. Groves deplete unless replanted through code. Towns consume food, and shortages cut payments in half. Bandits trigger raids that scripts can respond to with event handlers like on raid commands, deploying guards that operate continuously.
Merchant ships arrive with timed orders, and code decides sales quantities and timing. A shared database lets multiple programs claim jobs or coordinate through a dispatcher that restarts crashed workers. All scripts use standard Python 3 features including functions and imports across player-created files, so lessons transfer directly to external coding projects.
Game Modes
Play follows a structured path through 31 story chapters that progress from basic print statements to full kingdom automation. The Code School supplies 30 short lessons with runnable examples, explanations of common mistakes, and direct links to official Python documentation. Every game function includes an insertable example for quick testing.
Free experimentation runs alongside the guided content. Players can edit scripts in any external editor, with the game reloading changes automatically. A Python console queries live data such as resource rates or market news. Floating code windows support syntax highlighting, autocomplete, and error indicators. Themes alter the desk appearance, and custom backgrounds can be added through simple file edits.
Trading elements add another layer. Six neighboring islands maintain their own economies visible from the shore. A Trade Guild unlocks bidding, live price charts, and fees. Scripts access market functions for quotes, history, and standing orders that execute while workers handle other tasks. Events such as storms or strikes shift prices in realistic patterns of trends and swings.
Building and Automation Systems
Production chains require precise timing. Farms and mines feed into bakeries and smithies only when scripts schedule collection and transport correctly. The Founders Monument serves as a central landmark once unlocked. Libraries likely support advanced research or knowledge functions, though exact mechanics depend on player scripts.
Multi-worker coordination uses a shared database for job claiming and crash recovery. A single dispatcher program can monitor and restart others, creating resilient automation. This setup rewards modular code design where separate files handle distinct tasks like farming, defense, or trading.
Is It Worth Playing?
Kingdom.py suits players interested in learning or practicing Python within a relaxed simulation setting. The combination of visual feedback from running code and tangible kingdom growth provides immediate results for script changes. No prior coding experience is required, yet experienced programmers find depth in building realistic trading bots or complex dispatch systems.
The game emphasizes steady progress through story chapters while allowing open-ended automation. Resource management, event responses, and market interactions create ongoing challenges that reward iterative script improvement. Its indie focus on cozy automation distinguishes it from traditional strategy titles, appealing to those who enjoy both coding and gentle kingdom-building loops.