GM already does this by default.Hi All,
I want to implement precise collisions for my spider looking robots because the collsions are really bad with a normal shape.
Would it be possible to set the collision shape as a rectangle and then only check precise collision when the rectangle collision has be triggered?
The fast collision system makes use of space partitioning, such that the collision code is not being run when two objects are away from each other.I just switched to precise collision expecting the debug module to show an increase on performance hit and it appears that using a rectangle or precise collision makes nearly no difference at all, when using the built in fast
collision system.
Very impressive! how is that even possible?
when you say building up thee number of collisions that's only if a lot of precision objects overlap? Like if you have 20 precision objects on screen but none overlap then no checking is occurring so its fine? Only if all 20 overlap at the same time will there be more of an impact?The fast collision system makes use of space partitioning, such that the collision code is not being run when two objects are away from each other.
Another thing to consider is that a single instance of precise collision wont do your game any harm, but rather when you start building up the number of precise collisions going on.
yes, from what I can gather, GM first uses some for of spacial partitioning (BVH, quads, hashes...), Then performs a bounding box check, before doing the precision check. (This is from fragments of info i got from the forums, so im just guessing).Like if you have 20 precision objects on screen but none overlap then no checking is occurring so its fine? Only if all 20 overlap at the same time will there be more of an impact?
Not really, GM does a great job already.Isn't there still some use for setting up your own checks to limit unnecessary checks?
At this point, It changing the logic: You are no longer relying on spacial information alone, but are introducing extra variables GMengine would have no way of knowing about.if not_your_hitbox
place_meeting(obj_hitbox)
Pretty neat!yes, from what I can gather, GM first uses some for of spacial partitioning (BVH, quads, hashes...), Then performs a bounding box check, before doing the precision check. (This is from fragments of info i got from the forums, so im just guessing).
My quote goes with the example I provided lol I would hope that by throwing this condition GM won't even check for spatial proximity instead of checking for spatial proximity and then skipping the precise part. I would assume that the spatial check only occurs on place_meetings that are actually activeNot really, GM does a great job already.
well yes, when you call place_meeting ,GM does collision code.My quote goes with the example I provided lol I would hope that by throwing this condition GM won't even check for spatial proximity instead of checking for spatial proximity and then skipping the precise part. I would assume that the spatial check only occurs on place_meetings that are actually active