Skip to content

SCrocky/age_of_tiny_wars

Repository files navigation

Age of Wars

A free, open-source medieval RTS built with Python and Pygame. Gather resources, raise an army, and crush your enemies — alone or with a friend over LAN.

No installs beyond Python. No accounts. No monetisation. Ever.


Prerequisites

Download the Tiny Swords (Free Pack) asset pack and place the zip — unmodified, still named Tiny Swords (Free Pack).zip — in the downloaded_assets/ folder at the repo root. The game reads sprites straight from the zip, so there's no need to extract it.

age_of_tiny_wars/
└── downloaded_assets/
    └── Tiny Swords (Free Pack).zip

If you'd rather keep the zip elsewhere, point ASSETS_ZIP at it (e.g. ASSETS_ZIP=/path/to/Tiny\ Swords\ \(Free\ Pack\).zip).

Play the game

pip install -r requirements.txt

# Single-player vs AI
python server_main.py --players blue=human,black=ai
python client_main.py

# Multiplayer 1v1 — host (default)
python server_main.py

# Multiplayer — join
python client_main.py

Setting up a match

Use --players to describe every seat in the match. Each token is team=role, where team is one of blue, red, yellow, purple, black, and role is human or ai. Two to five seats are supported, all colors must be distinct.

# 1 human vs 3 AI
python server_main.py --players blue=human,red=ai,yellow=ai,purple=ai

# 2v2v1 free-for-all (5 humans)
python server_main.py --players blue=human,red=human,yellow=human,purple=human,black=human

# Watch 5 AIs duke it out
python server_main.py --players blue=ai,red=ai,yellow=ai,purple=ai,black=ai

The server waits for every human seat to connect (in the order listed) before starting; AI seats fill in automatically. Default with no flag is blue=human,black=human (multiplayer 1v1).

map_editor/create_map.py accepts the same colors via --teams:

python map_editor/create_map.py --teams purple,blue
python map_editor/create_map.py --teams blue,red,yellow,purple,black
screenshot-2026-04-28T06:14:03+08:00

How it works

Collect gold, wood, and meat to build up your base and train troops. Your Castle is both your stronghold and spawn point — lose it and it's over.

Building Purpose
Castle Base, spawns Pawns
House Raises population cap, acts as a resource depot
Archery Trains Archers
Barracks Trains Warriors and Lancers
Monastery Trains Monks
Tower Defensive structure — garrison an Archer for extra range and damage
Unit Role
Pawn Gathers resources, constructs buildings
Archer Ranged — picks off enemies from a distance
Warrior Heavy melee — blocks the first hit every swing
Lancer Fast melee — 8-directional attacks
Monk Support — heals nearby allied units

Controls

Input Action
Left-click Select unit / building
Click + drag Box-select multiple units
Shift + click Add to selection
Right-click unit / building Attack
Right-click resource Gather (Pawns)
Right-click ground Move
Right-click own Tower (with Archer selected) Garrison the Archer
Arrow keys Pan camera
Mouse wheel Zoom
H Centre camera on your Castle
P Pause / unpause
Ctrl + S Save game
Ctrl + 1–9 Assign selected units to control group
1–9 Select control group and centre camera on it
ESC Cancel pending action

Saving and loading

Press Ctrl + S to save at any time. The game pauses automatically while the file is written, then resumes. Save files are stored as JSON in the savefiles/ folder at the repo root, named by timestamp (save_YYYYMMDD_HHMMSS.json).

To load a save, pass it as --scene when starting the server:

python server_main.py --players blue=human,black=ai --scene savefiles/save_20260508_120000.json

The --players teams must match the teams recorded in the save file.


Contributing

This game is a gift to the community — and a work in progress. If you want to help shape it, you're very welcome.

Good places to start:

  • New unit or building — add a class under entities/, drop a sprite in assets/, register it in game.py
  • New map — edit or extend map_editor/ to generate different terrain layouts
  • Balance tweaks — unit stats live at the top of each file in entities/
  • Bug reports — open an issue, describe what happened and how to reproduce it
  • Art — sprites are plain PNGs, 192×192 for units. Any style that fits the medieval theme is welcome

The codebase is intentionally kept readable. There's no build step and no framework magic — just Python files you can open and change.


Credits

All in-game art is from the Tiny Swords (Free Pack) asset pack by Pixel Frog, released for free use. Thank you for making beautiful work freely available to the community.


Contributors

A big thank you to everyone who has played, reported bugs, or sent a PR — you're what keeps this project alive.

Want to go deeper? Check out the contributor guide for architecture notes, coding conventions, and a roadmap of planned features.

About

A free and open source RTS game written in python with pygame-ce

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages