effect_create_above(ef_explosion, x, y, 2, c_red);
I'm not running as admin and did as you instructed and get no error. I get an explosion at the point where I placed the object in the middle of the room.It seems to be circumstantial and not everybody experiences it, even with the same code. I was able to solve my problem by running as admin and make a new/save as project while as admin. My concern though is not solving it but rather that people shouldn't be experiencing such problems in the first place.
If you want to recreate the problem, make a new project and put this code in the keypress-enter event on a new object and drop that object right in the middle of the room.
This is the same code used in the thread shared earlier. It should create some particle explosion effect when you press enter. However, when I make a new project on 2.3 (2.2 as well), it doesn't work, but it does when I run as admin.GML:effect_create_above(ef_explosion, x, y, 2, c_red);
function A(_a) constructor{
a = _a;
}
function B(_a, _b) : A(_a) constructor {
b = _b;
}
function C(_a,_b,_c) : B(_a, _b) constructor {
c = _c;
}
var test = new C(1,2,3);
show_debug_message([test.a, test.b, test.c]);
Hello people. I will make a small contribution. I updated GM2 to the beta version released today IDE v23.1.1.172 Runtime v23.1.1.165 and it is running very light on my Dell Inpiron Core I7 16 GB machine.
The previous version of GM2.3 - Beta was very stuck on my machine, especially when you tried to edit a script, it was impossible to drag the bottom scroll bar of the window.
In this version this problem has been solved. The GM is very light to work with and without crashes.
But I also have to make an observation. Coincidentally, today I updated Window 10 from version 1909 to the latest version 2004.
So I don't know if the improvement in GM performance happened due to the new version of GM 2.3 - Beta or my Windows 10 update.
Thank you.
That is indeed the official recommendation. However, in my experience if you just do work in smaller than usual chunks and make sure you are backing up more often than usual, its usually fine.I don't recommend starting a serious project with 2.3. IDE Bugs and project corruption still lurking.
I started a brand new project and within 30 minutes to an hour my project got corrupted and also the game would fail to run every time. I will use 2.2.5 for now and wait until 2.3 becomes more stable.That is indeed the official recommendation. However, in my experience if you just do work in smaller than usual chunks and make sure you are backing up more often than usual, its usually fine.
I guess you have some bad luck. Its not that unstable for me honestly. I've done several hours of work in this project and it hasn't corrupted on me. I've seen others with experiences similar to mine so I'm not sure exactly what you are doing that is causing it. Have you reported bugs about it?I started a brand new project and within 30 minutes to an hour my project got corrupted and also the game would fail to run every time. I will use 2.2.5 for now and wait until 2.3 becomes more stable.
I'm personally using Github Desktop...seems to be fine for me. It does a local repo along with the free cloud one. Even better, I have it in a dropbox, AND it auto-backups locally to an external drive. I guess besides more of the same backups, the only other thing I can really do it if I did backups to a friend's PC(some backup software does this actually), but I think I'm pretty well covered as it is.Don't forget to at least have a local Git repo just in case, the time spent learning the basic commands will pay back tenfold in all the time you save on command-line backups and being able to go back in the timeline whenever you feel like it.
You are right...but in my case I've never had issues with it. I only ever do any actual work on my GMS2 stuff on a single PC though, I'm not trying to use it as any sort of version control or anything crazy like that. In fact, I've opened projects up on other PCs through the dropbox and I never get issues there. The trick is to always make sure you work with the single latest version, don't open a project on another PC until the dropbox is fully updated. And make sure that whatever you do gets sent to dropbox before you shut down, and that it gets downloaded before you open on the other PC. So its basically one at a time, and being 100% sure its always the right version. In any case, I also have the local external hard drive plug github backup/versioning as well so I'm not risking much, and the automatic cloud backup is worth it.Using dropbox/gdrive/others for GMS project isn't a best idea, as if you start to do something on another PC, all can corrupt outside of IDE cause of delayed file sync.
Not in my case...@nephewtom Should be there:
tower() contructor
{
hp = 100
name = tower
x = 0
y = 0
}
new tower()
] , giving it to a object instance [ instance_create(x,y, obj_tower)
] and then transfer all variables values from the struct to the instance. (a script heavily lifted from FrostyCat's struct_merge() but copying to instance instead)Structs at this point are best used for abstract data management. Anything with a concrete component in room or event space is still supposed to be done with object instances. For active agents in action games, I would still recommend doing it the traditional way with objects, GMS 2.3 has not changed the paradigm on that.so with GM2.3 structs, how would one go about instances(heavy object) of a struct?
I used structs to define "Units" say
this essentially has all the info for that unit. For it to concretely (collisions) exist in the world I would need to associate it with a game instance.GML:tower() contructor { hp = 100 name = tower x = 0 y = 0 }
I do it by creating a struct instance [new tower()
] , giving it to a object instance [instance_create(x,y, obj_tower)
] and then transfer all variables values from the struct to the instance. (a script heavily lifted from FrostyCat's struct_merge() but copying to instance instead)
This works nicely: it creates game instances that automatically get all the variables from the unit structs i make.
But I'm realising now that it creates a duplication of all variables: the struct and the instance copy and they are not synchronised. This makes sense but it feels inefficient. In theory, I only need to change the instance's variables, since that is what acts and exists in the world. But it feels off to keep an out of date associated struct. Also, when/if saving comes in line, the struct it would be usefull to keep the struct updated (easier to save).
Anyone encountered this design situation? How do you handle it?
I know this is more of a design question, but I've seen a lot of discussion on good ways to use the structs and I like to think the situation I've described has been encountered here?
- I can see how I could not even copy the struct variables and simply operate on the struct variables. ie: if collision mystruct.hp -= 10 but stat would be a mess and all instance code would always need "mystruct" prefix
- Not use instances, do all code from struct. but that loses all the benefits from built in instances.(events)
- Let variables desynchronise, synchronise them manually when needed.
loseHp = function(loss) {
corestruct.hp -= loss;
};
if (place_meeting(x, y, oEnemy)) {
loseHp(10);
}
Yes, I do that actually. But I still call it from instances. There is only one object, but the "draw" it will call varies from instance to instance depending on the struct associated.You can also put draw functions in your struct, and make them draw during draw events. This is the power of structs. You can make one object control thousands of struct "instances"
I agree, in my situation however I have a mix of both: Units have to exist "abstractly" before they are bought/ created and concretely when on field being acted upon. Giving the object methods acting on its struct is a great idea.Structs at this point are best used for abstract data management. Anything with a concrete component in room or event space is still supposed to be done with object instances. For active agents in action games, I would still recommend doing it the traditional way with objects, GMS 2.3 has not changed the paradigm on that.
The most direct compromise I can think of is setting up methods in the object's Create event to use later:
GML:loseHp = function(loss) { corestruct.hp -= loss; };
This is better suited for non-action games and UI components, especially when some parts of the data do not map verbatim. For example, in a grid setup, the struct will hold the abstract grid position in cells, while the live instances will hold the in-room position in pixels.GML:if (place_meeting(x, y, oEnemy)) { loseHp(10); }
myAimFunction = corestruct.structAimFunction
I assume it refers to gaming consoles...its basically a placeholder for adding support for the new consoles as they come out, or updating for the current supported ones...or both.Another word what's the Console Updates meaning
I'm new to GMS and pretty new to programming in general, so forgive me if my question is clueless. But I'm wondering where arrays would fit into your flowchart. For learning purposes, I've made a Tetris clone and now a chess clone using GMS 2.2, and for the chess game in particular, I'm getting ready to refactor using the 2.3 beta. Right now my game uses ds_lists to store move lists, which get manipulated thousands of times as the AI considers move after move, but I've got memory leaks. I'm inclined to rewrite using 2.3's new multidimensional arrays to contain move info (piece, old position, new position, other data for special cases like pawn promotion and castling). But reading your flowchart makes me wonder whether I should be using a struct, as it's garbage-collected the same way an array is, yes?After the questions on whether to use constructors or objects, I thought I'd share my flowchart for choosing which to use (yea I know, lol) Any thoughts?
Yes, structs are garbage-collected just like arrays. Ideally, once structs are fully optimized, most data structures should be structs. That way, they are much easier to visualize, add functions to, and inherit from each other. If you are using ds_lists and are having garbage-collection problems, I've got a constructor that might help: Arraylist. It uses an array to mimic the functionality of a ds_list. The main issue with structs as data structures is that they are slower to use than gamemaker's data structures. This isn't a problem in most normal projects, but if you need to do thousands of changes and accesses a second, there will be a noticeable difference.I'm new to GMS and pretty new to programming in general, so forgive me if my question is clueless. But I'm wondering where arrays would fit into your flowchart. For learning purposes, I've made a Tetris clone and now a chess clone using GMS 2.2, and for the chess game in particular, I'm getting ready to refactor using the 2.3 beta. Right now my game uses ds_lists to store move lists, which get manipulated thousands of times as the AI considers move after move, but I've got memory leaks. I'm inclined to rewrite using 2.3's new multidimensional arrays to contain move info (piece, old position, new position, other data for special cases like pawn promotion and castling). But reading your flowchart makes me wonder whether I should be using a struct, as it's garbage-collected the same way an array is, yes?
Thanks for the link. That looks very helpful. I actually don't need full ds_list functionality, as I just need to access the array sequentially, from start to finish. I was thinking of simply declaring an array with 120 values or so, longer than the number of chess moves available at even the most complex position. But your constructor looks very useful.I've got a constructor that might help: Arraylist.
Thanks also for this suggestion. I'll give it a try.As to your move info and unique special cases, make it easy on yourself and use a constructor. It's an object that is purely data, perfect for storing and accessing data in an easy-to-understand, object-oriented way.
Yes, when all critical bugs will be fixeddoes anyone has a clue when 2.3 will be out of beta?
list = ds_list_create();
ds_list_add(list,"Hello World");
num = ds_list_size(list);
list = new ds_list();
list.add("Hello World");
num = list.size();
There isn't enough time in the GMS 2.3 timeframe to retrofit any of the existing ID-based resources, including data structures. That is why I wrote this.I had a thought. Now that we have structs and methods, wouldn't it be cool if the gms data structures acted like structs as well?
Instead of doing the following:
We can do something like this:GML:list = ds_list_create(); ds_list_add("Hello World"); num = ds_list_size(list);
This feels more intuitive and I think it would attract more devs to use GMS. What do you guys think?GML:list = new ds_list(); list.add("Hello World"); num = list.size();
I agree. It's not something urgent as it's already a working feature. I don't want 2.3 be delayed any further but I thought it would be a nice idea for a later update.There isn't enough time in the GMS 2.3 timeframe to retrofit any of the existing ID-based resources, including data structures.
Nice! I'll check it outThat is why I wrote this.
I REALLY wish they would have added destructors too...they would have come in handy for everything that isn't already garbage collected....maybe they are planning to eventually make data structures an actual type and garbage collect them?!?! If they did, it would leave buffers and surfaces as far as I remember the only things that don't self garbage collect.They always say "if you can do something by writing a script, then we won't add this as a feature in GML". Moving ds into struct isn't that hard, except they don't want add destructors, which in that case would allow to have garbage collected structures. Of course this is still possible in some way, but you need to use arrays in struct, and to not slow down GM on array resize, it's preferred to use array_create(10000, 0) for example to reserve memory, which waste RAM (for ds_map two arrays may be needed), and performance will be slower.
xyxy_draw_button(xyxy, text)
and I want to define several buttons that use this draw function, where text will be fixed, but xyxy will be a variable.playbutton.draw = function (xyxy) {xyxy_draw_button(xyxy, "Play");};
quitbutton.draw = function (xyxy) {xyxy_draw_button(xyxy, "Quit");};
for (var lev = 1; lev <= number_of_levels; lev += 1) {
levelbutton[lev].draw = function (xyxy) {xyxy_draw_button(xyxy, string(lev));};
}
xyxy_draw_button(xyxy, string(lev))
(giving an error, because lev does not exist in the function). But I want it to call xyxy_draw_button(xyxy, string(3))
.levelbutton[lev].lev = lev;
and then using self.lev in the function definition, and using method() to assign the function to the instance. But adding this extra variable is not a very nice solution and I'd still like to hear a more general solution to this. xyxy
as an argument. But use text
as though it exists anyways.function xyxy_draw_button(xyxy) {
/* Use xyxy and text here */
}
text
through one of its keys.playbutton.draw = method({ text: "Play" }, xyxy_draw_button);
quitbutton.draw = method({ text: "Quit" }, xyxy_draw_button);
xyxy
through an argument.self
to that of the struct literal. If you want to keep access to the current instance, stick the id
in the struct closure as well, and use that to backdoor into the instance later.playbutton.draw = method({ text: "Play", this: id }, xyxy_draw_button);
I use the same SDK for GMS 2.3.0 as for GMS 2.2.5, and thus far everything is fine.Where can I find the SDK's required for 2.3.0? Or are these exactly the same as for 2.2.5?
It's not on this page: https://help.yoyogames.com/hc/en-us/articles/227860547-GMS2-Required-SDKs
Where can I find the SDK's required for 2.3.0? Or are these exactly the same as for 2.2.5?Where can I find the SDK's required for 2.3.0? Or are these exactly the same as for 2.2.5?
It's not on this page: https://help.yoyogames.com/hc/en-us/articles/227860547-GMS2-Required-SDKs
You just need to make sure that the APK has x86 checked in Game Options > Android > General > Architecture, which by default is off on GMS 2.3 due to low market share.Where can I find the SDK's required for 2.3.0? Or are these exactly the same as for 2.2.5?
In my case I'm using the same settings as 2.2.5 in 2.3.0 and I'm having problems on Android Module. You can compile the project but you cannot open it.
The project compiled in 2.2.5 works perfectly, but in 2.3.0 it doesn't work.
When I try to open the Bluestacks emulator, this message appears:
View attachment 33119