🛠

Getting set up

Simulations using TNT as their transport need to be deterministic for now. As we enable join/rejoin during our closed beta, we will be able to handle non-deterministic simulations.
TNT is a Unity Netcode for GameObjects transport that uses the Tashi Consensus Engine (TCE) to provide distributed communication with fair ordering of events.

Supported operating systems and environments

The native shared library has been tested on the following operating system versions, where the target triple references a Rust compiler target:
  • Windows 11 (x86_64-pc-windows-gnu), tested on 10.0.22621.
  • macOS 13.2 Apple Silicon (aarch64-apple-darwin).
  • Ubuntu 22.04 (x86_64-unknown-linux-gnu).
We tested the Unity plugin using the latest LTS, 2021.3.18f1, with the Mono scripting backend.

Closed beta roadmap

  • Peers will be able to join and re-join an existing session.
  • Peers will be able to leave a session.
  • Improved robustness of the consensus algorithm - support for graph forks and general hardening.
  • Switch to using UDP. This is in preparation for supporting various NAT traversal solutions.
  • Enable the re-use of secret keys.
  • Improved higher level error messages.

Limitations

Each of these limitations will be resolved before the open beta phase.

Peers cannot join or leave an existing session

The number of peers within the network must be decided upfront, and peers are unable to join or leave a running session. The work around for this is hard-coded in the transport for now:
  • When used within Unity Editor it's set to 2 peers each listening on the loopback address on a random port.
  • When used outside of the Unity Editor it expects to environment variables to be set:
    • TNT_PEERS is how many peers to expect, including the local peer, e.g. 2.
    • TNT_ADDRESS is the IP address and port to bind to, e.g. 192.168.0.1:0.

The network configuration must allow connections between peers

There is currently no support for NAT traversal, which means the network must be configured manually in order for peers to be able to communicate with each other. We’ll gradually add various solutions for this, such as: NAT hole-punching, UPnP, and Unity Relay.

Determinism

As mention, you can only use TNT as a network transport for in-game events in deterministic simulations for now.

Adding TNT to your project

Import the Unity Package

  1. 1.
    Unzip the TNT package.
  2. 2.
    Open your Unity project. Open the Package Manager window which is under the Window menu.
  3. 3.
    Select +, and choose to add package from disk.
  4. 4.
    Navigate to the unzipped TNT package and select package.json.
  5. 5.
    Click Open and you should see it in the Packages - Other section within the Package Manager.

Configure NetworkManager to use TNT

  1. 1.
    Open the NetworkManager in the Inspector.
  2. 2.
    Click Select transport...
  3. 3.
    Select Tashi Network Transport from the drop down.

Enabling Tashi Platform (TP) logging

The native library (libtashi_platform.so, etc.) includes support for logging which is disabled by default. This could be useful to get additional information - our higher level error messages are quite minimal for now. To enable it you should set the following environment variables:
  • RUST_LOG according to the rules explained here. Example: RUST_LOG=tashi_platform=info,error.
  • RUST_LOG_PATH to a file location. No directories will be created and the file will be truncated if it already exists. Example: RUST_LOG_PATH=/tmp/tce.log.