Page 1 of 1

the best ways to prevent lagging?

PostPosted: Wed Feb 02, 2011 12:07 am
by poopbrigade
hello every one,umm
I would like to know what are the best ways to prevent lagging
when making a game....


thanx in advance :D XD.

Re: the best ways to prevent lagging?

PostPosted: Wed Feb 02, 2011 12:18 am
by AliceXIII
always use fps that are divisible by 2, makes the game more stable..

Re: the best ways to prevent lagging?

PostPosted: Wed Feb 02, 2011 12:35 am
by poopbrigade
XD thanx..is that for the animation? fps

Re: the best ways to prevent lagging?

PostPosted: Wed Feb 02, 2011 2:44 am
by AliceXIII
for the overall game properties. animation frames just pretain to how many frames of the animation there are :D

Re: the best ways to prevent lagging?

PostPosted: Wed Feb 02, 2011 3:49 am
by poopbrigade
XD ahh the one in properties, I don't usually touch that....
I've just understand its purpose today.. I always wonder why my animation speed never goes beyond 30 when I set it..
XD LOL... and are there other advice/s you can give me anyway..thanx by the way +1

Re: the best ways to prevent lagging?

PostPosted: Wed Feb 02, 2011 4:29 am
by AliceXIII
most of it's going to be how well your code is done :P

Re: the best ways to prevent lagging?

PostPosted: Wed Feb 02, 2011 7:28 am
by skydereign
One way is to use activation regions. To sum them up, they cut up your game into sections, so when you are in an activation region, only those actors "exist". So if you had a separate levels, the enemies in only the current region will act. If you need more explanation, you can search the forums, or ask here.

A similar effect is to disable events for actors not in the screen. This setting can be set for actors in the actor control panel.

Some tips, if you can avoid draw actor events without changing what you want to do, you should. Also, avoid redundant events, of course, but definitely when dealing with clones and collisions. An example, if you are making a shmup, you can give the bullets or the enemies the collision event. There will be lots of clones of both, but, usually there will be more bullets then enemies. In that case, give the event to the enemies.

There are some other general tricks when making your game, but those were the big ones. If you search around, you can find more tips, the link below is full of good tips.
http://game-editor.com/forum/viewtopic.php?f=5&t=6854

Re: the best ways to prevent lagging?

PostPosted: Wed Feb 02, 2011 8:37 am
by poopbrigade
@skydereign thanx +1
the tutorial is very helpful... I did notice that post but never read it..

Re: the best ways to prevent lagging?

PostPosted: Sun Feb 13, 2011 8:25 pm
by BloodRedDragon
Skydereign basically explained all of what I was going to say..
BUT!
Also change the resolution to no more than 800x600, maybe even less. You're stuff will appear more pixellated in fulscreen but it means you have space for less actors and images on screen, therefore less lag.
Oh yeah don't have millions of actors on screen at the same time :)

The sad thing is that ive found out that even with just one moving actor, GE has a tiny bit of lag anyway. It's definately not my PC, as it has a dual graphics slot, but having said that, lag can be down to your PC :)

Re: the best ways to prevent lagging?

PostPosted: Sun Feb 13, 2011 10:53 pm
by Game A Gogo
AliceXIII wrote:always use fps that are divisible by 2, makes the game more stable..

Correction, it's 8,16,32,64,128,256,512
48 seems stable as well
Setting FPS higher will make things faster somehow. but too fast at time as well

Re: the best ways to prevent lagging?

PostPosted: Sun Feb 13, 2011 11:37 pm
by poopbrigade
XD thanx +points...

Re: the best ways to prevent lagging?

PostPosted: Wed Feb 16, 2011 9:39 am
by candy123
Beneficial info you got here!

Re: the best ways to prevent lagging?

PostPosted: Sun Feb 20, 2011 8:56 pm
by AnarchCassius
Do not use an infinite tiling actor if your gamespace is finite. Which unless you're doing Escape Velocity type game it probably is, even then you may want a system cut-off. This may not be true for very large stages but replacing my tiling background with a function to draw tiles behind the gamespace saved me a lot of FPS.

Likewise always disable collision state when you don't need it. You might think not having any collide events is good, but the game is apparently still "considering" these pixels, if not as intensively, unless you actually disable collision itself in the Create event. Although I haven't tried to confirm this I also imagine that your background will cause interference with the CollisionFree test otherwise.

With these two fixes my slow machine no longer drops FPS by 10-50% when the player or camera is in motion. It's actually pretty hard to get lag on modern machines for me, so a slow one hopefully gives a closer approximation of a mobile device's capacities.

Re: the best ways to prevent lagging?

PostPosted: Thu Feb 24, 2011 1:04 am
by Hblade
Convert your graphcs to 16 bit. Or 24bit.