Skip to content

banished-viewer ​

An asset browser for the game data of Banished. It shows the game's models (with their animations), textures, sounds and dialogs. It is drawn with the game's own interface system (banished-ui), so it also tests that system. It runs on the desktop and in the browser.

The viewer in Models mode, showing the Town Hall model

Build and run ​

bash
cargo run -p banished-viewer --release                       # reads game-data/original/WinData
cargo run -p banished-viewer --release -- /path/to/WinData   # or another WinData folder

In the browser:

bash
tools/dev-web.sh --release      # http://127.0.0.1:8731/?data=/game-data/

Without ?data=, the page asks you to choose the four .pkg files.

The four modes ​

The buttons at the top choose the mode. In each mode, the lists on the left filter the resources by type and category, and the Resources list shows the matching entries. The bar at the bottom shows how many of each kind the game data holds (for Banished 1.0.7: 271 models, 406 textures, 72 sounds and 55 dialogs).

ModeWhat it shows
ModelsA mesh with its materials. Choose Textured, Vertices or Wireframe. If the mesh has animations, the Model Animation panel plays its clips: previous and next clip, play, stop, and steps of 0.1 seconds.
TexturesA texture, with its size, format, mip levels and source file name
AudioA sound, with its length, channels, sample rate and source file name. The Audio Player panel plays it, with a position bar, loop and volume.
DialogsA dialog of the game, drawn as the game draws it. Animated dialogs (such as the loading screen) can be played frame by frame.

The viewer in Dialogs mode, showing the main menu dialogThe viewer in Audio mode, with the audio player

Controls ​

ActionControl
Choose a mode, a filter or a resourceClick it
Next or previous resourceDown / Up
20 resources forward or backPage Down / Page Up
Step an animation by 0.1 seconds (Models)Right / Left
Turn the modelDrag with the left mouse button
ZoomMouse wheel

Headless commands ​

Two commands draw without a window and stop. They read game-data/original/WinData.

CommandWhat it does
banished-viewer --screenshot FILE.png [MODE] [FILTER]Draw the whole viewer at 1400 × 860. MODE is models, textures, audio or dialogs. FILTER selects the first resource whose name contains it.
banished-viewer --capture OUT_DIR [FILTER …]Draw every mesh whose name contains one of the filters, alone, as a 512 × 512 PNG in OUT_DIR

For --capture, two environment variables pose animated meshes:

VariableEffect
VIEWER_POSE=CLIP@SECONDSPose each mesh with the clip CLIP at SECONDS
VIEWER_ANIMS=TEXTLook for the clip only in animation groups whose name contains TEXT
bash
# The screenshots on this page
banished-viewer --screenshot models.png models TownHallMesh
banished-viewer --screenshot dialogs.png dialogs MainMenu_resource

# Every chicken mesh, in the Walk clip at 0.5 seconds
VIEWER_POSE=Walk@0.5 VIEWER_ANIMS=Chicken banished-viewer --capture chickens/ ChickenMesh

A sequence of --capture runs at increasing times gives the frames of an animation. The chicken video on the Playing page was made this way.

Source files ​

FileWhat it contains
src/main.rsThe window, the event loop, the headless commands, the browser's file chooser
src/tool.rsThe browser's interface: modes, lists, filters, the camera
src/assets.rsReading the packages and listing the resources by kind
src/render.rs, src/mesh.wgslDrawing meshes (with skinning) and the interface
src/model_player.rs, src/dialog_player.rs, src/audio_player.rs, src/player.rsThe animation, dialog and audio panels

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