Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411488 Posts in 69377 Topics- by 58433 Members - Latest Member: Bohdan_Zoshchenko

April 29, 2024, 03:56:01 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)damn lag getting up in my grill (on Gamemaker)
Pages: [1]
Print
Author Topic: damn lag getting up in my grill (on Gamemaker)  (Read 5680 times)
William Broom
Level 10
*****


formerly chutup


View Profile
« on: September 21, 2008, 03:24:49 AM »

Can anybody help me with this problem? It's pretty weird. I'm making this game in Game Maker and it lags. It gets around 20-22 fps. But the weird thing is, it only does this when the window is completely visible. If any other windows are overlapping it, even by the tiniest margin, then it shoots up to 30 fps. Then when I click back on the game window, the overlapping window gets pushed behind it and the framerate goes down again. I found a way around it by moving the game's debug window over the game window - because the debug window doesn't fall behind when it loses focus, I can play the game at 30 fps and it works perfectly. But this isn't going to be an option when I want to make it into a standalone executable.

Now, I don't much about what things slow a game down, but I don't think my game is highly system intensive. There are no flashy particles, high numbers of collisions etc, and each level is only a single screen. The framerate doesn't seem to be affected at all by the amount of objects in the level. And I figure if I'd accidentally written some kind of noobish laggy code, the game would freeze rather than just slowing down.

Has anybody encountered this problem before, or knows of some secret programmer's secrets that makes sense of it?
Logged

ChevyRay
Guest
« Reply #1 on: September 21, 2008, 05:53:02 AM »

Are you using...

surfaces,
polygon/circle drawing functions, or
any sort of particle system?

PM me an EXE and I'll tell you if it runs likewise on my computer. It's hard to say what it could be without knowing what you've got happening, but I find it very strange that it stops doing it when a window is overlapping.

You should run your games at with the room speed at 60 fps anyways, looks better Gentleman
Logged
moi
Level 10
*****


DILF SANTA


View Profile WWW
« Reply #2 on: September 21, 2008, 08:49:06 AM »

Strange bug, it could be caused by a problem in the input handling routine, as input is probably being disabled when you're game isn't in focus. Undecided
Logged

subsystems   subsystems   subsystems
Hideous
That's cool.
Level 10
*****


3D models are the best


View Profile WWW
« Reply #3 on: September 21, 2008, 08:51:31 AM »

But it doesn't lag when the debug window is over, and then he can still control his game.
Logged

ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #4 on: September 21, 2008, 09:18:23 AM »

Try turning off vertical synchronization.
Logged

Core Xii
Level 10
*****


the resident dissident


View Profile WWW
« Reply #5 on: September 21, 2008, 12:10:41 PM »

Sounds like something's wrong with a dirty-rectangle drawing system. I don't really know how GM does this stuff but what I mean by that is I'm assuming GM uses a dirty rectangle screen update system, where it only uploads those regions of the screen into video memory that changed in the last frame.

But when you have overlapping windows, the operating system tells the application that it needs to re-draw its screen, because otherwise the other window would leave a "ghost" image on the app's screen.

So my guess is this system is somehow buggy in GM, whether you triggered it or not by doing something, and is causing this problem.

Of course, this doesn't actually help you in any way since it's a theory of the problem and not a solution.
Logged
medieval
Guest
« Reply #6 on: September 21, 2008, 12:48:08 PM »

It might be because your game processing priority is set to high.

Go to Global game settings > Other

Then check game processing priority. Set it to normal if it's not.
Logged
William Broom
Level 10
*****


formerly chutup


View Profile
« Reply #7 on: September 21, 2008, 06:58:51 PM »

Well, I did a little bit more testing and it does seem to be dependent on screen activity to a certain extent. If I take out everything but the player and some platforms, for example, it runs smoothly no matter what. If I put in loads of basic enemies, then the 'uncovered' framerate can go down to 15 fps or so, but the 'covered' framerate stays firmly at 30 fps. Whomp-type enemies (that are constantly checking for the player to move underneath them) affect the framerate more. But it's still kind of weird because I would have thought that if one whomp reduces the framerate by 8 fps, then two whomps would reduce it by 16. But instead, I can put in about ten of them and only have the framerate drop by 9 or so. Is this normal?

It might be because your game processing priority is set to high.

Go to Global game settings > Other

Then check game processing priority. Set it to normal if it's not.
Nah, it was already on normal. Thanks anyway.
Are you using...

surfaces,
polygon/circle drawing functions, or
any sort of particle system?

Not sure what a surface is but I don't think I'm using it. No polygons or particles.

PM me an EXE and I'll tell you if it runs likewise on my computer. It's hard to say what it could be without knowing what you've got happening, but I find it very strange that it stops doing it when a window is overlapping.

Thanks, I'll do that. If you want to see the difference between covered and uncovered, you can cover the window with task manager, since that's another window that doesn't fall behind automatically.
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic