How To Get Started with Gameboy Development using GBDK

So, you’ve decided to make a Homebrew Gameboy Game using GBDK, Good for you! Let’s get you up and started with some of the vital tools that you’ll need.

  1. GBDK – GBDK Download & Install Guide
    ( I installed my copy to C:\gbdk and will refer to that location throughout this series of tutorials.)
  2. A Text Editor. Programmers Notepad is pretty nice and FREE
  3. BGB (Gameboy Emulator, again FREE and the best one out there.)

Please note that I’ve only done GBDK coding on my Windows Machine so some installation bits may vary depending on your choice of Operating System.

That’s it, that’s the bare minimum you’ll need to get started and get used to bare minimums, because the Gameboy, despite being a well-balanced machine, isn’t powerful, if you’re used to Unity or other modern development tools, this will be quite the step back. Let’s take a brief look at the specs

Yay Gameboy!CPU Speed: 4.19 MHz ( or 0.000419 GHz if you prefer)
RAM: 8kb – Expandable to 32kb depending on your ROM Carts settings

And we’re looking at ROM Sizes between 32kb to I think 1Mb. Not much space, and to start we’ll be dealing with 32kb ROM Size only.

Everything Graphical is Tile-based (8×8) and we have a screen resolution of 160 x 144 Pixels, In 4 shades of grey.

And yes, you can still make a game, running at nearly 60FPS on this, cool huh?

Tomorrow we’ll write our first program which will cover that most important thing, getting something on-screen with a few lines of code and running, it’ll be great!

Background collisions and more visual debugging #1GAM

BKG Layer Collision in GBDKYay! Turns out it wasn’t too tough to get the collision working there, man, does visual feedback help out a shit ton with coding, I’m loving all the features in BGB, A really great Gameboy Emulator, they really help me out here.

So yeah, hopefully, that GIF will animate and you’ll see the friction applied to the car when it goes off-track. Simple stuff but hey, it’s working well and fairly quickly (I’ve got around 90% of CPU left per frame when the debugging is removed and roughly 70% with debug info being output every frame (not optimal, I know)

I’m going to need some animation frame for the car at some point, so it can at least have some appearance of turning, maybe 2 frames of animation. I can get away with only 8 tiles for that with sprite flipping, which is going to prove to be a great bonus when I get around to sparks and explosions further along the month!

Soo, yeah, next up animation frames and making other collision objects stop the car / explode it into tiny pieces, ohh rahh!

Before I sign off on this update, I should note some other systems I’ll put in ,obvoius control schemes for controlling using A and B for gas and brakes, with the D-Pad for steering, pressing up could use some sorta Turbo maybe. That would be pretty cool to figure out.

There’s still Scrolling, Music, SFX and maybe some rudimentary homing A.I. to add here, but I think the code loops should be tight enough to keep the gameboys 60fps with some cunning compression, I could make some super long levels also.

#1GAM Racing game on the Gameboy – Day 3

A few more developments on the racing game were begun tonight and a change of focus seemed to serve me well for once.

I was having a few issues with the background layer scrolling new tile row correctly last night and they were still occurring today so I just commented out the scrolling code for the moment and instead started on some quick sprites and getting some debug info to help me determine which tiles the car is colliding with currently, all whilst keeping variable usage down (so yeah, I’m reusing variables inside loops more now, yay RAM efficiency!)

Nothing too tough tonight but it’s good to have some more data and in-game debugging more of a possibility!

I’ll probably use the white lines as restore points should you explode off-track. They’ll need regular spacing, but that shouldn’t be too tough to sort out tomorrow perhaps? Updated screeny below, with sprites and X ‘n’ Y coordinates in the window (first 3 characters per line).

Racing game sprites and in-game debugging