OFFICIAL GMS 2.3.0 BETA ANNOUNCEMENT

Good....then get on giving us access! Lots of us have already sent our tickets in but as far a I know none of us have gotten the responses yet(I'm not actually rushing...just excited to get me hands on it :) )
I get a feeling that they will only reply tomorrow... I could be wrong though... I hope... please let me be wrong!! xD
 
I'm waiting for the post-beta release, but this is awesome news. I can't wait to finally learn how to use all the new features that all of the smarter people are excited for instead of just nodding and going, "Oh, structs! Lightweight objects! This changes EVERYTHING!" like I know what's going on.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
1) are we able to control image_index in the sequences? or will it come later down the road?
Yes. ;)

2) another thing.. the online documentation is not updated yet, right? I'm trying to find it and I'm not seeing it!
Could we get our hands on the updated docs while waiting to be accepted for the beta?
I'll see if we can get them updated, or have them placed on a temp link (so as not to confuse regular 2.2.5 users!).
 

Khao

Member
I just have one question about this update.

The blog states that all variables defined in a script are now global in scope.

What does this mean for scripts that are currently specifically defining and/or referencing local variables? Will the variable be treated as global? Can I still reference local variables from the instance calling the script? If I set a variable to a specific value inside the script, am I setting a new global variable at the start of the game despite the fact that its a variable I just want to use locally in an object? The wording is just super confusing for me and has me really scared. If this really works like I think it works, I'm basically going to have to recode most of my game. Really hope I'm just misunderstanding or at least just being paranoid!
 

kburkhart84

Firehammer Games
I'm understanding that if if is inside a function declaration with brackets, then they would still be local/instance variables, and only things that are outside of the functions(similar to macro declarations) would be global.
 

drandula

Member
Whenever I get the beta access, I'll be putting those chained accessories in test by making neural network based on my previous scripts.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
What does this mean for scripts that are currently specifically defining and/or referencing local variables? Will the variable be treated as global? Can I still reference local variables from the instance calling the script? If I set a variable to a specific value inside the script, am I setting a new global variable at the start of the game despite the fact that its a variable I just want to use locally in an object? The wording is just super confusing for me and has me really scared. If this really works like I think it works, I'm basically going to have to recode most of my game. Really hope I'm just misunderstanding or at least just being paranoid!
I'm understanding that if if is inside a function declaration with brackets, then they would still be local/instance variables, and only things that are outside of the functions(similar to macro declarations) would be global.
This is correct, and all scripts will be automatically converted and work exactly as they do currently in 2.2.5. I've been testing with my YYG Marketplace assets, and even the most complex ones likes Aura (my lighting engine) "just work" after importing them into 2.3.0.
 

kburkhart84

Firehammer Games
@Nocturne Will there be a way to have actual GML run through the global scope that could maybe create an object instance in the first room? I'm looking for something similar to the Init Function of the extensions that would work when my code isn't actually in extensions. In that old style, I could put the init function in the extension settings and have it create an object instance instead of having to have to make an initializing function to be called. But since my code is in scripts instead of gml files(in extensions) I can't do it the same way.
 

Khao

Member
This is correct, and all scripts will be automatically converted and work exactly as they do currently in 2.2.5. I've been testing with my YYG Marketplace assets, and even the most complex ones likes Aura (my lighting engine) "just work" after importing them into 2.3.0.
Massive feelings of relief acquired.

Thanks for clarifying! I'm really looking forward to the new features, so the idea that I'd have to just stop updating to keep my project working was... pretty painful, haha.

Guessing there's gonna be a bit of a learning curve if I want to keep using scripts like before (I often literally just copy-paste code from objects to scripts if I want to re-use a chunk of code, which is probably not gonna be completely straight-forward from now on), but with so many new features and possibilities, it's gonna be worth it.
 

XanthorXIII

Member
Thank you guys for getting this out today. I woke up this morning thinking, I kind of feel like something should be happening with 2.3 today. Right on the Money!!!
 

Aviox

Member
My Thoughts on 2.3:

GML

Overall, the changes to GML look great. For some reason, I thought I remembered those being slated for Q4 of 2020. Glad to be wrong!
  • Chained assessors will make life so much easier when dealing with complex data. No more extra vars just to get ds ids.
  • Structs are also a big win for complex data. No more need for data structures filled with enums around every corner. Item.value instead of Item[ItemData.value]? Yes please.
  • I'm personally a little nervous about the addition of Try & Catch. I have a feeling a lot of learning users will throw try{ } around things when they don't understand why they aren't working, and really break things for themselves.
  • I've been in GMS for so long that I don't have strong feelings either way for functions. I think one main benefit for me is I won't have folders of "sub scripts" cluttering up my script resources. As I get used to them, I'm sure I'll wonder how I ever lived without them.
IDE
  • I imagine a lot of people will be hesitant over the new asset browser. (WHERE did that asset go? why aren't sprites at the top anymore?) But for big projects, This is so needed. Thank you.
  • I'm personally really excited about the potential of Tags. It currently can be a little messy to add the equivalent of custom built-in variables. I'm thinking tags will be a great way around this? I'm curious to see what kind of options there to manage them. For example, can you see a list of all created tags in the IDE when assigning tags to something? Can you inherit them from parent objects? Are they treated like a list of strings in code, or is there a more elegant way of referencing them?
  • Really curious to play around with animation curves, too. They might be great for things like xp curves in RPGs, or diminishing return math for stackable buffs in Rouge-lites.
  • Although it's arguably the biggest new feature, I'm still not really sure about sequences. I can only think of a few instances I'd want to use them currently (some menu/HUD elements & MAYBE cutscenes). I think I'll need to "get my hands wet" or see other user's ideas to really grasp just how good of a feature add this is. I'm a little leary of them because it almost feels like a more advanced path editor, and I don't currently have a single use for paths, unless I'm being lazy or just prototyping a concept quickly. Also. Do sequences mean paths are essentially obsolete? (I mean, they kind of already are obsolete in my mind, but you know...)
 
Hello and thank you for update news, I got a lovely feature request here!

GML:
string = json_encode_struct(struct)
struct = json_decode_struct(string)
Same as json_encode/decode but for structs, this will be a game changer feature!

Edit: To clarify, when decoding a json with this new method, objects will be turned directly into structs.
 
Last edited:

kburkhart84

Firehammer Games
Since you can add script calls to sequences...I'd say its a nice way to do better animation stuff, even if it is just for basic sprites. For example, you could easily use a sequence to add footstep sounds to the right moments of the animation instead of having to code in image_index checks for that. You could even add things like particles and effects that work as part of the animation without having to actually create the sprite that way(like if you have a generic pic of a solar flare or particle).
No. Scripts are now compiled before the actual game is run.
Darn....I guess the only way to get what I want is to go ahead and add an itty bitty gml file to an extension resource and use the Init function of the extension system to handle it. That just feels kinda wonky though, but it could save the user from having to call an init function at the least.
 

gnysek

Member
Good to see all of you so excited! Tbh, I am too! I really want to see what people do with sequences, as I have a feeling it's going to be one of those systems where the obvious things (like creating UI) lead to a lot of emergent uses that YYG never even thought of. :)
There's no option (yet?) to make free deform/skew of sprite edges (like in draw_sprite_pos), I think that adding it would expand possibilities twice, for character animations.
 
I'm personally really excited about the potential of Tags. It currently can be a little messy to add the equivalent of custom built-in variables. I'm thinking tags will be a great way around this? I'm curious to see what kind of options there to manage them. For example, can you see a list of all created tags in the IDE when assigning tags to something? Can you inherit them from parent objects? Are they treated like a list of strings in code, or is there a more elegant way of referencing them?
I'm also hyped regarding tags... it was something that made me smile while I was reading the 2.3 news! But those questions are good..
1) will there be inheritance for tags?
2) and what about collisions can we use tags to check collision?
3) or for example match multiple tags something like instance_get_with_tags("a", "b", "c");

tags could be handled as bits instead of text under the hood... something like a "global" object for example: tags.player or tags.fire (performance wise would be better, I think).
this would allow for auto-completion:

instance_has_tag(tags.player);

or even better:

GML:
with(tags.my_tag)
{
    // do stuff
}
 
Last edited:

FoxyOfJungle

Kazan Games
Is there any news about built-in video player?
I can't really understand what struct is, right the first time I hear this word, my mind will explode. But I'm really looking forward to this update, the high Dollar makes things a bit more difficult for me...
 
Is there any news about built-in video player?
I can't really understand what struct is, right the first time I hear this word, my mind will explode. But I'm really looking forward to this update, the high Dollar makes things a bit more difficult for me...
you can create a struct using:


GML:
item = {
    name : "sword",
    attack : 10
};

// and then use it like this

var _name = item.name;
var _attack = item.attack;

//or even create an empty struct, and fill it afterwards

skill = {};
skill.cost = 10;
skill.power = 200;
skill.name = "supernova";

// it's like an instance (with no events) or like a ds_map that can use dot (.) accessor
another example:


GML:
// you have a functions that returns an array

function my_func()
{
    return [10, "john", 22, 32];
}

// now you call the function and try to access the data
var a = my_func();

// the problem is that you need to know what index is each value
var _age = a[0];
var _name = a[1];
var _attack = a[2];
var _defense = a[3];

// Now the same thing using structs
// you have a functions that returns an array

function my_func_2()
{
    return { age: 10, name: john, attack: 22, defense: 32 };
}

// now you call the function and try to access the data
var a = my_func_2();

// it's super easy to access data and you don't have to memorize the indexes
var _age = a.age;
var _name = a.name;
var _attack = a.attack;
var _defense = a.defense;
 
Last edited:

kburkhart84

Firehammer Games
Don't know about the video player(I'd like it to be in this update of course).

A struct is basically as described, a light weight object. It stores variables of whatever types you want, and can have functions to run on those as well.

Think of a 2d Vector as an example. Right now, you would have to have separate x/y variables for that vector, or use a mini-list, or an array, to store that. Then you would have to have separate scripts to run operations on it, like getting the size of it. Now, you can put the x/y inside a struct and access it like vector.x, vector.y. You could also attach a function that calculates the size of it and then access it like vector.size(), and internally it would automatically use the x/y in that specific vector instance to calculate the size, instead of you having to use external scripts and pass along the data values.
 

FoxyOfJungle

Kazan Games
you can create a struct using:


GML:
item = {
    name : "sword",
    attack : 10
};

// and then use it like this

var _name = item.name;
var _attack = item.attack;

//or even create an empty struct, and fill it afterwards

skill = {};
skill.cost = 10;
skill.power = 200;
skill.name = "supernova";

// it's like an instance (with no events) or like a ds_map that can use dot (.) accessor
another example:


GML:
// you have a functions that returns an array

function my_func()
{
    return [10, "john", 22, 32];
}

// now you call the function and try to access the data
var a = my_func();

// the problem is that you need to know what index is each value
var _age = a[0];
var _name = a[1];
var _attack = a[2];
var _defense = a[3];

// Now the same thing using structs
// you have a functions that returns an array

function my_func_2()
{
    return { age: 10, name: john, attack: 22, defense: 32 };
}

// now you call the function and try to access the data
var a = my_func_2();

// it's super easy to access data and you don't have to memorize the indexes
var _age = a.age;
var _name = a.name;
var _attack = a.attack;
var _defense = a.defense;

A struct is basically as described, a light weight object. It stores variables of whatever types you want, and can have functions to run on those as well.

Think of a 2d Vector as an example. Right now, you would have to have separate x/y variables for that vector, or use a mini-list, or an array, to store that. Then you would have to have separate scripts to run operations on it, like getting the size of it. Now, you can put the x/y inside a struct and access it like vector.x, vector.y. You could also attach a function that calculates the size of it and then access it like vector.size(), and internally it would automatically use the x/y in that specific vector instance to calculate the size, instead of you having to use external scripts and pass along the data values.
Now I understand, it looks a lot like enum. Thanks for the explanation!
 
Now I understand, it looks a lot like enum. Thanks for the explanation!
you cannot hold text inside enums nor change its value:

GML:
enum test
{
    a,   // 0
    b,   // 1
    c    // 2
}

var _a = test.a; // a is now 0;

// but you cant do
test.a = "something new"; // ERROR

// also when defining enums you CANNOT set elements to something other than numbers

enum test2
{
    a = "john" // ERROR
}


// with structs you can do read and write to the struct and even do:

my_struct = {
    a: 10,
    func: function() {
        show_debug_message(a);
    }
};

// now if you call
my_struct.func();

// this will print 10 to the terminal
// and if you change the value of a

my_struct.a = 20;
my_struct.func();

// now struct will print 20
// this is very powerfull stuff
 

FoxyOfJungle

Kazan Games
you cannot hold text inside enums nor change it's value:

GML:
enum test
{
    a,   // 0
    b,   // 1
    c    // 2
}

var _a = test.a; // a is now 0;

// but you cant do
test.a = "something new"; // ERROR

// also when defining enums you CANNOT set elements to something other than numbers

enum test2
{
    a = "john" // ERROR
}


// with structs you can do read and write to the struct and even do:

my_struct = {
    a: 10,
    func: function() {
        show_debug_message(a);
    }
};

// now if you call
my_struct.func();

// this will print 10 to the terminal
// and if you change the value of a

my_struct.a = 20;
my_struct.func();

// now struct will print 20
// this is very powerfull stuff
I personally use local variables instead of enums to make state machines, and I was not very familiar with it. Structs looks super promising! 😍
 
Last edited:

kburkhart84

Firehammer Games
Looking at the videos on the Sequence editor, I really like how Yoyo followed the methods of pretty much all the other animation programs I've seen. The editor is similar to Unity's and Blender's and likely most others. They didn't try to do things there own special way and that is a GOOD thing.

The part that I didn't see in the videos was (if it is possible) how to change interpolation types on the keyframes. It only shows a basic linear interpolation. If that is something you can't do yet, you will have to put way too many keyframes if you want a smooth curve. If I saw it correctly, the animation curve creator can do curvy stuff, although I'm not sure if it easily lets you control the interpolation or it is only doing smooth curving.

EDIT***

The blog post says the animation curves will be linear or smooth...doesn't say if it can be mixed in the same curve...and it doesn't have control points for you to shape the curve around the point like in other systems. Its a good start though for sure.
 

Yal

🐧 *penguin noises*
GMC Elder
Am I reading this wrong, or does scripts being able to define global variables mean that you can define persistent state variables (supposed to only be used by the functions in that script file) this way? Things like seeds for your custom random number generator, data structures for bookkeeping in your whatever-systems (even if you can't actually set them globally at compile time, you could have an initialization function)
...actually, considering how much global. I throw around in my games, I don't really think it matters... the old method will still work :p I'm overthinking that little detail...

Functions being basically "tabbed scripts 2.0" is super nice, though! I was kinda miffled when GMS2 removed script tabs and my resource tree got a lot more cluttered by helper scripts I'd forgotten about :p

Oh yeah, why didn't I react to tags basically being aspect oriented programming? :O This is like the best thing ever~
(The only thing that would make them even better would be the ability to assign events to tags to make them true aspect-oriented programming constructs... e.g. all light sources run some special step event... but you can solve that with loops in the appropriate that gets objects matching the parent tag, even if it's more involved. Being able to assign collision and input events to a tag would be a welcome crutch, though.)

Chained accessors and structs also are amazing - I throw around arrays of data all the time to be able to have composite return values (3D vectors, lists of all relevant data in a monster database lookup, etc), and either of those would make my life a lot easier.

I'm not sure how much I'd use sequences and animation curves, but having WYSIWYG editors that could help me write cutscenes without having to imagine everything in my head, make a state machine to act on it, and then implement and debug it for days seems like a pretty tempting prospect! It sounds dope as sheet okay that was the worst joke ever

I'm not sure what I think about the new generic resource tree, I'm so bad at organizing things that having the engine tell you how to do it was one of the selling points :p But I suppose organizing things based off of level or subsystem is more industry standard and helpful in large projects (instead of having one large "here's all the graphics assets" folder), and with Marketplace extensions I can definitely see the benefits of having them contained to ONE folder instead of one folder per resource type.
 

Homunculus

Member
I’m a bit confused about passing functions around honestly, after reading the blog post. Will things like the following be allowed?

GML:
//in a script make_foo()
var _foo = function() { show_debug_message(x); }
return _foo;

//in an instance
foo = make_foo();
foo(); //prints x?

GML:
//in an obj create
struct = {
    name: "Lighweight",
    print_name: function() {show_debug_message(name);}
}

my_print = struct.print_name;
my_print(); //at what scope is this method even run, if possible at all? what if the struct gets destroyed before this call?
 

kburkhart84

Firehammer Games
I'm not sure what I think about the new generic resource tree, I'm so bad at organizing things that having the engine tell you how to do it was one of the selling points :p But I suppose organizing things based off of level or subsystem is more industry standard and helpful in large projects (instead of having one large "here's all the graphics assets" folder), and with Marketplace extensions I can definitely see the benefits of having them contained to ONE folder instead of one folder per resource type.
If I read it right it will still default to having those folders that we are already used to(simply not enforcing their usage per the new system).

***************************************************************

In case Nocturne or the higher-ups see this....what is the future of "extensions?" Are they going to soon be deprecated since we can now distribute all the resources via asset packages? Or are they going to be kept around and possibly expanded upon later on?
 

gnysek

Member
The blog post says the animation curves will be linear or smooth...doesn't say if it can be mixed in the same curve...and it doesn't have control points for you to shape the curve around the point like in other systems
One curve can't be partially smooth and ten linear. You can however create several curves in one AnimationCurve resource and swap then with code at proper moment, or using sequence editor, just finish smooth one and start straight one from next keyframe.

I’m a bit confused about passing functions around honestly, after reading the blog post. Will things like the following be allowed?
Both should work. And structure won't be destroyed, as structures same as arrays are referenced in GML, and can be garbage collected when no more references - something that DS things lacks (yet).
 

Yal

🐧 *penguin noises*
GMC Elder
I’m a but confused about passing functions around honestly, after reading the blog post. Will things like the following be allowed?

GML:
//in a script make_foo()
var _foo = function() { show_debug_message(x); }
return _foo;

//in an instance
foo = make_foo();
foo() //prints x?

GML:
//in an obj create
struct = {
    name: "Lighweight",
    print_name: function() {show_debug_message(name);}
}

my_print = struct.print_name();
my_print(); //at waht scope is this event run, if possible
at all? what if the struct gets destroyed before this call?
Since GML is mostly pass-by-value, I'd imagine my_print gets a copy of whatever is in struct.print_name at that time, and that copy of the function is used even if the original struct is destroyed (and more importantly, even if it still exists and is updated later). Not sure if calling an entire script file is gonna be allowed, only the functions defined inside it (which makes the make_foo example not make sense to begin with). But in general, since we can store functions in variables it doesn't seem too far-fetched that you can have functions that return functions.
 

kburkhart84

Firehammer Games
One curve can't be partially smooth and ten linear. You can however create several curves in one AnimationCurve resource and swap then with code at proper moment, or using sequence editor, just finish smooth one and start straight one from next keyframe.
If it had control point handles, then you could set different handle types for each point, and that would let you make it smooth in one part and linear in another. I'm not rushing things though, as those are advanced features that may be coming in yet another update.
 

Homunculus

Member
@gnysek They do mention a delete method for structs though, that's why I'm wondering, seeing that the method requires the struct to exist since it references one of its variables (name)

@Yal Assuming that's the case, what about the "name" variable? Will it look for that in the struct (that may no longer exists), or for a name variable in the context of the instance calling the method?
 

gnysek

Member
Am I reading this wrong, or does scripts being able to define global variables mean that you can define persistent state variables (supposed to only be used by the functions in that script file) this way? Things like seeds for your custom random number generator, data structures for bookkeeping in your whatever-systems (even if you can't actually set them globally at compile time, you could have an initialization function)
...actually, considering how much global. I throw around in my games, I don't really think it matters... the old method will still work :p I'm overthinking that little detail...

From what I know, if you write in any scripts (not inside a function): some_variable = 1;
Then, you can use it under that name in same script, but in other scripts/objects, it became available as global.some_variable.

@gnysek They do mention a delete method for structs though, that's why I'm wondering, seeing that the method requires the struct to exist since it references one of its variables (name)
Yes, there is delete because as I said, structs are referenced. So they aren't removed as long, as part of them is assigned to something. The delete will remove reference from variable, but struct seems to remain in memory as long, as it's referenced somewhere else in memory (struct or it's functions, other variables doesn't seem to link so hard). delete seem to not delete it from memory yet.

So, this will work:
GML:
test = {
    name: "Lighweight",
    print_name: function() {show_debug_message(name);}
}

my_print = test;
delete test;
show_debug_message(my_print);

// returns
// { name : "Lighweight", print_name : function gml_Script_anon____struct___0_92_gml_GlobalScript_Script4 }
Of course my_print = struct.print_name(); will result in my_print = "Lighweight", I assume you were thinking about: my_print = struct.print_name without parentheses, so referencing a function, not getting it's result.

Also, the code you wrote earlier, works:
GML:
function make_foo() {
    var _foo = function() { show_debug_message("test"); }
    return _foo;
}

//in an instance
foo = make_foo();
foo(); // prints "test"
 
Last edited:

Homunculus

Member
I assume you were thinking about: my_print = struct.print_name without parentheses, so referencing a function, not getting it's result.
Yep, I actually meant storing the struct method in an instance variable, and running the method from the reference (I corrected the code shortly after). To make it more clear, if I understand what you are saying, the following

GML:
struct = {
    name: "I'm a struct",
    print_name: function() {show_debug_message(name);}
}

name = "I'm an instance"
my_print = struct.print_name; //storing the function reference, not its result
my_print();
Should print "I'm a struct" then?
 
Last edited:

gnysek

Member
Should print "I'm a struct" then?
Exactly! By default, variables are taken from struct scope, like there is self. before their name. You can use same name for variables in several struct/functions/objects. However, if there's a function with this name, it will give unexpected results (will return a function id/name probably).

----

Also, from what I noticed about structs (from what I understand, while they looks different, both are structs):

GML:
struct = { name: "struct"}
function f() constructor { name = "struct"; }

show_debug_message(struct.name == (new f()).name); // prints 1, so true
 

kburkhart84

Firehammer Games
So if functions are now being declared with their arguments as named variables...how does the new gml handle variable argument amounts? Is that still a thing?
 

gnysek

Member
So if functions are now being declared with their arguments as named variables...how does the new gml handle variable argument amounts? Is that still a thing?
argument_count + argument[n] still exits, and works in same way. The only difference with functions now is, that you can use own names for arguments, instead of argument0...argumentN. But you can still use them too if you like.

So, this:
1587680711425.png
converts to this:
GML:
function test(argument0) { return argument0; }
but you can also change it to:
GML:
function test(b) { return b; }
And it will work same.

Also, this is valid:
GML:
function test() { return argument_count == 1 ? argument[0] ? false; }
 
Last edited:
So after watching the videos on Sequences, I have one quick question: will you be able to manipulate the visibility of individual tracks via code so that you could (for example) customize player characters while keeping the same animation or swap out weapon sprites depending on what the animated character currently has equipped? I would assume so, but I just wondered if there was any official word.
 

Aviox

Member
So after watching the videos on Sequences, I have one quick question: will you be able to manipulate the visibility of individual tracks via code so that you could (for example) customize player characters while keeping the same animation or swap out weapon sprites depending on what the animated character currently has equipped? I would assume so, but I just wondered if there was any official word.
I hadn't even using the sequencer as a skeletal rigging system. That'd be a rad use. I'd be really surprised if the tools to do that sort of thing weren't possible!
 
Top