Tutorial Play/port your GameMaker games on NintendoSwitch

KardchCode

Well-Known Member
OP
Member
Joined
Sep 18, 2017
Messages
130
Trophies
0
XP
562
Country
Spain
As you might already know there is a way of running different gamemaker games recently discovered by Chocolate2890. However some of them might not work correctly or might fail on launch.... So I did my job and discovered a way of fixing multiple issues on those games that don't work, example of this is Zelda Breath Of the NES, not a popular game right now but it was back in time (developed by winterdrake, do you remember?). Well I tried making the "trick" to play this demo on the switch, it always crashed but here's how to fix it...

For those who don't know yet, it's possible to use the cfw layeredfilesystem AKA gamemods to replace the original game.win from undertale with another game made with GameMaker1 and later versions. To be more specific this file it's located at titles/010080b00ad66000/romfs/game.win
This file is in other words the game itself, so by replacing it we are able to play mostly every game designed with GameMaker!

How to play GameMaker Games over Undertale:

IMPORTANT NOTE: This guide is outdated, you can still follow the steps and you will probabbly obtain good results, however there are more pwerful programs out there like UndertaleModTool which work in a better way. Gonna update the tuto as soon as I can, for the moment you can still use it ofc (if you have any trouble contact me or ask me anything and I will help you with the porting)

Basic Method
Basic steps (UNDERTALE XCI/NSP ALREADY INSTALLED NEEDED):

- Extract your data.win from any game you want, you can do this by opening the .exe program like a zip file, click left mouse button over the game.exe and click on open with... WinRar (you can also use similar programs). You will see there a few files, pick the data.win which is the one you need. (sometimes the data.win isn't inside the exe but it's at least in the same folder)

- Move your data.win (previously renamed to game.win) into cfwname/titles/010080b00ad66000/romfs/game.win in your SD card like you normally do with game mods.

- Open Undertale and see if it works or not, easy isn't it?

NOTE: some games might work like this, without any modification which is great, but they will have several problems in docked mode or if Joycons aren't attached, this may not occur but it's really possible.

If the basic method doesn't work for you you will need to go trough the FixMethod below


Fix Method(windows only)
This method is just in case the game doesn't works correctly or doesn't boots (UNDERTALE IS NEEDED AS WELL)

- First we need the data.win that we tested later but sadly didn't work. We will need a few manual touches to make it such a good kid and that way it will work. So as I said, we need to edit some things, you will download this application called altar.exe https://gitlab.com/PoroCYon/Altar.NET/-/jobs/artifacts/master/download?job=release Also create another folder in the same directory as altar.exe called BadKid (for example).

- Great, then take your bad kid data.win into the same folder as altar.exe and badkid folder and open a PowerShell window. To do this press in empty space inside the folder and click mayus+left mouse button, this will show different options click the one that says Open powershell window here

-
Once the window opened and loaded the directory in order you will execute the following command:

./altar.exe export --project --file data.win --out BadKid


- Wait for it, depending on the size of the game it will last longer or shorter, once it has finished his processes (don't mind the chunk errors) minimize the window and go into the BadKid folder to see what mess the kid did (sorry for the metaphors hehe).

- What a disaster! well not at all, now you need to edit one single file, most of the game.win errors are because of the unsupported window size, let's take a look. If you look closely you will see a file named general.json Ok! open that file with your favorite text editor and search for this:

"windowsize":{"width":somesizenumbers,"height":somesizenumbershereaswell},

- You will have then to change the width and height values to look like this: "windowsize":{"width":640,"height":480}
Yes you heard right, 640 and 480, those are the values to resize the game (you can change them to 1280 and 720 but it's not recommended, you will have some fps/texture problems)

- Time for the real action to happen! Once you edited the values save the file in the same format and in the same place, just save the editions you made to the original file you were editing easy tho. But wait wait! that's not all my friend we have to Repack the files into our new and fresh good kid.win file!

- In order to repack our game assets into a new fixed-data.win file again we will need to revive the minimized Powershell window (don't tell me you closed, I said it minimize it very clear). Ok it's as easy as just executing the following command:

./altar.exe import --file ./BadKid/NameOfYourGame.json --out fixed-data.win

You must change the NameOfYourGame with the name of the game you are trying to use. To be more specific this file is located at the folder BadKid with SomeGameName.json, take that name and use it up there, in that command you just saw, easy? of course!

- Sadly my friends we come to the last step, moving the fixed.data.win file produced it the root of our working folder (next to altar.exe and our original data.win file). we have to place this fixed.data.win like we did with the basic steps, Don't forget to rename it to game.win!

- That's it for now! You just have to layer the new game.win and run undertale!

You can also create a new nsp file using the exefs from undertale and a romfs folder that contains the desired game.win

Credits to Chocolate2890 and the creator of altar tool and to everyone that contributed with this things!

This is how it would look like (just an example with the mentioned breath of the nes demo)
https://twitter.com/kardch_code/status/1046441568239063041?s=19

Also an example of an nsp fully working (photo below)
de0926dd49cbc3ec114752d13fe0a771.jpg

IMPORTANT NOTE: Some games may fail when exporting, I'm investigating the most common issues. Also this process is experimental as the games when playing can have bad performance (from 10 to 60fps depending on the context), issues like this and savedata errors, not playable in docked mode, wireless joycons not working, etc are being worked to be fixed and make a full port of your favorite games, stay tunned!
 
Last edited by KardchCode, , Reason: update altar link and a few advises

KardchCode

Well-Known Member
OP
Member
Joined
Sep 18, 2017
Messages
130
Trophies
0
XP
562
Country
Spain
I also have to advice that there are a few problems left to solve like performance on fps, and savedata files with a fee others, but this guide covers (and will cover) the most important fixes, right now is just the size, which is the most important one but I will provide more fixes to the problems left, as always stay tuned and follow me on Twitter! (@kardch_code): https://twitter.com/kardch_code?s=09
 

KardchCode

Well-Known Member
OP
Member
Joined
Sep 18, 2017
Messages
130
Trophies
0
XP
562
Country
Spain
Also, if a mod is watching this please change the tag to none since it's a tutorial and not a release, my bad
 

cheese the chao

Member
Newcomer
Joined
Mar 15, 2009
Messages
14
Trophies
0
XP
296
Country
United States
Can you tell me the error log?, (Sorry for double message, it somehow got bugged)

"Exporting rooms... (98/391)An error occured during export

Unhandled Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Altar.Unpack.Serialize.SerializeRoomTile(RoomTile tile, BackgroundInfo[] bgs)
at Altar.Unpack.Serialize.<>c__DisplayClass31_0.<SerializeRoom>b__3(RoomTile t)
at Altar.Unpack.Serialize.SerializeArray[T,TRet](IEnumerable`1 coll, Func`2 converter)
at Altar.Unpack.Serialize.SerializeRoom(RoomInfo room, BackgroundInfo[] bgs, ObjectInfo[] objs)
at Altar.Program.Export(ExportOptions eo)
at Altar.Program.<>c.<Main>b__10_0(String verb, Object vo)
at CommandLine.Parser.ParseArgumentsStrict(String[] args, Object options, Action`2 onVerbCommand, Action onFail)
at Altar.Program.Main(String[] args)"
 

KardchCode

Well-Known Member
OP
Member
Joined
Sep 18, 2017
Messages
130
Trophies
0
XP
562
Country
Spain
"Exporting rooms... (98/391)An error occured during export

Unhandled Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Altar.Unpack.Serialize.SerializeRoomTile(RoomTile tile, BackgroundInfo[] bgs)
at Altar.Unpack.Serialize.<>c__DisplayClass31_0.<SerializeRoom>b__3(RoomTile t)
at Altar.Unpack.Serialize.SerializeArray[T,TRet](IEnumerable`1 coll, Func`2 converter)
at Altar.Unpack.Serialize.SerializeRoom(RoomInfo room, BackgroundInfo[] bgs, ObjectInfo[] objs)
at Altar.Program.Export(ExportOptions eo)
at Altar.Program.<>c.<Main>b__10_0(String verb, Object vo)
at CommandLine.Parser.ParseArgumentsStrict(String[] args, Object options, Action`2 onVerbCommand, Action onFail)
at Altar.Program.Main(String[] args)"
What game are you trying to export?
 

KardchCode

Well-Known Member
OP
Member
Joined
Sep 18, 2017
Messages
130
Trophies
0
XP
562
Country
Spain
AM2R . Wondered if this fix would solve its not booting problem. But can't even get all the files exported out of it.
Ohh I see, I'm casually trying to export it right now hehe, it's going ok, we will see if it gets past rooms and if not I will track the problem!
 
General chit-chat
Help Users
    NeoGaming @ NeoGaming: like me