Skip to content

Building from Source

Zaldaryon edited this page Jul 5, 2026 · 9 revisions

Building from Source

Requirements

  • .NET 10 SDK
  • bash (Linux/WSL/Git Bash)
  • python3
  • git, curl, perl

Quick Start (Linux / WSL / Git Bash)

git clone https://github.com/Zaldaryon/Optimum.git
cd Optimum
make build    # downloads ~570MB client, decompiles, clones forks, patches, compiles
make test     # runs 224 unit tests
make run      # deploys DLLs + shaders to .vanilla/ and launches the client

The first make build takes 2-5 minutes depending on download speed. Subsequent builds take 5-10 seconds.

Quick Start (Windows PowerShell)

git clone https://github.com/Zaldaryon/Optimum.git
cd Optimum
.\scripts\bootstrap.ps1
dotnet build VintageStory.slnx -c Release

The bootstrap script downloads the official Windows installer, extracts it with innounp (fetched on first run), decompiles with ILSpy, clones the open-source forks at pinned refs, and applies patches.

What Bootstrap Does

  1. Downloads the official Vintage Story client archive for your platform (Linux tar.gz or Windows exe).
  2. Extracts it into .vanilla/vintagestory/.
  3. Decompiles VintagestoryLib.dll and Vintagestory.dll with ILSpy into baseline/.
  4. Runs post-decompile fixup regex (ref-casts, GeneratedRegex, ambiguous calls).
  5. Clones the open-source forks (vsapi, Cairo, vsessentialsmod, vssurvivalmod, vscreativemod) at the refs pinned in forks.json.
  6. Applies patches from patches/ over both decompiled and fork sources.
  7. Copies Optimum-original sources from sources/ into the working tree.

Deploy

make deploy copies the compiled DLLs and optimized shaders into .vanilla/vintagestory/:

  • Vintagestory.dll (main client)
  • VintagestoryLib.dll (engine)
  • VintagestoryAPI.dll (API)
  • VSEssentials.dll, VSSurvivalMod.dll, VSCreativeMod.dll (game mods)
  • cairo-sharp.dll (Cairo fork)
  • sources/shaders/*.fsh, *.vsh (optimized GLSL shaders)

Tests

make test

Runs 81 xunit tests covering config serialization, distance gate thresholds, LOD tier boundaries, weight renormalization, and frame pacing logic.

Makefile Targets

Target Description
make check Report installed tools (installs nothing)
make bootstrap Download, decompile, clone, patch
make build Bootstrap if needed, then compile
make clean Remove obj/ and bin/ from project dirs
make refresh Force full re-bootstrap
make patches Regenerate patches/ from the working tree
make deploy Copy DLLs + shaders into .vanilla/
make run Build, deploy, launch client
make test Run unit tests
make package Build all release archives

Clone this wiki locally