GodotBoy Export Template
A downloadable asset pack
This is a template for exporting a GB/GBC ROM into an bundled executable for Linux, Windows, or Android. This makes publishing on Steam or Google Play Story as easy as dropping your ROM into the template, pointing the emulator at it, and exporting the project.
Under the hood, I've used RBoy (a Rust based emulator) into a library, and interfaced into Godot. Using a full game engine like Godot under the hood means you can modify controls easily, add/modify touch screen controls (touch screen Android controls are WIP), write custom screen shaders, or even place your game into a 3d environment. And since Godot is lightweight, the download size is still quite reasonable.
To interface your GBStudio/gbdk-2020 game into a larger Godot world through variable reading, check out the current development version (bottom GitLab link).
As a bonus, it hides the ROM within a compressed asset files. It is possible to even encrypt your ROM to make it harder (but not impossible) to pirate, if you very strictly wanted your game to run on a supported platform. I don't suspect that would be a popular option, but it's possible for anyone who cares to.
To try it out yourself, download this repo, download Godot, replace my ROM with yours (be sure to delete my rom), and follow the export tutorials on Godot. Currently, it supports Linux (ARM64 or x86_64), Android (ARM64 & x86_64), and Windows (x86_64).
For MacOS, I ask you to compile yourself (for code signing reasons, idk much about distributing MacOS software though). It does require an ARM Mac to compile, and Cargo (Rust's compiler chain), but that is not required run (even in Editor). I don't personally use MacOS, so if you have any issues, let me know and we might need to figure it out together.
If there is enough interest, I would like to publish a Anthology game: a collection of GBStudio or gbdk-2020 games in a single Steam and/or Android download. If your game is in a presentable state and you'd like to be part of an anthology, contact me on BlueSky.
It is, in it's current state, MIT licensed. I don't *expect* to make any money on this, but if this helps you publish your game on one of these stores, consider supporting it so I can spend more of my personal time on it. (And back GBStudio on Patreon while you're at it)
For business inquiries and console porting contact me on BlueSky.
Thanks for checking it out!
GodotBoy source code: https://gitlab.com/greenfox/godot-boy
My BlueSky: https://bsky.app/profile/greenf0x.bsky.social
Status | Released |
Category | Assets |
Rating | Rated 4.8 out of 5 stars (6 total ratings) |
Author | GreenF0x |
Tags | Asset Pack, Game Boy, game-boy-rom, Game Boy ROM, Godot, No AI, Pixel Art, tools |
Download
Click download now to get access to the following files:
Comments
Log in with itch.io to leave a comment.
Love this, perfect for my 3D Emulation system! However one thing I noticed with certain games I get this error at random times.
I’d love to see what else is in your 3d emulation system. But I’d also like to see what causes that error. Do you have a ROM that will reliably reproduce it? Does the error result in a ROM crash or does it continue normally after the error?
Blib_buf is used for sound. I find it strange that it would error like that. It does lots of checks before hitting that line to insure it won’t read out of bounds.
If you’d like to file a bug on gitlab that would probably be easier to talk about code with.
I don’t think it’ll make a difference but: did you download an old version or do you have the latest version here.
My personal favorite, Shrek Fairy Tale Freakdown extracted ROM crashes consistently. I downloaded the addon straight from the Godot AssetLib and it even crashes in your template. The ROM crashes and I am no longer able to play. It's random but sudden enough to test, it also happens on a very few other ROMs I tested.
The asset lib version is old. It will always be old. Godot AssetLib is not a good platform for automating updates. It says as much in the AssetLib listing.
If you can find a legal homebrew ROM that can replicate this error, I will look into it. But I cannot spend time on a fix for an ripped cartridge ROM, even if it’s for personal use copied from a legit cartage that you own. This emulator is intended for publishing homebrew games on modern hardware.
I suspect that game doesn’t quite follow the spec and that’s what’s causing this error. I would be curious to see if it causes other emulators to crash. Regardless, investing that is outside of the scope of this project. Sorry.
Okay things going to be serious here ! Maybe the best addon for GBS !
This is great. Will you give it Mac support?
I don’t own any Apple hardware and I don’t have a subscription to Apple’s developer program, so I can’t deliver Mac binaries for codesign reasons. BUT if you check out the repo, there are instructions on how to compile it for yourself and those instructions work for Mac. You’ll have to figure out codesigning for yourself too.
That’s also mentioned in the text above.
You can distribute Mac software without paying Apple. or having signed code It just requires users to open it using their password
If you want to walk through it with me, I'd be happy to compile it and let you upload it for others to use too. My main concern is that there are going to be compilation issues and without realtime help, it's just going to be a waste of energy because compilation instructions on open source software never seem to work. I'm not sure if it's because the different OS software has slight differences or what, but it's an issue I ran into 100% of the times I tried to do it
Try the instructions as written on the repo and tell me if you have any trouble. I’ve written
buildSystem.sh
, refined, and reused it for quite a few projects at this point. And others hasn’t had any problems. One person didn’t install the prerequisites, but they figured it out. It’s pretty battle-tested at this point. But please try it for yourself and let me know how it goes! If you have any trouble, it’ll be worth learning what happened to further refine the buildSystem.Really, anyone trying to use this tool is likely trying to publish on Steam or similar. They’re gunna NEED to codesign for themselves.
I apprentice the offer to build it for me, but I have no way of knowing if what you built was really what I sent. This itch build is compiled on GitLab. Anyone could audit the log (I should install install checksums if anyone was concerned). Ultimately though the project does get updates pretty regularly and I don’t think people will want to have to call someone else to get them builds.
I could pay for GitLab to use one of their Mac build machines, but this project already makes less then nothing, so I can’t invest in a Mac build pipeline when I get Windows, Linux, and Android for free.
Really the best way is to refine buildSystem as much as possible. If you find any pain points, I’d love to hear about them.
OK! I hear what you're saying and I'll give it a shot and let you know if I have any issues
How has it been going?
Thank you so much for making this! I'm using it and also adding some code to add border support and other things, I was wondering if there's a function or some way to access the memory of the rom to do stuff like achievements or interface the frontend part with the game itself, I know that you are providing a memory viewer to find the memory addresses and values in the rom, but how do i read/write to these memory addresses in the godot frontend? any pointer to documentation or any ideas so i could look for something specific would be appreciated, thanks in advance!
In Godot Editor, press F1, search GodotBoy. The memory functions aren’t well documented yet, but they’re pretty self explanatory. The next release of GBStudio includes some files to help figure out script variable bindings.
https://github.com/chrismaltby/gb-studio/issues/1750
Hello! I have downloaded and tried with my rom. All works fine except the saving.
I notice the following behaviour:
My rom is called game.gb
Inside Godot IDE, it creates a game.sav and it loads it. However the Restart function never loads the save again. If I stop and play it loads the save correctly.
When I export to windows, the save file is name_of_project.sav instead of game.sav but the loading works. However, same as before, the Restart function never loads the save. I have to close the .exe and open again to load the save.
EDIT: the easiest fix is just to add this:
Cool, if you can do a Merge Request on GitLab, I can merge that. Otherwise, I’m out of town and can’t review/fix it properly for a bit.
But thank you for bug+fix!
Not gonna lie, I don't even have a gitlab account 😂
Btw the other thing, different names for the save file depending if using the IDE or just run it, still happens. I can check it too but I don't know if that is intentional.
Any tips/best practices for trying to apply a shader to the TextureRect (say if I want to apply visual filters like a CRT effect)? I tried a test with this shader (VHS and CRT monitor effect - Godot Shaders) and it doesn't seem to play nice.
Godot 4 came out in 2023. This shader is from 2021. I wouldn’t expect it to run out of the box, but you might be able to fix the 3.x->4.x changes.
It actually works fine with some minor tweaks.
and viola:
Sorry I forgot to respond, but yes! I actually ended up coming to this solution on my own previously. I basically ran into the issue I described with almost any shader (4.x or not) I used unless I applied it to a texture-rect sitting over the one with the actual GB rom.
Hello! Just found this amazing project as I was wrapping up the development of my own GBC demo.
Is there a way to export with the DLL file "inside" the same .exe godot export's? I'm asking because it'd be really nice to have to share just the .exe with my own icon.
Amazing tool btw!
Nope. DLLs must be separate files for security reasons. Windows gets upset when you break that paradigm. In theory, someone could make a GameBoy emulator that compiles with Godot. But I’m not working on that.
There are tools to change the Icon of Godot at export time. It’s documented in their docs. Since most people are using this project for Steam distribution though, the DLL usually fine; most games have LOTS of ancillary files.
Thank you!
Yeah I was just curious about it for "✨aesthetic✨" reasons, but its not an actual issue.
I changed the logo and ended up uploading my game on tuesday with ur tools, u rock.
Here it is if you wanna take a look! Its a small demo. https://damianartclub.itch.io/the-office-escapist-gameboy-game
Hi :) I'm trying to use GodotBoy to import my GBA game but I don't know where to place my bios file. Or do I need to include it somewhere?
BTW: GodotBoy is really an awesome tool! Thanks for creating it!
GBA was a rough prototype that has had a lot of problems. I was working on another tool for GBA and other emulators, but it’s a bigger project than I’m able to do on my own.
I just made BubbleWrapGBA because I couldn't make it work with GodotBoy. It's a tool to wrap a GBA file with EmulatorJS to an exe file. Thanks for your help though!
When I "run project" in Godot, everything starts up fine. When I click to run the exported .exe file, it opens to the Godotboy logo and just sits there. Any ideas?
Hrm. Did you copy the exe to a new folder on it’s own? It needs the dll and (if you didn’t bundle it with the exe) the pck files.
Try running it from command line and seeing what the error messages are.
ERROR: godot-rust function call failed: GodotBoy::load_rom_buffer()
Reason: parameter #0 (godot_core::builtin::collections::packed_array::PackedByteArray) conversion
Source: cannot convert from NIL to PACKED_BYTE_ARRAY: null
I also see this error in Godot debug report:
ERROR: Could not create child process: rcedit ./mrmoosdemo.tmp --set-icon C:/Users/adama/AppData/Local/Temp/_rcedit.ico --set-file-version 1.0.0.0 --set-product-version 1.0.0.0
RcEdit is a tool for changing your games icon. If it’s missing, the export will still work, but it will have the Godot logo. Nothing wrong with that, but if you want to change that, you can install that.
Read Godot’s docs for more.
Well, it looks like it’s not loading your ROM. Did you put it in the right place? Does it have a matching file extension?
I added my rom, deleted the original GB Studio demo rom, and renamed my rom to game.gb
I have followed to Video linked above. I exported into the same folder as the template...and the dll file is there. It loads and plays the ROM just fine when I preview the project in Godot, but the .exe file doesn't work.
I have tried on 3 different machines. Same result. I am using Godot 4.4 which prompts me to update the template project with this
I have done both "restart and upgrade" and "cancel" but it doesn't seem to change the outcome.
Godot4.4 issues are outside the scope of this project. This template was built for 4.3. It should work in 4.4, but if it doesn’t, it’s likely this is a 4.4 issue, not a GodotBoyTemplete issue. Read their docs for more. Try deleting your
.godot
folder first though. That forces projects to reimport assets and sometimes fixes issues.The template here was behind the Git repo a bit. Looks like there are some old bugs with the export that were fixed on the main branch. I updated the build here. Try your export again.
I found this tutorial :
Yeah! I’ve chatted with him. I think there are a couple of edits I would make: debug checkbox in the export screen should be off for releases and PLEASE save it to a new folder, not just on your desktop. It creates a DLL file that you need for export.
Oh okay! Thank you!