MilesThatch
Member
I've pinned down the objects that caused my game to lag for 2-3 seconds at the start of every room. Turns our it was my lighting master object. This is not a complex lighting system - a single surface the size of the game camera (1440x900), cleared with a draw_clear(c_black); and all the lights use bm_src_color to punch through the blackness. Basic stuff everyone knows about. I've deleted the lighting master object from a level and instantly the lag went away. I've continued pin pointing the exact code that caused the momentary lag. I've re added the master light object and commented out the surface stuff, same deal - lag is gone. This is a ported project from 1.4 and the master lighting objects did no lag the game when it was in 1.4.
I've read somewhere that you shouldn't use surfaces of large resolution, although I use only one surface in the entire game, it begs the question of why it wasn't an issue in 1.4...?
Also why does it lag the game for just a few seconds and not the entire time. Is the surface being loaded or something? After a few seconds, the lag goes away and the game runs at an appropriate speed.
I've read somewhere that you shouldn't use surfaces of large resolution, although I use only one surface in the entire game, it begs the question of why it wasn't an issue in 1.4...?
Also why does it lag the game for just a few seconds and not the entire time. Is the surface being loaded or something? After a few seconds, the lag goes away and the game runs at an appropriate speed.
Last edited: