Armok Vision

repository·master·Indexed 43 days ago

https://github.com/rosarymala/armok-vision

A 3D real-time visualizer for Dwarf Fortress that connects to the game via the DFHack remotefortressreader plugin using protobuf-formatted messages over TCP.

Tokens
4.2K
Snippets
11
Records
26
Agent score
55%

What's inside Armok Vision

  1. How Armok Vision connects to Dwarf Fortress

    master

    Armok Vision functions by connecting to the remotefortressreader DFHack plugin via TCP. The communication uses protobuf-formatted messages.

    Key architectural components:

    • Networking: The submodule Assets/RemoteClientDF-Net contains the generated C# protobuf files and connection management classes. The script Assets/Scripts/MapGen/DFConnection.cs manages the connection on a separate thread to expose data from Dwarf Fortress.
    • Map Management: Assets/Scripts/MapGen/GameMap.cs manages the onscreen map by storing GameObjects for different map chunks. It utilizes scripts in Assets/Scripts/MapGen/Meshing to build meshes on separate threads.
    • Asset Loading: Most assets (textures, 3D models, sprites) are loaded at runtime from Assets/StreamingAssets via Assets/Scripts/MapGen/ContentLoader.cs. This folder is copied directly to the generated application folder.
  2. How to contribute 3D models, sounds, and concept art

    master

    Artists can contribute assets in two ways:

    Method 1: Direct File Editing

    Locate the StreamingAssets folder near the Armok Vision executable (or inside the app bundle on macOS). You can edit files directly in this folder and restart Armok Vision to see changes. Note: Be careful when editing .xml files as they are sensitive to formatting errors.

    Method 2: Unity Editor

    Load the project assets into Unity and edit them there using the standard Unity workflow.

  3. Armok Vision Controls and Navigation

    master

    Use the following keyboard and mouse controls to navigate and interact with the Armok Vision interface:

    Movement & View

    • Horizontal Movement: W, A, S, D, or middle-click drag.
    • Vertical Movement: Q or E.
    • Zoom: Mouse wheel.
    • Rotation: Right-click drag.
    • Follow Center: F (toggles following the center of the Dwarf Fortress screen).

    Time & Environment

    • Sun Movement: P (pauses/resumes sun movement).
    • Time of Day: [ or ] (changes time of day; automatically pauses sun movement).
    • Shadows: O (toggles shadows cast from hidden Z-levels).

    Display & Interface

    • Creature Scaling: L (toggles scaling of creatures based on size).
    • Dwarf Fortress Screen: ` (toggles showing the DF screen).
    • Options Menu: Esc.

    Screenshots

    • Full Screenshot: F9.
    • Minimap: Ctrl+F9.
  4. Use OBJ-IO to import and export OBJ geometry

    master

    OBJ-IO provides functionality to import and export OBJ files. The core Import and Export functions are designed to be flexible by accepting a System.IO.Stream as a parameter, allowing you to read from or write to files, memory streams, or other stream-based sources.

    Note: The current implementation only supports geometry data; it does not support materials or other non-geometric OBJ data.

    // The API uses System.IO.Stream for flexibility
    // Example conceptual usage:
    // Import(Stream stream)
    // Export(Stream stream, geometryData)
  5. Install Armok Vision

    master

    To install Armok Vision, you must have a copy of Dwarf Fortress with a recent build of DFHack installed.

    For full functionality, ensure you have one of the following:

    1. A version of DFHack built after the current Armok Vision release.
    2. An updated RemoteFortressReader plugin for your specific platform.

    If neither is available, you must build DFHack yourself from the develop branch following the DFHack compilation guide.

  6. Set up the development environment for Armok Vision

    master

    To contribute to the codebase, you need to set up a Unity-based development environment:

    1. Install Unity 5.
    2. For non-Windows users, install the Git LFS extension (verify with git lfs version).
    3. Clone the repository including submodules:
      git clone --recurse-submodules --depth 1 https://github.com/JapaMala/armok-vision.git
    4. Open the armok-vision folder in the Unity editor.
    5. Crucial Step: Run the Mytools -> Build Material Collection menu item in Unity. This is required after a fresh pull or after modifying any material files.
    git clone --recurse-submodules --depth 1 https://github.com/JapaMala/armok-vision.git