Skip to content

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 ​

ProgramPackageWhat it does
banishedbanished-appThe game, for the desktop and the browser. It also makes headless captures for tests.
banished-viewerbanished-viewerBrowses the game's models, animations, textures, sounds and dialogs.
banished-clibanished-cliCommand-line tools for the game data: it decodes every sound to MP3, and searches and installs mods from Nexus Mods and banishedinfo.com.
banished-modsbanished-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.
banished-relaybanished-relayThe multiplayer relay: a small WebSocket server with rooms, which passes the players' data on. Not part of the original game. See Multiplayer.

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

Libraries ​

CrateWhat it containsDepends on
banished-coreThe exact foundations: the C runtime's float maths, the game's random number generator, Perlin noise, transforms, game time, the calendar, pickingnothing
banished-terrainMap generation from a seed, the terrain mesh, rivers, ground height and cell typescore, formats
banished-pathThe A* pathfinder, walkable regions and the sector graphcore, terrain
banished-gameThe game rules: citizens, jobs, buildings, farming, trade, disasters, and the towncore, terrain, path, formats
banished-formatsReaders for packages, resources, meshes, textures, sounds, dialogs and savesnothing
banished-uiThe game's interface system: elements, layout, text, controls, inputformats
banished-gfxRendering shared by the game and the viewer: texture upload, the interface renderer, materials, skinningformats, ui, wgpu
banished-audioSound decoding and playback: the 64-channel device and the sound sceneformats, wma
banished-wmaA decoder for Windows Media Audio v2, the codec of the game's soundsnothing
banished-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
banished-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
banished-netMultiplayer 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 browsernothing (postcard; tungstenite with the native feature)
banished-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)

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 ​

ProgramUses
banishedgame, formats, ui, gfx, audio, mods, nexus, banishedinfo, net
banished-viewergame, formats, ui, gfx, audio, wma
banished-cliformats, nexus, banishedinfo
banished-modsmods, nexus, banishedinfo
banished-relaynet

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

  1. banished-core, banished-formats, banished-wma, banished-nexus, banished-net: no dependencies on other crates of the workspace.
  2. banished-terrain, banished-ui, banished-audio, banished-mods, banished-banishedinfo.
  3. banished-path, banished-gfx.
  4. 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 codeWhere it goesRules
Exact maths, random numbers, game timecrates/coreNo game rules, no data files
Game rules and the simulationcrates/game, crates/terrain, crates/pathNo graphics, windows or sound; deterministic; tested against the original
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.4.0-5125009 is free software under the MIT or Apache-2.0 licence. It is not affiliated with or endorsed by Shining Rock Software.