Hello! I am quite new to game development and have just encountered my first big issue with performance.
I am basically trying to create a crowd of npcs that spawn on one end of the map and try to reach the other end. I want to emulate running through a crowd that is walking in the opposite direction the player is. All while being chased by one big enemy.
I read up on ways to improve performance and this currently how I have set it up:
- I am using object pooling, all the npcs that I want in the scene are instantiated beforehand and added to the navigation region. Once they reach their destination, they are warped back to their spawn location. So they are being reused.
- The npcs have their collision and process turned off automatically, and only activate once they start moving (one by one) according to a timer I have set up in the main scene.
The issues I have are:
- Whenever there is a simple collision between **ANY **character bodies, there is a big loss in frames.
- There is also a loss in frames whenever I get closer to the spawn location.
I would really appreciate any feedback from someone that has had similar problems when using a large volume of 3d character bodies.