Un-Banished

2 min read Original article ↗

Un-BanishedBanished, rebuilt from scratch

A new engine for a classic city builder. It runs on Windows, macOS and Linux, and in your web browser. It uses the game files from your own copy of Banished.

The same game, exactly

The same seed makes the same map. Citizens are born, work, age and die by the same rules, with the same numbers and the same timings as in Banished 1.0.7.

On every computer

Native on Windows, macOS (Apple Silicon and Intel) and Linux. The browser version runs on WebGPU or WebGL 2, and installs as an app.

Your towns still load

Un-Banished reads and writes the original save format, in the original save folder. Your old towns appear in the Load dialog.

Free, open, and all new

All code is new, under the MIT or Apache-2.0 licence, with no code, art, sound or text from the original. A copy of Banished is required.

Screenshots ​

About the project ​

Banished is a city-building game by Shining Rock Software, released in February 2014. It runs only on Windows. Its last version is 1.0.7.

Un-Banished is a reimplementation of the game's engine in Rust. It reads the data files of an installed copy of Banished and runs the game on Windows, macOS, Linux and in web browsers. The goal is identical behaviour: the same maps, rules, numbers, timings and save files. Where Un-Banished behaves differently from the original, this is treated as a bug.

Un-Banished contains no code, art, sound or text from the original game. A copy of Banished is required, from Steam or GOG.

More about the project

How it was made ​

We did not have the source code of Banished. We had only the finished program. Ghidra turned the program's machine code into readable pseudocode. An AI agent read it, wrote down what each part does, and ran the original functions in an emulator to get exact numbers. Then it wrote new code in Rust from those notes, and tested the new code against the original.

  1. 1Read the data files

    The .pkg packages and their formats

  2. 2Decompile

    Ghidra turns machine code into pseudocode

  3. 3Trace

    Understand one function and write it down in plain words

  4. 4Measure

    Run the original function in an emulator

  5. 5Rebuild in Rust

    New code from the notes, citing the original function

  6. 6Check

    Tests against the emulator, saves and screenshots

  7. 7Write down, commit

    Documents, the checklist, and one commit per piece

  8. Does not match?

    The work goes back to step 3, Trace, until the check passes.

Every part of the game went through this loop.

Read how each step works