Hi folks,
Maybe someone here can enlighten me on what I might be doing wrong!
I implemented my game logic using mono behaviors but ran into performance issues when trying to spawn several instances of an object and thus I am going down the ECS route as that is supposed to be more performant.
The main issue I am having at the moment is with physics. I am literally only creating 40 entities with a couple of primitive colliders (BoxColliders) and mass to enable gravity but the framerate drops down to 1 or 2 FPS when it is going past 30 entities.
I have no other systems or behaviors in this project. I am creating the entities in the same spot so they drop in a pile. I don’t even have a graphics object attach or linked to them, they are pure entities with just PhysicsCollider, PhysicsVelocity, PhysicsMass, PhysicsGravityFactor, LocalTransform.
This is what the original object looks like, I’m using it as a reference to build the colliders for the entity:
Performance drawing with the Physics debug helper:
I already tried reducing the Solving iteration count to little improvement.
The challenge is that I am expected to be able to pile up around 1k entities for my game.
I only need these basic physics interactions (like gravity and collider) without any other fancy thing on top, is the unity version maybe too complex hence counter performant for this scenario? Is there an alternative anyone could suggest that would so the job well but with simple features that I can try?
Thanks in advance for any pointers!