I'm looking to maximize the number of rigid bodies in a small simulation I'm making. However, I'm encountering trouble when too many physics objects collide : Love2D just crashes
Is there any way to do anything about this without doing object pooling ? (I really want to be able to simulate all of these objects.)
Maybe there is something terribly wrong with my code, I'm still new to Love after all.
Steps to reproduce my issue:
- Download my .love and run it
- Spawn around 900 balls with the down arrow key or by pressing q. There is a counter in the top right of the window.
- Press g to activate gravity. Sometimes you need to nudge some of the balls by spawning new balls as they tend to go to sleep.
- Watch the game crash as all the balls fall down
I've included a minimal .love file. I hope you can check the code out.
Specs : Intel integrated graphics + i5-7200U CPU @ 2.50GHz
OS : Tested on windows and linux (debian), same results --> crash
Love version : tested on 11.3