ZombieSquirrel
Member
Hi everyone.
Today i've been trying to tackle an issue I have with my project: lag.
At first I thought it was my surfaces, which in some way: yes, absolutely. For
some reason when I minimize the game, a lag spike appears, and endures after i maximize.
I'm still trying to resolve that.
However, I came across something very interesting that I didn't know was possible to track in the debugger.
You see, when I have a large amount of objects and I minimize the game, the lag becomes really bad. It is a combination of amount of objects and something with surfaces...
But that's not the topic of this post. I delved deeper and noticed something very interesting, so time to learn what this means:
What I want to ask about is the debugger. When i profile my current room, I can
see a list of objects, variables,... with next to them:
a) call count
b) time (Ms)
c) step%
My question is: how do I interpret these? What's the difference between "average" and "total"?
The object I want to duplicate a lot clearly shows some concerning numbers, both for its step AND draw event:
call count: 800 (800 objects)
time: 3.3 Ms (game should run at 60 fps but now it's around 30)
step%: 22.2%
Still having trouble trying to interpret these, but I have some other complicated objects that don't nearly get those values.
If this is the root of my lag problems, I'm going to have to figure out how to run the code just once in a controller object, and then somehow execute that ONCE per frame at each x and y position of my large amount of instances.
Which is uh, a problem, as i need to draw things with a depth, depending on an instance's position.
As far as I'm aware of, there is no function like draw_at_depth or something. And that's not even mentioning the step event...
Today i've been trying to tackle an issue I have with my project: lag.
At first I thought it was my surfaces, which in some way: yes, absolutely. For
some reason when I minimize the game, a lag spike appears, and endures after i maximize.
I'm still trying to resolve that.
However, I came across something very interesting that I didn't know was possible to track in the debugger.
You see, when I have a large amount of objects and I minimize the game, the lag becomes really bad. It is a combination of amount of objects and something with surfaces...
But that's not the topic of this post. I delved deeper and noticed something very interesting, so time to learn what this means:
What I want to ask about is the debugger. When i profile my current room, I can
see a list of objects, variables,... with next to them:
a) call count
b) time (Ms)
c) step%
My question is: how do I interpret these? What's the difference between "average" and "total"?
The object I want to duplicate a lot clearly shows some concerning numbers, both for its step AND draw event:
call count: 800 (800 objects)
time: 3.3 Ms (game should run at 60 fps but now it's around 30)
step%: 22.2%
Still having trouble trying to interpret these, but I have some other complicated objects that don't nearly get those values.
If this is the root of my lag problems, I'm going to have to figure out how to run the code just once in a controller object, and then somehow execute that ONCE per frame at each x and y position of my large amount of instances.
Which is uh, a problem, as i need to draw things with a depth, depending on an instance's position.
As far as I'm aware of, there is no function like draw_at_depth or something. And that's not even mentioning the step event...
Last edited: