We are excited to share some of the work our Physics team has done in the first half of 2024. It’s been a productive period with significant advancements in performance optimizations, fixes, and new features that will enhance your development experience. Here’s a more detailed recap:
Optimizations
We have focused on improving performance and efficiency across various aspects of the physics engine:
Mesh Collision Detection: Optimized internal mesh BVH, resulting in approximately 3x faster decoding process (makes collision detection between complex meshes a lot faster )
StepContacts Times: Improved StepContacts by about 0.1ms per frame in the Racing Template (we really want to make collisions as performant as possible )
Mesh Allocation Merging: Reduced memory footprint by merging allocations (this frees up memory for other things )
Rendering/Physics Interop: Implemented better synchronization between rendering and physics for part CFrame updates (makes games with lots of moving parts faster )
Shapecast Narrowphase: Reduced allocations to streamline the narrowphase collision detection (makes shapecast detections more performant )
Part Sleep Transitions: Achieved about a 30-40% improvement in part sleep transition performance (parts fall asleep for cheaper )
Block Parts: Reduced the in-memory size by about 168 bytes and made setting the size approximately 24% faster (same functionality, less memory, much faster )
Triangle Meshes: Reduced allocations to improve memory efficiency (helping free up memory everywhere we can )
Collision Detection and Solver Multi-threading: Optimized for better performance in multi-threaded environments (better parallelism leads to better performance )
Fixes
We have addressed several bugs to improve stability and reliability:
Shapecasts on 64-bit Arm: Fixed a bug where shapecasts could miss parts
GetPartsInBox and GetPartsInRadius: Added clamps to prevent hangs
Nested Parts in Models: Fixed an issue where a model with nested parts would get entirely deleted if one part fell through the kill plane
Assembly Velocity from Script: Improved reliability when setting assembly linear velocity and assembly angular velocity from a script
LDL Hangs: Reduced hangs caused by physics stalling on very large mechanisms
Attachments and Constraints in WorldModel: Now you can select Attachments and Constraints which are in a WorldModel outside the workspace and see their visualization
Features
We introduced several new features to enhance your development capabilities:
Physics Pause: Added the ability to pause physics without disabling rendering
Step Forward Physics: Added the ability to step the simulation forward by 1/60th of a second (60Hz) while Physics is paused
StepPhysics API: Added the ability to advance the world, or part of it, forward by a specified amount of time
Aerodynamic Force Model: Introduced a more realistic aerodynamic force model in the April Studio Beta update
FluidFidelity Property: Added to the GeometryService and AssetService APIs, allowing creators to specify this property when importing meshes or performing CSG operations (also part of the April Studio Beta update)
We are committed to providing the best tools and features to help you create amazing experiences on Roblox. Thank you for your continued support and feedback. Stay tuned for more updates in the coming months!
In my opinion step physics is the best update of 2024. Close match with SurfaceAppearance coloring though .
The optimizations are nice but as usual with those kinds of updates it’s hard to see a noticeable impact. I trust the numbers you’re putting out though.
This bit is really interesting – I recall in the release notes that redundant vertices were removed, since you can infer a cuboid’s size with three vertices. Is it referring to this optimization, or something else that was added further down the line? Just curious about the internals
is this physics update out? if it is, i think it broke my game’s soccer minigame where you hit a soccer ball with a car, because the car is now just glitching over the soccer ball, i know i didnt do anything because its doing this in previous versions that it worked in
This change actually affected some stuff i was working on. It did nothing other than force me to subdivide 15k limit into multiple queries.
But other than that, those are some pretty nice optimizations overall.
I’m also not entirely sure about multi threaded collision detection and the multi threaded solver. Physics are still pretty slow to do if you do the them en masse. What am i missing here? Aerodyamic stuff still seems to annihilate performance also.
Also, any plans for soft body physics? I believe there is a real demand for those with pretty good and real use cases. Im pretty sure official engine support for soft body physics would absolutely annihilate whatever performance metrics things like SmartBone could get (i hope).
Also make raycasting faster pls!!! My 4k resolution raycast renders take too long!!!
The system that used queries past 15k was a custom part lod system that i originally built for a map around 200k by 200k studs in size. My original setup was to just divide the entire map into different octrees of around 4-6 subdivisions however the new 15k limit would always occur on the first and second sub div of the octree. The initial map divisions for the octrees were around 75k-25k studs in size (as i would divide that 200k stud area by around 4-6 actors per axis).
Right now the 15k limit is forcing me to already run way more divisions (both using more actors AND subdividing the actor space) than i would like.