• Hey! Guest! The 40th (!!!) GMC Jam will take place between February 25th, 12:00 UTC to March 1st 12:00 UTC. Why not join in this very special anniversary jam! Click here to find out more!

GMS 2.3+ 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