RetroDotCards dev log (alt account)

RetroDotCards dev log (alt account)

@devlog.retrodotcards.com

My alt account to @retrodotcards.com On this account I post dev log updates on the games I am working on. Expect smaller, more frequent and more raw posts. Currently making Eridin, a fantasy strategy game for GBA/e-reader and PC.

70 followers2 following80 posts

Starting to build out the card loading scene and my old sprite text function's limitation of 64px wide (which is the max width of a GBA sprite) ain't gonna cut it. This will end up being a pretty complex function, as it will need to draw the text spanning across several sprites.

An example of a very simple/early card. It might seem crazy to use z80 assembly as a "scripting" language, but this code is almost identical to standard e-reader card code. I can use all my learnings from e-reader dev for this. Then from there use the e-reader tool chain to convert this into a card.

To do this, GBA Eridin will scan cards, have an API cards can use, a z80 emulator, resources, etc. In other words, it's going to act a lot like the e-reader itself. If I build the API out well, cards should be able to alter almost anything in the game. First step, a z80 emulator...

I did it similarly to how I'd have done it on the Neo Geo, using a background layer. I created 8 tiles from 1 to 8, and render in as many 8 tiles as needed, throw in one partial tile (so if their health is 22, that's two 8s and one 6), and then fill the remaining space with black tiles.

I threw in an attack range indicator, just like Fire Emblem. Today's goal is functioning energy bars. Usually how a system handles graphics influences how to accomplish something, but in this case you can do energy bars in several different ways on the GBA and they are all valid approaches.

If I could just plot tile indexes like on the Neo Geo, or draw directly into a bitmap, then energy bars would be a sinch. But the GBA is kinda stuck in the middle here. Anyway, once they are done, I'll be juuuust about to my first milestone goal of a very basic Fire Emblem clone.

The turn callout is a sprite, and partially transparent sprites on the GBA eat other sprites. This video is slowed down, and you can see the character is chomped by the callout. Hmmmm... make it a background? Trouble is, I'm out of backgrounds. Not sure yet...

In Pixel Pup, all memory is static. When the game starts, everything in the entire game that needs RAM, grabs it. The entire game is in RAM at all times (the puzzles don't need to be in RAM, they are read from ROM). I know that won't cut it for Eridin, so I created a very simple memory allocator.

View full thread

Resting back to zero means I never have to worry about memory leaks or freeing. There is a small amount of global memory that keeps track of things that shouldn't reset. Ex: When attacking, the game goes from battle phase to attack phase. Global memory is used to keep track of who is in the fight.

In Pixel Pup, all memory is static. When the game starts, everything in the entire game that needs RAM, grabs it. The entire game is in RAM at all times (the puzzles don't need to be in RAM, they are read from ROM). I know that won't cut it for Eridin, so I created a very simple memory allocator.

The allocator grabs 128kb of memory from the GBA's RAM. Then the different parts of the game call mem_alloc() to get a chunk of that to use. When that phase of the game is done (say moving from title screen into gameplay), the allocator resets back to zero. Very primitive, but it works very well.

Today I'm tackling action points. Each character has a set amount per turn, and can use them how they please to move/attack/etc. At least in early Fire Emblem games, I was never a fan that characters can or can't move depending on what they've done so far. This is my attempt to clarify that.

See how the 2nd 1 icon has a green corner? That is the goblin sprite down below, the menu itself is a background. The clear corner of the 1 icon is allowing the goblin pixel to push through the bg. The GBA's method for deciding how sprites/bgs combine to form the final pixel is a little primitive.

Taking a break from coding, back to art. I'm going to take a stab at Tril's attack animation. For starters, I got a decent idle pose going. And what better place to get reference and inspiration on pixel art sword attack animations than Samurai Shodown?

Hoo, that was a big change. But the end result is awesome. The code got cleaned up a lot, is much easier to work with, and now animations for one character are all defined in a single file. This does mean aseprite is now a required tool, which I have mixed feelings about. But overall this is a win.

Plugging away at the fight scene. The goblin's portrait is in the wrong place because my sprite flipping code is too primitive. The Pixel Pup engine didn't need to address many things because ultimately that game was pretty simple. So I'm filling in the gaps as I go.

The GBA has a built in hardware mosaic effect, and I think once set up well, it makes sense to use for fight transitions. SDL has nothing like this built in, so I'll need to implement it myself. Probably by taking the scene, downscaling it so it gets blocky, then scaling that blocky image back up.

View full thread

But most commercial games did it differently. They keep the sprite using the same tiles, and copy frames into that tile location over time to accomplish the animation. This uses fewer tiles, but the game needs to copy the tile data into vram fast enough to get smooth animation without any tearing.

I'm happy with the general direction this battle map is taking (it still has a long ways to go, especially the colors). But it's made out of 259 unique tiles, and I doubt that will work in the long run. I'll need to come up with graphics that use more repeated tiles.

I decided to switch over to graphics for the starting work on the fight scene. I'm planning to have them take place on scenes that kinda look like a 2D fighting game. How realistic is this decision? Maybe too ambitious. One way I'll judge that is how long it takes for me to draw this village.

To get this scene started, I found a photo of a German village online. It's just to kick things off, the game's buildings will look totally different when done. This helps make the scene feel more "real", it's easy to fall into the trap of just plopping in a flat row of boring buildings.

Now that I have a functional menu system, it's time to start tackling a basic 1-on-1 fight system. My goal is to have a basic, but complete, battle/fight system in place for the Detroit Retro Gaming Show on November 7th. A lofty goal, but I think it's doable.

On the GBA, the menu is done using 2 backgrounds. But it won't be the only UI element, so I had to step back and make a component that manages the entire bg. Showing the menu is just a "menuShow()" call, but behind the scenes, craziness is happening. The PC version is very simple in comparison.