How many Rigidbodies can Unity support?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

I enjoyed this but have no idea what he is talking about, which made me think. How many people on earth even know what he’s talking about and furthermore could put that information to use?

πŸ‘οΈŽ︎ 9 πŸ‘€οΈŽ︎ u/gonickryan πŸ“…οΈŽ︎ Dec 16 2017 πŸ—«︎ replies

Haven't even watched the video, but as a hobbyist Unity developer of a few years: not that many.

Edit: Just watched the video. Was about twice of what I expected. I guess using strictly cubes helps, or maybe my machine just sucks. Anyway, within one order of magnitude is good enough for me.

πŸ‘οΈŽ︎ 3 πŸ‘€οΈŽ︎ u/jiffyjuff πŸ“…οΈŽ︎ Dec 16 2017 πŸ—«︎ replies

What is that original video of the barrels falling? I remember watching it in elementary school a long ass time ago and it blowing my mind.

πŸ‘οΈŽ︎ 2 πŸ‘€οΈŽ︎ u/PeskyPeen420 πŸ“…οΈŽ︎ Dec 16 2017 πŸ—«︎ replies
Captions
Before I got into game development I used to watch crisis physics tests in these wonderful videos people would spend hours carefully placing thousands of barrels Only to knock them over and blow them up. That's just something oddly satisfying about watching crazy amounts of game objects colliding anyone Who's ever discovered the rigidbody component knows this I remember adding my first with your body to the test Cube and watching it fall as I marvelled at my creation. I thought the possibilities with this are endless But are they let's put unity to test and see just how many rigid bodies it can handle before slowing down I started by putting a few cubes in a simple scene with default settings one directional light Real-time shadows and 50 cubes each with a rigidbody a cube Collider and a mesh renderer to no surprise the scene ran smoothly But how smooth I went to the asset store and downloaded mini profiler with this I could track my framerate over time without running the heavy building unity profiler Also made sure to disable vsync under graphical settings, and I could now see the scene running at a glorious 160 frames per second with this in place it was time to add more cubes so I tried with 500 then 1500 Things were still running smoothly of course my framerate was dropping, but it was still around the 100 mark I began to feel like I could keep increasing this number infinitely the 3,000 cubes my framerate started falling below 30 But I couldn't stop there I increased the total amount of cubes to just over 6000 and the result was Well with an average FPS of 2 there was room for improvement So I started by increasing the fixed time step this value determines the amount of time between physics calculations So naturally if we increase it the rate of these calculations will be reduced and so unity will spend less time on physics each second this led to some very clear improvements just Increasing it from the default point o2 to 0.04 effectively tripled my frame rate Setting it to 0.06 we sold it in an average FPS of 14 and going all the way up to 0.1 Gave a reasonable average frame rate of 24 the problem with raising the fixed time step too much It's that you start to be able to see each physics update Which makes our collisions look laggy again a fixed time step of 0.1 Means 10 physics updates per second, which is definitely noticeable and on top of that. I was still seeing massive frame drops Next I turned to graphics quality if it would spend less time on graphics We might be able to allocate more time to physics so tune the render settings all the way down and disabled the scene light this Definitely helped, but it didn't make us big an impact as I was hoping if we look at the profiler. It's pretty clear Why actually? Rendering the scene only took up around 10 percent of the processing time so making the scene easier to render wouldn't make too much of a difference Finally I turned to the physics settings. I tried adjusting all the values, but nothing seemed to work except for when it turned on adaptive force Adaptive force is a special technique in physics that compensates for numerical errors when dealing with the stack of objects since we are stacking 6000 cubes on top of each other I think it applies here and just as predicted my average frame rate went from 24 to 33 and more importantly instead of dropping all the way down to 3 FPS when things got the most tough It will now stay above 16, but before we start pressing this setting there's something we have to take into consideration Look at these two simulations notice anything different Well adaptive force made everything run smoother it also slowed down the collapse of the building which in turn put less pressure on the processor But still better frame rates means more freedom so I decided to leave it on for now next I started adjusting settings on the rigid Bodies to see if this could make things more performant at ride with interpolation extrapolation Collision detection modes and different amounts of drag also created the spreadsheet to help track my results unfortunately no matter what I did it only seemed to make things worse and just as my Optimization mission seemed most hopeless I got an idea it wasn't genius in fact I don't know why I didn't think of it before What if we just built the game the unity editor itself comes with a bit of overhead running as a standalone might make things significantly? Better, and it did in fact it took my average FPS from 33 to almost 50 with this I could once again decrease the fixed time step turnoff adaptive voice and enjoy a close to smooth simulation of 6000 cubes with only a bit of started towards the very end But why stop there? I created a simple script that would take in a mesh and spawn a cube on each vertex This way I could create models in blender import them into unity and then watch the mayhem unfold this led to some pretty interesting results Finally I tried using the particle system to see if it could handle Cubes of course the unity particle system doesn't have support for inter collision, which definitely made it less exciting But it did run ten thousand cubes as smooth as butter And that marked the end of my journey I do however encourage you to try it out on your own of course the results are Going to depend completely on the hardware that you're using here's my bill to those of you interested It's a pretty standard setup apart from the fact that I used two CPUs of course however I did also run a few tests on some pretty standard gaming rigs and the frame rates were pretty similar That's pretty much it for this video. Thanks for watching, and I will see you in the next one Thanks all of the awesome patreon supporters who donated in November and especially. Thanks dude. Oh, man I mean arou C hands off tune cyber Kumiko Cabral Dan Evans John Perot guard Superman the great James P Thomas Wally Jason the Tito dark heaps Kirk, Chaisson Murphy Rob fern James Rogers Alex rickets key man Alice Oh March
Info
Channel: Brackeys
Views: 1,593,854
Rating: undefined out of 5
Keywords: brackeys, unity, unity3d, asset, assets, game, development, develop, games, programming, coding, C#, rigidbodies, stress test, max, cubes, objects, how, many, rigidbody, support, handle, physics, test, maximum, crash, break
Id: 8zo5a_QvJtk
Channel Id: undefined
Length: 5min 19sec (319 seconds)
Published: Sun Dec 03 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.