Tutorial  Updated

Play/port your GameMaker games on NintendoSwitch

DISCLAIMER:
THIS TUTORIAL IS A WIP, I'm still (eventually) updating it to contain the latest methods/fixes to allow mostly any gamemaker game to be ported onto the switch. Take in mind this guide is still incomplete, but does contain valuable info to start porting!


So... As you might (or not) already know there is a way to run different Gamemaker games by "overwriting" the main game.win file of an existant switch-gamemaker game (like Undertale for example) with another one (props to Chocolate28 who originally discovered this method). Hoowever, some games might not work properly or might not even launch at all! So here I am, with a guide that will most likely help you fix most of the relevant issues, and hopefully will guide you through the process of doing it so. Good luck!

REQUIREMENTS:

• Having Atmosphére CFW up and running (guide here)
• Having a gamemaker game installed on the switch ("DELTARUNE Chptr 1" is the recommended target)
• The data.win file of the game you want to port (You can find this in your game's installed location, sometimes it's embedded inside the exe of the game itself, so just open it as if it was a zip file and you may find it there!)
• The super awesome but somewhat tricky tool... UnderModTool aka UMT by krzys-h (download here)

LET'S START:

First compilation/testing:
You will want to open UMT tool (aka Undertale-Mod-Tool huh) and once opened drag your data.win file from the game you want to port inside this tool. Once loaded we will just try to compile it and see what's working and what's not.

To compile it again with any changes you've done just go into File >> Save, and save the new modified file as "game.win". Now create a folder named "010023800D64A000" (Deltarune's TitleID) and inside this folder create another one called "romfs", now place your "game.win" file inside this romfs folder. You can now place this folder with a bunch of numbers inside your sdcard to inject it in your switch, you must place this folder inside sdcard:/atmosphere/content/

Great! Now whenever you boot Deltarune in your switch you should see your game running!
Wait... it's not running?
Oddly expected

Time to get hands dirty and fix things by yourself! This part is a little more advanced than what you may think, so there's that, nonetheless... I believe in you!
Welcome to the awesome world of GMS decompilation and game modifying! (aka Gamemaker's modding hell)

First issue, Resolution Scale:
Usually lots of gamemaker games run in a window of a certain resolution, the switch can kind of handle different resolutions but only at supported scales. Most of the times this is the only fix you need to make the game display at all. So, go back to UMT, and with your data.win loaded double click on General Info in the left panel and look for Default windows size to check the resolution values. These values must be compatible with what the switch supports, so set them to 640x480 if the game uses 4:3 ratio scale or set them to 1280x720 if the games uses 16:9 ratio scale. Sometimes different values are valid and can cause much better image results than others (wide resolutions for example) so just play along with them while testing to see what works best for you.
Tbh I still have no clue to this day what the full supported resolutions are, so just try and let me know what worked and what didn't, ty!

Test again, Compilation/Testing reminder:
Now try and do the compiling process you followed earlier (File, Save, game.win...) and save the new modified game.win file in your sd card where you placed earlier the old one. This is how you are going to do the testing for the rest of the porting process, so get comfortable with it (because you're gonna be doing it a A LOT).

Uncommon issue, Collisions: (Todo, quote the use of the flag "FastCollision" system)
Now that your game is likely booting and all... you might have noticed that when you collide with certain objects, these don't have a proper collision (if every collision works fine just skip this step) and you would sometimes get stuck within those. To fix this you will want to navigate to the room where this collision is glitching and make sure it's marked as a solid object. So go into the left panel >> Rooms and search there for the room (go in fullscreen mode to see the whole room displayed). Once found your room, locate the collision object, it's usually an ugly block or something like that. Once found the collision object, double click on it and it will highlight the object in the object-list above, double click on the one highlighted and you will be now in that object's property panel. Now once there make sure the Solid checkbox is ticked, if it already is, you might want to go into the main character object properties and check the Solid box there as well (disclaimer: making your character solid can cause additional issues).
If this tips weren't enough to fix the collisions, please, report it and let me know here!

Implementing, Joycons:
You might have noticed that joycons work out of the box but only do so when attached to the console in handheld mode. To fix this you're gonna have to create an object that handles the joycons processes. Find the "Game Objects" section in the left panel and right click on it, click then on "Add". Name this object whatever you want and uncheck the Visible checkbox. You now want to place this object in the first loaded room, to do this open the Rooms section and navigate to the one where your character spawns, double click to open it and now navigate to the Game Objects section and find your object (do not click on it). While the room view is opened drag your newly created object to the room viewport. If UMT asks you to select a layer click on the Layer section above in the room's property panel and select any layer, then drag and drop your object in the viewport again and your done. Great! Now let's add some code! Double click on the created object and double click behind "Create" in the Events section. A new entry will be created but it's empty, you will see now the two buttons at the right of the new created entry, it's a plus sign next to a cross, click on add (+). Now a new code entry will be created, double click on it.

[THIS TUTORIAL IS A WIP]
 
Last edited by KardchCode, , Reason: update altar link and a few advises
you can try undertale mod tool comunity edition, is a modified ver of umt that can read more complex code [mainly designed for edit complex code in pt but works with other games]
Thanks! Gave the Community Edition a go but it had the same error. I looked through the issues and pull requests on the main UMT github and found this one, using the artifact from that I was able to load UFO 50's data.win - unfortunately but unsurprisingly given the pull request, it shows it's a pretty new version of the runner (GM 2024.8), can I assume there aren't any Switch games with that version yet? What's the latest version that's been found?
 
Thanks! Gave the Community Edition a go but it had the same error. I looked through the issues and pull requests on the main UMT github and found this one, using the artifact from that I was able to load UFO 50's data.win - unfortunately but unsurprisingly given the pull request, it shows it's a pretty new version of the runner (GM 2024.8), can I assume there aren't any Switch games with that version yet? What's the latest version that's been found?
The lastes switch runner i could find is 2023.8 is a game called "cryptrio" but maybe with a deep find and alot of determination you could find a newer runner
Post automatically merged:

Hey i actually found a 2024.4 runner, is a game called "crystal breaker" you can try it for run UFO 50's
Post automatically merged:

Well actually is 2024.8 not 2024.4, my bad
 
Last edited by Licuatronix,
  • Love
Reactions: hippy dave
So Crystal Breaker was a great shout, the same 2024.8 runner as UFO 50, and putting the compiled game.win without any resolution changes etc (I didn't try just using/renaming the original data.win) in layeredfs runs straight off. You do have to add all UFO 50's extra data files/folders to romfs too. Doesn't save, as seems to be the usual, and the A/B buttons are the "wrong" way round for the Switch standard, but can play the games.

I'm looking at the code and comparing with Crystal Breaker to see if I can figure out how to make saving work, I don't know if that can be achieved from UMT but we'll see I guess. Any tips appreciated if anyone has actually managed it.
 
Getting so close... I think I know what needs doing to make saving work, I've done a successful test that makes save data for the game during startup that DBI can see, but I'm not able to add the necessary code in the scripts where it's actually needed because the version of UMT I'm using still has problems with certain scripts. It's the version that's recommended by the UFO 50 modding community, and they acknowledge that it still has problems with some of the game's scripts, so I guess I'm stuck until more fixes are applied to the tool, or if there are any alternative tools that would work better?
*edit* I figured out I could add the needed code in the disassembly, rather than the decompiled code, bit more fiddly, but it will save from there, even if it won't show working decompiled code again for that script. I got save/load working, fully as far as I can tell. I might just be the greatest :tpi: anyway am trying to sort a few other things out and will do some more testing.

For anyone else trying to make saving work in a different game, here's what I found from looking at the code of Crystal Breaker:
First of all in the game's startup script, it opens the Switch's user account with the following code
Code:
var _id = -1;

while (_id < 0)
   _id = switch_accounts_select_account(true, false, false);

global.account = _id;
global.login_status = false;
global.nickname = "";

if (global.account != -1)
{
   switch_accounts_open_user(global.account);
   global.login_status = switch_accounts_login_user(global.account);
   global.nickname = switch_accounts_get_nickname(global.account);
}
This brings up the popup for you to choose your user, even when your Switch is set to not do so by default, which is a bit annoying and maybe fiddling with the values passed to switch_accounts_select_account might let you avoid that, haven't experimented yet.

Then before every file access it does this:
Code:
switch_save_data_unmount();
switch_save_data_mount(global.account);
and after the file access is complete it does this:
Code:
switch_save_data_commit();

I think that's it as far as the code changes go, tho I did notice it has "Console" ticked on in the Function Classification Flags on the General info page, so I ticked that on too.

Just adding all the above code to UFO 50's startup script, without any actual file access in between mount and commit, was enough for the Switch to create save data for the game, I confirmed it existed in DBI and it showed the appropriate access time/date, though there weren't any files in it as I didn't make any.
 
Last edited by hippy dave,
  • Like
Reactions: BigOnYa
So in case anyone didn't see it in the later edit of the above post, I did get saving working in UFO 50. Hope the above info can be useful for anyone else trying to make a port save properly. I've since rearranged the controls to match the Switch's face buttons. I certainly haven't tested all 50 games yet (UFO 50 is a compilation of 50 games) but it seems like the games work great, however I discovered last night that the Terminal feature crashes the game. Haven't looked at the code for that yet but will see what I can figure out.

Anyway, couple more related things...

Does anyone know a Gamemaker game on the Switch that uses the Switch's on-screen keyboard? Even just for entering your name or anything.

Also plz let me know if anyone finds a Switch game that uses GM 2024.11 - the new update for UFO 50 uses that version instead of 2024.8, and it's got a couple of useful menu changes as well as game bug fixes. If I have no luck finding the newer runner I could always try backporting the script changes to the old version, but ugh.
 
  • Like
Reactions: BigOnYa
So in case anyone didn't see it in the later edit of the above post, I did get saving working in UFO 50. Hope the above info can be useful for anyone else trying to make a port save properly. I've since rearranged the controls to match the Switch's face buttons. I certainly haven't tested all 50 games yet (UFO 50 is a compilation of 50 games) but it seems like the games work great, however I discovered last night that the Terminal feature crashes the game. Haven't looked at the code for that yet but will see what I can figure out.

Anyway, couple more related things...

Does anyone know a Gamemaker game on the Switch that uses the Switch's on-screen keyboard? Even just for entering your name or anything.

Also plz let me know if anyone finds a Switch game that uses GM 2024.11 - the new update for UFO 50 uses that version instead of 2024.8, and it's got a couple of useful menu changes as well as game bug fixes. If I have no luck finding the newer runner I could always try backporting the script changes to the old version, but ugh.
I ran it a while ago on the latest update that uses GM 2024.11.
I tried some games, and they work well; however, I haven't tested everything because I've been working on Undertale Yellow.
I have an idea: why don't we create a dedicated server where we can share all the information related to GM on Nintendo Switch?
 
  • Like
Reactions: hippy dave
I ran it a while ago on the latest update that uses GM 2024.11.
I tried some games, and they work well; however, I haven't tested everything because I've been working on Undertale Yellow.
I have an idea: why don't we create a dedicated server where we can share all the information related to GM on Nintendo Switch?
You ran the latest UFO 50 update on Switch? Which Switch game did you use for the 2024.11 runner?

You mean a discord server? Could be good...
 
هل شغّلتَ آخر تحديث لـ UFO 50 على Switch؟ أي لعبة Switch استخدمتَها في تحديث 2024/11؟

هل تقصد خادم ديسكورد؟ قد يكون جيدًا...

You ran the latest UFO 50 update on Switch? Which Switch game did you use for the 2024.11 runner?

You mean a discord server? Could be good...
Yes discord
(GUNS of fury) 24.11
Post automatically merged:

Yes discord
(GUNS of fury) 24.11
V1.7.2.1
 

Attachments

  • IMG_20250323_222439.jpg
    IMG_20250323_222439.jpg
    677.7 KB · Views: 38
  • Love
Reactions: hippy dave
Bit of a dumb question: Has there been any updates on this? For controller support at least?

EDIT: I am trying to figure out how to get a Pizza Tower Mod working on the Switch. I mean I have the switch port as well but I'm not sure on how to connect everything
 
Bit of a dumb question: Has there been any updates on this? For controller support at least?

EDIT: I am trying to figure out how to get a Pizza Tower Mod working on the Switch. I mean I have the switch port as well but I'm not sure on how to connect everything
Wait, you find a 2022.9 runner? What game is it?
 
wat? I have no idea what your talking about. All I know is that I've tried running the game.dat using both deltarune chapter 1 and the switch version of pizza tower. Nothing worked.
Oh wait i got confused, for a moment I thought hippy dave was you,

also i was talking about gm runners, you see when you build a game in gamemaker it creates a runner that runner is the exe when is a pc game, the apk when is a android game, etc, that runner has a version and it depends on the gm version you are using,

pizza tower uses the runner version "2022.9" because it was builded using that gamemaker version, so if you want to run it in the switch you need a game that uses the same runner version "2022.9"

as hippy dave says the game "moonleap" uses that runner version "2022.9" but when i tried it the game just crashes, prob caused by a pc only extencion like gameframe or the runner not being the correct version

So if you want to run any pizza tower mod without sounds on the switch you will need moonleap and lucky trying to find out why the game crashs on startup
Post automatically merged:

Also sometimes games like the official pizza tower switch port are compiled using the yyc metod

yyc = yoyo compiled

when a game is build like that all of the code that was in the data.win, game.win is now inside of the game runner, making it imposible to uses the runner of that game
 
Last edited by Licuatronix,
Oh wait i got confused, for a moment I thought hippy dave was you,

also i was talking about gm runners, you see when you build a game in gamemaker it creates a runner that runner is the exe when is a pc game, the apk when is a android game, etc, that runner has a version and it depends on the gm version you are using,

pizza tower uses the runner version "2022.9" because it was builded using that gamemaker version, so if you want to run it in the switch you need a game that uses the same runner version "2022.9"

as hippy dave says the game "moonleap" uses that runner version "2022.9" but when i tried it the game just crashes, prob caused by a pc only extencion like gameframe or the runner not being the correct version

So if you want to run any pizza tower mod without sounds on the switch you will need moonleap and lucky trying to find out why the game crashs on startup
Post automatically merged:

Also sometimes games like the official pizza tower switch port are compiled using the yyc metod

yyc = yoyo compiled

when a game is build like that all of the code that was in the data.win, game.win is now inside of the game runner, making it imposible to uses the runner of that game
dang. So do I try using moonleap I guess? Guess I gotta fork up some cash.
 
Error happened when ran. So sad
Post automatically merged:

as hippy dave says the game "moonleap" uses that runner version "2022.9" but when i tried it the game just crashes, prob caused by a pc only extencion like gameframe or the runner not being the correct version
Alright I just saw this. Hopefully we can find a way to update the gameframe and/or runner. But that only asks... Can these gamemaker games run on android on switch? So many questions.....
 
Last edited by DolphinCube,

Site & Scene News

Popular threads in this forum