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

 Future Feature: Disabling built-ins or set to 0?

kupo15

Member
There are a lot of preferences in GMS2 which is great, it would be amazing if we could have the control to disable built-in vars that we never use so they don't take up resources and for ease. If this is not possible maybe we can be able to default certain built-ins to a value?

For example I will always have to waste time setting image_speed to 0 since it is defaulted to 0. This list will eventually have all image_speeds = 0
 

csanyk

Member
This seems like a high degree of customization in your own project for your own reasons. It's pretty common for people to work against the runtime engine and handle things their own way using custom variables, and I guess there's something to be said for wanting to trim the overhead of the built-in variables. But I don't know how YYG could present a flexible, fine-grained interface for doing this for every built-in, in a way that wouldn't be overwhelmingly complex to manage.

Better idea: Can you minimize the amount of work you need to do through parenting?

Create an object called obj_NoAnimation

Create event:
Code:
image_speed = 0;
Now make all your objects that don't use image_speed inherit from obj_NoAnimation.

To extend this idea a bit further, you could name the parent object "obj_EngineReset" and add all the other disabling code that you want in the Create event.

It wouldn't remove the variables from the engine, so there would still be the overhead incurred from the variables taking up memory, and you wouldn't be able to repurpose the reserved words for your own use of course, so it's not perfect. But at least you wouldn't have to have so much duplicate code in all your objects.
 

kupo15

Member
This seems like a high degree of customization in your own project for your own reasons. It's pretty common for people to work against the runtime engine and handle things their own way using custom variables, and I guess there's something to be said for wanting to trim the overhead of the built-in variables. But I don't know how YYG could present a flexible, fine-grained interface for doing this for every built-in, in a way that wouldn't be overwhelmingly complex to manage.
...
hmmm very smart I never thought about using parenting in this way. It would be awesome to remove the overhead completely but if nothing can come from the YYG side then this is certainly a technique I will be employing. Thanks for the tip!
 

rwkay

GameMaker Staff
GameMaker Dev.
We did add a feature for this it is called "parenting" as pointed out above, common things that have defaults can be set once in the parent create event.

Russell
 
Top