SaarGaming-Trap_Sync icon

Trap Sync

Keeps crossbows and other timed traps in sync between players online. All players need the mod.

Last updated 5 hours ago
Total downloads 6
Total rating 0 
Categories Mods
Dependency string SaarGaming-Trap_Sync-0.6.1
Dependants 0 other packages depend on this package

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2305 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2305

README

Trap Sync

Keeps timed traps in sync between players in online games of Ultimate Chicken Horse.

Early state. This mod is in early development. Expect bugs, missing features and changes between versions. Feedback and bug reports are welcome.

In the unmodded game every player simulates traps locally. Crossbows drift apart because their firing rhythm depends on each player's frame rate, clients start their traps later than the host, and every stutter pushes a player's traps further behind. After half a minute the same crossbow can fire at visibly different moments on each screen.

What it does

  • Crossbows fire on a shared round clock instead of a local timer, so every shot happens at the same moment for everyone.
  • All other blocks that run on game time (saws, swinging axes, moving platforms, flipping spikes, fire hydrants, flamethrowers and so on) start at the same moment for everyone, and the game clock is kept on the shared round clock so they no longer drift after stutters.
  • Characters send their position more often (30 times per second by default), which reduces how delayed other players appear.

Requirements

Every player in the lobby needs this mod in the same version. The mod checks this automatically through the Steam lobby. If anyone is missing it, has a different version, or is not in the Steam lobby (for example a crossplay player), the mod stays completely passive and the game behaves as usual. It never sends anything to players without the mod.

How to check that it works

Set Overlay = true in BepInEx/config/mpb27.uch.trapsync.cfg. The overlay shows Netz-Sync: AKTIV once all players are verified, or the reason why not.

Configuration

File: BepInEx/config/mpb27.uch.trapsync.cfg

Setting Default Meaning
General.Enabled true Turns the whole mod on or off
Sync.RealtimeSchedule true Crossbows fire on the shared clock
Sync.NetworkSync true Clock synchronisation with the host
Sync.AlignStart true All players arm their traps at the same moment
Sync.ClockDiscipline true Keeps game time on the shared round clock
Sync.CatchUpMaxDeltaTime 0.3 Seconds of lost time recovered per frame after a stutter
Sync.CharacterSendRate 30 Character position updates per second, 0 = unchanged
Debug.Overlay false Status overlay
Debug.LogLevel Debug Amount of logging

Known limitations

  • Other players' characters are still delayed by the network latency while traps are now on time. On fast moving platforms another player can therefore appear slightly behind the platform.
  • Arrows fly locally on each machine. The moment of the shot is synchronised, individual collisions are not.
  • The hockey shooter benefits from the shared start and clock, but its own timer is not rescheduled yet.
  • Bees and anything that depends on player positions are not synchronised.
  • While a machine catches up after a long stutter, the whole game on that machine runs up to 5 % faster for a moment.
  • Overlay and log messages are in German.

Test status

The crossbow synchronisation was verified in a two-player online session. The shared start and the game clock coupling were verified on the host side. The higher character send rate has not been tested with two players yet.