t2-mapper/README.md
2026-03-09 12:38:40 -07:00

3.6 KiB

T2 MapGenius™

Map inspector for Tribes 2.

Screenshot of map inspector

Usage

👉 Open the app!

Camera Controls

Click inside the map preview area to capture the mouse.

Key Action
W Forward
A Left
S Backward
D Right
Space Up
Shift Down
Esc Release mouse
Left click Next observer camera
Scroll/mouse wheel up Increase speed
Scroll/mouse wheel down Decrease speed

Development

Install dependencies:

npm install

Run the dev server:

npm start

Relay Server

The relay server bridges WebSocket connections from the browser to Tribes 2 game servers via UDP. This is necessary because browsers can't open UDP sockets directly.

Local development

First, obtain TribesNext account credentials:

npm run login

This prompts for your TribesNext username and password, downloads the account certificate and encrypted key, and writes them to .env.local.

Then run the relay (or use npm run start:both to run it alongside the Next.js dev server):

npm run relay:dev

Deploying to Fly.io

The relay is configured for Fly.io deployment via relay/Dockerfile and fly.toml. It needs a persistent volume to hold game assets (~1.5 GB) used for the CRC integrity check.

1. Create the app and volume:

fly launch          # creates the app (adjust app name in fly.toml if needed)
fly volumes create gamedata --region ord --size 3

2. Set account credentials as secrets:

Run npm run login locally first if you haven't already, then copy the values from .env.local:

fly secrets set \
  T2_ACCOUNT_NAME=... \
  T2_ACCOUNT_PASSWORD=... \
  T2_ACCOUNT_CERTIFICATE=... \
  T2_ACCOUNT_ENCRYPTED_KEY=...

3. Deploy:

fly deploy

4. Populate game assets on the volume:

SSH into the running machine and clone the repo to get docs/base/:

fly ssh console

Then inside the machine:

apt-get update && apt-get install -y git
git clone --depth 1 --filter=blob:none --sparse \
  https://github.com/exogen/t2-mapper.git /tmp/t2-mapper
cd /tmp/t2-mapper
git sparse-checkout set docs/base
mv docs/base /data/base
rm -rf /tmp/t2-mapper

This only needs to be done once — the volume persists across deploys.

Environment variables (all optional, with defaults):

Variable Default Description
RELAY_PORT 8765 WebSocket listen port
GAME_BASE_PATH docs/base relative to relay Path to extracted game assets
MANIFEST_PATH public/manifest.json relative to project root Path to resource manifest
T2_MASTER_SERVER master.tribesnext.com Master server for server list queries

Running scripts

tsx is included to run TypeScript files directly.

Example:

tsx scripts/generate-manifest.ts