Apps and crates
The Un-Banished workspace has five programs and thirteen libraries. Each one has a README with its purpose, how to use it, and examples.
Programs
| Program | Package | What it does |
|---|---|---|
banished | banished-app | The game, for the desktop and the browser. It also makes headless captures for tests. |
banished-viewer | banished-viewer | Browses the game's models, animations, textures, sounds and dialogs. |
banished-cli | banished-cli | Command-line tools for the game data: it decodes every sound to MP3, and searches and installs mods from Nexus Mods and banishedinfo.com. |
banished-mods | banished-modmanager | The mod manager, a small desktop program: turn mods on and off, set their order, keep mod lists, install from Nexus Mods and banishedinfo.com, and start the game. Not part of the original game. |
banished-relay | banished-relay | The multiplayer relay: a small WebSocket server with rooms, which passes the players' data on. Not part of the original game. See Multiplayer. |

Libraries
| Crate | What it contains | Depends on |
|---|---|---|
banished-core | The exact foundations: the C runtime's float maths, the game's random number generator, Perlin noise, transforms, game time, the calendar, picking | nothing |
banished-terrain | Map generation from a seed, the terrain mesh, rivers, ground height and cell types | core, formats |
banished-path | The A* pathfinder, walkable regions and the sector graph | core, terrain |
banished-game | The game rules: citizens, jobs, buildings, farming, trade, disasters, and the town | core, terrain, path, formats |
banished-formats | Readers for packages, resources, meshes, textures, sounds, dialogs and saves | nothing |
banished-ui | The game's interface system: elements, layout, text, controls, input | formats |
banished-gfx | Rendering shared by the game and the viewer: texture upload, the interface renderer, materials, skinning | formats, ui, wgpu |
banished-audio | Sound decoding and playback: the 64-channel device and the sound scene | formats, wma |
banished-wma | A decoder for Windows Media Audio v2, the codec of the game's sounds | nothing |
banished-mods | The mod list (IO::Modification) shared by the game and the mod manager: the .pkm packages, which are enabled, their order and conflicts, and the settings file | formats |
banished-banishedinfo | Optional banishedinfo.com support, not part of the original game: listing and searching the site's mods, their versions, and installing them (desktop only) | nexus (its installer); ureq with the native feature |
banished-net | Multiplayer networking, not part of the original game: the protocol between a game and the relay, and a WebSocket connection that works natively and in the browser | nothing (postcard; tungstenite with the native feature) |
banished-nexus | Optional Nexus Mods support, not part of the original game: searching Banished mods, download links with the player's API key, and the .pkm packages in a download | nothing (zip, serde_json; ureq with the native feature) |
banished-game re-exports banished-core, banished-terrain and banished-path. For example, banished_game::random is the same module as banished_core::random, and banished_game::terrain is the banished_terrain crate.
How they fit together
| Program | Uses |
|---|---|
banished | game, formats, ui, gfx, audio, mods, nexus, banishedinfo, net |
banished-viewer | game, formats, ui, gfx, audio, wma |
banished-cli | formats, nexus, banishedinfo |
banished-mods | mods, nexus, banishedinfo |
banished-relay | net |
The libraries form layers. A crate uses only crates in the layers below it:
banished-core,banished-formats,banished-wma,banished-nexus,banished-net: no dependencies on other crates of the workspace.banished-terrain,banished-ui,banished-audio,banished-mods,banished-banishedinfo.banished-path,banished-gfx.banished-game.
The two crates with no dependencies at all, banished-core and banished-formats, can be used on their own. banished-wma also has no dependencies.
Rules for each kind of code
| Kind of code | Where it goes | Rules |
|---|---|---|
| Exact maths, random numbers, game time | crates/core | No game rules, no data files |
| Game rules and the simulation | crates/game, crates/terrain, crates/path | No graphics, windows or sound; deterministic; tested against the original |
| Reading files | crates/formats | No dependencies |
| The interface system | crates/ui | General interface code; no rules of the game |
| Engine loops, game controllers, dialogs, rendering | apps/game | Must also work in the browser (WebGL 2, one thread) |
The API documentation lists every public item of the libraries.