• 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 [SOLVED] Are any of the debuggers functions available outside of the debugger?

Hi.

Not quite sure how to have best worded that title, so hopefully I can explain this :)

I'm wondering if some of the things available under 'engine' in the debugger are stats you can access within GMS.

Elements like the step time / percentage taken to flush the graphics, or handle collisions etc. Are they calculations specific to the debugger?

I'm trying to arrange my game so that events are only called if there is the head room within a step to do so.

Knowing the cost of the behind the scenes engine functions would be useful - is that at all possible?

Or is it only possible to know the cost by handling the graphics / collisions etc yourself, and then doing your own calculations to get how long it took?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Running the game without using the debugger does indeed limit the information that you get back, and so you'd have to code your own tests, which in itself will affect performance. You do have basic debugging using show_debug_overlay() which provides useful information about texture swaps/batches and the CPU/GPU overhead, but it's only useful in a very general way. What I have is a small test project that uses the get_timer() function and various loops within which I can place code I want to test and see what type of performance hit it causes, which is great for self contained code and scripts or functions, but not ideal for anything else.

For what you want, I guess the simplest way would be to track the fps_real variable over time and then check the average value and if it is above a certain threshold then you have the required overhead and if it is below the threshold then there isn't. However this approach will give results that vary greatly depending on the device and the other apps/processes that are running apart from your game.

Personally, I think the best approach is always to supply game options so the player can change things that affect performance, so options to enable/disable particle effects, or shader effects, or cosmetic instances (things like dust, or snow, or whatever), etc... and so the player can then tweak the game to suit their gaming environment.

Out of curiosity, Is there a specific issue you are having that makes you think you need this?
 
Out of curiosity, Is there a specific issue you are having that makes you think you need this?
Sorry if this is a long winded explanation, but in my defense - you did ask :)

I am using an mp grid to put the paths of my enemies into. These paths are not just vertical / horizontal, can repeatedly alternate direction, and in some cases I also need to account for a circular radius around the enemy. Having tried many alternatives this is the cheapest way I have found to do what I want.

One alternative was creating physics fixtures that are to the paths dimensions: the size of the object travelling it, plus the dimensions of the object looking for free space. Creating the fixture would be cheap, but checking physics collisions is probably heavier than testing free cells in an mp grid.

On the one hand:
It doesn't have too much cost to actually find free cells, so that instances can check where they are not in collision with other paths and move to safety. Looping through the grid isn't all that heavy, even though it has 250,000 cells. It is "pixel perfect" and cheaper than using any collision detection.

But on the other hand:
Actually putting in the paths can be costly if I don't stagger it. If I'm figuring out step time / percentage correctly then one instance is about 30% of a step, and a for loop (with several objects) where its not staggered is 300 to 400% (a whole 3 to 4 steps)

Those times when its not being staggered are presumably when I see some dips from 60 fps to around 55, as the game can't keep up? Since the time taken is more than a step, it eventually slows down a little?

Otherwise, this is manageable for me to do - as long as I know what else is going on under the hood (graphics, collision, sound etc), and can account for its cost before calling any AI related events.
 
Last edited:
Top