What we've built for The Long Drive
Work on the game's beta branch, contributed to TLD RevaMP, Normal99's multiplayer and performance mod. Every number below was measured in the game, and every change links to its code.
Timeline
- Bat fix merged into RevaMP (pull request #2), released in 0.68.2 the same night.
- Rabbit fix added, released in 0.69.0 eight minutes later.
- In-game mod browser added to RevaMP's development branch; it reaches players with the next release.
In-game mod browser
on RevaMP's development branch15 files · +822 −17 lines
A Mods screen in the game's settings (Settings → Revamp → Mods): browse, install, update and remove mods without leaving the game.
What it does
- Lists the mods in RevaMP's catalog with author, size, description, source link and the version you have.
- Install and Update download the mod's GitHub release and put it in place; the game asks for one restart.
- Remove sets the mod's file aside (renamed, not deleted) for the next start.
- Only mods on the approved list that ships with your RevaMP version can be installed, the same list RevaMP already uses when a host sends mods to players joining a game. Anything else is listed but can't be installed.
- Nothing is downloaded unless the Mods screen is open.
Tested
| Check | Result |
|---|---|
| Catalog loads in the game | every catalog mod listed, with its state |
| Remove an installed mod | file set aside as .removed |
| Install it again from its GitHub release | installed, byte-for-byte the approved file |
| Install a mod that isn't approved | refused before downloading |
| A different file passed off as an approved mod | refused |
| Automated checks (no game needed) | 52 of 52 pass, run on every pull request |
Rabbits no longer slow the game down
in RevaMP 0.69.01 file · +57 lines
The problem
The game freezes rabbits that are 200–300 m from the player, but their walking and jumping code kept pushing them every frame anyway. Each push wrote a warning to the log, for every frozen rabbit, every frame: 13,800–16,500 lines every 20 seconds. 84% came from walking, 16% from jumping.
Measured with about six rabbits in range
| Before | After | |
|---|---|---|
| Warning lines per 20 s | 13,800–16,500 | 0 |
| Time spent per second | 144 ms | 0.8 ms |
| Memory churn | 6 MB/s | 0 |
The fix
While a rabbit is frozen, its walk and jump are skipped. Turning, sounds and behaviour are unchanged, and a rabbit that wakes up walks on from where it is.
Bats: 1.6 million log lines gone
in RevaMP 0.68.21 file · +35 lines
The problem
In a two-hour session, the game's log grew to about 170 MB: 1.6 million identical physics warnings, 99.8% of the whole log, between 160 and 1,850 every second depending on frame rate.
How it was found
Unity writes this warning without saying where it comes from. So every piece of code in the game and the loaded mods that sets an object's speed was wrapped with a counter. Every single warning came from one place: the bats the game places at some locations, which keep steering while frozen. It happens without RevaMP too (108 warnings in 15 seconds next to one bat), so it's a bug in the game itself.
Measured
| Run (new world, 15 s on foot, then eight 400 m jumps) | Frozen bat updates skipped | Warnings |
|---|---|---|
| Without the fix | – | 108 in 15 s |
| With the fix, run 1 | 864 | 0 |
| With the fix, run 2 | 4,687 | 0 |
The fix
While a bat is frozen, its steering is skipped. Its sounds and choice of where to fly are unchanged, and an unfrozen bat flies exactly as before.
Get it
The bat and rabbit fixes are in TLD RevaMP 0.69.0 and later, for the game's beta branch (Steam → The Long Drive → Properties → Betas → beta). The mod browser comes with the next RevaMP release.