• 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!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Android [solved] will smaller collisionbokses save framerate?

U

Uberpink

Guest
i have a house instance and its sprite have a simple collision all over, howewer i only need some piksels tall collision at top of the house

Question,, will smaller collision be better for the framerate? in other words does a collision boks cost more for the processing etc the bigger it is?
 
I

icuurd12b42

Guest
non precise collision, using the box, is simply rectangle intersection math. so the size matters not... \
 
U

Uberpink

Guest
thanks for answer:) how about precise collision, is that very heavy? wonder if its some kind of possability to measure it heh.. how much it takes compared to non-precice coll,,, maybe theres a fps counter command or something eksisting
 

FrostyCat

Redemption Seeker
thanks for answer:) how about precise collision, is that very heavy? wonder if its some kind of possability to measure it heh.. how much it takes compared to non-precice coll,,, maybe theres a fps counter command or something eksisting
It's absolutely heavy, and the difference in performance is well-known and documented. The gap is so blatant that you can tell from the logic alone how much heavier it is compared to simple rectangular collisions, no need for a profiler.
 
I

icuurd12b42

Guest
With precise collision the bounding box is used as a collision precheck. so the performance issues only apply when the bounding boxes of colliding instances overlap where pixel to pixel check is performed...
 
U

Uberpink

Guest
With precise collision the bounding box is used as a collision precheck. so the performance issues only apply when the bounding boxes of colliding instances overlap where pixel to pixel check is performed...
aha but that was kind of smart.. so it aint heavy all the time when not colliding
 
I

icuurd12b42

Guest
Yeah the blanket "More Efficient" statement is really starting to piss me off... that and the misconception about collision shape in a yoyo approved tut no less...


Read my comment on the video...
 

kupo15

Member
With precise collision the bounding box is used as a collision precheck. so the performance issues only apply when the bounding boxes of colliding instances overlap where pixel to pixel check is performed...
Does precise collision break out of the checking once it detects a collision? So if it detects a collision at the first pixel to pixel check, how much slower is it really? The bounding box precheck should help a lot in most cases to producing more first check detection also I would think
 
I

icuurd12b42

Guest
Does precise collision break out of the checking once it detects a collision? So if it detects a collision at the first pixel to pixel check, how much slower is it really? The bounding box precheck should help a lot in most cases to producing more first check detection also I would think
I would assume it does break out on the first hit. would not make sense otherwise.

There is the memory management to consider... does it load the 2 images involved into a separate memory spaces to do the comparison, or does it preload all the images in memory at startup and references the memory addresses directly from that... I don't know... I just know that if nothing is touching, there is no difference in cost with rectangle based collision
 

kupo15

Member
I would assume it does break out on the first hit. would not make sense otherwise.
That's my thinking. I wish we had control over which direction it did its checks. Like if I'm going to be detecting a landing, it would make sense of the player's collision box to start checking from the lower right and work its way to the upper left.
 
I

icuurd12b42

Guest
it's possible it only checks inside the intersecting region, that's the way I implemented my gml version in gm6
 
Top