• 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.

 instance_disable_update [SUGGESTION]

SUGESTION::

what I mean by this is to have a way to disable the "hidden" update logic, without...
disabling the event triggering... the only way I know how to disable HIDDEN update is by
deactivating instances (instance_deactivate) but this disables everything events included.
I just wanted to deactivate the logic...

Okay you may say that the hidden update logic is what triggers the events xD and I'm aware of that...
but it would be great to separate the "hidden variable update logic" from the "hidden event logic"...
and make it possible to disable the "hidden variable update logic".

for example: I have a parent/children structure built within instances so parent calls the respective event on their children.. (update event/draw event). I this need because I want to control the draw order and also because this way I can have different refresh rates for update and for draw. As I'm talking about a GUI implementation I don't need to update [x, y, image_index] every frame. I would like to be able to control when it gets updated...

I also know I can create different variables x_pos, y_pos... and update them the way I like but then again the "Hidden update" overhead is still there.

ANOTHER THING::

I don't know if when compiling, GMS2 removes the hidden event logic check for objects that have no code in that specific event. (what I mean is that an object with no "mouse_click" code would not compile that event check (this would make the hidden update logic much lighter). IF IT DOESN'T I think an option on the object to disable specific (not needed) events would be awesome.

NOTE: I'm aware this could not be done at run time.. as an object with a disabled event would not even check for that event.

(and I think this would even help solve the issue/request regarding update with delta time, people could disable the hidden variable update an make one manually, once again without deactivating the instance and loosing the events triggering)
 

RangerX

Member
- GUI that you don't update every frame: draw it on a surface in the GUI layer and.... don't refresh it every frame.
- Manipulating your draw refresh rate? (at least generally speaking), disable the draw events at X number of frames.
- You could even manipulate the draw further by having a blocking variable triggered before any draw event in any object.
- Variables can also let you determine which objects and when they are drawing or not.

Not saying your suggestion isnt valid, just saying there's alot of stuff you mention that you can already do, at least to some level.
 
Last edited:
- GUI that you don't update every frame: draw it on a surface in the GUI layer and.... don't refresh it every frame.
- Manipulating your draw refresh rate? (at least generally speaking), disable the draw events at X number of frames.
- You could even manipulate the draw further by having a blocking variable triggered before any draw event in any object.
- Variables can also let you determine which objects and when they are drawing or not.

Not saying your suggestion is valid, just saying there's alot of stuff you mention that you can already do, at least to some level.
I know that, thank you ;)
I was not talking about the draw event... :)
I'm talking about the "update event" I can disable the draw event I'm aware of that... but I can't disable the update event... not without disabling the other events all at once (with instance_deactivate)

And the update event IS that important because an empty object will still create overhead.. exactly because of the "hidden" update event.. even if it is not drawing, not moving, not nothing...
 
Use an instance variable and then just exit if set..... job done. :)
Or make the update event empty and put the code inside an user_event ;) I know how I can control my update code but
what about the "Hidden Update Code" that updates all the builtin variables?! I may not want it to occur... I may just want to
update the image_index... instead I am "forced" to make all the other updates.

In other words... how can I set a speed to the instance?! and make is so that the new position is not computed...
the value is there but it is not computed...
and don't say create a different name variable "spd" and use that because the other speed is still used for computation every frame... :/ I just wanted to reduce the overhead disabling not needed computations.

GMS don't let me have control how the CPU time is spent regarding the builtin variables, and that would be so cool... @Fel666 even added more to this make it possible to disable ANY event you want (that would be cool) even if it was fixed upon compilation, something that was set within the IDE (that you coudn't change at run time)... and remove code for checking that event all at once.


EXTRA::

What do I mean with remove the code for checking that event all at once?! :p

when there is a end_of_path event, I don't believe is the path that triggers it... instead the object every frame
makes a check like this:

Code:
(is there a path?) {
    (is the current point == end point?) {
        call end of path event()
    }
    else {
        update current point()
    }
}
What I mean by "remove the code for checking that event all at once" is removing all this code if I should to disable that event... the code is removed from the source files and doesn't even get computed... I know that if there is no path the only line of code that is checked is the first one (is there a path?) but then again if you make this unneeded/unwanted check for every instance in the room.... it sure takes some CPU time.

Again, I'm not being rude/ not trying to... just defending my point. ;)
 
Top