175 Commits over 120 Days - 0.06cph!
Fix video recorder crash when vulkan video fails to initialize on AMD cards
Properly cleanup resources if video or audio context creation fails at any point.
Revert "Mark as Dirty if physics body transform did change"
This reverts commit e493682a3343f8eed75fd50e7b437505915e64fd.
Account for more floating point imprecissions
Further, reduce goal overshooting for nav agents
Optimize crowd simulation, should be twice as fast
This mitigates the performance loss caused by enabling Collision Avoidance & Separation
Reformat Detour/Recast C# files
Mark as Dirty if physics body transform did change
Early return in PhysicsBody.Move if transform didn't change
Fix agent acceleration oscillating when reaching goal
Add Rotation.AlmostEqual
Add Transform.AlmostEqual
Only mark physics body as dirty if it actually moves
Fixes issue where navmesh areas would be rebuild unnecessarily
Accept Context Menu Event for feature tabs. Add some more validation to clipboard JSON
Fixes sbox-issues/issues/7867
Enable nav agent avoidance and separation
No idea if they have always been off or if i disabled them by accident at some point.
Get rid of float/double.Epsilon usage use more sane defaults
10^-4 for singles
10^-6 for doubles
Refactor some navmesh code, allows for less agressive locking
Spaces -> Tabs
Add some locks since this can be accessed by multiple threads
Get rid of unused ChunkyTrimesh recast code
Update recast from Facepunch/recastnavigation
Untangle navmesh threading, significantly reduces initial navmesh generation time.
Fix floating point precission issues in recast pathing code
see recastnavigation/recastnavigation#515 & recastnavigation/recastnavigation#735
NavMesh only allocate debug draw buffers if we actually want to draw
Disable Navmesh generation on prefab scenes
Don't recreate Inspector widget if the object is already inspected
Fixes sbox-issues/issues/7882
https://files.facepunch.com/lolleko/2025/March/17_09-35-SvelteMeerkat.mp4
Add 99.9 percentile to benchmark data collection to diagnose largest lag spikes
Also P5 and P95 while we are at it.
Fix Navmesh.DrawInEditor spawning 500 generation threads at the same time
Use Environment.ProcessorCount instead of ThreadPool.GetMaxThreads
We are tracking frame time not FPS so we want to use P99 not P1
Hookup GCPause performance stat for benchmarks
Calculate P95, P1 and Stuttering metrics for our benchmark samples
Run deathmatch benchmark after regular benchmark (#1850)
https://files.facepunch.com/lolleko/2025/March/13_20-16-AdvancedOrangutan.mp4
Bump default avoidance for nav agents
Small optimizations in GameObject.Clone
Preallocate some containers
Slightly reduce reflection usage
Small optimization in Components.GetAll
Reduces allocations/garbage by getting rid of recursive lazy evaluation (yield).
Set transform to identity/zero during ConvertToPrefab serialization, restore instance transform after serialization
Closes sbox-issues/issues/7840
Fix GameSettingsModal incorrectly showing some properties as bool
Improve error handling for navmesh queries
Vectorize and cleanup some things in BBox math
Obsolete `BBox.GetVolume` we already have `BBox.Volume` (property)
Obsolete `Sphere.GetVolume`, add `Sphere.Volume` as replacement
Add static variant of Vector3.Clamp
Add static variant of Vector3.Abs
Support non uniform scale in BBox.Transform
Add back support for H.265 video encoding. Use HW accelerated Vulkan Video if available.
Encoding H.264 and H.265/HEVC now uses Vulkan video and the underlying hardware accelerators if supported.
If Vulkan video is not supported, both H.264 & H.265 will fallback to openh264.
This mean the support for H.265 encoding is limited to modern GPUs.
Update FFmpeg again, I forgot webp codecs & muxers in the last build
Custom FFmpeg build: Reduces FFmpeg binary size from 120mb to 20mb
Update ffmpeg 6.0 -> 7.1 (#1842)
Navigation Links (#1833)
Allows to place and edit nav links.
Links are considered by pathing and agents will be able to traverse them.
Link traversal is customizable via code:
- Links can be inherited to customize behavior.
- Agents have an delegate that is invoked when they start/stop traversing a link.
Detailed Instructions: https://sbox.game/dev/doc/navigation/navmesh-links/
https://files.facepunch.com/lolleko/2025/March/05_17-11-MadCrayfish.mp4
https://files.facepunch.com/lolleko/2025/March/05_17-14-CraftyOropendola.mp4
Remove additional stack trace in callback batch completly, performance hit is too big unfortunately
Also caused weird NREs in some cases
Only assert `Calling awake on XXX but active scene is YYY` in game/during play
6cec910 has been resolved and the assert now only fails for for false-positives/non-issues in editor, which is annoying.
Only enrich CallbackBatch.Execute StackTrace in Editor & Debug builds, as the extra stack trace has a performance impact
Fix prefab duplication when dragging prefab into the scene tree widget
Enrich CallbackBatch.Execute Exceptions with an additional stack trace to improve debuggability
Before
https://files.facepunch.com/lolleko/2025/March/05_09-08-DeadCommabutterfly.png
After
https://files.facepunch.com/lolleko/2025/March/05_09-08-ElegantEwe.png
EditorHandleAttribute show base sprite for inherited types
SBOX-2FDH: Fix NRE when clicking on a compile diagnostic with invalid spans that are not mapped to a file
SBOX-2Z9F: Add missing `SceneEditorSession.Scope()` / `Scene.Push()` calls to editor actions that modify the scene
Should get rid or at least reduce the amount of `OnAwake on X on (Object) failed from Create: Assert: AreEqual Calling awake on X on (Object) but active scene is...` errors
Fix navmesh rasterizer skipping triangles that only touch a cell