UC2 Linux

UC2 Linux is a native Linux port of Unreal Championship 2: The Liandri Conflict made by static recompilation with modern graphics options and online play.

README

UC2 Linux

A native Linux port of Unreal Championship 2: The Liandri Conflict (Xbox, 2005), made by static recompilation: the game's original x86 code is translated into C, compiled on your own computer into a normal Linux library, and run on a small runtime that stands in for the Xbox's kernel, graphics chip, sound chip, network card and controllers.

It is not an emulator in the usual sense. Nothing interprets Xbox instructions while you play: the game runs as native machine code, rendering through Vulkan, with modern options the original never had (high resolutions, widescreen, upscaling, anti-aliasing, ambient occlusion, a wider field of view, keyboard and mouse, online play over the internet).

You need your own copy of the game. This repository and its AppImage contain no game code, art, sound, maps or other game data. The launcher builds the game from your disc image on your machine. Nothing from the disc is ever uploaded, shared or stored in this repository.


Contents

  1. What you get
  2. Quick start (AppImage)
  3. Requirements
  4. Supported disc
  5. The launcher, tab by tab
  6. Online play
  7. Where things are stored
  8. Running the game from the command line
  9. Building from source
  10. How it works
  11. Repository layout
  12. Troubleshooting
  13. Credits and legal
  14. License

What you get

  • The whole game, natively on Linux: story mode (the tournament ladder), Instant Action, every game type, every arena and character on the disc, and saves.
  • The Bonus Pack, unlocked. The 2005 Xbox Live Bonus Pack (four maps: DM-EvilHands, DM-Sever, CTF-Monoxide, OD-Ascension; ten alternate characters) was only ever a key: all of its files are already on the retail disc. Xbox Live is gone, so the runtime answers the game's "do you own this content?" check with yes. See docs/notes/m5-bonus-pack.md.
  • Graphics far beyond the Xbox: up to 6× internal resolution, AMD FSR 1 upscaling and CAS sharpening, SMAA/FXAA anti-aliasing, anisotropic filtering, ambient occlusion (SSAO), bloom, a frame-rate limit, VSync, fullscreen or windowed, and an FPS overlay (or MangoHud).
  • Widescreen (Hor+) at any aspect ratio (16:9, 16:10, 21:9, 32:9, or the window's own shape): you see more at the sides, with nothing cropped or stretched, and the HUD stays in proportion.
  • Field of view slider (60–130°) for the player view.
  • Game language: English, French, German, Spanish or Italian (all are on the disc).
  • Keyboard and mouse, fully rebindable, plus any SDL-supported controller, with dead zones, response curve and vibration.
  • Online play: the game's own System Link mode carried over the internet through a small lobby/relay server. No port forwarding needed for players.
  • Cheats for offline play (god mode, infinite ammo, all weapons, no-clip, game speed, unlock everything, Xbox-style memory codes). They are switched off in online matches.
  • HD texture packs: dump the game's textures, edit or upscale them, and load them back.
  • Shader precompiling so the first match isn't full of compile stutters.
  • A save manager that lists, backs up and deletes saves.

Quick start (AppImage)

  1. Download UC2-Native-x86_64.AppImage from the Releases page.

  2. Make it executable and run it:

    chmod +x UC2-Native-x86_64.AppImage
    ./UC2-Native-x86_64.AppImage
    
  3. Pick your disc image. On first start the launcher asks for it. Browse to your .iso (or an extracted disc folder), or paste its path. The launcher reads the game's executable, identifies it, and shows the title ID and version.

  4. Build the game. The Play tab offers Build the game. This recompiles the game's code from your disc into uc2_game.so. It takes a few minutes, once. It needs a C compiler: install clang (preferred) or gcc from your distribution if the launcher says none was found.

    # Debian / Ubuntu
    sudo apt install clang
    # Fedora
    sudo dnf install clang
    # Arch / CachyOS / Manjaro
    sudo pacman -S clang
    
  5. Optionally press Precompile shaders on the Graphics tab (useful after you have played a few matches, and again after an update).

  6. Press Play.

The game is built again only when needed: after an update changes the recompiler, the game profile or the runtime's interface, or after the runtime discovered new code entry points while you played (the launcher checks when the game exits).

Requirements

CPUx86-64 (64-bit Intel or AMD)
OSLinux with glibc 2.35 or newer: Ubuntu 22.04, Debian 12, Fedora 36, and anything newer (Arch, CachyOS, openSUSE Tumbleweed, …)
GPUVulkan 1.3 with a current driver (Mesa RADV/ANV, NVIDIA proprietary)
Compilerclang or gcc, to build the game from your disc (once)
DiscYour own Unreal Championship 2 disc image (see below)
Disk spaceThe AppImage is about 45 MB; the built game, caches and saves need a few hundred MB more
DisplayX11 or Wayland
AudioPipeWire, PulseAudio or ALSA (through SDL 3)

The AppImage bundles Qt 6.8, SDL 3 and everything else it needs. It is built in an Ubuntu 22.04 container so it runs on old and new distributions alike.

Supported disc

TitleRegionXBE SHA-1
Unreal Championship 2: The Liandri ConflictUSA, Europe (En, Fr, De, Es, It)1f6e3417b6a912b5d3503593fd54d9b7a92c4bd0

This matches the Redump dump of the retail disc. The port is driven by a game profile (profiles/) keyed by the executable's SHA-1; other versions are identified but reported as "not supported" until someone adds a profile for them.

How to make an image of your own disc is outside the scope of this project; any standard Xbox disc dump (XISO / Redump ISO) or an extracted disc folder works.

The launcher, tab by tab

All settings are saved in ~/.config/uc2-native/settings.toml and apply the next time the game starts.

Play

Shows your disc, whether the game is built, and the Play button. When the build is out of date it offers Build the game. While it builds, a progress panel shows which of the three steps is running (recompile → compile → link), the overall percentage, how many of the game's parts are compiled, the time so far and an estimate of the time left, with a Cancel button.

If something goes wrong (the build fails, or the game can't start or stops with an error), an error box on the Play tab says what happened. Show details reveals the last lines of the log, Open log opens the whole file, and Copy details puts the message, the log's location and those lines on the clipboard, ready for a bug report. The build's log is <data>/game/build.log; the game's is <data>/logs/last-run.log. You can change the disc image here at any time, and if the image has moved, the launcher looks for it nearby and otherwise asks you to pick it again.

Graphics
  • Renderer: GPU selection, internal resolution (native 640×480 up to 6×, 3840×2880), aspect ratio (auto, 4:3, 16:9, 16:10, 21:9, 32:9, stretch).
  • Upscaling and sharpening: AMD FidelityFX FSR 1, Lanczos, bicubic, bilinear, nearest or integer (pixel-perfect) scaling, and AMD CAS sharpening strength.
  • Anti-aliasing and textures: SMAA, FXAA or off; texture filtering (game default, forced bilinear or trilinear), anisotropic filtering, mipmap LOD bias.
  • Lighting: ambient occlusion (SSAO) and its strength, bloom and its strength.
  • Smoothness: save compiled shaders (on by default), Precompile shaders.
  • Texture packs: load HD texture packs, dump textures.
  • Display: windowed, borderless or exclusive fullscreen; VSync (on, mailbox, off); frame-rate limit; FPS and frame-time overlay; start with MangoHud.
  • Detail: model and texture detail (original or maximum), blood (original, more, maximum).
Gameplay
  • Game language: English, Français, Deutsch, Español, Italiano.
  • Field of view: 60–130° horizontal at 4:3 (90° is the game's own). Widescreen adds more at the sides on top of this. Zoomed views such as the sniper scope keep their own.
  • Skip startup waits: the boot screens otherwise sit for about 9 seconds.

Difficulty, crosshair, invert look and per-match rules (goal score, time limit, bots, mutators) live in the game's own menus, as on the Xbox.

Controls
  • Player 1 device (keyboard and mouse, or a controller).
  • Mouse: horizontal, vertical and melee sensitivity, invert vertical look, smoothing.
  • Keyboard and mouse bindings for every Xbox control (sticks, triggers, A/B/X/Y, Black/White, stick clicks, D-pad, Start, Back) plus next/previous weapon.
  • Controller: left and right stick dead zones, stick response curve (original, smooth, exponential), vibration.
Cheats

Local play only. The runtime ignores every cheat in online matches and never sends them to a server.

  • Player: god mode, infinite ammo, all weapons, infinite adrenaline, infinite shield, one-hit kills, ghost (no-clip), jump height.
  • Match: game speed, kill all bots (F9), spawn pickups (F10).
  • Unlocks: every character, arena, ladder, cinematic and extra.
  • Codes: Xbox-format memory codes.
Saves

Lists the game's saves (from the emulated hard disk), backs them all up (copied to <data>/save-backups/<date and time>/), opens the saves folder, or deletes a save.

Online

Connect to a lobby server, create or join a lobby, and play System Link matches with people anywhere. See below.

Online play

UC2 has a System Link mode for consoles on the same network. This port keeps the game's own networking code completely unchanged and gives it an emulated network card whose Ethernet frames travel through a lobby server's UDP relay. Discovery, the session handshake, the game's encryption and in-game voice all stay the game's own.

  1. In the Online tab, enter a lobby server address (host:39200) and a player name, then Connect.
  2. One player creates a lobby (optionally with a password); the others join it.
  3. Everyone presses Play online on the Play tab.
  4. In the game: one player chooses Networked Combat → Host System Link Game; the others choose Join System Link Game and pick that match. Join while the host waits in the pre-match screen.

Everyone in a lobby needs the same game build (the launcher shows "different game build" otherwise), and cheats are off online.

Running your own lobby server

The server is a single Python file with no dependencies beyond the standard library and no game data. Only the server needs an open port (TCP and UDP 39200 by default); players never forward ports.

python3 server/uc2_lobby_server.py --port 39200 --motd "Welcome"

Or install it as a sandboxed systemd service:

scp server/uc2_lobby_server.py server/install.sh root@YOUR_SERVER:/root/uc2-lobby-install/
ssh root@YOUR_SERVER 'bash /root/uc2-lobby-install/install.sh'

Details, limits and the wire protocol: server/README.md, server/PROTOCOL.md, docs/notes/m7-online-play.md.

Where things are stored

WhatWhere
Settings~/.config/uc2-native/settings.toml
Data folder (<data>)~/.local/share/uc2-native/ (or $XDG_DATA_HOME/uc2-native, or UC2_DATA_DIR)
The built game<data>/game/uc2_game.so (+ build.log, build-stamp)
Saves (the Xbox's E: drive)<data>/saves/E/UDATA/<title id>/<save id>/
Entry points found while playing<data>/build/hints.txt (used by the next build)
Last run's log<data>/logs/last-run.log
HD texture packs<data>/override/textures/<id>.dds
Texture dumps<data>/dump/textures/<id>.tga
Save backups<data>/save-backups/<date and time>/
Shader cache~/.cache/uc2-native/shaders-<build>/ and ~/.cache/uc2-native/shader-sources-<layout>/

Back up <data>/saves to keep your progress. Deleting <data>/game only means the launcher builds the game again.

Running the game from the command line

The launcher is a front end for uc2-run. You can run it directly (inside the AppImage it lives in usr/bin/):

uc2-run --iso PATH --game PATH [--data-dir DIR] [--log FILE]
        [--info] [--dump-textures] [--precompile-shaders]
OptionMeaning
--iso PATHyour disc image (or extracted folder)
--game PATHthe built uc2_game.so
--data-dir DIRwhere saves, hints, dumps and logs go
--log FILEwrite the runtime log here
--infoprint the game library's function count and ABI version, then exit
--dump-textureswrite every texture on the disc to <data>/dump/textures, then exit
--precompile-shadersbuild every shader and pipeline earlier sessions used, then exit

Most settings can be overridden for one run with environment variables, for example UC2_RES_SCALE, UC2_UPSCALER, UC2_SHARPEN, UC2_AA, UC2_ASPECT, UC2_FOV, UC2_FPS_LIMIT, UC2_VSYNC, UC2_WINDOW_MODE, UC2_SSAO, UC2_BLOOM, UC2_BLOOD, UC2_TEXTURE_PACKS, UC2_TEXTURE_DUMP. The launcher's own paths can be overridden with UC2_RUN, UC2_XRECOMP, UC2_INCLUDE, UC2_RUNTIME_LIB, UC2_DATA_DIR, UC2_GAME_LIB and UC2_RUN_LOG.

Building from source

There are four pieces: the recompiler (xrecomp, Rust), the runtime (libuc2rt.so and uc2-run, C++20), the launcher (Qt 6 / QML), and the game library, which is generated from your disc and never committed.

Dependencies
Version
Rust (cargo)stable, edition 2024
clang18 or newer (the lifted C is written for clang; gcc also works for the game)
CMake3.24+ (and Ninja, recommended)
SDL3
Vulkanheaders and loader (1.3)
shaderc(pkg-config shaderc)
Qt6.5+ (Core, Network, Quick, QuickControls2, Test), for the launcher
Python 3for the build scripts and the lobby server

On Arch-based systems, for example:

sudo pacman -S rust clang cmake ninja sdl3 vulkan-headers vulkan-icd-loader shaderc qt6-base qt6-declarative python
1. The recompiler
cargo build --release -p xrecomp
cargo test --release -p xrecomp      # optional
2. The runtime
cmake -S runtime -B build/runtime -G Ninja -DCMAKE_BUILD_TYPE=Release \
      -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
cmake --build build/runtime --target uc2rt uc2-run

With -DUC2_BUILD_TESTS=ON (the default; it fetches Catch2) the unit tests build too; run them with ctest --test-dir build/runtime.

3. The game, from your disc
scripts/build-game.sh /path/to/your/UC2.iso ~/uc2-game

This builds the runtime and recompiler if needed, lifts the game's code from the disc into ~/uc2-game/gen (C source), compiles it and links ~/uc2-game/uc2_game.so. The generated C is derived from the game and must not be committed or shared.

Then run it:

build/runtime/uc2-run --iso /path/to/your/UC2.iso --game ~/uc2-game/uc2_game.so
4. The launcher
cmake -S launcher -B build/launcher -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build/launcher
QT_QPA_PLATFORM=offscreen ctest --test-dir build/launcher   # tests
5. The AppImage

The release AppImage is built inside an Ubuntu 22.04 container so it runs on older distributions (needs podman; the first build downloads about 2 GB of toolchain):

packaging/build-appimage-container.sh          # → out/UC2-Native-x86_64.AppImage
packaging/check-no-game-data.sh out/UC2-Native-x86_64.AppImage
packaging/test-appimage-jammy.sh out/UC2-Native-x86_64.AppImage

packaging/build-appimage.sh builds one with your host's libraries instead (it then only runs on distributions as new as yours). check-no-game-data.sh fails if anything from a disc ended up in the AppImage; check-glibc.sh fails if anything needs a newer glibc than 2.35.

How it works

 your disc image ──► xrecomp ──► C source ──► clang/gcc ──► uc2_game.so
                     (lift)       (gen/)                         │
                                                                 ▼
                                   uc2-run ──► libuc2rt.so  (Xbox kernel, GPU,
                                                             audio, network,
                                                             input, files)
  • Lifting (xrecomp). The recompiler reads the Xbox executable (XBE) from the disc, finds every function (following calls, jump tables and pointers, plus extra entry points listed in the profile or found at run time), decodes each x86 instruction (integer, x87 floating point, MMX, SSE) and writes equivalent C. Each guest function becomes a C function; registers and flags become variables; guest memory accesses go through the runtime's memory. A differential test suite (crates/difftest) runs thousands of instruction snippets both natively on your CPU (as 32-bit code) and through the lifter, and compares every register, flag and byte of memory.
  • Memory. Guest RAM is 64 MiB of shared memory, mapped so guest virtual pages alias physical pages exactly as on the Xbox.
  • Threads. Guest threads are real Linux threads, but only one runs at a time: they pass a single CPU token and a timer preempts the running one, matching the Xbox's single core. This keeps the game's own locking (IRQL raises, cli) correct without changing its code.
  • Kernel. The runtime implements the Xbox kernel exports the game imports: memory, threads, waits, DPCs, files (the disc as a read-only drive, saves on an emulated hard disk), crypto (SHA-1, HMAC, RC4, DES/3DES, Diffie-Hellman), time and settings.
  • Graphics. The game's Direct3D 8 talks to the Xbox's NV2A GPU through push buffers. The runtime decodes them and renders with Vulkan: the NV2A's vertex programs and register combiners become SPIR-V shaders (compiled with shaderc and cached), and textures are converted and cached. The modern effects (upscaling, AA, SSAO, bloom) run as post-processing passes.
  • Audio. The Xbox's audio processor (APU) voices are mixed by the runtime and played through SDL 3.
  • HLE hooks. A few game functions are replaced or wrapped at known addresses (listed in the profile) to add features: widescreen projection, the FOV slider, skipping boot waits, unlocking the Bonus Pack, cheats.
  • Network. An emulated nForce Ethernet card at the Xbox's address; its frames go to the lobby relay (see Online play).

The design and the decision log are in docs/superpowers/specs and docs/notes (one note per subsystem: D3D/NV2A, audio, exceptions, performance, widescreen, anti-aliasing, ambient occlusion, bloom, texture packs, the Bonus Pack, the launcher's game build, online play).

Repository layout

PathWhat
crates/xrecompthe static recompiler (XBE → C)
crates/xbe, crates/xdvdfsXbox executable and Xbox disc filesystem readers
crates/uc2fs-ffiC interface to the disc readers, used by the runtime
crates/difftestdifferential tests of the lifted instruction semantics
runtime/libuc2rt.so and uc2-run: kernel, CPU/threads, GPU (Vulkan), audio, input, network, HLE hooks; runtime/tests
launcher/the Qt 6 / QML launcher; launcher/tests
profiles/per-game-version profiles: code sections, extra entry point