kupo15
Member
Weak references?? What are those!? So many new concepts and things with 2.3 I want to wrap my head about them...its pretty awesome!BUT...weak references is a huge!! PLUS
And those new array functions.. love them.
Weak references?? What are those!? So many new concepts and things with 2.3 I want to wrap my head about them...its pretty awesome!BUT...weak references is a huge!! PLUS
And those new array functions.. love them.
Regarding Weak References...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.
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
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!!
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);
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 lolRegarding Weak References...
It ran just fine in Windows for me!Can anyone confirm if there is a problem with the feature in Windows also.. or even on OSX?
@Juju used this principle to track surfaces... and automatically delete from memory.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!
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!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 aliveweak_ref_alive
if there are not delete from memory
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.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!
Only when the entity gets garbage collected, which is "whenever".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.
Yep, what she said!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.
I'm 99% sure that arrays have their own GC which is instant, so example you put there is true - that array doesn't exists anymore in memory.a = undefined;
data[$ "x"] = 5
equal to data.x = 5;
?? Do I understand this correctly?Exactly that is true!btw. isdata[$ "x"] = 5
equal todata.x = 5;
?? Do I understand this correctly?
Something to provide context for autocompletion for better suggestions./// @func Vector.Add( vector3 );
/// @func Coord.Add(x,y,z);
/// @func Score.Add(value);
Confirmed... our game still shows 1.0.0 on Android. iOS is working as expected.GM_version still returns "1.0.0" on Android
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 laterWhat 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.
/// @context Vector
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) {}
}
[@Vector] myfunc({array} an_array)
[@OtherClass] myfunc({integer} number)
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
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.
Pros: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?
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.I'm going to express an insensitve but important opinion here: Why is incompatibility with 32-bit these days considered a con?
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).I'm actually a little sad they are phasing out 32-bit
That's not asset browser, that's recent windows. Windows -> Asset Browser.I just installed 2.3.1 Beta.
View attachment 34995
When I open my project, the Assets panel is empty!!!
Wow!
View attachment 34992
When I open some smaller test projects they are opened correctly. (Well, at least I see their assets.)
I'll check ui.log.
[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 was going by what @FrostyCat seemed to suggest but maybe I missed something.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.
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!Pros:
"Cons":
- 2TB (i.e. absolutely ridiculous in 2020) max RAM usage
- Potential performance boost
- 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.
Might be insensitive but you definitely make valid points here!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:
- https://forum.yoyogames.com/index.p...-32-bits-version-of-gamemaker-studio-2.17326/
- https://forum.yoyogames.com/index.php?threads/64-bit-to-32-bit.74035/
- https://forum.yoyogames.com/index.p...with-gms-1-4-or-convert-32bit-to-64bit.72644/
- https://forum.yoyogames.com/index.php?threads/gamemaker-studio-2.12451/
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.
- 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.
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 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.I was going by what @FrostyCat seemed to suggest but maybe I missed something.
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.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.zipNo, 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.@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?
.curve
here:
//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;
.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.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 lolIf I understand your questions right, this tutorial might be what you're looking for (especially the second example of the HP meter):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.
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 lolIt happens that "...agree...EULA" button doesn't react. I had that poblem too. Just try with another web browser.I can't download this plugin from the marketplace, can you help? (on v2.3.0.529 ) https://marketplace.yoyogames.com/assets/5888/outline-shader-by-matharoo
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 SequenceIf 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 ofanimcurve_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
Sometimes incognito mode is enough, cause of some errors in cookies.Just try with another web browser
@clee2005@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?
// Check if any superclasses implement this method and call it
if([[self superclass] instancesRespondToSelector:@selector(application:willFinishLaunchingWithOptions:)])
{
[super application:application willFinishLaunchingWithOptions:launchOptions];
}
//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]
}
});
}
big_struct = undefined;
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)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?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)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
.thank you, its working with microsoft edge.It happens that "...agree...EULA" button doesn't react. I had that poblem too. Just try with another web browser.
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!@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.