All work

In testing

Composable speed modifiers

Replacing last-writer-wins movement speed with stackable, named modifiers, and moving a live codebase onto it without breaking anything.

Role
Design and implementation
Stack
Lua (GLua)
Context
Shared player systems on Diverge Networks
Status
In testing

The problem

Every system on the server set player speed directly. Carrying a lot of cash, being drunk and being tased all overwrote each other, and nothing restored the right value afterwards. The last system to write won.

The design

Code excerpt coming soon

The generated modifier API, the recompute step, and the legacy setter that makes gradual migration possible.

assets/excerpts/speed-modifiers.lua

Adapted from production code, lightly edited for readability.

Migrating without breaking anything

A codebase this size can’t switch over in one go. The engine’s old speed setters still work, but now set the base value and log a warning naming the call site. Plugins I haven’t converted yet keep behaving correctly, and the warnings show me exactly what’s left to migrate.

Video (optional) coming soon

A player slowed by carrying cash and by being drunk at the same time, then recovering from one without losing the other.

assets/projects/speed-modifiers/speed-stacking.mp4 (about 15 seconds)

Two effects stacking and unstacking.