- Home /
Improve Physics Performance For large Number of Objects
Hi Im in the process of porting over the beginnings of a game I've been developing in XNA but im running into a problem.
In my XNA game I was able to have many thousand bullet objects in my game at one time with little performance issues until I had more objects to collide with [infinite bullets but nothing to collide with should mean no processing time required] however in unity I'm only able to get a few hundred rigid bodys at max before the FPS drops below acceptable levels. Even if they are all set on a physics layer that cant interact with anything [so there should be no performance hit bar the drawing?]
EDIT[Changed to ray-casts and seams to be working well so ignore this section] So is there a "lite" version of the ridged body that will improve performance for a large number of objects or will I have to switch the bullets from ridged body's to a ray-cast script that test from the bullets point back to its previous point each update
Also does unity use any form of spacial partitioning [octtree] to improve performance in large scenes [bullets should not be tested for collision against something that's many miles away]. If not is there a sample round that implements it.
I'd bet PhysX uses octrees internally, but I am not all sure.
I would also like to point out that you cannot develop for XNA with Unity.
Notice the "was" Im porting it over (reasonably easy since unity reads c#) as unity is much faster to work with.
Answer by Meltdown · Mar 24, 2011 at 09:54 AM
Try decreasing the 'Solver Iteration Count' in your projects physics properties.
Go to Edit -> Project Settings -> Physics
And change the value in there.
Since changing the bullets to raycasts this doesn't seam to impart any performance change. But thanks for the suggestion as I may have to look into this again
Ins$$anonymous$$d of using rigidbodies try creating rectangular cubes on the fly and attaching a box collider to them.
Your answer
Follow this Question
Related Questions
Add 2d rigidbodies to moving objects to increase performance or not? 1 Answer
Mobile physics optimizations and Mesh Colliders 1 Answer
Physics calculates collisions between disabled layers 0 Answers
Character Controller's performance for massive groups 0 Answers
Understanding Raycast How Actually works in Unity [As Algorithm] 2 Answers