Skip to content

entity12208/GeoPoliticalDomination

Repository files navigation

GeoPolitical Domination

A turn-based strategy game where you compete to conquer the world. Build armies, expand territory, earn continent bonuses, and outmaneuver opponents — locally against AI bots, or online with friends.

Install

Linux / macOS / Chromebook

curl -fsSL https://raw.githubusercontent.com/entity12208/GeoPoliticalDomination/main/setup.sh | bash

Then play:

cd ~/GeoPoliticalDomination
./play.sh

Custom install location:

GPD_INSTALL_DIR=/opt/gpd curl -fsSL https://raw.githubusercontent.com/entity12208/GeoPoliticalDomination/main/setup.sh | bash

On Debian/Ubuntu/Chromebook you may also need SDL2:

sudo apt install -y libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev

Windows

Requires Python 3.8+ — check "Add Python to PATH" during installation.

Open PowerShell and run:

irm https://raw.githubusercontent.com/entity12208/GeoPoliticalDomination/main/setup.bat -OutFile setup.bat; .\setup.bat

Then play:

cd $env:USERPROFILE\GeoPoliticalDomination
.\play.bat

Or just double-click play.bat in the install folder.

Manual setup (any OS)

git clone https://github.com/entity12208/GeoPoliticalDomination.git
cd GeoPoliticalDomination
python3 -m venv .venv
source .venv/bin/activate   # Linux/Mac
# .venv\Scripts\activate    # Windows
pip install -r requirements.txt
python3 client.py

Game Modes

Mode Description
Local Game Play against 0-6 AI bots on your machine
Spectate Bots Watch 2-8 AI bots battle each other
Online Game Play with friends via Firebase (no setup required)

How to Play

Each turn you choose one action:

Action What it does
Peace Earn $100 per country you own — but you become vulnerable for the entire round
Expand Move troops to an adjacent country. $200 claim cost. Unclaimed = free. Enemy = dice roll
Gather Roll d20 for buy limit, $50 per troop. Troops go to your border countries
Nothing Skip your turn safely

Combat

Attacker rolls 1d20, defender rolls 2d20 (takes higher). Attacker wins if strictly greater (~25% odds). Attacking a player who chose Peace is a guaranteed win — no roll needed.

Continent Bonuses (one-time)

Continent Bonus
Europe / Asia $1,000
North America $800
Africa $400
South America $350
Central America $200

Controls

Control Action
Scroll wheel Zoom in/out
Right-click drag Pan the map
F11 Toggle fullscreen
Escape Go back / quit

Tips

  • Claim unclaimed territory first — guaranteed for just $200
  • Don't Peace when enemies have troops next to you — they auto-capture your land
  • Continent bonuses are huge — prioritize completing one
  • The AI adapts: it gathers troops on borders, exploits vulnerable players, and breaks stalemates

Files

File Purpose
client.py Main game client (local + spectate + online), lobby, spectator mode
constants.py Centralized constants, colors, economy values, bot difficulty presets
geometry.py Mercator projection, polygon math, GeoJSON loading
models.py Player dataclass with host, spectator, and elimination fields
game_logic.py Core game logic (claiming, attacking, turn management, elimination, lobbies)
ui_components.py Reusable UI elements (buttons, sliders, font cache)
bot_playstyles.py Adaptive bot AI with multi-turn planning and configurable difficulty
heuristic_bot.py Bot AI entry point
firebase_sync.py Firebase REST backend (anonymous auth, no secrets needed)
web_serve.py Browser-based game streaming server
updater.py In-game update checker + downloader
setup.sh Installer script (works via curl or locally)

Updating

The game checks for updates automatically on the main menu. Click "Update Now" to download and install in-app — it restarts automatically.

Troubleshooting

"No module named pygame" — Run ./setup.sh again, or: source .venv/bin/activate && pip install pygame-ce

Game window is tiny — Press F11 for fullscreen.

"Firebase not available" — Check your internet connection. Online mode uses anonymous auth (no secrets needed).

SDL errors on Linuxsudo apt install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev

venv creation failssudo apt install python3.XX-venv (replace XX with your Python version, e.g. python3.13-venv)

About

A war strategy game made in Python - Credit to my history teacher...

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors