So I am making a prototype of a game-concept that i came up with, but I seem to have run into a problem.
I create 10 000 small dynamic bodies and random them out on the screen. When not moving anything this runs at 60 fps on my computer. It also run around 60 fps when I move all of them together in the same direction(so that they don't collide). However if I move all of them into the same point the frame-drop is huge(which of course is understandable). The thing is that I dont need them to collide with each other, nor do I need that collision to be registered. I use filters so that they don't collide with each other, which increases performance some - but since i box2d still seems to be doing some kind of processing when they overlap it starts to lag like hell when they are all drawn together.
So my question is really is there someway to make it so that box2d does not even register this collision, so that it does not process it what so ever? Because as far as I can tell 10 000 dynamic bodies seems to run fine together, moving and colliding with larger bodies - as long as they do not group up because that is when it all breaks.
I am using libgdx and their wrapper for box2d, but I thought it would be better to post here because it is more of a general question.
This is my first post in these forums so I hope I did everything right and didn't break any rules:). If u want a look at the code that is fine, but i didn't post it because I dont really see this as a coding issue but more of feature issue/question.
I create 10 000 small dynamic bodies and random them out on the screen. When not moving anything this runs at 60 fps on my computer. It also run around 60 fps when I move all of them together in the same direction(so that they don't collide). However if I move all of them into the same point the frame-drop is huge(which of course is understandable). The thing is that I dont need them to collide with each other, nor do I need that collision to be registered. I use filters so that they don't collide with each other, which increases performance some - but since i box2d still seems to be doing some kind of processing when they overlap it starts to lag like hell when they are all drawn together.
So my question is really is there someway to make it so that box2d does not even register this collision, so that it does not process it what so ever? Because as far as I can tell 10 000 dynamic bodies seems to run fine together, moving and colliding with larger bodies - as long as they do not group up because that is when it all breaks.
I am using libgdx and their wrapper for box2d, but I thought it would be better to post here because it is more of a general question.
This is my first post in these forums so I hope I did everything right and didn't break any rules:). If u want a look at the code that is fine, but i didn't post it because I dont really see this as a coding issue but more of feature issue/question.