pingolf on the GBA part 1
a fun side project
As I mentioned in last Sunday’s post, I’ve been playing a ton of UFO 50. One of my favourite games in the collection (to absolutely nobody’s shock) is Pingolf, a combination of Pinball and Golf. Here’s a screenshot of the game in UFO 50:
While I was playing, I noticed that the playable area of the game above the UI is always consistently 160px tall. That turns out to be the exact height of the Gameboy Advance’s screen in its scrolling tiled background modes!
I’ve been on kind of a GBA development kick recently. Anyone who’s followed my work for any length of time knows I love making stuff on older platforms or consoles, and the GBA is no exception to this rule. I have joyful memories of having done development on the system way back in 2012 when I started university; the course material used the GBA as a means to teach on-platform development, which was really fun and got me even more into retrocomputing as a hobby than I already had been.
So, anyway. Pingolf! So, even more good news here is that the UFO-50 uses a fixed 32-colour palette for its graphics, which the GBA can easily handle without even breaking a sweat, having support for 256 colours in 8bpp mode. Pingolf also doesn’t display many sprites per scanline either, checking off another box on my list.
One interesting thing is that the game’s maps are quite long horizontally, as seen in the image above; the first level stretches out all the way to 768px wide - the GBA’s maximum horizontal plane size is 512 outside of the specialized affine rendering modes, so I had to implement a traditional column scrolling routine to stream the tiles in from memory to VRAM as the camera pans over the scene.
So, with some rudimentary collision data for the 16x16 metatiles the levels are composed of, (that is, the LX and GBA both use 8x8 tiles for graphics, but the levels in Pingolf are made up of larger 16x16 chunks, each made of 4 of the smaller 8x8 tiles) and the ball’s sprite loaded up, I’ve managed to get a scene where I can fling a ball around a little bit and pan the camera across the level.
The physics bear absolutely no resemblance to Pingolf’s actual physics (which seem to have quite a few subtleties, especially ramps being a little “sticky”) yet, but overall I’m rather pleased that visually it’s coming together somewhat. Here’s a little video of what’s there right now - you can see how the level tiles stream in and out in the pane to the bottom-right!
I’d like to clone the game as close to the source material as I can, and then do some little GBA-only tweaks and effects quite similar to the way that platform-to-platform ports did back in the day. For example, the GBA’s lower resolution means I’m missing out on Pingolf’s great pinball backglass LED matrix display UI, but I could do something like introduce parallax into the background and add affine sprite effects for things like bumpers, etc.
That’s all for now, but I’ll post about it again soon!