ZombieSquirrel
Member
Hi everyone.
I've been using shaders and surfaces now for a while to come up with all
sorts of cool effects. Weather, lighting, fog, day/night cycles,....
However I've run across something that I'm sure a lot of people have already encountered:
Lag, specifically lag after I minimize the game, then enlarge it again (to full screen).
I've tried everything I can think of. I increased the texture page sizes. I clear the display buffer of each room.
I clear the surfaces in the cleanup event, in the objects where the surfaces are made. I changed variables to local variables wherever i could. Made sure that objects outside of the camera's view aren't drawn at all, and so on...
I learned a lot about optimization by doing this. in fact, the game runs almost as smooth as butter now, even with large amounts of objects (upwards to 2000/3000 within the room), each with quite a lot of code in it (couple of hundred lines per object).
When the object counts goes completely overboard, which I will never need anyway in such large amounts, yes I still encounter lag.
But that's not the issue here. Object count was just a test to see how far I can push it.
What bothers me is that, somehow... minimizing and unminimizing always causes lag. 60 FPS drops to like 40 - 35, sometimes even lower. The lag isn't there if I never un-minimize.
In the debugger, after I minimize, I see an FPS drop, one that clearly curves down from 60 to 40 (although not instantaneous, more like in a few seconds) and memory says somewhere around 64mb, and what's used on average is around 60 (I don't understand that memory thing I will add).
Sooo question:
1) Is this a common mistake? something I'm overlooking?
2) Is there by any chance a way to increase the system memory the game uses? I have a hunch that if I could double it, my issues would be over quickly.
I've been using shaders and surfaces now for a while to come up with all
sorts of cool effects. Weather, lighting, fog, day/night cycles,....
However I've run across something that I'm sure a lot of people have already encountered:
Lag, specifically lag after I minimize the game, then enlarge it again (to full screen).
I've tried everything I can think of. I increased the texture page sizes. I clear the display buffer of each room.
I clear the surfaces in the cleanup event, in the objects where the surfaces are made. I changed variables to local variables wherever i could. Made sure that objects outside of the camera's view aren't drawn at all, and so on...
I learned a lot about optimization by doing this. in fact, the game runs almost as smooth as butter now, even with large amounts of objects (upwards to 2000/3000 within the room), each with quite a lot of code in it (couple of hundred lines per object).
When the object counts goes completely overboard, which I will never need anyway in such large amounts, yes I still encounter lag.
But that's not the issue here. Object count was just a test to see how far I can push it.
What bothers me is that, somehow... minimizing and unminimizing always causes lag. 60 FPS drops to like 40 - 35, sometimes even lower. The lag isn't there if I never un-minimize.
In the debugger, after I minimize, I see an FPS drop, one that clearly curves down from 60 to 40 (although not instantaneous, more like in a few seconds) and memory says somewhere around 64mb, and what's used on average is around 60 (I don't understand that memory thing I will add).
Sooo question:
1) Is this a common mistake? something I'm overlooking?
2) Is there by any chance a way to increase the system memory the game uses? I have a hunch that if I could double it, my issues would be over quickly.