• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

GameMaker Steps - what if process exceeds step length?

I

Inge Jones

Guest
I thought I understood the step-driven game engine until I realised I didn't have a grasp on what would happen if the length of time to carry out an instruction exceeded the time between steps? I mean say I set room step speed to 30 which gives 2 seconds per step (right so far?) and I try to get my object to perform a behaviour that takes a minute during one step. Is this possible?
 

mMcFab

Member
First, let me clarify what room speed/game speed is - if you set it to 30, that means 30 steps will be executed per second, not 2 seconds per step. that would theoretically be a speed of 0.5, which you can't actually set it to - at least to my understanding as I've never needed a step to last more than a second. (The only way I know of to have a step deliberately last more than a second would be to use a loop that freezes the game until current_time exceeds a certain amount or something similar)

As for what happens when an instruction/process takes more than a step to execute - the game lags, stutters and generally runs slowly - we need to optimise our games so this doesn't happen - at least outside of loading times.
In order to answer your main question, it is indeed possible for an instruction to take longer than a step to execute (and by that I mean the expected duration of a step) - the next step will not happen until all instructions in the current step have been completed.

I hope this helps in some way!
 
Top