Page 1 of 1

up your frame rate on GP2x and PPC, disable collisions

PostPosted: Tue Jul 03, 2007 2:25 am
by pixelpoop
I have a puzzle game with over 100 actors that only got about 6fps until now. I just set all my actor's Collision States to Disable and the fps is up around 25 (which is what I set it at). Wow that was a massive bottle neck. Now I just need to reprogram the game with tons of variables instead of collisions.

So remember to change all your non-colliding actors collision states to disabled.

thanks to Kodo for the tip-off in another post. point for you.

PostPosted: Tue Jul 03, 2007 2:51 am
by d-soldier
So even if an actor doesn't have a collision event, GE still checks it for collision each drawframe?... Interesting.... How would you go about doing it by scripting variables instead?

PostPosted: Tue Jul 03, 2007 3:11 am
by makslane
I will check a possible optimization here!

PostPosted: Tue Jul 03, 2007 4:13 am
by pixelpoop
How would you go about doing it by scripting variables instead?

I haven't thought it all through yet but, I think I will set a variable for each place that a tile-actor can stop at. When a tile gets deleted it will change the variable for that position in the grid to 1. A script will check were the spot is and tell the tiles above to move down a certain distance.

PostPosted: Tue Jul 03, 2007 4:22 am
by pixelpoop
So even if an actor doesn't have a collision event, GE still checks it for collision each drawframe?


No, I'm sorry for miss-leading. I just took off all my collision events and did not setCollision States to Disable and got an excellent frame rate.

It seems that collision detection only calculates for actors that are set to look for collisions. However even a couple of actors looking for collisions will slow down your fps on slower devices... by a bunch. I am going to see if I can test collision by using the distance function instead of the pixel perfect collision that GE uses.

thx for tip!

PostPosted: Fri Jul 06, 2007 5:27 pm
by kyensoftware
thx for tip!

PostPosted: Sun Jul 22, 2007 1:06 pm
by foleyjo
My game crawls on the GP2X. I think it might be due to collisions.
Would I be better off if on the draw actor command I put a routine to say
if (actorA.xscreen == actorB.xscreen)
do events that would have happened if it was a collision;

PostPosted: Mon Jul 23, 2007 7:07 am
by pixelpoop
I don't know. But if you test it please let us know.

PostPosted: Mon Jul 23, 2007 8:50 am
by foleyjo
No it wont work at all. Looking at it properly you need to be more complex than that. What I was thinking will only work if the corners touch.