This has definitely been one of those Retrochallenges where most of my progress came at the very end of the month. I’ve been slowly working on the combat system infrastructure for a while, and a bunch of pieces finally came together in the last couple of days. It’s still very much a prototype, but a prototype where I can implement new ideas quickly.
Since I’m trying to keep the game as turn-based combat on a single map, I’m hoping to come up with enough different kinds of attack actions and enemy behaviors to make that interesting. For example, right now I’ve got:
- Ranged attacks. The player, or an enemy, can shoot at an object up to a certain number of squares away. The asymmetry – that one side in a fight might be able to shoot farther than the other – should mean you don’t always just face off and take turns shooting at each other.
- Fireball. The fireball is basically a ranged attack with a burst at the end. When it hits an entity, or an impassable terrain tile, the explosion can hit anything adjacent to the square it stops in. Since all attacks have to be in cardinal directions, you can sometimes use a fireball to attack an enemy that isn’t in position to hit you back. Right now the fireball explosion can actually hit an enemy on the opposite side of a barrier, which is probably too good to keep in, so I’ll have to change the interaction between fireballs and impassable terrain tiles in the future.
- Magewall. A defensive spell, magewall creates a temporary barrier between the player and an enemy. The barrier is actually implemented as a group of independent entities, and the spell’s duration is simulated by having each magewall entity damage itself during its update routine. Enemies (or the player) can also break through the wall more quickly by damaging it. I was very pleased with how easy it was to add something like this to the entity system.
- Enemies with behaviors. These aren’t complex yet, but there’s enough infrastructure there to make them distinct. For example, the woolly mammoth minds its own business unless a player gets too close. At that point the mammoth starts chasing the player until or unless they can get away. The “snake man” creature will make a ranged attack at any entity it can hit (not just the player, but also including mammoths or even other snake men!), and wander in a random direction otherwise. An obvious next fantasy CRPG trope to implement are the town guards who stand around stoically until the player commits some infraction of the law, and then transform into unstoppable killing machines.
An important caveat with the fireball and magewall spells is that there really isn’t a magic economy of any kind yet – there are no spell points, or reagents, or anything else to keep you from just spamming fireball endlessly. How that’s going to work is still TBD.
The numbers behind the system are also placeholders. By that I’m talking about things like miss chances, the amount of damage entities can do, and how much damage they can take. My general feeling is that I’m going for an attrition-based approach to adventuring, where the question isn’t so much “Can I take on this particular kind of monster?” as it is “Do I dare go any farther into the dungeon before going back to refresh my resources?” That means that individual enemies are fairly weak compared to the player, but they have the effect of slowly grinding the player down over time.
I’m feeling pretty good about where I’m at, considering the slow start I had this time around. I do have some concerns, though. One is just with the speed of map draws, which definitely needs some optimization. Another thing that concerns me is the amount of time taken up between turns when there are multiple enemies on screen that want to do something complicated like ranged attacks. Right now these are each handled in sequence, which means there can be a significant delay while the game shows all the enemy attacks before the player can take their next move. It would be interesting to try to do all those enemy actions simultaneously, but that would introduce a lot of complexity to the code.
Generally, I think the way I’m handling some of the map draw is a little too “2017” – there’s a vaguely model-view-controller sort of structure to the main loop. With the attack and spell effects I’ve tried using a more “immediate” sort of rendering style which may be better suited to the C64. That may be a direction to pursue more in the future.