Data Center Mods

Two mods for a Unity build with no managed code

Data Center is a Steam game about running a data centre: racks, cabling, customers and service requests. The game ships as an IL2CPP Unity build with HDRP visuals, so the usual modding route is closed. Everything goes through MelonLoader and Harmony, and a lot of it goes through raw memory-layout tricks instead.

  • RealCustomers (v1.2.3) — replaces the game's 34 fictional customers with real company names and logos.
  • RackColors (v1.0.2) — dark chassis for servers and network gear, with the device's type colour as a trim accent.

Swapping in 34 companies

The first version patched the game's asset files directly. It worked, but it broke on every game update, and Steam's verify-files feature undid it, so I moved to a mod. The asset-patching method is still written up as a fallback.

Most of the mod's difficulty was in deciding what IL2CPP would let me touch. Harmony can patch real static methods, but it can't patch the generated accessors for fields like customer name and logo. Writing the field directly on the scriptable object works fine. Packet colours are baked inside a Burst-compiled system, where a managed patch never fires, so the mod writes the ECS component data itself through non-generic calls, because generic accessors may not exist under AOT compilation.

A trap that cost real time: writing the gameplay colour field changed nothing on screen. The renderer reads a different HDRP material property, so the colour looked like ECS was failing when it wasn't.

App icons were the worst part. For a long time I assumed each app mapped to one icon. The game actually assigns every customer's app a random logo slot per save, so my first version was wrong for every save. I only found it by dumping the assignments. I had also been told to leave one slot alone because it looked like a UI button, and it turned out to be a real app logo. Every wrong assumption in this project was one I hadn't measured.

Packet recolouring was another lesson. It rescanned every live packet on every frame, which was the mod's main cost on big saves. Packets are transient, so they don't need correcting sixty times a second. Throttling it to about 12 times a second made a new packet wear the stock colour for under 80 milliseconds, which nobody can see.

Grey servers with a coloured accent

Stock servers are solid blue, green, purple or yellow boxes. I wanted them to look like real hardware: a grey or black body, with the type colour showing only as an accent. The game already has a grey brushed-aluminium material that its switches use, so the mod just reassigns which material each part points at. It creates no new materials at all. The accent I settled on is the thin trim around the screens and vents, which looked the best of the options.

  • Never edit a shared material. The coloured aluminium materials are also used on network modules and carts, so editing one would repaint gear all over the building.
  • Never recolour the prefab. Clones of an already-grey prefab look finished, so the mod skipped them. The hotkey did nothing visible. The fix was to touch only scene instances.
  • Don't scan every frame. Polling the object list every quarter second caused visible hitching on large saves. The mod now hooks the devices' start methods and keeps a sweep only as a safety net.
  • Debounce the hotkeys. The input system fires once per key repeat, so one press cycled the accent colour several times and looked like the key was dead.

Probe before building

The rule that saved the most time was to dump the live objects before writing any code that depends on them. Every time I reasoned ahead of the data in this project, I was wrong, six times by my count. Dumping live objects settled it every time.

Strip the probe code before every release. One leftover diagnostic class in an early version was calling a method that no longer existed, which spammed errors for a user until a point release removed it.

Two environment traps to know about. The Il2CppAssemblyFixer is mandatory for any mod in this game, because without it every mod dies on startup. And the first launch after a game update loads no mods at all. The second launch works, so the README tells people to launch twice after an update.

Shipped under MIT

Both mods are published on GitHub under the MIT licence. Game updates can break anything, so each release gets re-checked against the current build, and the probe files stay in the repo for that purpose.

← back to projects