up your frame rate on GP2x and PPC, disable collisions

Game Editor comments and discussion.

up your frame rate on GP2x and PPC, disable collisions

Postby pixelpoop » Tue Jul 03, 2007 2:25 am

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.
User avatar
pixelpoop
 
Posts: 276
Joined: Tue Aug 29, 2006 9:32 pm
Score: 28 Give a positive score

Postby d-soldier » Tue Jul 03, 2007 2:51 am

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?
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby makslane » Tue Jul 03, 2007 3:11 am

I will check a possible optimization here!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby pixelpoop » Tue Jul 03, 2007 4:13 am

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.
User avatar
pixelpoop
 
Posts: 276
Joined: Tue Aug 29, 2006 9:32 pm
Score: 28 Give a positive score

Postby pixelpoop » Tue Jul 03, 2007 4:22 am

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.
User avatar
pixelpoop
 
Posts: 276
Joined: Tue Aug 29, 2006 9:32 pm
Score: 28 Give a positive score

thx for tip!

Postby kyensoftware » Fri Jul 06, 2007 5:27 pm

thx for tip!
Games for Windows, Linux, and PPC
Bin dosnt stand for "Binary";
it stands for Bin.
You know, where the junk goes...
User avatar
kyensoftware
 
Posts: 198
Joined: Thu Oct 26, 2006 7:49 am
Score: 5 Give a positive score

Postby foleyjo » Sun Jul 22, 2007 1:06 pm

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;
foleyjo
 
Posts: 275
Joined: Mon Jul 09, 2007 1:15 pm
Score: 15 Give a positive score

Postby pixelpoop » Mon Jul 23, 2007 7:07 am

I don't know. But if you test it please let us know.
User avatar
pixelpoop
 
Posts: 276
Joined: Tue Aug 29, 2006 9:32 pm
Score: 28 Give a positive score

Postby foleyjo » Mon Jul 23, 2007 8:50 am

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.
foleyjo
 
Posts: 275
Joined: Mon Jul 09, 2007 1:15 pm
Score: 15 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron