• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

I'm Confused With the Rooms in the New Resource Tree in the GameMaker 2.3 Update

A

AwayObject

Guest
My OS is Windows 10. I like to move around my rooms for testing my game in my Test room. Room names are in the images. Before the update I didn't have problems with what room I go to when transitioning between rooms. After the update, when I drag my rooms in the right order to be played normally, I go from room Title, to room Training, to room Level_10. There's hasn't been any changes to the code so that can't be the issue. I've checked.

When I first open GameMaker, I looked under Quick Access Room Order and saw that the rooms were lined up in the way I was experiencing them in game, but when I rearrange then in the correct order, save, and play again it still is the same as if I didn't reorganize them at all.

It seems the way they are organized in Room Inheritance is in alphabetical order, but I haven't even used room inheritance in my game yet so they wouldn't be relevant, right?
 

Attachments

kburkhart84

Firehammer Games
You might need to clear the cache(use the broom icon). Its also possible that there is a bug you are encountering in 2.3(I don't think it was really ready for release but not my call).

That said, I personally never have counted on the room order for anything. The only thing that matters is the first one, and from there, the order doesn't matter. I never use "previous" or "next" versions of room switching...I only go directly by name. I bet if you switch to using that method, your problems will disappear.
 

DimaLe

Member
I have the same problem in the Room order in Rev. 2.3. Order of rooms in my games are important. And when I've tried to change the order I see that it does not work at all.
I use next and previous room commands and go to room as number. Is it real bug of 2.3?
Also I see that build code time is much longer then in previous Rev. Is it also known problem?
Please help to solve these problems of 2.3.
 

kburkhart84

Firehammer Games
I have the same problem in the Room order in Rev. 2.3. Order of rooms in my games are important. And when I've tried to change the order I see that it does not work at all.
I use next and previous room commands and go to room as number. Is it real bug of 2.3?
Also I see that build code time is much longer then in previous Rev. Is it also known problem?
Please help to solve these problems of 2.3.
I don't know if its a bug or not, but if you make a basic project with only a few rooms and mess with it, you can reproduce it if it is indeed a bug, and then file it with the helpdesk.

And like I said before, you can avoid it completely if you just code the room changes order by name instead of counting on the order in the IDE(I never thought that should be a thing anyway honestly).
 

Evanski

Raccoon Lord
Forum Staff
Moderator
They changed it so the rooms are now under a room manager, rather then how they are in the resource tree

1.png
2.png
 

curato

Member
I don't know if it was your issue, but I did have some issues with my game after the conversion. It kept remembering the wrong name and creating the ypp file. I had to remove that and then do a save as to get everthing named right. Then I was able to get it to run right.
 
A

AwayObject

Guest
I switched my code to room_goto and that fixed it, I think it works out anyway. Thanks.
 

DimaLe

Member
I've returned to v2.2.5.481 That's impossible to work with such buggy software. 2 main thinks are very bad for my games: 1 - Rooms order system is not working (I have more them 200 rooms with complex pointing),
2 - The program build time is about 6 times slower then in v2.2.5.481.
 

hangred

Member
This is weird. Only room_goto(23) is messed up for me. I can get to room 23 using room_goto_next(); All other room_goto(x) will work. Not sure what up with 23?
 

kburkhart84

Firehammer Games
This is weird. Only room_goto(23) is messed up for me. I can get to room 23 using room_goto_next(); All other room_goto(x) will work. Not sure what up with 23?

I'm sure its because the 23rd room index happens to not be 23. You are depending on undefined behavior. You should neve rrefer to rooms as hard values, rather only using the actual names of the rooms. Whaat did you name the 23rd room? Use that instead of the number 23 and I bet it will work just fine.

You may have been lucky that it conveniently has worked the wrong way for you, but you can't count on undocumented behavior.
 

hangred

Member
I'm sure its because the 23rd room index happens to not be 23. You are depending on undefined behavior. You should neve rrefer to rooms as hard values, rather only using the actual names of the rooms. Whaat did you name the 23rd room? Use that instead of the number 23 and I bet it will work just fine.

You may have been lucky that it conveniently has worked the wrong way for you, but you can't count on undocumented behavior.
That is very interesting. Has been working fine and only 23 is the problem. Using the room names is not convenient for me. I have a level practice function in my game and you specify the room number in the menus. It then jumps to that.
 

kburkhart84

Firehammer Games
That is very interesting. Has been working fine and only 23 is the problem. Using the room names is not convenient for me. I have a level practice function in my game and you specify the room number in the menus. It then jumps to that.
It may not be convenient, but it is the correct way to do it, and has always been. You have been lucky that undefined/undocumented behavior has worked in your favor, but that's not the way of things.

If you want an easy way to fix it, put all the rooms in an array, then just access the room from there using the proper index. This way, it won't matter at all what value GM puts in there, because you will be using the name correctly regardless.
 

curato

Member
In my project I needed to know the level numbers for various reasons. So all my game levels are named like rm_Level1, rm_Level2, etc; so, if I need the number i do something like this
GML:
level = room_get_name(room);
level = string_digits(level); // get just the level number
next_level = int64(level) + 1;
Otherwise, it is best to use the room manager to set the first room and and the next ordering the you can just use room_goto_next to go to the next room.
 
That is very interesting. Has been working fine and only 23 is the problem. Using the room names is not convenient for me. I have a level practice function in my game and you specify the room number in the menus. It then jumps to that.
Just store all the needed rooms in an array, then you can reference the room by it's array index. room_goto(array[23]);
 

hangred

Member
In my project I needed to know the level numbers for various reasons. So all my game levels are named like rm_Level1, rm_Level2, etc; so, if I need the number i do something like this
GML:
level = room_get_name(room);
level = string_digits(level); // get just the level number
next_level = int64(level) + 1;
Otherwise, it is best to use the room manager to set the first room and and the next ordering the you can just use room_goto_next to go to the next room.
I'll probably end up doing something like this. Thanks to all for the suggestions. Strange that this has been working for years then doesn't though.
 

kburkhart84

Firehammer Games
I'll probably end up doing something like this. Thanks to all for the suggestions. Strange that this has been working for years then doesn't though.
There are several things similar to this that worked before 2.3 and now no longer do. I don't know why this particular one stopped working, but it is one of several cases either way.
 

Yal

🐧 *penguin noises*
GMC Elder
I'll probably end up doing something like this. Thanks to all for the suggestions. Strange that this has been working for years then doesn't though.
The GM8 --> GMS1 transition broke things in a similar way; back in GM8 resource IDs were permanent and wouldn't change, GMS1 recomputes them on every compilation. If I recall correctly, the new "any asset can be anywhere" system has the side effect that all assets share the same list of IDs (which now might not even be numerical anymore), but it's not documented anywhere.

For parsing rooms, something like this perhaps?
GML:
for(c = 0; c < 9999; c++){
  if(room_exists(c)){
     show_debug_message("global.room_data[" + string(c) + "] = " + room_get_name(c))
   }
}
Run it, then copypaste the output into a script or something; array complete.
 

hangred

Member
Something is definitely wrong. I run the code and output to debug. It only deviates from sequential numbers at one or two rooms based on the room order. I use those asset indexes but it still does not room_goto correctly.
GML:
    for(var i = 0; i < 150; i++)
    {
        if(room_exists(i))
        {
            var roomname = room_get_name(i);
            global.room_data[level_number] = asset_get_index(roomname);
            level_number++;
        }
    }
    // in other script, lvl is the number input by user
    room_goto(global.room_data[lvl]);
 

kburkhart84

Firehammer Games
You are still depending on undefined behavior? What if the room indices are something like 105111? You may be lucky now but you may not always be lucky. You need to use the actual room names directly. Don't assume that room indices will be in any order or even within any range, there is no documentation saying that would be the case.

What you do is put all the room indices into an array, using the names of the rooms, in the order that you want them. Then, you can use that array to get the index of the level number you want to go to. room_get_name() isn't useful for this because you have to have the correct indices first, and you don't know what those are by any known means without using the names of the rooms.
 

hangred

Member
This is super confusing. I am putting the string names of the rooms into an array? Then what do I put into room_goto() when it wants a number?
 

kburkhart84

Firehammer Games
You are supposed to be putting the actual name of the room into the array...when you write the name of a room, it works like a constant, even showing the autocomplete for it.

Code:
array[0] = rm_Start;
array[1] = rm_Level1;
array[2] = rm_Level2;
....

room_goto(array[2]);
You don't need to even use strings for this. The name of the room in code is not a string, it is a number. The catch is that in the past(by your luck depending on undocumented behavior), those numbers started at 0 or 1 and then incremented based by luck on the room order or creation order or who knows what luck you had. But if you do it this way, you don't know or care what the numbers are, or if they are in any order...you just stick them into the array in the order you want.
 

hangred

Member
You are supposed to be putting the actual name of the room into the array...when you write the name of a room, it works like a constant, even showing the autocomplete for it.

Code:
array[0] = rm_Start;
array[1] = rm_Level1;
array[2] = rm_Level2;
....

room_goto(array[2]);
You don't need to even use strings for this. The name of the room in code is not a string, it is a number. The catch is that in the past(by your luck depending on undocumented behavior), those numbers started at 0 or 1 and then incremented based by luck on the room order or creation order or who knows what luck you had. But if you do it this way, you don't know or care what the numbers are, or if they are in any order...you just stick them into the array in the order you want.
Wow. Now I am beginning to understand what you and Yal were suggesting. Either I have to manually put the names into an array (or use debug dump to help) or put ordered numbers into my room names and code for that. I think my mental block was that you can use room_next and it works. If that works I assumed that the compiler already knows the room order and index. It must? Why can't I just use that info?
From the manual:
For example you can use the variable room to get the index of the current room and then use this function to find the room that follows it, as listed in the Room Manager.

I was able to use all the suggestions and get it to work. Thank you everyone!
 
Last edited:

kburkhart84

Firehammer Games
Wow. Now I am beginning to understand what you and Yal were suggesting. Either I have to manually put the names into an array (or use debug dump to help) or put ordered numbers into my room names and code for that. I think my mental block was that you can use room_next and it works. If that works I assumed that the compiler already knows the room order and index. It must? Why can't I just use that info?
From the manual:
For example you can use the variable room to get the index of the current room and then use this function to find the room that follows it, as listed in the Room Manager.

I was able to use all the suggestions and get it to work. Thank you everyone!
FYI, the "debug dump" won't help you...the numbers could easily change. And yes, room_next works because internally, as GMS knows internally what the room order is(as you have defined them). The only way for you to get that information is to put them in order like we have suggested, or using room_next, they haven't made anything else for that as far as I know(although what we have is really plenty).
 

Yal

🐧 *penguin noises*
GMC Elder
Yeah, starting at GMS1.0, all resource (asset) IDs change on each compilation. Until 2.2, the order would be that the first thing in the resource tree gets ID 0, the next thing 1 and so on, but supposedly 2.3 changed this to basically complete randomness. (I wouldn't know because I try not to rely on undocumented behavior, so I've not really used this behavior in years)

If you can't use the Room Order menu, use the names (i.e. not the strings but the constants that GM creates for each asset) and put them in a structure with the correct ordering for the access you need.
 

Aviox

Member
A little late to the party here, but I'd recommend indexing rooms by doing something like this:
GML:
room_array = [];
var i = 0;
var this_room = room_first;
while (this_room != -1){
    room_array[i] = this_room;
    this_room = room_next(this_room);
    i++;
}
room_count = i;

This will index the rooms in an array in the same order you have them in Room Order in the Room Manager.
Then, if you want to go to a specific room number, e.g. room 7, it'd be

GML:
var rm = room_array[7];
if room_exists(rm) {
    room_goto(rm);
}
Just keep in mind, if you ever change the room order, room indexes will change. So if you're, e.g. trying to save the room a player is in by saving an integer, save files may become incompatible with changes to room order, depending on your level layout.
For saving a specific room to a file, I'd suggest saving the name of the room as a string and searching for a room with that string on load. Then keep a rule that you can't change room names.

@curato @AwayObject @hangred
 

jobjorgos

Member
My room order section doesnot work for me either anymore. I have GM2.3.0 and the 'room order' section no longer is in synch with all the rooms of the project. I have around 100 rooms in the project and with no way I can change the starting room of the game.
From what I read here I can bypass this problem with room_goto to the actual starting room, this will indeed work out.
But is there no actual solution yet, or will there might comes a future update? It must be something in the main projects .yyp file that gets corrupted at some point, caused by a bug in the GM2.3.0 enige I guess
 

Yal

🐧 *penguin noises*
GMC Elder
My room order section doesnot work for me either anymore. I have GM2.3.0 and the 'room order' section no longer is in synch with all the rooms of the project. I have around 100 rooms in the project and with no way I can change the starting room of the game.
From what I read here I can bypass this problem with room_goto to the actual starting room, this will indeed work out.
But is there no actual solution yet, or will there might comes a future update? It must be something in the main projects .yyp file that gets corrupted at some point, caused by a bug in the GM2.3.0 enige I guess
You can try uncorrupting the project by exporting it to a YYZ file (File --> Export Project), then importing it into a new project. Everything will be in sync afterwards, but there's no way to tell what will be lost if there is corruption in the project, so make sure to save it under a different name.
 

jobjorgos

Member
You can try uncorrupting the project by exporting it to a YYZ file (File --> Export Project), then importing it into a new project.
Nah sadly that did not work out for me.

1603034948648.png

It only works for any new room that I create. But thats fine, I just copy/pasted the original Home room.
 

Slyddar

Member
Room order is totally busted. I've just upgraded to 2.3 retail after using the Beta for a long time without this issue, and find the same as you. All rooms gone from Room Order in Room Manager. That this bug is present makes Yoyo look like amateurs. For it to not be an issue in the Beta, yet be there in Retail, one must ask serious questions about the implementation of their beta program and the effective usefulness of it.
 

Yal

🐧 *penguin noises*
GMC Elder
Okay, it's starting to look kinda serious. Have you reported this as a bug? (Include the comparison image in the report, and a link to this topic)
It won't get fixed if it's not brought to Yoyo's attention, so... if you haven't reported it yet, now's the time.
 

Slyddar

Member
It won't get fixed if it's not brought to Yoyo's attention, so... if you haven't reported it yet, now's the time.
Yeh I've logged a bug on it. The failure in rooms to inherit the room order, resulting in having to recreate rooms and layers again.

Also did one on renaming or creation/deleting of layers in parent rooms not propagating to child room, especially when the parent layers are inside a group. That is especially problematic as forcing it by pressing inherit in the child causes it to lose any tiles you had placed on the layer in the child.
 
Top