• Add Review
  • Subscribe
  • Nominate
  • Submit Media
  • RSS

Tech Demo

I've got a demo working where you can walk around as Sofia and.. that's basically it. At least it works on the real hardware.

Download: https://rpgmaker.net/media/content/users/4965/locker/wcgb.gb
(You will need something like BGB to play this ROM)

One of the problems more unique to the Gameboy at the time is its very short vblank period. You can't access the video memory while the system is using it to draw the current picture, so any changes have to be made when its not being used. The picture is not being drawn during the vblank period and this is all the time you have to do things. These include loading new graphics, changing tiles on the background map, etc. The short time we get makes even the simplest things a challenge.

I've mentioned before how you need to place new pattern cells down as the screen moves to handle a tile map. There's barely enough time to update a column or row of new cells during vblank. This would be alright except there's more I want to do like animated tiles and sprites with many frames.

This is Sofia's character sprite sheet. There's 12 frames here for a total of 48 pattern cells needed. The Gameboy supports sprite mirror so we could get a bit more out of it, but there's not really that much VRAM and we'll want to leave room for all the other objects in the game. The solution is to stream animations into a specific location and just use that.

But there's no time to update new map cells AND Sofia's new frames as she walks in one vblank period. What we need is more vblank periods, but those only happen once a frame. Sofia changes her frames as she walks, and there's 16 frames of movement with only 2 being spent updating map cells. New frames can be scheduled to update on the frames the map isn't being updated, and if it was, the new frame can wait until a frame is available. This makes animating some of the map tiles a bit easier.

The engine simply loads one of these four sets of patterns into a specific spot in memory. The effect is that these tiles on the map get animated. Palette animations can't be done in dual mode games since the older Gameboy models had a single background "palette" that affects everything. These are done as the lowest priority update since you would have problems telling if there was 30 frames between a step of the animation or 32.

There's still props and other types of objects (like enemies) to handle in the engine. Enemies can have 2 frames of animation and have their sprites entirely loaded at once (for 8 patterns cells per enemy type) so there can be a lot at once. This is actually how they mostly looked in the game jam demo.. this sort of video game aesthetic was based on developers overcoming limitations.


Pages: 1
I managed to get a couple of other Sofias running around as other character entities. Things are going to get even more challenging since I have to optimize all this code.

Pages: 1