Zalo DS Blog

Tuesday, January 03, 2017

ZGB, a little engine for the Game Boy

2016 has been an interesting year for the Game Boy scene. I remember back in 2015 talking with people developing for the Game Boy saying lots of docs with important info had been lost over the years and that the scene was dying... Well, I am not sure what happened, but in this past year I've seen some really cool games like: carazu, Rocket Man, Where's my cake?Soup Raiders: Jailbreak, Biotic Limit, Snake Bird, Araku Hime: The Red Princess, Guns & Riders... it seems that the game boy scene has revived!!

Besides Pretty Princess' Castle Escape and Super Princess' 2092 Exodus I have been working on an engine that at some point I decided to name ZGB. This is the engine that both games are using. Some of its features:

- 4 directional scroll that allows maps bigger than 32x32. This is done updating the current row and column as the scroll moves.
- Sprites pool, that will help you manage everything that is moving on screen. It will also handle the creation and destruction of new sprites on screen
- Animations
- Collisions, sprite vs sprite and sprite vs background
- Automatized build support. Just 3 lines of code
- Bank management. Easy to select the bank for every file on the project and transparent bank switching in most cases
- Fonts and printing, and also some tools that will help to debug some values
- Music, using the legacy version of gbt-player
- Sound effects, using the fixed version of the sound sample that comes with the gbdk

ZGB is available on github. You can take a look at all the things you can do with it and there is a tutorial showing you how to create a game step by step. You can also download the source code from Pretty Princess' Castle Escape and Super Princess' 2092 Exodus and see how they do their stuff (or even create some rom hacks if you want :P)

There is a tutorial showing you how to code this

Just for clarification: this is not the definitive engine for the Game Boy. It is written in C using gbdk and that adds a lot of extra garbage on the code . Also there are some parts that still could be optimized a lot. But I think it is good for people who want to do something relatively fast (You know what other options you have if you really want to squeeze the machine). I think it perfectly fits on a game jam. 

There will be more game jams in 2017. I'd like to ask you to give ZGB a try. You'll make me very happy if you create something fun with it (I might even cry). I have already fulfilled one of my childhood's dreams and would like to see you doing it too: create a videogame for the Game Boy.

Happy coding!

ZGB on github


  • Sir, guide me throught this beautiful world of Gameboy Programming. Oh man, this is the article of my dreams, THE ARTICLE OF MY DREAMS!!! I got some basic knowledge of gameboy programming with C a while ago with gbdk.. but some content of libraries were outdated and didn't compile, some tutorials didn't explain very well, etc etc and i got a bit messed.

    Help me, i will make you proud and cry using ZGB and i will spread your word! thanks for existing, i hope you contact me :D

    By Blogger Unknown, at June 16, 2017 11:21 PM  

  • Thanks for your comments, the tutorial should be a good starting point if you want to take a look. I hope you do something awesome!

    By Blogger Zalo, at June 19, 2017 10:57 AM  

  • . I loved watching the "ultimate gameboy talk" back then- I guess you're seen it already? the bir about the pixels fifo to implement sprites was just perfect!

    By Blogger PypeBros, at November 08, 2017 10:47 PM  

  • That talk is amazing
    I din't mention it in this post because it was posted a few days after

    By Blogger Zalo, at November 09, 2017 9:46 AM  

Post a Comment

<< Home