Page 1 of 1

why does my game lag so mutch

PostPosted: Sat May 14, 2011 1:04 am
by 157pl
my computers slow but how can i speed up the game

Re: why does my game lag so mutch

PostPosted: Sat May 14, 2011 1:10 am
by 157pl
i found out it was the stars
is there any other way to speed it up without making it a solid sheet of stars

Re: why does my game lag so mutch

PostPosted: Sat May 14, 2011 1:27 am
by jimmynewguy
please post the data files with the .ged so we can open it and therefore help you!

Re: why does my game lag so mutch

PostPosted: Sat May 14, 2011 2:59 am
by skydereign
The only file missing was the raava.ttf. I loaded the game but have no idea what you are talking about. The game has no potential to lag right now, and the stars are not causing any slow down. Their speed is a bit slow, but in the ged you posted there is only one star at a time... I made the stars fall down constantly and it ran fine.

Re: why does my game lag so mutch

PostPosted: Sat May 14, 2011 3:42 am
by 157pl
as i said i have a slow computer
is there any way i can speed up the game


i had the stars falling constantly wonder why you didnt

Re: why does my game lag so mutch

PostPosted: Sat May 14, 2011 6:03 am
by skydereign
Well, as I said it isn't doing what you said it does. Until I can see how you made the stars fall, I can't really do much to help optimize it. I can have over 1000 falling stars without causing any lag, so even if you have a very slow computer, you should be able to have a decent number of stars without having any lag. How slow does the game get? Have you used the real_fps variable to see?

Re: why does my game lag so mutch

PostPosted: Sat May 14, 2011 4:22 pm
by 157pl
i made the ship actor drop stars in a draw actor statement then on the stars i used
Code: Select all
yvelocity-=rand(-4)-1;
ChangeZDepth("Event Actor", yvelocity/0.000001);



the fps goes down to about 10 on startup then stays around 25 and 30

Re: why does my game lag so mutch

PostPosted: Sat May 14, 2011 9:52 pm
by skydereign
The reason it wasn't creating stars for me is that you removed the animation for star, so if you ever do that, you will have to remember to switch the animations in create actor to icon. One improvement is to not use the draw actor event to destroy the stars. I'd use a Out of Vision for that one. Though, I managed to get the slow down by creating 15 stars per frame, and removing the draw didn't help much. You could turn on motion compensation so if does lag gE will try to hide it. Another thing is you could simply reduce the number of stars being spawned, or create animations that have a few stars on it, and pick them randomly. That way you dramatically reduce the number of stars you need to spawn.

Re: why does my game lag so mutch

PostPosted: Sat May 14, 2011 10:25 pm
by 157pl
im only spawning one per frame

what does motion compensation do is it a frame skip

Re: why does my game lag so mutch

PostPosted: Sat May 14, 2011 10:32 pm
by 157pl
its the immage i use the icon and no lag
i was using this
nvm u cant see that ill give u a folder
star.zip
(312 Bytes) Downloaded 96 times

do you think its the transparency at the edge

Re: why does my game lag so mutch

PostPosted: Sun May 15, 2011 3:57 am
by skydereign
Well, it doesn't seem to effect the fps for me. If anything the stars make it easier. I had 15 per frame again and it was working. What you could do is find the max number of stars on the screen that it can handle, and prevent that from happening. That and/or make the stars fall a bit faster, that way the slow ones won't overrun the screen like they can now. Motion compensation speeds up moving actors to simulate the normal fps. So if the game should run at 30, but real_fps is 15, it will double the actors' speeds.

-Edit
So, with how it is currently, you have an average of about 190 stars on the screen. If you switch the rand yvelocity to this, you will have an average 145, and it still looks fine.
Code: Select all
yvelocity=rand(3)+2;

Re: why does my game lag so mutch

PostPosted: Wed May 18, 2011 10:06 pm
by 157pl
ok thanks i guess this works thanks for the help

sorry i didn't respond sooner i was studying for finals