-
My game lags!
Edit: Im remaking this post.
I had a game working perfectly yesterday. And today, I copied one of my frames, and made it about twice as big (20.000 x 1.500). Suddenly, it started lag, or run a lot slower. The new frame have almost 1500 objects, but most of them are just tiles, or just pieces of each background. When I test the frame, it says 85 mb, I have no idea if thats relevant or not. Does anyone know a solution for this lag? Is it cause the frame is too big?
-
Re: My game lags!
Too many objects most likely.
Try ticking the box for active objects if they are too far from frame see if that helps. Otherwise its simply too many objects for your computer to handle, or you have some events which are slowing you down.
Whats your framerate like? compare against both frames and see what the difference is
-
Re: My game lags!
Bah, if my PC cant run it, you will need a PC far over the average :(
I tried the inactivate if too far away, but that destroyed all.. Or at least removed them somewhere else.
Its 50 on the small frame, and 30 on the big. Bah, this sux. The level wont be very big if its starting to limit at 8000 width. What kind of objects are slowing this down anyway? Animation objects, or movement objects that perhaps moves even tho they are out of the window?
-
Re: My game lags!
I tried removing all the enemies, and the fps popped up to 50. I have a few solutions, so I think Ill be fine.. I did a really fast test, and replacing all the enemies with small objects that creates the enemies on these objects right before they enter the frame window seems to work. But I could also try turning off their movement when they are out of window, hopefully that will do! Thanks for your help anyway :)
-
Re: My game lags!
-
Re: My game lags!
Yea, Im using HWA. Thats what I wrote first time before I edited, that some time long ago I got a perfect solution. But I just remembered that it was HWA. I also remember switching DirectX something, but I tested all four options I have, and the current is the best :0
-
But I actually asked about this earlier. What kind of objects are slowing down the application? Too many objects in general, or too many objects that includes in events?
-
Re: My game lags!
Too many objects being handled in an inefficient way, or waaayy too many objects being handled correctly.
-
Re: My game lags!
Replacing some of the fastloops with ForEach loops seems to work perfectly.. At least on my PC. But just in case, I think Ill stick to both ForEach loops and the create enemy when in frame events I spoke of yesterday. Btw, most of my objects are just backgrounds, doing nothing. Not even a qualifier.
But I have an issue about the ForEach object. I dont know how to replace "Start loop -enemy gravity- 6 times".. ForEach does not have these numbers, and if I just ignore it, the enemies are falling very slow. I tried replace the event that moving it 1 pixel down with 6 pixels, but that just looks messed up because of another event moving it 1 pixel up when its overlapping the floor. And then, when its not overlapping anymore, it gets moved 6 pixels down.. And this loops. If I remove this move 1 pixel up, the enemies will most likely get stuck in the floor :S
-
Re: My game lags!
You could run the ForEach loop 6 times. As in, 6 actions to start the ForEach loop.
-
Re: My game lags!
-
Re: My game lags!
No, I mean literally make 6 actions in one event that start the ForEach loop so it looks like this:
My Condition:
-Start ForEach loop "MyLoop" for object MyObject
-Start ForEach loop "MyLoop" for object MyObject
-Start ForEach loop "MyLoop" for object MyObject
-Start ForEach loop "MyLoop" for object MyObject
-Start ForEach loop "MyLoop" for object MyObject
-Start ForEach loop "MyLoop" for object MyObject
-
Re: My game lags!
Aaaah, yes thats a clever idea indeed :D
But sadly, the ForEach object have obviously prevented this, as its just reacting as 1 :(
-
Re: My game lags!
Ill set it to move 5 pixels down, and then 5 pixels up. It wont look that weird. Thanks anyway, always appreciated! :)
-
Re: My game lags!
Ahh, I forgot. No it doesn't prevent it, it's MMF2 just being stupid. Just make the event over and over:
My Condition:
-Start ForEach loop "MyLoop" for object MyObject
My Condition:
-Start ForEach loop "MyLoop" for object MyObject
My Condition:
-Start ForEach loop "MyLoop" for object MyObject
My Condition:
-Start ForEach loop "MyLoop" for object MyObject
My Condition:
-Start ForEach loop "MyLoop" for object MyObject
My Condition:
-Start ForEach loop "MyLoop" for object MyObject
-
Re: My game lags!
Ow, cool! Its working! :D Thanks a lot! :)