Skip to content

Apps and crates ​

The Un-Banished workspace has five programs and fifteen libraries. Each one has a README or a crate page with its purpose, how to use it, and examples. How Un-Banished is built explains how they fit together as layers.

Programs ​

ProgramPackageWhat it does
unbanishedunbanished-appThe game, for the desktop and the browser. It also makes headless captures for tests.
unbanished-viewerunbanished-viewerBrowses the game's models, animations, textures, sounds and dialogs.
unbanished-cliunbanished-cliCommand-line tools for the game data: it decodes every sound to MP3, and searches and installs mods from Nexus Mods and banishedinfo.com.
unbanished-modsunbanished-modmanagerThe 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.
unbanished-serverunbanished-serverThe multiplayer server: rooms, the checks that the players' towns agree, joining a running game, kept towns, and (with the operator's game data) its own copy of each game. Also a library, which the desktop game runs to host a game itself. Not part of the original game. See Multiplayer.

The mod manager, unbanished-mods, with five mods, three of them on

Libraries ​

CrateWhat it containsDepends on
unbanished-coreThe exact foundations: the C runtime's float maths, the game's random number generator, Perlin noise, transforms, game time, the calendar, pickingnothing
unbanished-terrainMap generation from a seed, the terrain mesh, rivers, ground height and cell typescore, formats
unbanished-pathThe A* pathfinder, walkable regions and the sector graphcore, terrain
unbanished-gameThe game rules: citizens, jobs, buildings, farming, trade, disasters, and the towncore, terrain, path, formats
unbanished-simThe running town, with no drawing, sound or interface: Simulation, player commands, the tools' core, loading and writing saves, achievements, the game's stringsgame, formats, mods
unbanished-sessionWhen a game carries out its players' commands (single player, lockstep), lockstep turns and messages, links to the other players, digests, recordings, and a town run by the server (Watcher). Not part of the original gamesim, game, formats; net with the relay feature
unbanished-formatsReaders for packages, resources, meshes, textures, sounds, dialogs and savesnothing
unbanished-uiThe game's interface system: elements, layout, text, controls, inputformats
unbanished-gfxRendering shared by the game and the viewer: texture upload, the interface renderer, materials, skinningformats, ui, wgpu
unbanished-audioSound decoding and playback: the 64-channel device and the sound sceneformats, wma
unbanished-wmaA decoder for Windows Media Audio v2, the codec of the game's soundsnothing
unbanished-modsThe 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 fileformats
unbanished-banishedinfoOptional 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
unbanished-netMultiplayer networking, not part of the original game: the protocol between a game and the server, the rooms' rules and checks, kept towns, and a WebSocket connection that works natively and in the browsernothing (postcard; tungstenite with the native feature)
unbanished-hooksRule hooks from WebAssembly plugins, not part of the original game: loading and checking them, and running them after each iteration with a fixed budgetsim, game, formats; wasmi
unbanished-nexusOptional 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 downloadnothing (zip, serde_json; ureq with the native feature)

unbanished-game re-exports unbanished-core, unbanished-terrain and unbanished-path. For example, unbanished_game::random is the same module as unbanished_core::random, and unbanished_game::terrain is the unbanished_terrain crate.

How they fit together ​

ProgramUses
unbanishedsim, session, hooks, game, formats, ui, gfx, audio, mods, nexus, banishedinfo, net, server
unbanished-viewergame, formats, ui, gfx, audio, wma
unbanished-cliformats, nexus, banishedinfo
unbanished-modsformats, mods, nexus, banishedinfo
unbanished-serversession, net, formats

The libraries form layers. A crate uses only crates in the layers below it:

  1. unbanished-core, unbanished-formats, unbanished-wma, unbanished-nexus, unbanished-net: no dependencies on other crates of the workspace.
  2. unbanished-terrain, unbanished-ui, unbanished-audio, unbanished-mods, unbanished-banishedinfo.
  3. unbanished-path, unbanished-gfx.
  4. unbanished-game.
  5. unbanished-sim: the core, which depends on no drawing, window, interface, sound or network crate (a test checks it).
  6. unbanished-session.

The two crates with no dependencies at all, unbanished-core and unbanished-formats, can be used on their own. unbanished-wma also has no dependencies.

Rules for each kind of code ​

Kind of codeWhere it goesRules
Exact maths, random numbers, game timecrates/coreNo game rules, no data files
Game rulescrates/game, crates/terrain, crates/pathNo graphics, windows or sound; deterministic; tested against the original
The running towncrates/simAs the game rules; also no network. The game app and the server both run it
What Un-Banished adds (multiplayer, the server, recordings, the probe…)crates/session, crates/net, apps/server, and feature-gated modules of apps/gameAn extension: behind a cargo feature, through the doors in Extensions, never changing the core's results
Reading filescrates/formatsNo dependencies
The interface systemcrates/uiGeneral interface code; no rules of the game
Engine loops, game controllers, dialogs, renderingapps/gameMust also work in the browser (WebGL 2, one thread)

The API documentation lists every public item of the libraries.

Un-Banished 0.6.0-ab22835 is free software under the MIT or Apache-2.0 licence. It is not affiliated with or endorsed by Shining Rock Software.