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

lordelan

Well-Known Member
Member
Joined
Jan 4, 2015
Messages
5,787
Trophies
1
Age
44
XP
6,517
Country
Germany
To get them to work you need the am2r game maker studio 2 source code and I only have them partly working. It's a temp save in the /rooms/int folder that i made in the romfs files before recompiling it into am2r.nsp it's not a good way to do it because it triples the file size of it but 350mb is still not bad.
So you got saves working (with your "workaround") with the only downside, that the game is bigger?
 

Imancol

Otak Productions
Member
Joined
Jun 29, 2017
Messages
1,375
Trophies
0
XP
2,762
Country
Colombia
I get this error when I try to compile

Code:
Loading general...
Warning: GM:S 2.0 support is incomplete!
Loading options...
Loading strings...
Loading variables...
Loading functions...
Loading textures...
Loading texture pages... (418/418)
Loading audio...
Loading sprites... (87/87)
Loading objects... (65/109)
Error loading object/obj_image_button.json
An error occured during import
System.ArgumentNullException: Value cannot be null.
Parameter name: j
   at Altar.Repack.Deserialize.DeserializeArray[T](JsonData j, Func`2 converter)
   at Altar.Repack.Deserialize.DeserializeObj(JsonData j, SpriteInfo[] sprites, Func`2 objNameToId)
   at Altar.Repack.Deserialize.ReadFile(String baseDir, JsonData projFile)
   at Altar.Program.Import(ImportOptions opt)
   at Altar.Program.<>c.<Main>b__12_0(String verb, Object vo)
Done
 

The Real Jdbye

*is birb*
Member
Joined
Mar 17, 2010
Messages
23,284
Trophies
4
Location
Space
XP
13,840
Country
Norway
I have a data.win file with bytecode version 17, but the Undertale NSP uses bytecode version 16. Is there a nsp that has bytecode version 17 I can use as a base? What about Deltarune or the update nsp for either?

Edit: Deltarune is bytecode version 17. The update nsps are just a bunch of fragments and I don't know how to modify or merge the data into the base nsp.
Edit2: No luck, it still crashes. I think the version of GM:S used (2.3) is just too new.
 
Last edited by The Real Jdbye,
  • Like
Reactions: Mythical

Journoid

Member
Newcomer
Joined
Oct 28, 2015
Messages
19
Trophies
0
XP
1,044
Country
United States
I have a data.win file with bytecode version 17, but the Undertale NSP uses bytecode version 16. Is there a nsp that has bytecode version 17 I can use as a base? What about Deltarune or the update nsp for either?

Edit: Deltarune is bytecode version 17. The update nsps are just a bunch of fragments and I don't know how to modify or merge the data into the base nsp.
Edit2: No luck, it still crashes. I think the version of GM:S used (2.3) is just too new.

I'm running into this same issue now actually. I think the GM:S version is the issue, as I was able to get a game compiled on GM:S 2 from earlier this year to run, but not one compiled very recently.
 

ScottSchods

Member
Newcomer
Joined
Oct 24, 2019
Messages
22
Trophies
0
Age
22
XP
117
Country
Australia
Does anyone know of any way to change the Title ID or any other GMS games on Switch other than Undertale and Deltarune? Trying to install 3 GMS titles through the basic method and have only been able to get Undertale and Deltarune replaced.
 

hippy dave

BBMB
Member
Joined
Apr 30, 2012
Messages
9,868
Trophies
2
XP
29,074
Country
United Kingdom
Does anyone know of any way to change the Title ID or any other GMS games on Switch other than Undertale and Deltarune? Trying to install 3 GMS titles through the basic method and have only been able to get Undertale and Deltarune replaced.
To change the titleid you need to extract and rebuild the nsp. I don't know if NSCB has a function for this or if there are any other tools to automate it, but the manual way would be to extract with hactool, change the titleid wherever it occurs, and rebuild with hacPack or similar.
 

ScottSchods

Member
Newcomer
Joined
Oct 24, 2019
Messages
22
Trophies
0
Age
22
XP
117
Country
Australia
To change the titleid you need to extract and rebuild the nsp. I don't know if NSCB has a function for this or if there are any other tools to automate it, but the manual way would be to extract with hactool, change the titleid wherever it occurs, and rebuild with hacPack or similar.
I've tried to do this, but didn't really have much luck, with the NSP returning as a ~500KB file. I've basically given up at this point, might consider trying again in the future but as of now I don't really mind.
 

iKirby8

Member
Newcomer
Joined
Dec 5, 2022
Messages
16
Trophies
0
Age
23
XP
149
Country
United States
Sorry to reply to this years later, I really wanted to try and get the fan-made Undertale Yellow onto my switch, I can't seem to get this method to work. I've tried replacing the game.win file on multiple GameMaker games on switch and most of the time it crashes but sometimes it'll throw an error relating to a variable I can see inside undertale modtool. I'm just not sure if I'm doing something wrong.
 

KardchCode

Well-Known Member
OP
Member
Joined
Sep 18, 2017
Messages
133
Trophies
0
XP
867
Country
Spain
Sorry to reply to this years later, I really wanted to try and get the fan-made Undertale Yellow onto my switch, I can't seem to get this method to work. I've tried replacing the game.win file on multiple GameMaker games on switch and most of the time it crashes but sometimes it'll throw an error relating to a variable I can see inside undertale modtool. I'm just not sure if I'm doing something wrong.
Hey there, no worries! It's been a while since I last updated this thread... So I'll try my best to help ya but no promises (I'm a little rusty with this topic) 😅

First of all, what games did you use to replace the game.win file? If possible, please try with Undertale, as it's likely to be the best matching case for this one
And second, what was the full error and variable shown upon crashing those certain times?
 
  • Like
Reactions: lordelan

iKirby8

Member
Newcomer
Joined
Dec 5, 2022
Messages
16
Trophies
0
Age
23
XP
149
Country
United States
Hey there, no worries! It's been a while since I last updated this thread... So I'll try my best to help ya but no promises (I'm a little rusty with this topic) 😅

First of all, what games did you use to replace the game.win file? If possible, please try with Undertale, as it's likely to be the best matching case for this one
And second, what was the full error and variable shown upon crashing those certain times?
I've tried undertale and deltarune to no success. Swapping the game.win with Zeroranger prompts the error code that may be stopping it from launching it from any game I try and swap it with? Maybe deltarune and undertale just don't have some debugging error option enabled but I'm just speculating. It gives an error code and throws me a message about the audio_bus_main variable which I can find referenced in undertale modtool. Then it crashes. I'll attach a stitched together image of the error. Thanks for any amount of help you can provide :')
error code.png
 

KardchCode

Well-Known Member
OP
Member
Joined
Sep 18, 2017
Messages
133
Trophies
0
XP
867
Country
Spain
I've tried undertale and deltarune to no success. Swapping the game.win with Zeroranger prompts the error code that may be stopping it from launching it from any game I try and swap it with? Maybe deltarune and undertale just don't have some debugging error option enabled but I'm just speculating. It gives an error code and throws me a message about the audio_bus_main variable which I can find referenced in undertale modtool. Then it crashes. I'll attach a stitched together image of the error. Thanks for any amount of help you can provide :')
Thanks for providing the error msg! Just to clarify, what gave you the error is in fact a game ported with a tool known as "RussellNX" (which contains a modified version of the GMS Switch runtime)

As far as I can tell, Undertale Yellow is making use of the new audio-effects system introduced in Gamemaker 2 a year ago or so. Recent released gamemaker games are often using new functions that are not supported anymore by old runtimes from like Undertale or Deltarune. That said, you might have much more success if you try with a relatively new gamemaker game released on the switch (tho if there's additional errors you won't be able to see them at all). Hope this is helpful enough for ya!
 

iKirby8

Member
Newcomer
Joined
Dec 5, 2022
Messages
16
Trophies
0
Age
23
XP
149
Country
United States
Thanks for providing the error msg! Just to clarify, what gave you the error is in fact a game ported with a tool known as "RussellNX" (which contains a modified version of the GMS Switch runtime)

As far as I can tell, Undertale Yellow is making use of the new audio-effects system introduced in Gamemaker 2 a year ago or so. Recent released gamemaker games are often using new functions that are not supported anymore by old runtimes from like Undertale or Deltarune. That said, you might have much more success if you try with a relatively new gamemaker game released on the switch (tho if there's additional errors you won't be able to see them at all). Hope this is helpful enough for ya!
That does help a lot! I'll definitely look into that, thank you so much for your help! :)
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    AncientBoi @ AncientBoi: Tattle-tale :creep: