why does my game lag so mutch

Game Editor comments and discussion.

why does my game lag so mutch

Postby 157pl » Sat May 14, 2011 1:04 am

my computers slow but how can i speed up the game
Attachments
ship game1.ged
(6.68 KiB) Downloaded 96 times
User avatar
157pl
 
Posts: 109
Joined: Thu May 13, 2010 10:49 pm
Location: AZ
Score: 3 Give a positive score

Re: why does my game lag so mutch

Postby 157pl » Sat May 14, 2011 1:10 am

i found out it was the stars
is there any other way to speed it up without making it a solid sheet of stars
User avatar
157pl
 
Posts: 109
Joined: Thu May 13, 2010 10:49 pm
Location: AZ
Score: 3 Give a positive score

Re: why does my game lag so mutch

Postby jimmynewguy » Sat May 14, 2011 1:27 am

please post the data files with the .ged so we can open it and therefore help you!
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: why does my game lag so mutch

Postby skydereign » Sat May 14, 2011 2:59 am

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.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: why does my game lag so mutch

Postby 157pl » Sat May 14, 2011 3:42 am

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
User avatar
157pl
 
Posts: 109
Joined: Thu May 13, 2010 10:49 pm
Location: AZ
Score: 3 Give a positive score

Re: why does my game lag so mutch

Postby skydereign » Sat May 14, 2011 6:03 am

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?
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: why does my game lag so mutch

Postby 157pl » Sat May 14, 2011 4:22 pm

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
User avatar
157pl
 
Posts: 109
Joined: Thu May 13, 2010 10:49 pm
Location: AZ
Score: 3 Give a positive score

Re: why does my game lag so mutch

Postby skydereign » Sat May 14, 2011 9:52 pm

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.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: why does my game lag so mutch

Postby 157pl » Sat May 14, 2011 10:25 pm

im only spawning one per frame

what does motion compensation do is it a frame skip
User avatar
157pl
 
Posts: 109
Joined: Thu May 13, 2010 10:49 pm
Location: AZ
Score: 3 Give a positive score

Re: why does my game lag so mutch

Postby 157pl » Sat May 14, 2011 10:32 pm

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
User avatar
157pl
 
Posts: 109
Joined: Thu May 13, 2010 10:49 pm
Location: AZ
Score: 3 Give a positive score

Re: why does my game lag so mutch

Postby skydereign » Sun May 15, 2011 3:57 am

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;
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: why does my game lag so mutch

Postby 157pl » Wed May 18, 2011 10:06 pm

ok thanks i guess this works thanks for the help

sorry i didn't respond sooner i was studying for finals
User avatar
157pl
 
Posts: 109
Joined: Thu May 13, 2010 10:49 pm
Location: AZ
Score: 3 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron