Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)
You are not logged in.
Hello everyone! I started developing for Gameboy a little more than two months ago to practice coding in assembly. I had programmed a small game for GBA before this, but that was in C. This game, Carazu, is a simple platformer written entirely in assembly. It was a great learning experience and I'm sure I will make more games for Gameboy in the future. It is seriously so fun
Link to ROM:
https://drive.google.com/open?id=0Bz6zR … XdiLU5PRlU
You play as a mouse and the goal is to reach the final level while collecting as many bubbles as you can. There are three worlds (plains, caves, sky city) and a secret level hidden in each of them.
I ran out of time while working on this (about to start grad school) so I couldn't polish things very much, but that's okay because I got it running on my gameboy pocket so that is the most rewarding feeling.
Feedback is welcome. Thanks for checking out my little game!
Offline
Quite a few fairly sizable levels here! I just got the speed-boosting powerup.
I noticed the ROM is reasonably sizable at about 250 KB. I'm guessing a big chunk of that is the level data? Are you using any sort of compression for the levels? Meta-tiles? Or is it just stored raw?
I don't know how much more you intend to work on the game, but something I would recommend is to try to cut down on the number of blind jumps to places where there's moving monsters but you have no real way of knowing whether or not the monster will be at a safe point in its patrol until it's too late.
Last edited by DonaldHays (2016-08-30 21:42:52)
Offline
Yea, the ROM just barely went over 128k limit. I had to use 9 ROM banks, so the ROM size went up to 256kB just for one extra bank. I probably could have rearranged the levels so that I could fit it into 128k. And yes, most of the data is map data for the levels. I don't really know how to implement compression, so all the maps are stored raw. But I am really interested in learning the techniques for compressing map data, so if you have any resources on that, I would definitely be interested in them.
Yea the blind jumps are terrible ahaha. I wish I had someone to design the levels for me because I don't enjoy it much in comparison to coding the gameplay. I was actually going to make the camera go farther up/down/left/right depending on what directions you are holding, but this ended up conflicting with the way i was loading enemies, and players could abuse the camera changing location, so i had to make the camera static :[
Thanks for playing my game Donald!! And thanks for the feedback!
Offline
Isn't it nice how with modern hobby Game Boy programming it's generally fine if your game's data just barely bumps you up into a higher storage tier? We don't have the economic constraints to worry about that professionals back in the day did. "If I can't squeeze it into this smaller size, the carts are going to be X dollars more expensive to manufacture." I kind of chuckled at the thought when I added high-score battery save to my Snake game. I'm only storing six bytes: four for the word "SAVE" for integrity-checking, and 2 for the actual score. And that was fine. But if the game was developed back in the Game Boy's prime and was destined for a physical release I would have had to justify the added expense for the on-cart RAM and battery.
For making map data smaller, there's a couple of common techniques. Look into Metatiles (an extra layer of definition inserted between tiles and maps, where metatiles are arrangements of smaller tiles, and then your map is built as indices into a metatile table instead of indices into a tile table) and Run-Length Compression (instead of storing tile/metatile indices one-for-one, you pair a `count` with an `index`, and then decompress the map by writing out the `index` from each pair `count` times. So your stored data is like, "one of Tile 1, one of Tile 2, five of Tile 3, one of Tile 2, three of Tile 3", and that decompresses to "12333332333").
Also, I beat the game! I like that there was a decent number of levels, that stood out to me. Going into it I only expected one or two levels, so it was nice when it turned out there was more than that. Also awesome to hear you wrote it in assembly. And that you ran it on a Pocket! As a child I wanted to make Nintendo games, so I understand how rewarding it is to finally see your work running on hardware.
Just because I like reading these sorts of stories: have you got any interesting anecdotes about your experience developing it? Any awesome breakthroughs, neat tricks you implemented, or really tough bugs you spent a long time struggling with?
Offline
The run-length compression is the idea I was thinking of to save space! But I didn't know it was called. The metatile technique also sounds very useful, and it makes sense. Glad you beat the game
As far as anecdotes... It took me a stupid long time to figure out why I couldn't save my game on the cart ram. Didn't realize that there was a battery powering it ahaha. It makes sense now too, because I was curious as to what type of RAM the cartridge was using that would allow it to persist with no power. Also makes sense why the pokemon silver cartridge that I found with my old gameboy has no save file and saving wouldn't work. So eventually I realized I had to change the ROM header to include that battery The game doesn't even need a save feature but I wanted to figure out how it worked. So yea, like you said the extra cost wouldn't have been justified lol.
The map tile streaming was probably the most challenging part. I've thought of better ways to do it thanks to other users on the forum, but it was definitely rewarding when the streaming worked.
I really want to make a video series on developing for the gameboy in assembly. We'll see if that ever happens though
Offline
Yes, it is cool when you suddenly find the correct code to stream in tiles to the background map. Took me a while to figure it out, but I found something that streams tiles on the horizontal axis (not perfectly, the wrong tiles are loaded sometimes, but it works good enough for a reference point for me).
Offline