Sprites! They seem important!

If I’m going to make a game, I’m relatively sure I’m going to need to understand sprites, those little graphics that animate and/or ping about the screen so you know what’s going on.

Handily there’s already a good tutorial for that, so I went through that with a couple of differences, rebel that I am.

I won’t reiterate the contents of the tutorial, but suffice to say that Gameboy Tile Designer is a neat tool and this whole process was an absolute doddle.

eBoy are safe… for now.

The tutorial ran like a dream (once I remembered to export the right number of tiles) and I made a slight variation in order to animate both 8×16 parts of the sprite (as the mouth covers both). I also added basic animation.

#include <gb/gb.h>
#include <gb/drawing.h>
#include "speaky.c"

void main() {
	int speaky_x = 75;
	int speaky_y = 75;
	SPRITES_8x16;
	set_sprite_data(0, 8, speaky);
	set_sprite_tile(0, 0);
	move_sprite(0, speaky_x, speaky_y);
	set_sprite_tile(1, 2);
	move_sprite(1, speaky_x + 8, speaky_y);
	SHOW_SPRITES;

	while(1){
		speaky_x++;
		speaky_y++;
		set_sprite_tile(0, 4);
		set_sprite_tile(1, 6);
		move_sprite(0, speaky_x, speaky_y);
		move_sprite(1, speaky_x + 8, speaky_y);
		delay(500);
		set_sprite_tile(0, 0);
		set_sprite_tile(1, 2);
		delay(500);
	}
}

Incidentally, the character is called “speaky” because I was considering making it open and close its mouth on keypress, making lines of dialog appear. However, with this movement it now reminds me more of something else…

Time Spent: About half an hour.

Hello World. So far so good…

Time to get set up!

Barring a quick diversion into a charged thread on how good or not good GBDK is (spoiler: it’s good enough for me!), I got the tools set up.

Pretty simple so far. Grabbed the latest win32 GBDK, extracted it somewhere sane for command-line work, nabbed a recommended emulator called bgb and tested it all by compiling the examples. So far so good…

So let’s see if I can get some code running.

#include <gb/gb.h>
#include <gb/drawing.h>

void main() {
    gprintf("Hello world");
}

aaand…

Classic, no?

So the tools work. I guess the rest is up to me…

Time Spent: about 45 minutes

Doing the Research

OK. Decision made. But not without looking into it.

While mulling it over during the Easter break I had a google around to see what kind of challenge I’d be setting myself up for. Turns out that the Game Boy homebrew scene is alive and well, so there’s loads of information out there.

Probably the most impactful information I found was the existence (and popularity of) GameBoy Developers Kit (GBDK), enabling development of native Game Boy programs in C. This was the real moment where I felt that this challenge was within my grasp and worth pursuing, as trying to learn the concepts and limitations of the platform AND assembler at the same time would likely polish me off pretty quickly. Thanks, GBDK!

Fuelled by my own enthusiasm I dug in, got bookmarking and found a fair bit…

The biggest find (apart from GBDK) was, without a doubt, this post-mortem write-up of someone who has taken this journey before me. “Doctor Ludos” and his experience developing the original game “Sheep It Up” *and* committing it to cartridge. Some really great insights in there and tremendous inspiration.

So what’s next? Well, I’d better decide on what kind of game I’m making. Actually, inspiration struck over the Easter weekend too, but I’ll have that for the next update.

Fun discovery: Wichita State University did a course on Game Boy development, still online here thanks to the Internet Archive.

Time Spent: Lots of bits and pieces, but altogether probably approximately 2.5 hours.

I’m Going To Write A Game Boy Game

I’ve been scratching around for a new hobby and made a decision:

By Christmas this year I will write a Game Boy game capable of running on the original Nintendo hardware.

There are multiple reasons why, which I won’t bother going in to now, but as the original “grey brick” Game Boy turned 30 this Easter weekend it felt like an appropriate aspiration.

So I’m going to attempt the following:

  • The game should be reasonably polished – that means playable, has a title screen, some music etc.
  • I’m going to go for a C-based workflow. Starting with assembly will be a bit much for my level, and the newly released (and awesome looking) gbstudio.dev relies on me having a great idea for a JRPG, plus I want to try some reasonably heavy coding.
  • I will keep a brief diary of my progress as I go, which is what this thing is.
  • If I succeed in doing this, I will buy myself a fancy flashable cartridge and play it on our original childhood Game Boy (initially owned by my brother, now in the possession of my sister).

I’ll cross-post a few things to twitter. If you know anything (or anyone who knows anything) about these kinds of things then do reach out – or just cheer me along!