• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Maximum amount of 2D fixtures?

Karlstens

Member
Happy New Year! :banana:

Is there a limit to the amount of fixtures that can be assigned when programming with physics enabled? I recall reading once that it's 2000, but not sure if that's true?

A sample of my code below that is generating triangles and assigning them to an object. I'm wondering how many triangles within an object, and then how many objects within my game can be supported whilst remaining playable. (I'm yet to gear my code into a FOR Loop... there's a good chance I'll answer my own question here once I do so. :) )

GML:
_fixture = physics_fixture_create();
physics_fixture_set_polygon_shape(_fixture);
    physics_fixture_add_point(_fixture, node[1]._x,node[1]._y);   
    physics_fixture_add_point(_fixture, node[0]._x,node[0]._y);   
    physics_fixture_add_point(_fixture, 0,0);
    my_fix = physics_fixture_bind(_fixture, id);   
physics_fixture_delete(_fixture)
 

Mert

Member
Neither Box2D has fixtures limits, nor Game Maker has object limits.

The limit is how many of them that player's device can handle, because at a certain point, the game will start lagging due to heavy workload on CPU/Memory
 

Karlstens

Member
Neither Box2D has fixtures limits, nor Game Maker has object limits.

The limit is how many of them that player's device can handle, because at a certain point, the game will start lagging due to heavy workload on CPU/Memory
Perfect. So far it's performing well - I might implement a triangle count debug message to help track performance. Thanks again!
 
Top