• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Performance Issues in Title Screen

M

McWolke

Guest
Hey there,
i have some performance issues, and i really don't know why.
It's just a Title Screen with a Menu. I know that drawing costs a lot, but it's just a Title Screen!
This also happens in the Game itself but that's probably my code, i guess.
It fluctuates between 2000 and 70 fps.
It starts at 2000 and after a while it drops to 70~120



i made a script to draw these windows/buttons which draws a lot:
Code:
///draw_window(x,y,width,height,sprite,alpha)

var xx = argument0;
var yy  = argument1;
var width = argument2;
var height = argument3;
var sprite = argument4;
var alpha = argument5;

var spriteWidth = sprite_get_width(sprite);
var spriteHeight = sprite_get_height(sprite);

var lowEnd = yy + height - spriteHeight;
var rightEnd = xx + width - spriteWidth;

//Fill Middle
draw_sprite_ext(sprite,4,xx+spriteWidth,yy+spriteHeight,width/spriteWidth-2,height/spriteHeight-2,0,c_white,alpha);

//Draw Edges
draw_sprite_ext(sprite,1,xx+spriteWidth,yy,width/spriteWidth-2,1,0,c_white,alpha);
draw_sprite_ext(sprite,7,xx+spriteWidth,lowEnd,width/spriteWidth-2,1,0,c_white,alpha);
draw_sprite_ext(sprite,3,xx,yy+spriteHeight,1,height/spriteHeight-2,0,c_white,alpha);
draw_sprite_ext(sprite,5,rightEnd,yy+spriteHeight,1,height/spriteHeight-2,0,c_white,alpha);

//Draw Corners
draw_sprite_ext(sprite,0,xx,yy,1,1,0,c_white,alpha);
draw_sprite_ext(sprite,2,rightEnd,yy,1,1,0,c_white,alpha);
draw_sprite_ext(sprite,6,xx,lowEnd,1,1,0,c_white,alpha);
draw_sprite_ext(sprite,8,rightEnd,lowEnd,1,1,0,c_white,alpha);

so is this just a GameMaker thing that it slows down because it does not need any more performance or do i really have to worry about performance now?
 
E

elementbound

Guest
I could be wrong but I would not give this much thought. This could be literally anything from background services to a child sneezing in your local area.
The code seems OK too. So if there's really a problem, it's most probably with something else. Then again, my opinion is that there is no problem.
 
M

McWolke

Guest
i guess you're right :< i was worried because 70 fps on my Computer, which is a really good Computer, was way too low, but on my Laptop it works too. so i guess i'll just ignore it. anyways i would be glad to hear the explanation why it happens :)
 
If the fps slowly gets worse and worse, you might be accidentally creating the same objects over and over again. (objects or surfaces or some other resource).
 

TheouAegis

Member
Draw the normal buttons (unselected) to a surface at the the start of the room and draw that surface. Then only draw a button when it's highlighted/selected.

If your fps still drops low, you have an unrelated leak like flyingsaucer surmised.
 
Top