2024 H1 Physics Recap

Hi Creators,

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 :dash:)
  • StepContacts Times: Improved StepContacts by about 0.1ms per frame in the Racing Template (we really want to make collisions as performant as possible :pinched_fingers:)
  • Mesh Allocation Merging: Reduced memory footprint by merging allocations (this frees up memory for other things :grin:)
  • Rendering/Physics Interop: Implemented better synchronization between rendering and physics for part CFrame updates (makes games with lots of moving parts faster :mechanical_leg:)
  • Shapecast Narrowphase: Reduced allocations to streamline the narrowphase collision detection (makes shapecast detections more performant :boom:)
  • Part Sleep Transitions: Achieved about a 30-40% improvement in part sleep transition performance (parts fall asleep for cheaper :zzz:)
  • 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 :100:)
  • Triangle Meshes: Reduced allocations to improve memory efficiency (helping free up memory everywhere we can :heavy_dollar_sign:)
  • Collision Detection and Solver Multi-threading: Optimized for better performance in multi-threaded environments (better parallelism leads to better performance :chains:)

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!

Best,
The Physics Team

200 Likes

This topic was automatically opened after 9 minutes.

Love to see more physics work, keep it up!

16 Likes

This is awesome! I was just talking to my brother about this and now it’s here.

10 Likes

physics one of the most things that needs updates in roblox after the moderation :slightly_smiling_face:
keep it going !

13 Likes

Excited for what’s more too come!

7 Likes

very cool, i’d be excited to see a physics engine rework so that having a large number of simulated objects doesn’t reduce simulation performance :smile::+1:t2:

10 Likes

In my opinion step physics is the best update of 2024. Close match with SurfaceAppearance coloring though :sweat_smile:.

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.

Overall thanks for all the great physics updates!

9 Likes

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 :smile:

10 Likes

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

9 Likes

It’s referring to that optimization :slight_smile:

10 Likes

I like the improvements, but when are we gonna get soft body physics :smiling_face_with_tear:

9 Likes

margins for shapecasts please i’ll do anything

13 Likes

These are many changes that have been released over the past 6 months.

When was the timeframe this started happening? Can you xpost to #bug-reports:engine-bugs with a repro?

8 Likes

Can the StepPhysics buttons NOT be inbetween Play and Stop, please?

image

:thinking:

Is my number one reason I turned the Beta Feature off.

 

Also, is “Raycast” by itself part of Physics?

8 Likes

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!!!

7 Likes

We’re open to raising this. How big were the areas you were checking?

3 Likes

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.

6 Likes

Any plans for fixing floating point rendering issue?

6 Likes

it started like this week, i noticed that this weird behavior just started happening

2 Likes