Making games for the Game Boy in 2020
Hey! During this Ludum Dare, my team and I made Scrambl'd, a puzzle platformer for the Game Boy! Some say it is brutal, too hard and in desperate need of checkpoints... while others say that it pays perfect homage to a bygone era of trial-and-error and unforgiving gameplay! To each, their own, I suppose. Either way, we're very proud of what we achieved during this LD, and absolutely appreciate all of the constructive feedback and kind words we've received thus far.
Why don't you head on over to our page and try it out for yourself?
We're currently working on implementing features and content we couldn't find time to do during the jam, to try to make this little thing into a proper game! Just yesterday, I finally took the time to add a sound effects system. Now, Scrambl'd sounds better than ever. :wink:
Making games for the Game Boy in 2020
Anyway, I thought it would be fun to share some technical details of the Game Boy, as well as some of the challenges one might encounter while developing games for it. The tools we used to develop this game are probably far better than anything developers had access to back in the day. Hobbyists have created super accurate emulators (bgb, SameBoy) with amazing debuggers and tools to visualize what lies in memory, be it VRAM or WRAM. There's hardly any need to try the game on proper hardware! (In fact, I don't think I ever did until after the deadline.)
Part 1: The Background
On the Game Boy, you never really manipulate pixels in a frame buffer, like you might do on a modern system. Instead, graphics rendering is based on tiles, 8 pixels tall and 8 pixels wide. Each "pixel" in a tile can be of one of four colors; 0 through 3. Whatever actual color these numbers represent on screen may vary depending on what palette is currently in use, but on the original Game Boy (or DMG) they can only represent either white, light gray, dark gray or black. Well, with a green-ish tint, of course!

Here's a visualization of the tile data that is loaded into video memory when playing a level of Scrambl'd, courtesy of bgb's VRAM viewer! A total of 384 tiles can be present in VRAM at any given time... and as you might be able to tell from the image, this includes the egg, springs, feather as well as all of the level's graphics. At any given time, it basically contains all graphics that you might want to show on screen now or in the near future. 384 are not that many!
One way to display these tiles on screen is by using the background. The background can display tiles from one of two tile maps that holds indices - tile numbers - of 32x32 tiles. This effectively means that each of these maps can, at any given time, represent 256x256 pixels composed of tiles! In our imagination, at least.

The Game Boy has a resolution of 160x144 pixels, so only roughly a quarter of the background can be seen at any time. Fortunately, the background (or viewport, if you will) can be scrolled freely in any direction and will wrap around its edges. We use this scroll to make it look like the "camera" is following the egg while it's traversing the level!
But... what do we do if we want levels larger than 32 tiles (or 256 pixels) in any direction? Well, Scrambl'd, like most games, solve this by making changes in the tile map as the background scrolls! Here you can see the background as it is scrolled around the tile map and the tile map being updated with new data as needed.

You might notice that the height of the level is constrained to the height of the background map. This is a limitation I imposed myself in order to make the scrolling logic a bit less complex. We only had 72 hours, you know. :wink: It is no problem, performance wise, to have levels like these scrolling in both directions!
That's about it! Of course, this is not in any way a detailed explanation, but I thought it would be fun to touch on some of the basics. If you found this at all interesting, make sure to leave a comment and I'll make sure to do a part 2. Maybe about the music! Or the sprites! Or the physics! Or about writing assembly! Or something else entirely!
Make sure to check out our game, Scrambl'd!
A big thank you to everyone who played, rated and gave feedback on our game! :v:


