The Physics Update – Engine Overhaul and Modding

Gun Mechanics

The Physics Update Release

The dubious physics in Broke Protocol has needed some love for quite a while, and now while Unity is updating its core physics API, I thought it’d be a good time to overhaul BP’s physics implementation as well. Everything from ragdolls, to gun handling, and even water buoyancy has been adjusted and tweaked for more predictable and better quality reactivity. There are some other important details to get into so let’s cover those too:

Unified Physics Overhaul

Unified Physics

Until now, BP’s physics had been segmented among classes with different handling and reactions. Client-side destructibles lacked buoyancy, only entities were reactive to explosions, and drag was applied differently depending on type of object. But now, physics reactions are unified and handled the same across all classes of objects. Explosions, buoyancy, and drag is applied consistently and predictably across the board so players can plan and react better to any kind of explosive scenario.

Dismemberment and Ragdolls

Ragdolls War Server

I didn’t want to get too gory on this next feature, but I feel like it’s a requirement for all the War Modding that’s been developing lately (mostly by DwightSchrute and the talented WarForce team). Player models now have limb dismemberment after death. Body parts also have proper reactions as part of the unified physics system. Additionally, all entities can now continue to take damage after ‘death’ which for players results in additional dismemberment. And for vehicles, it can result in quicker or instantaneous explosions similar to the GTA series.

Weapon Updates

Weapon Attach Bones

Weapons also receive a big overhaul in both modding and mechanics. Recoil is much better animated with a more standard re-centering pattern seen in traditional shooters like Counter-Strike, Rainbow Six, and others. Equipables can also have their Attach Bone property modded. This is used for Muzzle restraints on animals now but can be repurposed for all kinds of modding ideas. The EquipablePoser in BPResources will, as always, help placement for this.

UI Elements Modding

Custom UI

UI has seen major updates and fixes, especially for mobile and interactivity. UIs are no longer set active by default. Modders must call the new SvPlayer.VisualTreeAssetClone() with the UI top level element name to produce a UI and SvPlayer.VisualElementRemove() to remove part of the subtree. Note that any time a UI is cloned, all button clicked events must be re-established. So it might be more beneficial to hide/show complex UIs rather that Removing and Cloning each time from scratch. Layer and input fixes across PC and mobile have been added as well. Rockford is making beautiful interfaces with this for their relaunch soon, so keep an eye out.

Interior Cloning and Other Improvements

Apartment Cloning

Tons of other fixes in the changelog below have been added, I’m especially thankful to TheUnishark for some of these improvements. A major update for interiors is the return of Cloning and Destroying entire interiors. Apartments now use dynamic interiors, and this will also be useful for missions in the future but it’s fully accessible in the SceneManager class for modding in the current API. PointLife might use this system again for their very cool Ganghouses implementation.

Here’s the full Physics Update changelog:

v1.39 Physics Update Changelog

Game Changes:

  • Interiors can be cloned and destroyed dynamically
  • New ragdoll dismemberment and physics
  • Gun mechanics and handling overhaul
  • Unified buoyancy, drag, and explosion physics for ragdolls destructibles, and entities
  • Allow negative health for extra entity destruction effects
  • Fixed MGFixed low firerate
  • Jump velocity is now moddable
  • Attach bone on Equipable items is now moddable
  • Moved credential checks to purely serverside (GameSource)
  • Player mantling physics fix
  • Footstep audio is synced to animation rates now
  • Cleaner InWater and Ground properties to replace Grounded property
  • Fixed embarking players into single seat furniture
  • Allow random spawns to be knocked out
  • Fixed some wheel physics sleep logic
  • Save entities CustomData in apartments (Thanks TheUnishark)
  • Improved godmode (Thanks TheUnishark)
  • Sprint is now toggled as long as an input button is held
  • Cleaned up Humanoid and Mob fbx files with cleaner animations and mesh fixes
  • Wait until grounded again before recovering from KnockedDown state
  • Many UI blocking/layer fixes for custom UIs on mobile and PC
  • Clone/Destroy Visual element nodes from UI API
  • Add account delete option from Register Menu
  • Rebuild vanilla BPA’s with latest updates
  • Can play destroy effect on any entity now
  • Added particle trails to Flare effects
  • Improved AI passenger behavior
  • Update to Unity 2023.3.0a18
  • API Changes:
  • Unity physics naming changes with related to velocity and drag (angular and linear)
  • ShEntity.Grounded replaced with InWater and Ground Properties
  • SceneManager.Instance.ClonePlace()
  • SceneManager.Instance.DestroyPlace()
  • SvPlayer.VisualTreeAssetClone()
  • SvPlayer.VisualElementRemove()
API Changes

See you!


Official Discord