Hotfix Patch v0.12.2 - Netcode hotfix for co-op play

Roguefort Playtest · published

Hey folks, a quick hotfix update for a netcode issue to address high latency when playing co-op (especially over long distance connections).

A big thanks to T-StalkerZero on Discord for reporting this and discussing it. Hopefully, it does the trick!

Patch notes:

- Movement commands now have an ID on them. When you're the joiner, walking doesn't happen on your machine — each step is a request sent to whoever's hosting, and you only move once they confirm it. If the confirmation is slow, your game assumes the step got lost and sends it again. Nothing on that repeat message said "this is the same step you already have", so the host did it twice and you walked an extra tile. Every command now carries an ID, and the host ignores one it has already carried out.

- The fix covers everything, not just walking. The ID was added to the shared plumbing all player commands go through, so opening chests, trading, and equipping gear are protected from the same double-action problem rather than just movement.

- The "step got lost" timer now adjusts to your actual connection. It was fixed at 1.5 seconds, chosen when both test windows were on the same computer and replies came back in a tenth of a second. Anyone further away than that tripped it constantly. It now measures the real round trip and waits proportionally.

- Reloading mid-game won't lock you up. A subtle risk with IDs is that a player who reloads starts numbering from scratch, and the host could mistake their fresh commands for old ones already done — freezing them in place. The IDs are built so a reloaded player is always recognised as new.

- The test rig that Tim has developed ofr this can now simulate distance. This bug survived the last round of fixes because both test windows run on one machine, so replies are effectively instant and the faulty code path never ran. There's now a setting that adds artificial delay, and the test suite runs a third player two seconds away from the host.

All that said, some slowness is unavoidable unfortunately. Every turn resolves on the host's machine, so a player on the other side of the world still pays travel time per step. This stops that from compounding into overshooting, but it doesn't remove the distance.

If I can raise some funds for the game after launch, I will look into a dedicated online infrastructure, so we can all adventure en masses in the Roguefort MMORPG :-)