Stratagus: The Open-Source RTS Engine Behind Wargus, Its Lua Scripting, and Its Status in 2026

Stratagus is the free, open-source RTS engine behind Wargus. Here's its history from FreeCraft, how its Lua game data works, a tested external-AI example, and its status today.

Flat illustration of a top-down strategy map with a river, forests, a walled base and two teams of abstract unit tokens, representing the Stratagus real-time strategy engine

Stratagus is a free, open-source engine for 2D real-time strategy games. It’s best known for Wargus, which lets you play Warcraft II on modern systems using data from your own copy of the game, and for sister projects that do the same for Warcraft: Orcs & Humans and StarCraft. The engine is written in C++ and released under the GPL v2, and everything that makes a particular game, from units and spells to AI and menus, is defined in Lua scripts.

This profile covers where Stratagus came from, how its engine and game data fit together, the games built on it, its external AI interface with a tested example, and whether it’s still developed in 2026. Facts were checked against the project’s repository in October 2026, and the example was run on a fresh build of the engine.

What Is Stratagus?

Stratagus is a free, open-source 2D real-time strategy game engine, written in C++ and scripted in Lua, under the GPL v2. It began in 1998 as a Warcraft II clone called FreeCraft and took its current name in 2003. It powers Wargus, War1gus and Stargus, and supports LAN and online multiplayer, AI opponents, replays and a map editor. The latest stable release is 3.3.2 (August 2022).

Stratagus at a glance

Type2D real-time strategy game engine
First releasedJune 1998, as ALE Clone (later FreeCraft)
Named Stratagus2003
Latest stable release3.3.2, August 2022
DevelopmentActive; continuous builds from GitHub
Written inC++
Game scriptingLua 5.1
LicenceGNU GPL v2 only
Built withSDL2, libpng, zlib, bzip2
Runs onWindows, Linux and macOS
Main gamesWargus, War1gus, Stargus
FeaturesLAN and online multiplayer, AI opponents, replays, map editor, external AI interface

From FreeCraft to Stratagus

Lutz Sammer released the first version in June 1998 as ALE Clone, a free Warcraft II-style game for Linux. It became FreeCraft in 1999 and grew into a capable clone that could use the graphics and sounds of Warcraft II.

In June 2003, Blizzard Entertainment sent the project a cease-and-desist letter, citing the name’s similarity to Warcraft and StarCraft and the game’s similarity to Warcraft II. FreeCraft shut down. Within weeks, developers carried the code on as Stratagus, explicitly as a general RTS engine, with games kept separate from it (LinuxFr.org’s July 2003 report). Warcraft II support moved into its own project, Wargus, which needs the player’s own copy of the game.

Development slowed and paused in 2007, then resumed around 2010. The code moved to GitHub, where the engine and its game projects now live under the Wargus organisation (Stratagus on GitHub), and version 3.0 followed in December 2020.

How Stratagus Works

Stratagus splits cleanly into an engine and the data that turns it into a game:

  • The C++ engine handles the map and fog of war, pathfinding, units and their orders, combat and missiles, animation, sound, the user interface, the map editor, replays, and networking for LAN and online play. It’s built on SDL2, with zlib and bzip2 for compressed data.
  • Lua scripts define the game itself: unit types and their stats, buildings, upgrades, spells, the interface, menus and the computer players’ strategies. Almost everything a modder wants to change can be changed in Lua, without recompiling the engine.
  • Game data packages, such as Wargus, combine those scripts with graphics, sounds and maps. Wargus, War1gus and Stargus include tools that extract the art and audio from a player’s own copy of the commercial game.

Because the engine is generic, the same binary runs Warcraft II, Warcraft I and StarCraft-style games, depending on which data you point it at.

Games Built on Stratagus

GameWhat it isStatus
WargusWarcraft II and Beyond the Dark Portal on Stratagus; needs your own copy of the gameActive, releases tracked with the engine (3.3.2)
War1gusWarcraft: Orcs & Humans on Stratagus; needs your own copy of the gameActive
StargusStarCraft-style play using your own StarCraft dataIn development; last tagged release 2016
Aleona’s TalesA free fantasy RTS with its own artReleased

Two other well-known games started from Stratagus code and continued on their own modified engines: Bos Wars, a futuristic RTS, and Wyrmsun, built on the Wyrmgus fork.

Connecting an External AI to Stratagus

Stratagus has long been used for AI research. In 2005, a team including David Aha of the US Naval Research Laboratory used Wargus to build a case-based planner that learned to pick winning strategies against varied opponents, connecting it to the game through a testbed called TIELT (Aha, Molineaux and Ponsen, 2005). TIELT is no longer maintained, but since December 2020 the engine has had its own built-in hook for external agents: three Lua functions that send the game state to a program over TCP and receive back one action per decision.

How Stratagus talks to an external AI Three Lua functions, one TCP connection, and a one-byte answer per decision. Stratagus game Lua script Your AI agent TCP server, any language AiProcessorSetup(host, port, states, actions) sends I + number of state values + number of actions every decision AiProcessorStep(ai, reward, state) sends S + reward since last step + state values replies with one byte: the chosen action AiProcessorEnd(ai, reward, state) sends E + final reward + state, then closes All numbers travel as 32-bit big-endian integers. The script decides what each action does in the game. Source: src/ai/script_ai.cpp in the Stratagus repository (October 2026)
How a Stratagus game exchanges state and actions with an external AI agent through three Lua functions and one TCP connection.

The agent can be written in any language. This one is a small Python server that follows a fixed build order: train workers, then soldiers, then attack.

"""A tiny external AI for Stratagus, speaking its AiProcessor protocol over TCP."""
import socket
import struct

ACTIONS = ["train worker", "train soldier", "attack"]

def recv_exact(conn, n):
    data = b""
    while len(data) < n:
        chunk = conn.recv(n - len(data))
        if not chunk:
            raise ConnectionError("Stratagus closed the connection")
        data += chunk
    return data

def choose(gold, workers, soldiers):
    if workers < 4 and gold >= 400:
        return 0
    if soldiers < 3 and gold >= 600:
        return 1
    return 2 if soldiers >= 3 else 0

with socket.create_server(("127.0.0.1", 9292)) as server:
    print("Waiting for Stratagus on port 9292...")
    conn, _ = server.accept()
    with conn:
        assert recv_exact(conn, 1) == b"I"           # setup message
        num_state, num_actions = recv_exact(conn, 2)
        print(f"Setup: {num_state} state values, {num_actions} actions")
        while True:
            kind = recv_exact(conn, 1)                   # b"S" = step, b"E" = end
            reward, *state = struct.unpack(f"!{1 + num_state}l",
                                           recv_exact(conn, 4 * (1 + num_state)))
            if kind == b"E":
                print(f"Game over, final reward {reward}")
                break
            action = choose(*state)
            print(f"State {state}, reward {reward} -> {ACTIONS[action]}")
            conn.sendall(bytes([action]))                # one byte: action index

On the Stratagus side, a Lua script connects, sends three state values (gold, workers and soldiers) on each step, and applies whichever action comes back. To keep the example self-contained, it simulates a tiny economy in Lua instead of loading a full map:

-- Connect to an external AI and ask it for decisions.
local ai = AiProcessorSetup("127.0.0.1", 9292, 3, 3)  -- 3 state values, 3 actions
local gold, workers, soldiers, reward = 1200, 2, 0, 0

for turn = 1, 6 do
  local action = AiProcessorStep(ai, reward, {gold, workers, soldiers})  -- 1-based
  if action == 1 then gold, workers = gold - 400, workers + 1
  elseif action == 2 then gold, soldiers = gold - 600, soldiers + 1
  else reward = reward + soldiers end
  gold = gold + 100 * workers                          -- workers mine gold
end

AiProcessorEnd(ai, reward, {gold, workers, soldiers})
Exit(0)

Start the agent, then run the engine with the script’s folder as its data path (stratagus -d .). The agent prints:

Waiting for Stratagus on port 9292...
Setup: 3 state values, 3 actions
State [1200, 2, 0], reward 0 -> train worker
State [1100, 3, 0], reward 0 -> train worker
State [1100, 4, 0], reward 0 -> train soldier
State [900, 4, 1], reward 0 -> train soldier
State [700, 4, 2], reward 0 -> train soldier
State [500, 4, 3], reward 0 -> attack
Game over, final reward 3

In a real game, the script would read live values, such as a player’s resources and unit counts, and turn each action into engine commands. The reward lets a learning agent tell good decisions from bad ones.

Tested: we built Stratagus from its current source (reported as version 3.3.3-git, October 2026) on Ubuntu 24.04, and ran this script in the engine with SDL’s dummy video driver, so no window or game data was needed. The agent ran on Python 3.13, and the output above is from that run.

Is Stratagus Still Developed in 2026?

Yes, steadily if not quickly. The latest stable release is 3.3.2, from August 2022, and the project publishes continuous development builds instead of frequent releases: Windows builds, Linux AppImages and Ubuntu packages are built automatically from the main branch, and Windows installers for the games are on their release pages (Wargus releases). The repository saw hundreds of commits a year from 2020 to 2023, fewer since, and still has regular activity in 2026, including a new automated test suite for multiplayer and save games in May and June and Stargus-related fixes in October.

The caveats: the newest work isn’t in a stable release, the documentation is thin outside the Lua function list, and the best-known games need data from commercial games that players must own. For a brand-new RTS with its own art, Stratagus is a workable but niche choice. For playing or modding classic Blizzard RTS games on modern systems, it’s still the main open-source option.

Stratagus Alternatives

  • 0 A.D. and its Pyrogenesis engine: a free, open-source 3D historical RTS with its own art and an active community. See our Pyrogenesis engine profile.
  • Spring: an open-source 3D RTS engine whose Recoil fork runs Beyond All Reason and Zero-K. See our Spring engine profile.
  • Godot: if you’d rather build a new strategy game in a general-purpose open-source engine. See our Godot engine profile.

For more open-source engines, see our directory of open-source C++ game engines.

Key Takeaways

  • Stratagus is a free, open-source 2D RTS engine, written in C++ and scripted in Lua, under the GPL v2.
  • It began as FreeCraft in 1998 and became Stratagus in 2003, after a cease-and-desist letter from Blizzard.
  • The engine is separate from the games: Wargus, War1gus and Stargus run classic Blizzard RTS games using data from your own copies.
  • Lua defines the game, from units and spells to menus and AI, so most modding needs no C++.
  • Its built-in AI interface sends game state to any program over TCP, as the tested Python and Lua example shows.
  • The latest stable release is 3.3.2 (August 2022), with continuous development builds and steady work in 2026.

Conclusion

Stratagus turned a fan clone that Blizzard shut down into a general engine that has kept classic RTS games playable for more than two decades. It’s small and specialised, but its clean split between C++ engine and Lua game data, and its simple hook for outside AI agents, still make it one of the easiest places to study or experiment with real-time strategy.

For more engines across every genre, browse our game development hub.

Scroll to Top