You are viewing a potentially older version of this package. View all versions.
TGO-SyncUpgrades-1.5.6 icon

SyncUpgrades

Syncs host upgrades with clients in REPO.

Date uploaded a year ago
Version 1.5.6
Download link TGO-SyncUpgrades-1.5.6.zip
Downloads 14745
Dependency string TGO-SyncUpgrades-1.5.6

README

Sync Upgrades

  • Only needed on the host!
  • Supports modded upgrades!
  • If any player consumes an upgrade, it will be synced to all other players.
  • If a player joins late, they will receive all the host upgrades.

What makes this different?

  • You may be familiar with SharedUpgrades or SyncHostUpgrades

  • This mod is a combination of both, and it is not buggy, not laggy, and not inefficient.

  • The code behind this mod only runs when a player consumes an upgrade, a player joins the game, or a level is loaded.

  • This is different behavior than the other mods, which run every frame to check for upgrades.

    • The before mentioned problem causes lag, fps drops, stutters, and other bugs.
  • It was programmed and designed properly.

What's the technical workflow?

  1. When a player consumes an upgrade, the server receives the upgrade event.
  2. If the player is the host, the server checks all clients and ensures they are on the same level as the host.
    • If they are not on the same level, the server sends the upgrade event for that player to all clients.
  3. If the player is not the host, then the server upgrades the host first, which triggers the upgrade event once again (2).

Modded Upgrades

Any problems?

  • Due to the non-standardized nature of consumable upgrades, there is no way to notify the appropriate handler when a player consumes a modded upgrade. When a player loads into the game, LateStart is called which fetches the upgrade values and updates the underlying properties. This means, that once a player has loaded into the game, only NON-modded consumable upgrades will change the underlying properties and henceforth be applied to your player.

What does all the mumbo jumbo mean?

  • When a player consumes an upgrade, it changes the appropriate underlying properties of the player.

    • Here are some examples of the underlying properties: PlayerAvatar.upgradeMapPlayerCount, PhysGrabber.grabStrength, PhysGrabber.throwStrength, PhysGrabber.grabRange
  • Inside the PunManager there are functions for UpdateThrowStrength, UpdateGrabStrength, UpdateGrabRange, etc.

  • When a player consumes an upgrade, it is possible to call PunManager.UpdateThrowStrength or similar, and these functions will update the underlying properties of the player, in this case PhysGrabber.throwStrength = newValue.

  • There are no such functions to call for modded upgrades

  • The only way to notify the modded upgrade is if the modded upgrade required this mod SyncUpgrades as a dependency.

  • The only time the underlying properties are updated are as follows

    • When a player consumes an upgrade (it makes an RPC call)
    • When a player is loaded into the level (LateStart is called which loads the underlying properties)
  • There are no built-in RPC calls for modded upgrades

How does this affect me?

  • Modded upgrades will not update during the current session if they are consumed after the level has loaded and players have spawned in.
  • Modded upgrades do not send event calls when a player consumes a modded upgrade.

What to do about it?

  • Consume all modded upgrades during the "Truck Lobby" phase.

HELP, when a non-host player consumes an upgrade, it doesn't sync to the host or anyone else!

CHANGELOG

2.2.6

  • Fixed small bug

2.2.4

  • Removed RPC and reduced network operations

2.1.6

  • Updated method patches for the latest beta version of REPO

2.1.5

  • For modded upgrades registered with REPOLib:
    • Added dynamic config options to disable modded upgrade synchronization
    • Fixed a small sync bug with modded upgrades

2.1.2

  • Added support for TumbleWings and CrouchRest (Beta)
  • Ensures backwards compatibility with previous versions of REPO (non Beta)
  • Fixed naming and description of config entries

2.0.7

  • [x] Fixed modded upgrade synchronization (now works 100% for REPOLib registered upgrades)
  • [x] Fixed client disconnect bug when duplicate networking operations are sent (removed duplicate networking)
  • Rewrote SyncManager & removed ALL instances of duplicate networking
  • Added ISyncRequest queue and queue processing for network operations
    • Operations are now execute per FixedUpdate instead of per iteration
  • Changed BepInEx version to 5.4.21
  • Migrated project settings to use NuGet packages for some dependencies
  • Added tons of logging to the debug builds (on GitHub)

1.9.2

  • Fixed accidental DOS on clients. Some reason the game calls "ChangeLevel" 17 trillion times when the game restarts after the arena

1.8.6

  • Updated dependencies and readme

1.8.4

  • Changed icon (made by actibytes)
  • Changed networking behavior to increase efficiency (any slander from Lordfirespeed is outdated)
  • Somehow forgot and have now added MapPlayerCount and ExtraJump upgrades

1.5.6

  • Initial release