PTCV

I wanted a game server of my own. I ended up building everything around it

A private Ultima Online server that grew into an assistant written from scratch, a protocol proxy, a 3D client, a launcher and its own hosting.

contextUltima Online is an online game from 1997 that still has live servers. A privately run server is called a shard. You don't need to know the game to follow this.

how one thing led to the next
  1. 1

    The shard

    I have always liked Ultima Online and always wanted a server of my own. So I made one: a world shaped to my taste, with everything I ever wished a server had, for me alone to play.

  2. 2

    The assistant

    Players use assistant programs to automate the game. Instead of using the ones that exist, I decided to write a new one from scratch.

  3. 3

    The protocol

    The assistant needed to understand the game's traffic, and I wanted to see the packets go by and learn from them. So I built a proxy that sits between client and server, decodes every packet and keeps a model of the world in memory. The protocol is binary, the server-to-client traffic is Huffman-compressed, and the spec only lives in old forums and other people's code.

    clientproxy · Rustserveridlengthpayload · huffmanworld statemobilesitemsjournaltargetsplayer
    illustration, not a screenshot
  4. 4

    The client

    The protocol code was good enough to reuse. First it fed improvements to the regular client. Then I started a 3D client for this 2D game on top of the same code.

  5. 5

    The launcher

    With that many modified pieces, installing by hand stopped being reasonable. The launcher delivers all of it: it checks 3.2 GB of files against a manifest, downloads only what differs and verifies each file before it replaces the old one.

    manifest · sha2563,2 GB✓ matches✓ matches.part → sha256 → swap✓ matches✓ matches
    illustration, not a screenshot
  6. 6

    The hosting

    Production and a separate test world both run on a Raspberry Pi 5 at home. A 1 GB virtual machine at Oracle is the public entrance and bridges to the Pi over WireGuard, so my home IP address is never exposed.

architecture
launcher · clientmy modifications
Oracle VMpublic entrance · 1 GB
WireGuardtunnel
Raspberry Pi 5shard · production and test

Protocol logic lives in a pure Rust crate with no async runtime and no UI, which is what let the assistant, the client work and the 3D client share it. Scripts never touch the socket. They read the world state and ask for actions, and the proxy decides how those become packets.

decisions

What I chose, and what it cost

My changes are injected plugins, and the upstream projects stay almost untouched

The server (ModernUO) and the client (ClassicUO) are open-source projects that keep moving. Everything of mine is a DLL that each of them loads at startup, with as few patches to their core as I could get away with, each one documented. That way I can pull their updates and keep my modifications. The cost: when something needs a hook that does not exist, I have to design the smallest possible seam instead of just editing the code.

Protocol code in its own crates

It started as a part of the assistant. Keeping it separate is why three other pieces could be built on it.

API compatible with the community's most used assistant

Existing scripts run unchanged. The cost: inheriting names and quirks of an API I did not design.

Production and test are separate worlds

The test world starts as a copy of production and can be reset from it at any time, so I can break things without losing my own save. The cost: two servers on one small machine.

A file only replaces the old one after its hash matches

The launcher downloads to a temporary file, checks SHA-256 and only then swaps. An interrupted download never leaves a broken install.