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

OFFICIAL GMS2 Version 2.3.1 (Beta Release)

Status
Not open for further replies.
Oh man, 64 bit compiling and weak references!


Obviously as an expert programmer I already totally know what those things mean, but for the newbies could anyone give a brief rundown of what compiling to 64 bit Windows means? Pros/cons? Would it mean anyone with 32 bit Windows can't run the game (limiting the audience that can play it)? Does it affect the ability to port to other systems (Mac, consoles, mobile?) Is there any reason not to use it? It sounds like it gives a memory boost...anything else?

And clearly I know what weak references are, I mean who doesn't! But for the newbies, could anyone explain what kind of things you would commonly use them for in a game? Is it useful if you aren't using ds_lists etc? It sounds like variables just randomly disappearing which seems like it would be a bad thing...to newbies of course, not to me, as an expert programmer.
 
Last edited:
And clearly I know what weak references are, I mean who doesn't! But for the newbies, could anyone explain what kind of things you would commonly use them for in a game? Is it useful if you aren't using ds_lists etc? It sounds like variables just randomly disappearing which seems like it would be a bad thing...to newbies of course, not to me, as an expert programmer.
Regarding Weak References...
take this example:

EXAMPLE 1 (strong references):
GML:
a = [1, 2, 3]; // here you create an array and make 'a' take a reference to it (strong reference)

b = a; // here you point 'b' to the array (creating a strong reference)

a = undefined; // here you de-reference the array stored in 'a'

// the array still exists in memory because 'b' still references it!

b = undefined; // now there are no more references the garbage collector will remove the array from memory

EXAMPLE 2 (weak references):
GML:
a = [1, 2, 3]; // here you create an array and make 'a' take a reference to it (strong reference)

b = weak_ref_create(a); // here you point 'b' to the array (creating a weak-reference)

var isAlive = weak_ref_alive(b) // this returns true

a = undefined; // here you de-reference the array stored in 'a' the garbage collector will remove the array from memory.

// even though 'b' refers to the array (weak-reference) it doesn't count as a reference to the garbage collector.

var isAlive = weak_ref_alive(b) // this returns false!!
 
Last edited:
[ERROR] array_sort with custom function silently crashes the game, in OSX!

GML:
var testArray = [9,7,82,35,6,4,52,3,23,64,54,742,42,8,33,6,7];
var sortTest = function(inst1, inst2) { return inst1 - inst2; };

array_sort(testArray, sortTest);
Can anyone confirm if there is a problem with the feature in Windows also.. or even on OSX?

Just found out the problem in OSX if array size is >= 8 the game crashes.
 
Last edited:
Regarding Weak References...
Awesome, that clears up the difference between them nicely, thanks! I'm not sure what to do with it in the context of making a game, I'm guessing anything expecting "b" to still have something in it after changing "a" would crash the game so it seems like a risky thing to mess with unless you're doing something advanced with memory management that's probably way above my coding level lol

Can anyone confirm if there is a problem with the feature in Windows also.. or even on OSX?
It ran just fine in Windows for me!
 
Awesome, that clears up the difference between them nicely, thanks! I'm not sure what to do with it in the context of making a game, I'm guessing anything expecting "b" to still have something in it after changing "a" would crash the game so it seems like a risky thing to mess with unless you're doing something advanced with memory management that's probably way above my coding level lol


It ran just fine in Windows for me!
@Juju used this principle to track surfaces... and automatically delete from memory.

you can make an object that holds weakrefs to surfaces and during the step event goes through all the weakref to check if they are alive weak_ref_alive if there are not delete from memory ;)
 
I keep getting the error "The main project file "blabla\mygame" has changed. Would you like to reload the resources, or save? WARNING: Save will only update the resources files that are currently held in memory, and therefore may not restore some deleted or edited files" and I have the option to Reload or Save my game's main yyp project file and my one sprite (a Spine file)

I get this popup every single time I start the new beta and open my project up, even when literally all I've done is saved it, closed GMS, reopened GMS, then reopened my project. I use dropbox and github desktop but github doesn't show any actual changes to the files so I'm not sure what GMS thinks is happening to them.

If I click Reload it just keeps giving me the same error until I click Save...and I'm not sure what either button is really supposed to be doing but it sounds scary like I'm about to lose my files or they've been corrupted and I'm about to save over files that worked when I saved and closed GMS. Maybe the message could be made more clear, I think this error would be scary for a newbie.

When I click Save it finally works, and gitHub shows that the main yyp project file has had some GMLive extension files changed/added by the Save button (when I haven't done anything with them between closing GMS and reopening GMS).

Oddly the sprite that came up in the error doesn't show any changes and there's no changed references to it in the .yyp file so I don't know what it's doing with that sprite lol

And if I now immediately save then close GMS, then reopen GMS and my project, the exact same error for the exact same files (main yyp and a Spine sprite) happens and gitHub shows the same lines relating to the GMLive extension's files being added (and again nothing to do with the sprite changing despite it showing up in the error)

I can still work when I hit Save but it seems like something is broken!

you can make an object that holds weakrefs to surfaces and during the step event goes through all the weakref to check if they are alive weak_ref_alive if there are not delete from memory
Ah, so if I understand right the idea there would be that you'd force it to clear that memory every step to ensure you're using the lowest memory possible vs letting the garbage collector decide when to do it and risking a traffic pileup if it doesn't clear some surfaces out right away? I'm actually using a lot of surfaces in my game for some effects so that sounds like something I should look into more for sure!
 
Last edited:

Alice

Toolmaker of Bucuresti
Forum Staff
Moderator
Ah, so if I understand right the idea there would be that you'd force it to clear that memory every step to ensure you're using the lowest memory possible vs letting the garbage collector decide when to do it and risking a traffic pileup if it doesn't clear some surfaces out right away? I'm actually using a lot of surfaces in my game for some effects so that sounds like something I should look into more for sure!
I don't know whether weak reference becomes not "alive" as soon as all strong references are gone, or only when the corresponding entity gets garbage collected.

The core of this use-case isn't preventing the garbage collector pileup and keeping overall memory as low as possible. Rather, it's to ensure you can automatically free memory for entities that aren't garbage-collected.

Alongside garbage-collected structs/arrays/instances/etc. there are entities that you need to clean up explicitly - surfaces, ds_* data structures, buffers and so on.
Now you can associate such an explicitly-removed entity with a weak reference, then call the cleanup function (surface_free, ds_*_destroy...) as soon as the weak reference is no longer alive.
Without it, you'd either need to designate a spot where the entity is cleaned up, or you'd end up with a memory leak if the entity wasn't cleaned up at all.

In short: weak references with surfaces aren't primarily meant to ensure surfaces are removes as soon as possible. They're to ensure surfaces are cleaned up at all, in an automatic garbage-collector-like manner.
 

Juju

Member
I don't know whether weak reference becomes not "alive" as soon as all strong references are gone, or only when the corresponding entity gets garbage collected.
Only when the entity gets garbage collected, which is "whenever".

In short: weak references with surfaces aren't primarily meant to ensure surfaces are removes as soon as possible. They're to ensure surfaces are cleaned up at all, in an automatic garbage-collector-like manner.
Yep, what she said!

That surface garbage collection library is half useful tool and half an example use-case for weak references. I'm glad it's given people something to discuss.
 

gnysek

Member
Ok, I thought that maybe it have another usage over being a shorter version on variable_struct_set(s,n,v).
 

drandula

Member
What do you need to set up for Pi? 🤔 Want to test how well it works.

Also I would like to know about autocompletion. I have constructors, which then have similiarly named functions. Now these functions may want different inputs, like "Add(value)" and "Add(x,y)", currently autocompletion doesn't know how to deal with these, and shows just one of them (maybe latest, random who knows).
For writing code this is bit nuisance, as you need to go for constructor itself to see the function and what arguments it needs.

Will there be solutions for this in future?
If fully automatic system suggesting correct arguments for functions isn't plausible, could there be user given hints to help autocompletion?

Like dot notation for comments 😆

/// @func Vector.Add( vector3 );
/// @func Coord.Add(x,y,z);
/// @func Score.Add(value);
Something to provide context for autocompletion for better suggestions.
 
Last edited:

clee2005

Member
@Dan I finally got our games to build under 2.3 (using this 2.3.1 beta) and the things that were preventing it from running before are fixed! Because I was able to make it further into the testing I found that IAPs are not working in iOS now. Under iOS when you purchase a consumable it brings up the item, and allows you to purchase, but the game fails to acknowledge the purchase now (this is production code that works under 2.2) - so something changed there.

Edit : Android works fine, but was working differently as the configuration tag changed from "default" to "Default" and I was using os_get_config() == "default" to create the proper IAP Object. Fixed that, and now Android is ok, but iOS IAPs are still not running properly.

Edit 2 : This seems to be a problem with an extension that extends the AppDelegate class. I'm not sure if that's the problem as I don't have enough ObjC knowledge to effectively make changes. I do know if I remove this extension then the IAPs work and receive the response from Apple. If the extension is present then the IAP response from Apple never happens. Seems like something changed in the expectation of iOS extension handling that is causing this.

Basically, the Async IAP Event never fires with this particular extension in place. Any ideas what could stop that from firing? A rogue AppDelegate class not propagating it's application events?
 
Last edited:
What do you need to set up for Pi? 🤔 Want to test how well it works.

Also I would like to know about autocompletion. I have constructors, which then have similiarly named functions. Now these functions may want different inputs, like "Add(value)" and "Add(x,y)", currently autocompletion doesn't know how to deal with these, and shows just one of them (maybe latest, random who knows).
For writing code this is bit nuisance, as you need to go for constructor itself to see the function and what arguments it needs.

Will there be solutions for this in future?
If fully automatic system suggesting correct arguments for functions isn't plausible, could there be user given hints to help autocompletion?

Like dot notation for comments 😆


Something to provide context for autocompletion for better suggestions.
During v2.3 beta I made an entire post suggesting autocomplete alternatives ;) and I think they will do it someway along the way but don't know when. I hope we get those sooner than later :p

I suggested some extra JSDoc tags like:
/// @context Vector

so you could use it like:
GML:
function Vector() constructor {
    /// @function myfunc(an_array)
    /// @context Vector
    /// @param {array} an_array
    function myfunc(_a) {}
}

function OtherClass() constructor {
    /// @function myfunc(a_real)
    /// @context OtherClass
    /// @param {integer} number
    function myfunc(_number) {}
}
or even try to auto-detect context for methods defined inside a constructor:
note that the autocomplete would still don't know which method you want to call so autocomplete would show you a list with all the alternatives:

Code:
[@Vector] myfunc({array} an_array)
[@OtherClass] myfunc({integer} number)
 
Last edited:

Arzulo

Member
Ever since updating, I've been having an issue with HTML5 and Android builds.
When trying to build the game, I'm faced with this error for HTML5:

GML:
System.NotSupportedException: The given path's format is not supported.
   at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
   at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)
   at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
   at Igor.HTML5Builder.Deploy(Boolean _exe)
   at Igor.HTML5Builder.Run()
Igor complete.
elapsed time 00:00:11.5683683s for command "C:\ProgramData/GameMakerStudio2-Beta/Cache/runtimes\runtime-23.1.1.187/bin/Igor.exe" -j=8 -options="C:\Users\Zane\AppData\Local\GameMakerStudio2-Beta\GMS2TEMP\build.bff" -v -- HTML5 Run started at 10/12/2020 17:59:32
And this one for Android:
GML:
System.NotSupportedException: The given path's format is not supported.
   at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
   at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)
   at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
   at Igor.AndroidUtils.(String , String )
   at Igor.AndroidUtils.(String , String )
   at Igor.AndroidBuilder.Deploy(Boolean _exe)
   at Igor.AndroidBuilder.Run()
Igor complete.
My understanding is that these errors normally show up whenever there is an issue with File/Directory names, such as using special characters that aren't permitted. However I haven't changed any of the options in my project, and everything used to work prior to the 2.3.1 update. The game also compiles perfectly fine for Windows and MacOS, both VM and YYC

I'm struggling to figure out how to approach debugging this further. If anyone has any suggestions or work around, please let me know.
 
Last edited:

gnysek

Member
I've reported a bug, that when merging layers in sprite, not only all images are still kept on disk, but even in .yy file, wasting space (and you won't notice change in git) and causing a mess in file structure. They answered they are aware from some time, sadly as bug database is private (so that bug may be even year or two old), I can't check progress with it, and when it's gonna be fixed, I will find it out in release notes. So, probably not in 2.3.1, and who knows if ever.

What a joke.
 
Obviously as an expert programmer I already totally know what those things mean, but for the newbies could anyone give a brief rundown of what compiling to 64 bit Windows means? Pros/cons? Would it mean anyone with 32 bit Windows can't run the game (limiting the audience that can play it)? Does it affect the ability to port to other systems (Mac, consoles, mobile?) Is there any reason not to use it? It sounds like it gives a memory boost...anything else?
Pros:
  • 2TB (i.e. absolutely ridiculous in 2020) max RAM usage
  • Potential performance boost
"Cons":
  • Incompatible with users on a 32-bit OS
  • Slightly larger exe sizes
  • Larger base RAM usage

The biggest benefit is the 64-bit address space. This means you can essentially use however much RAM you want as opposed to the 32-bit soft cap of 2GB. Lots of higher-end GM games already brush up against that barrier, so having a 64-bit option is very welcome. I note "potential" performance boost, but it's also possible that there may be a small performance loss instead. It all depends on how GMS handles it under the hood and how complex the operations you need to do are. Also of note is that those cons are much smaller than they might at first appear to be:

- On OS incompatibility, as of Sept. 2020, only 0.3% of Steam users still use 32-bit Windows. More people use Windows 7 64-bit. Heck, more people use Windows 8 (not 8.1). This number has been shrinking significantly over the last few years--it was 6% in 2017. Microsoft no longer sells 32-bit OSes to hardware manufacturers. Nvidia is no longer providing support for 32-bit OSes. Mac OS X, iOS, Android, UWP, and Ubuntu have already long phased out 32-bit. The latest versions of GMS2 already export only 64-bit executables for those targets. At some point, 32-bit exes will fail to run on Windows without an emulation layer like DOSBox does for 16-bit exes. Going 64-bit guarantees your game will survive into that near-future/almost-current era without people having to use workarounds to play it.

- GM exe sizes are already small enough that a larger exe size doesn't matter. The difference between GM's tiny exe output sizes vs. that of other popular engines is so vast that when I download a game on Steam, I can almost guarantee whether or not a game was made in GM just by how small the filesize is.

- Larger base RAM usage is not an issue at all considering how small the size difference would be and how absolutely tiny the base RAM usage for GMS 32-bit exes currently is.

TL;DR: On paper, the pros outweigh the cons so much that any new project should use the 64-bit target as the default.
 
Last edited:

FrostyCat

Member
I'm going to express an insensitve but important opinion here: Why is incompatibility with 32-bit these days considered a con? These days, excluding people who still use 32-bit-exclusive devices is no longer a con. It is as much a pro as it is a practical necessity.

Here are some topics regarding 32-bit architecture on the GMC over the past few years:
What recurrent themes do you see in these topics? This is my take, as politically incorrect as it is:
  • You can tell that they will be tightwads. They will not be any more generous with your product than they are with their equipment.
  • You can tell that there will be corner-cutting on their devices to make it still run, and your product will take the blame when those measures fall short.
  • You can tell that if they are allowed to run your app, their devices will likely be resource-starved, sometimes "to death", and that too will be blamed on your product.
  • You can tell that they don't understand how far behind the times they are, or how much extra effort a modern developer would have to take in order to cater to them.
  • You can tell that they are argumentative, unprofitable, technically primitive, and infeasible to please.
If you value your sanity and ratings on the marketplace, these look like very good reasons to keep 32-bit architecture out of future offerings.

It only takes an adolescent to see the benefits of serving others in the marketplace. It takes an adult to see the downsides to universal inclusivity in such service.

YoYo is making the adult decision for GMS 2 developers going forward. While I can't stand by all their decisions, I can and will stand by their decision to phase out 32-bit builds.
 
I'm going to express an insensitve but important opinion here: Why is incompatibility with 32-bit these days considered a con?
While I agree with almost all of your points, the fact is that there are still users of 32-bit Windows, which 64-bit executables are incompatible with. Currently, the amount of Steam users on 32-bit Windows outnumbers those running Ubuntu versions officially supported by GMS2. Having that amount of potential users now unable to play your game is objectively a con, even if it is an insignificant con as both of us pointed out.
 
Last edited:

Samuel Venable

Time Killer
I'm actually a little sad they are phasing out 32-bit due to the fact that kills off quite a bit of marketshare. But all my computers except my ancient laptop I'm about to throw out possibly soon are all 64 bit capable machines, and I own and have access to a lot of computers in my house, probably more than I need.
 

gnysek

Member
I'm actually a little sad they are phasing out 32-bit
Where it's written that YYG is phasing out 32-bit? I thought they just added an option for x64 and that's all. Also, as a reminder - since May 2020, all new notebooks with OEM Windows can't use 32-bit version anymore (that doesn't mean support for it ended - just it's not sold for OEM purposes anymore, it will still get all updates on existing machines).

x64 is even not checked by default on latest beta, and 32-bit is still a default export option. So until they swap those options we're far away from phasing out.
 

Tornado

Member
I just installed 2.3.1 Beta.
version.jpg

When I open my project, the Assets panel is empty!!!
Wow!
no_assets.jpg

When I open some smaller test projects they are opened correctly. (Well, at least I see their assets.)

I'll check ui.log.
 
Last edited:

Tornado

Member
That IS Asset tab and Asset Browser is missing. I already said, that for other Projects it works!!!

EDIT: I tried doing Windows->Asset Browser like you suggested, but nothing happens!

This is in ui.log:
Code:
[15:04:57:13(886a)] Blank IdReference found - could be that the project is corrupt.
[15:05:00:189(886a)] Project Load Exception, Object reference not set to an instance of an object.   at YoYoStudio.Resources.ResourceBase.PostDeserialise(GMProject _project)
   at YoYoStudio.Resources.GMSpriteFrame.PostDeserialise(GMProject _project)
   at YoYoStudio.Resources.GMSprite.PostDeserialise(GMProject _project)
   at YoYoStudio.Resources.GMProject.PostDeserialise(GMProject _project)
   at YoYoStudio.Resources.GMProject.LoadUpdate(OnLoadSaveSuccess _onSuccess, OnLoadSaveUpdate _onUpdate, OnLoadSaveFailed _onFailed)
[15:05:00:237(886a)] No root view detected... automatically creating one
I use Windows version of GMS.
 
Last edited:

Samuel Venable

Time Killer
Where it's written that YYG is phasing out 32-bit? I thought they just added an option for x64 and that's all. Also, as a reminder - since May 2020, all new notebooks with OEM Windows can't use 32-bit version anymore (that doesn't mean support for it ended - just it's not sold for OEM purposes anymore, it will still get all updates on existing machines).

x64 is even not checked by default on latest beta, and 32-bit is still a default export option. So until they swap those options we're far away from phasing out.
I was going by what @FrostyCat seemed to suggest but maybe I missed something.
 
Pros:
  • 2TB (i.e. absolutely ridiculous in 2020) max RAM usage
  • Potential performance boost
"Cons":
  • Incompatible with users on a 32-bit OS
  • Slightly larger exe sizes
  • Larger base RAM usage

The biggest benefit is the 64-bit address space. This means you can essentially use however much RAM you want as opposed to the 32-bit soft cap of 2GB. Lots of higher-end GM games already brush up against that barrier, so having a 64-bit option is very welcome. I note "potential" performance boost, but it's also possible that there may be a small performance loss instead. It all depends on how GMS handles it under the hood and how complex the operations you need to do are. Also of note is that those cons are much smaller than they might at first appear to be:

- On OS incompatibility, as of Sept. 2020, only 0.3% of Steam users still use 32-bit Windows. More people use Windows 7 64-bit. Heck, more people use Windows 8 (not 8.1). This number has been shrinking significantly over the last few years--it was 6% in 2017. Microsoft no longer sells 32-bit OSes to hardware manufacturers. Nvidia is no longer providing support for 32-bit OSes. Mac OS X, iOS, Android, UWP, and Ubuntu have already long phased out 32-bit. The latest versions of GMS2 already export only 64-bit executables for those targets. At some point, 32-bit exes will fail to run on Windows without an emulation layer like DOSBox does for 16-bit exes. Going 64-bit guarantees your game will survive into that near-future/almost-current era without people having to use workarounds to play it.

- GM exe sizes are already small enough that a larger exe size doesn't matter. The difference between GM's tiny exe output sizes vs. that of other popular engines is so vast that when I download a game on Steam, I can almost guarantee whether or not a game was made in GM just by how small the filesize is.

- Larger base RAM usage is not an issue at all considering how small the size difference would be and how absolutely tiny the base RAM usage for GMS 32-bit exes currently is.

TL;DR: On paper, the pros outweigh the cons so much that any new project should use the 64-bit target as the default.
Awesome, thanks for writing this up! I was sincerely looking for answers lol I'm an artist learning to code on my own so I don't know a lot about technical stuff. I don't have a very fast cpu myself (64bit Win on a 6yo lappy with its default Intel 4000 card) so I try to code as optimized as I can just so I can play my own game (lol) but the stuff about 32-bit needing hacks to get games running on it makes sense and was the part that sold me on 64-bit. No point making a game that's going to be inconvenient to get running for the vast majority of players!

Also I had no idea other platforms were 64-bit by default, so thanks for all this information! I'll set my game to 64 bit when I go back to coding after writing this post lol

I'm going to express an insensitve but important opinion here: Why is incompatibility with 32-bit these days considered a con? These days, excluding people who still use 32-bit-exclusive devices is no longer a con. It is as much a pro as it is a practical necessity.

Here are some topics regarding 32-bit architecture on the GMC over the past few years:
What recurrent themes do you see in these topics? This is my take, as politically incorrect as it is:
  • You can tell that they will be tightwads. They will not be any more generous with your product than they are with their equipment.
  • You can tell that there will be corner-cutting on their devices to make it still run, and your product will take the blame when those measures fall short.
  • You can tell that if they are allowed to run your app, their devices will likely be resource-starved, sometimes "to death", and that too will be blamed on your product.
  • You can tell that they don't understand how far behind the times they are, or how much extra effort a modern developer would have to take in order to cater to them.
  • You can tell that they are argumentative, unprofitable, technically primitive, and infeasible to please.
If you value your sanity and ratings on the marketplace, these look like very good reasons to keep 32-bit architecture out of future offerings.

It only takes an adolescent to see the benefits of serving others in the marketplace. It takes an adult to see the downsides to universal inclusivity in such service.

YoYo is making the adult decision for GMS 2 developers going forward. While I can't stand by all their decisions, I can and will stand by their decision to phase out 32-bit builds.
Might be insensitive but you definitely make valid points here!

I was going by what @FrostyCat seemed to suggest but maybe I missed something.
I believe FrostyCat was referring to YoYo not making GMS (like the development IDE itself) 32-bit anymore, but the games made inside it can still support 32-bit.
 
Has anyone else had problems with Spine + Sequences? I'm just about to dive into Sequences but even a completely blank project with a single Sequence moving a Spine sprite across the screen blows up. It locks the game up if I start layer_sequence_create by pressing space in a step event, and if I put it in a create event the game crashes on compile with no error and literally doesn't even run.

I'm filing a bug report but has anyone else run into this? I need to get it working ASAP, I've got a ton of Spine stuff I need to set up in Sequences!

I'm using Spine v3.7.94, and the sprites load and work just fine, and I can use the Sequence editor to move them around. But if I try to run a sequence with one...KABOOM!

(edit): Here's a project file with literally just a single Spine sprite, a single Sequence, and a single line of code if anyone wants to take a look at the problem lol this won't even compile for me...if the layer_sequence_create is executed on a keypress then it just locks the game up and the Windows program crash popup happens: http://bulletproofoutlaws.com/junk/sequenceswtf.zip

(edit2): Hmm...it looks like it works with objects that have Spine sprites attached to them? So you just can't use Spine sprites themselves in a Sequence? Is this a bug or do I just not understand Sequences at all lol

(edit3): But now qutting my game with game_end() causes a Windows program crash popup?? Even if the Sequence isn't playing, it's just in the project? When I remove the sequence game_end() shuts down like normal. Anyone else run into any of this?
 
Last edited:

Ricoh5A22

Member
I found this:
- Right click over a folder in asset browser -> Open in new Asset Browser
- Drag the new window into asset browser and you have something like this:
before_bug.PNG
- Then click in Layouts -> Save Layout
- And then click in Layouts -> Load Layout and this happen:
after_bug.PNG

Obs.: If you reopen the project this still happen.
 

Ricoh5A22

Member
I don't know if it's a restriction of HTML5 export or if its a bug before 2.3. But if I create a Variable Definition of expression type and pass a function name as parameter (to be called by script_execute) and try to export for HTML5 I receive this message:

Undefined variable 'func_to_be_used_in_variable_definition' referenced in o_html5_define_variable_expression_bug's variable 'DEF_FUNC_TO_EVAL'

Then if I put the global keyword before the function name, like this: global.func_to_be_used_in_variable_definition. It works for HTML5 but another problem happen for Windows export with this error message:

script_execute argument 1 unable to convert to integer, result is nan
at gml_Object_o_html5_define_variable_expression_bug_Create_0 (line 1) - script_execute(DEF_FUNC_TO_EVAL);
############################################################################################

gml_Object_o_html5_define_variable_expression_bug_Create_0 (line 1)

I solved the problem putting the code below in the variable definition DEF_FUNC_TO_EVAL:
os_browser?global.func_to_be_used_in_variable_definition:func_to_be_used_in_variable_definition

But I think it should work in the same way for both platform.
 

Ricoh5A22

Member
@Ricoh5A22 on the first image the bottom Asset Browser is filtering Sprites and on the second one, there is no filter applied.
Was it intentional?
No, in the first image I created a new asset browser window specific for Sprite (with the Open in new Asset Browser) this create a implicit filter for this folder in this window. Then I saved as custom layout, but after reload this layout it remember that I have two asset browser but forgot that the second was associated only with the Sprite folder and load it as a normal asset browser.
 
Experimenting with making Sequences in GML some more...I've got it showing a graphic and sliding it around the screen, but I'm blanking on how to apply an animation curve to the movement. I made a 3 point Sequence and from the docs it seems like you would just set the .curve here:
GML:
//this is just part of a cleaned up version of the Manual example lol
var _ParamKeys;

    //keyframe
    _ParamKeys[0]       = sequence_keyframe_new(seqtracktype_real);
    _ParamKeys[0].frame = 0;

    var _ParamKeyData;
        //x
        _ParamKeyData[0]         = sequence_keyframedata_new(seqtracktype_real);
        _ParamKeyData[0].channel = 0;
        _ParamKeyData[0].value   = 0;
        _ParamKeyData[0].curve   = animcurve_get(AnimationCurve1);
        //^^^how do I apply a curve here? shouldn't this make this value go from
        //this keyframe's 0 value to the next keyframe's room_width value, but using
        //the anim curve?

        //y
        _ParamKeyData[1]         = sequence_keyframedata_new(seqtracktype_real);
        _ParamKeyData[1].channel = 1;
        _ParamKeyData[1].value   = 0;
        _ParamKeyData[1].curve   = animcurve_get(AnimationCurve1);
        //^^^do I apply it here too, if this is how to apply it? I tried having both an
        //x and y in the anim curve but using animcurve_get_channel makes sense
        //in my head but breaks it...

        //logically it seems like it should just be: make a curve in the curve editor
        //with two lines in it, make a keyframe, set it's [0] channel's .curve to the
        //curve's index [0] (and do the same with [1] for the y movement)

    _ParamKeys[0].channels = _ParamKeyData;

    //keyframe
    _ParamKeys[1]       = sequence_keyframe_new(seqtracktype_real);
    _ParamKeys[1].frame = 80;

    var _ParamKeyData;
        //x
        _ParamKeyData[0]         = sequence_keyframedata_new(seqtracktype_real);
        _ParamKeyData[0].channel = 0;
        _ParamKeyData[0].value   = room_width;
        _ParamKeyData[0].curve   = animcurve_get(AnimationCurve1);
        //^^^would I do it to this frame too? it seems like this would make the value
        //from this frame to the next keyframe follow the same easing, so if this ease
        //was a Sine In/Out, each point to point travel on this path I'm making would
        //start slow, speed up, slow down, rinse and repeat for each point

        //y
        _ParamKeyData[1]         = sequence_keyframedata_new(seqtracktype_real);
        _ParamKeyData[1].channel = 1;
        _ParamKeyData[1].value   = room_height;
        _ParamKeyData[1].curve   = animcurve_get(AnimationCurve1);
        //??? i_have_no_idea_what_im_doing_dog.jpg

    _ParamKeys[1].channels = _ParamKeyData;
...and it does seem to do SOMETHING, because when I run this code and put the animcurve_get(AnimationCurve1) code on the 3 different points in various combos, it DOES affect the travel...but none of it looks anything like the Sine In/Out easing I drew lol it does stuff like not move the X position at ALL, or jump from position to position instantly.

Does anyone know of any tutorials on manually setting up the .curve stuff this way? I know there's a realtime "get the value at this point" command, but isn't the point of setting up a Sequence that you can just initialize it like this and then trigger it whenever and it handles itself? I'm literally one day into looking at Sequences for the first time so I might be completely lost in the woods here lol

Is there any chance of a .curve usage example in the Manual? The examples in there are solid but there's basically one sentence for .curve and it seems to be more complicated than just setting .value or .channel is. I'd imagine applying easing curves to manually created Sequences would be something almost 100% of people who make manual Sequences would want to do because it makes things look nice and polished, so I think it would be useful for more than just me lol

I'm picturing letting the player place a bunch of points and choosing an ease curve and then the game would travel them point to point using the ease curve they picked. I know I can do this a bunch of other probably simpler ways, which I'll probably end up doing, but I wanted to experiment with Sequences and see what kind of stuff is possible with them first since it's a cool new feature lol

P.S. On that note the Sequence editor is fantastic from what I've messed with so far...feels very Adobe After Effects inspired and slick to use. I can't tell how much it overlaps Spine's features (both being able to ease and fire messages etc) and what the best tasks to do in each of them are yet (maybe Spine for purely straightforward visual anims and the Sequence editor for object/nesting anims?) but I'm really looking forward to playing around with it all. It feels like visually GMS will let me make literally anything I can think up at this point and I LOVE it!
 

drandula

Member
I have a question, can Sequence positions use curves relationally to keep between keyframes?

First, for my understanding sequence editor can use animation curves for position; but the problem is that curve values are the absolute position values for Sequence. I haven't found any other way to use them. So, can curves be used as lerper?
What I mean is that Sequence has position A in first keyframe and position B on second.
Normally without curve it lerps straight A to B at constant speed.
Using curves makes me add more target values as absolute positions, which I feel to be awkward. For example set X/Y separately and try keep new positions in line between A and B, and just trying to affect how fast it approaches it, or even overshoot first, without having "visual curve".
Can curves be used relatively in Sequence editor?
Like curve goes in 0,0 to 1,1: which represents going from A(X,Y) to B(X,Y), but makes them more abstract and doesn't need absolute values. Relative curve can be applied to many positions, as it isn't in absolute units.

Also in relational curve, x/y can use same curve, which would make some spring animations easier. With absolute values making overshooting spring animation at angle is bit of hassle and always need to be redone.
 
I have a question, can Sequence positions use curves relationally to keep between keyframes?

First, for my understanding sequence editor can use animation curves for position; but the problem is that curve values are the absolute position values for Sequence. I haven't found any other way to use them. So, can curves be used as lerper?
What I mean is that Sequence has position A in first keyframe and position B on second.
Normally without curve it lerps straight A to B at constant speed.
Using curves makes me add more target values as absolute positions, which I feel to be awkward. For example set X/Y separately and try keep new positions in line between A and B, and just trying to affect how fast it approaches it, or even overshoot first, without having "visual curve".
Can curves be used relatively in Sequence editor?
Like curve goes in 0,0 to 1,1: which represents going from A(X,Y) to B(X,Y), but makes them more abstract and doesn't need absolute values. Relative curve can be applied to many positions, as it isn't in absolute units.

Also in relational curve, x/y can use same curve, which would make some spring animations easier. With absolute values making overshooting spring animation at angle is bit of hassle and always need to be redone.
If I understand your questions right, this tutorial might be what you're looking for (especially the second example of the HP meter):


That example is why I'm not sure if maybe my code above manually assigning easing to a manually created Sequence needs some use of animcurve_channel_evaluate somewhere or what...it seems like it should handle it automatically like you just create a sequence and then tell it to play and not have to do any manual calcuating in a Step event, same as letting a Path play, but I can't figure it out lol
 

drandula

Member
If I understand your questions right, this tutorial might be what you're looking for (especially the second example of the HP meter):


That example is why I'm not sure if maybe my code above manually assigning easing to a manually created Sequence needs some use of animcurve_channel_evaluate somewhere or what...it seems like it should handle it automatically like you just create a sequence and then tell it to play and not have to do any manual calcuating in a Step event, same as letting a Path play, but I can't figure it out lol
Yeah that didn't answer, I know you can use curves like that codewise, but can you do it in Sequence editor itself without actual code? I still feel Sequence editor bit clunky and prefer animating things by code. Also if some things I need from sequence needs also good amount of code, why bother using Sequence 😅

Edit. I have loved 2.3 overall, it is just sequences I am not sure of.
It seems sequences are hard to use in 3D space too, as all layers in it are flat in same plane which makes them z-fight. Also can you rotate them with Matrices?
 
Last edited:

chirpy

Member
@Dan
Edit 2 : This seems to be a problem with an extension that extends the AppDelegate class. I'm not sure if that's the problem as I don't have enough ObjC knowledge to effectively make changes. I do know if I remove this extension then the IAPs work and receive the response from Apple. If the extension is present then the IAP response from Apple never happens. Seems like something changed in the expectation of iOS extension handling that is causing this.

Basically, the Async IAP Event never fires with this particular extension in place. Any ideas what could stop that from firing? A rogue AppDelegate class not propagating it's application events?
@clee2005
I had personally found an issue back in 2.2.5, where extensions subclassing AppDelegate would cause other AppDelegates to stop working, due to incorrect/missing superclass method chaining (I don't know what to call it in obj C). Thing is, GMS merges all AppDelegate extensions by inheriting one another, and the default example of superclass method chaining is incorrect (think of event_inherited() not working), so any extension that copy-pasted the code snippet may cause missing initialization of another.

Code snippet in question (copied from iOS_InAppPurchaseAppDelegate.mm):
Code:
// Check if any superclasses implement this method and call it
if([[self superclass] instancesRespondToSelector:@selector(application:willFinishLaunchingWithOptions:)])
{
    [super application:application willFinishLaunchingWithOptions:launchOptions];
}

Here [self superclass] must be replaced with an explicit classname, i.e. [${YYExtAppDelegateBaseClass} class].

References:
(1) Discussion in
https://developer.apple.com/documen...ject/1418583-respondstoselector?language=objc

(2) https://stackoverflow.com/questions/31201801/respondstoselector-for-super-class-invocation

This was reported and supposedly fixed back in April 2020.
 
3 quick question just because I want to make absolutely sure I have a good grasp on garbage collecting and structs:
GML:
//random complicated struct full of "stuff" with lots of nesting
big_struct = {
    some_var:  true,
    other_var: 1000,
    do_something: function() {
        button: new Button("Start Game", function() {
            another_struct = {
                more_stuff: true,
                some_array: [1, 2, 3]
            }

            return another_struct;
        }),
        button2: new Button("Button 2", function() {
            return true;
        })
    }
}

big_struct.yet_another_struct = {
    button: new Button("Other Button", function() {
        return {
            some_var: 1,
            an_array: [1, 2]
        }
    });
}
1) If I have a bunch of nested stuff like the above with structs that even have "new Constructor" items in them and those have functions inside them etc...and then when the user presses a button that closes the whole huge nested GUI and I do this:
GML:
big_struct = undefined;
...and that's the only place in my game where that struct was referenced, will this mean all the above stuff gets properly garbage collected? or am I gonna have memory leaks? It's ONLY ds_lists/maps/etc inside there that would cause a problem right? (I'm using FrostyCat's amazing Lightweight Data Structures instead of ds_ related stuff so no risk of that)

So for a GUI I can have a "menu" variable that loads a main_menu struct, a continue_menu struct, an options_menu struct etc, literally just changing which one that menu points to, and whichever one it stopped pointing to gets GC'ed (as long as it's not referenced elsewhere)?

2) and if I delete the object holding that "big_struct" up above, that would also GC everything that was in it even with all the complicated stuff nested in it, because that was the only place pointing to that struct right? I don't have to go "big_struct = undefined" and THEN destroy the object right?

3) And is there any way to tell what structs currently exist? On game_end() I do a with (all) {show_debug_message(id);} to make sure only instances I expect to still exist still do...is there a way to do that with structs?
 
Last edited:

gnysek

Member
1) yes, only ds_xxx and loaded resources like sprites will cause issues
2) not sure if big_struct = undefined does same as delete big_struct, but yep, all should be GC at some point (not immediately and not all at same time)
3) yes, they created weak reference functions in 2.3.1 (it returns address to struct, but doesn't count as reference for GC), so you can check if and when something is GC collected.

You can also flush things manually.
 
One thing I'm liking exploring is Sprite Broadcast capabilities ;) great feature @rmanthorp, YYG team is GREAT! ;)
BTW will we have access to add Broadcast events through GML and also are you planning on adding moments to sprites (similar to sequences). (I made a feature suggestion for this but wanted to know if it's in the plans your not at all) :)

PS1: On a second though adding moments would only be viable if the self of the function moment could be set to the instance running the sprite.

PS2: Another thing right now broadcast messages are accessed using event_data[? "message"] this is ds_map syntax (slower than structs) wouldn't it be faster if event could be replaced by struct access... event_data.message.

PS3: What about allowing to access "instance" from event_data of the instance whose sprite broadcasted the message.
 
Last edited:

clee2005

Member
@clee2005
I had personally found an issue back in 2.2.5, where extensions subclassing AppDelegate would cause other AppDelegates to stop working, due to incorrect/missing superclass method chaining (I don't know what to call it in obj C). Thing is, GMS merges all AppDelegate extensions by inheriting one another, and the default example of superclass method chaining is incorrect (think of event_inherited() not working), so any extension that copy-pasted the code snippet may cause missing initialization of another.

This was reported and supposedly fixed back in April 2020.
Thanks @chirpy ! It seems some variation of what you described was not fixed in this 2.3.1 build. I ended up removing the "App Delegate Class Name" that was specified in the Extension and then everything worked, including the functionality of the extension which I thought might stop working because I had cleared that field naming the App Delgate code!

I updated my ticket with YoYo, so hopefully they can have a look at it and sort it out. At this point, I have no idea what that field is for on the extension since being there doesn't seem to be required.
 
Status
Not open for further replies.
Top