A utility to automate the processing of Tabletop Simulator (TTS) save files from the Red Strike Wargame for Song of the Nibelungs (SOTN) sessions into KML map files. This tool coordinates the conversion of all three map layers (Tactical, Strategic, and Operational) from a single save file.
This project is built upon the original TTS2KML scripts created by Gronank. The individual map conversion scripts, coordinate transformation system, and KML generation logic were all originally developed by Gronank. This fork builds on that work by fixing the scripts to account for the changes to the maps in the TTS save from the early versions, generates a KML for all 3 map layers in the Red Strike TTS save, and adds a batch script that makes the process a one-click operation.
Original repositories by Gronank:
The scripts works by:
- Taking a TTS save file containing three map layers (TacMap, StratMap, OpMap)
- Using transformation data (tts2lola.json) to convert game coordinates to real-world coordinates
- Generating KML files for each map layer with NATO and PACT unit positions
- Prompting you for an archive folder name and copying the outputs into a folder
- Combining the latest outputs into the repo root for easy web map integration
Each map layer (Tactical, Strategic, Operational) has its own coordinate transformation system:
- TacMap: Highest detail, smallest area coverage
- OpMap: Medium detail, regional coverage
- StratMap: Strategic overview, largest area coverage
Each folder contains a tts2lola.json file that defines:
- Map bounds in game coordinates
- Scale factors for converting to real-world coordinates
- Offset values for proper geo-positioning
The Python scripts:
- Read the TTS save file JSON
- Identify map objects and their transforms
- Convert game coordinates to real-world coordinates
- Sort units into NATO and PACT categories
- Generate KML with proper styling and organization
- Python 3.x (must be added to system PATH)
- Folder structure must be maintained:
SOTN_TTS2KML_Merged/ ├── process_maps.bat ├── AnalyzeTTS-TacMap/TTS2KML/ ├── AnalyzeTTS-StratMap/TTS2KML/ └── AnalyzeTTS-OpMap/TTS2KML/
-
Install Python:
- Download from https://www.python.org/downloads/
- Important: Check "Add Python to PATH" during installation
- Restart your computer after installation
- Verify by opening Command Prompt and typing:
python --version
-
Verify Python PATH: If Python isn't recognized:
- Open System Properties → Advanced → Environment Variables
- Under "System Variables", find and select "Path"
- Add Python paths (typically):
C:\Users\[Username]\AppData\Local\Programs\Python\Python3x\ C:\Users\[Username]\AppData\Local\Programs\Python\Python3x\Scripts\
- Place your TTS save file (e.g.,
TS_Save_48.json) in the main folder - Run
process_maps.bat - When prompted, enter an archive folder name (examples:
GT3,2025-10-21-Turn3) - Three KML files will be generated:
TacMap.kml- Tactical layerStratMap.kml- Strategic layerOpMap.kml- Operational layer
- Outputs are also archived under
Archived KML's/<your-folder-name>/alongside the original save JSON for traceability
- Latest KMLs are copied to the repository root (for quick access)
- A persistent copy is placed in:
Archived KML's/<your-folder-name>/- Contains:
TacMap.kml,StratMap.kml,OpMap.kml, and the original save JSON you used
- Contains:
- Finds JSON save files in the main folder
- Copies save file to each map's TTS2KML folder
- Runs the Python conversion scripts
- Collects generated KML files and copies then to the root folder
- Prompts for an archive folder name and copies the generated KMLs + the source JSON into
Archived KML's/<name>/
- Calculates the coordinate transformation parameters for each map layer
- Uses a system of known reference points (cities) to calibrate the map
- Works in conjunction with
towns.luawhich contains real-world city coordinates - Process:
- Loads city locations from
towns.lua(real-world lat/long coordinates) - Finds city markers in the TTS save file by matching nicknames
- Calculates transformation matrix using city positions:
- Compares TTS coordinates (X,Y,Z) to real-world coordinates
- Solves for scale and offset parameters
- Accounts for map rotation and mirroring
- Generates
tts2lola.jsoncontaining:- Easting parameters (longitude transformation)
- Northing parameters (latitude transformation)
- Map bounds for coordinate validation
- Loads city locations from
- Creates KML files for Google Earth visualization using the pykml library
- Implements a GeoReferencedMap class for coordinate transformation
- Process:
- Loads transformation parameters from
tts2lola.json:- Scale and offset for longitude (easting)
- Scale and offset for latitude (northing)
- Map boundary coordinates
- Processes unit positions:
- Reads unit transforms from TTS save file
- Converts game coordinates to relative positions
- Transforms relative positions to real-world coordinates
- Validates positions against map boundaries
- Generates KML structure:
- Creates unique styles for each unit type using their custom images
- Organizes units into separate folders:
- NATO forces (units with 'NATO' tag)
- PACT forces (units with 'WP' tag)
- Undefined/Neutral (all other markers)
- Preserves unit names, imagery, and positioning
- Loads transformation parameters from
-
Python Path Issues:
- Verify Python installation:
python --version - Check PATH environment variable
- Try running Python scripts manually in each folder
- Verify Python installation:
-
Save File Issues:
- Ensure save file is valid JSON
- Check that map names match exactly: "TacMap", "StratMap", "OpMap"
- Verify unit data contains required fields (Transform, Tags, etc.)
-
KML Generation Issues:
- Check tts2lola.json files are present in each TTS2KML folder
- Verify coordinate transformations are correct for each map
- Ensure unit Tags are properly set for NATO/PACT sorting