The Basic mechanics of Akalabeth

My experience playing Akalabeth left me unsatisfied, so I decided to delve into the source code to try to understand how it works. If anything, this was more fun and more satisfying than playing it.

As an Apple BASIC game, the source code is right on the disk image, and can be extracted with CiderPress.

Monster tables

This was the first thing I looked for. Turns out the “table” looks like this:

1 Skeleton
2 Thief
3 Giant rat
4 Orc
5 Viper
6 Carrion crawler
7 Gremlin
8 Mimic
9 Daemon
10 Balrog

Yeah, that’s it. No stats for HP, AC, damage, or any of the usual stuff I’d expect a monster table to have. This is not a very data-driven game. We’ll get into how those are generated later, but the rule is that the higher the row index, the tougher the monster.

This table is also used by Lord British to hand out quests. Your first quest is selected from this table, and after completing it, your next quest will always be the next monster on the list. In my playthrough, the first quest was a Carrion Crawler, followed by a Gremlin, Mimic, Daemon, and Balrog.

When entering a dungeon level, the game loops through the list of monsters. If (monster index – 2) is smaller than or equal to the dungeon level, then the monster has a 60% chance of spawning somewhere. So, on level 1, you might face skeletons, thieves, and giant rats. On level 8, you could hypothetically face all ten monsters, though in practice this will never happen thanks to the way the RNG works. The game will never spawn two monsters of the same type on the same level.

Player stats & combat

Your difficulty affects the amount of HP the monsters get. That’s it.

A monster’s HP is (2 * monster index) + (2 * dungeon level * difficulty level).

Strength enhances your weapon damage. Each point adds 0.2 damage to the damage of a successful hit, and the sum is rounded down.
A note here – weapon damage is mislabeled. All weapons except amulets have a minimum of 0, not 1. That rapier that says it does 1-10 damage? The base damage range is actually 0-10, and it can indeed do 0 total damage if your strength bonus is low enough.

So let's say you have 23 strength and are wielding a rapier capable of 0-10 damage? With the +4.6 strength bonus, you'll inflict 4-14 damage on a successful hit.

You might wonder what the point of doing +4.6 bonus damage is, if damage is always rounded down. Base damage is always a floating point number. So your rapier with a range of 0-10 might do 5.5623 damage. With a bonus of 4.4, the sum would be 9.9623, and round down to 9. With a bonus of 4.6, it would be 10.1623, and round down to 10.

This strength bonus applies to thrown axes and bows too, but not amulets, which don’t care about strength.

You can attack with a shield too, for 0-1 damage, plus the strength bonus. Your fists do 0 base damage, plus strength bonus.

Dexterity decides your chance to hit an enemy. The formula is:
4% * (dexterity - monster index - dungeon level)

So let’s say you have 20 dexterity points, and are fighting a thief (index 2) on level 5. That’s a 52% chance of hitting.

Ranged weapons follow this code path too, including the amulet’s kill spell. Ranged weapons follow some additional logic that I don’t fully understand, but it does seem like they hit less often.

This also suggests that if your stamina isn’t high enough, beating the game may be impossible. You have to kill a balrog to win, they have a monster index of 10, and they don’t start appearing until dungeon level 9. What if your dexterity is 19 or less? You have no chance at all of hitting them.

Stamina decides your chance to avoid getting hit by an enemy. The formula is:
4% * (stamina - monster index - dungeon level)

This does not affect the chances of being pickpocketed by thieves and gremlins.

Wisdom is interesting. It determines your starting quest from Lord British. When you first visit, take your wisdom, divide by 3, and round down. That’s the monster index of your first quest. After that point, wisdom does nothing. When I had wisdom of 20, this evaluated to a monster index of 6, so I got sent to kill a carrion crawler.

This actually makes it beneficial to have LOW wisdom. With high wisdom, you’ll just be skipping the early easy quests, and won’t get the stat boost reward for completing them.

Also, if your wisdom is 33 or higher, then you’ll crash the game when getting your first quest, because the monster index of 11 (or higher) doesn’t exist. So, don’t transform into a lizard man until AFTER getting your first quest!

Amulet stuff

When using an amulet as a mage, there’s a 25% chance the amulet gets destroyed.

As a fighter, one of the four spells is chosen randomly, with an equal chance for each spell. But the amulet will never be destroyed.

The Kill spell’s damage is always (10 + dungeon level). Whether it hits or not is determined by dexterity in the same manner as weapons.

The Bad? spell invokes one of three effects chosen randomly. Toad sets all of your stats to 3. Backfire halves your hitpoints. Lizard Man multiplies all of your stats by 2.5, rounded down.

More monster stuff

The gold reward for killing a monster is equal to its monster index plus the dungeon level.

The HP reward is stored in a variable called “LK.” Whenever you kill a monster, LK increases by this:
(monster index * dungeon level)/2

On exiting the dungeon, your HP increases by LK.

Monsters normally pursue you, but will flee instead if their HP drops below (dungeon level * difficulty level). A monster in flight status will attack if they cannot retreat.

Fleeing monsters’ HP will regenerate by (dungeon level + difficulty) on turns when they do not attack. When it rises above (dungeon level * difficulty) they will pursue again.

Mimics do not pursue when they are within 3 spaces of you.

Thievery

When gremlins and thieves attack, there is a 50% chance that they will steal instead. Stealing is always successful.

Thieves will randomly select one of six item types to steal (food, rapier, axe, shield, bow, amulet). If you have at least one, then you lose one. If you don’t, then the thief will try again until he picks something you do have. If you have no items and less than one food (a very probable occurrence early on), this can actually make the game lock up, as the thief endlessly rummages in your pockets looking for loot that you don’t have!

Gremlin theft cuts your food supply in half, which really sucks, and is the main reason why I believe this game to be impossible to beat without cheesing.

Game 39: Akalabeth: World of Doom

Long story short concerning the chronology – Garriott’s Akalabeth seems to have been made in the summer of 1979, and had its wide release through California Pacific Computing in 1980. Garriott’s claims are consistent with this narrative. The former date is more relevant to my interests, so I’m treating it as a 1979 game.

Like most players, I suspect, my first exposure to Akalabeth was with the DOS port released by Electronic Arts in 1997. I had made it my mission to experience the Ultima saga from start to finish (a mission I have yet to complete as of today, as Ultima IX still remains unplayed). Even then, I cared about chronology, but hadn’t yet adopted my appreciation of playing games in their original forms. I figured DOS games ran fine on my Windows 98 box, and any changes they made had to be enhancements, so why go to the trouble of emulating an old Apple game when the DOS version worked fine and was probably better? The DOS port offered color, music, and saves, all things the original Apple II version lacked.

I remember laughing at my first ignominious death of the game. At the starting shop I loaded up on weapons, a shield, and arrows, and then immediately starved to death as I took a single step outdoors. Seemed you needed to buy some food too, and unlike Ultima I, you didn’t start the game with any rations!

I remember finding that the mage class could utterly dominate and break Akalabeth. One spell has a chance of transforming you into a lizard man, which grants a massive, permanent, and cumulative stats boost, but also can transform you into a useless toad, at which point you may as well restart. The trick was to save before casting, and if it didn’t work, to reload until it did. A few successful lizard man transforms meant you could punch out balrogs.

I remember beating it on its hardest difficulty the same afternoon that I started it, and writing it off as little more than a relic, only of interest because of its place in Ultima history. I felt it offered nothing but very basic dungeon crawling, which Ultima I offered in a nearly identical format as a small part of a bigger and better game.

Since then, I’ve started caring more about the original platform a game appeared on. Sometimes the look and feel isn’t quite the same on a DOS port, sometimes gameplay balance is upset in subtle and not so subtle ways. Case in point, the lizard man spell which trivializes Akalabeth, only does so because of the DOS-exclusive ability to save the game. I’ve never actually played the original 1980 version, so I figured it was time, with my usual rules on save states (saving only permitted after 30 minutes of earnest playtime without loading or restarting).

We begin with an illustrated intro in color. It’s crudely drawn, but also the first time on this blog we’ve seen anything like it.



Interesting that Akalabeth first introduces not only Lord British, but Mondain too. It also raises some questions on the chronology and geography – by the time of Ultima, British rules Sosaria, not Akalabeth, and Mondain has very much not been driven out of it. Are Akalabeth and Sosaria separate places, or is one part of the other? When British drove out Mondain, was that before the Avatar killed him, or are these the same event? If the former, that makes Lord British either over 1,000 years old, or a time traveler like the Avatar. I’m sure I’m just overthinking this, and Garriott was just making everything up from game to game.

Next, some instructions:


Not quite as detailed as the PLATO helpfiles, but that’s a heck of a lot more detail than many contemporary CRPGs with lengthy manuals and nothing ingame whatsoever. In fact, the original release’s manual is just these four screens printed out, plus a map legend:

Starting a new game, we get some options:



The lucky number is actually an RNG seed. The land, dungeon layouts, and starting stats are generated according to the number you enter here. Level of play must be ‘10’ in order to truly finish the game, otherwise Lord British will end the game before you finish all of his quests and challenge you to increase this next time.



These seem like pretty good stats.

And so, I set out to explore the world of Akalabeth. I mapped out the overworld, which will look like this if and only if your lucky number is 1.



Some light farming in a dungeon to the south accumulated about 45 pieces of gold, which the game also sometimes calls “pieces of eight,” and really shouldn’t since the piece of eight was historically a large silver coin worth eight smaller denominations. I spent it all on lots of food and a few sets of weapons, and headed for the castle.

Huzzah, I have been granted a name, and a quest, just not a favorite color!

Sometime in, it became apparent that the fighter is not a viable class at this level of play. For all intents and purposes, fighters can’t use amulets, except perhaps to invoke them over and over again in the hopes that you eventually get a ladder spell in the direction that you want and to pray you don’t get turned into a toad. Fighters can do decent damage at first with rapiers, but it doesn’t take long before monsters with over 100 HP start appearing, and they only go higher the deeper you delve.

You can always farm for HP, and there’s essentially no maximum (there’s no such thing as “healing,” you are simply rewarded with HP when leaving a dungeon based on how much you killed), so outlasting the monsters isn’t necessarily a problem. That said, thieves are extremely annoying because they will randomly steal your gear, possibly leaving you with no weapons except your fists.


But the real problem is these little bastards who live deeper:


These gremlins have a chance, every round, to steal half of your food. And by the time I found my first, he had over 100 HP and I was doing maybe 10 hits per round on a successful strike. If we assume I can hit it three times out of four and do 10 points on average, then it will take 12-15 rounds for me to kill it. That’s a minimum of 12 chances for it to steal half my grub. If we assume 6 successful food steals, and assume I need 20 food units to safely retreat to town, that means I need at least 1280 food units just to beat this guy and not starve. And this is with making some very optimistic assumptions.

Why not just grind for levels? Here’s the thing – Akalabeth hasn’t got any. You can farm for gold, HP, and gear, but those things aren’t permanent character upgrades, and won’t enhance your ability to hit enemies or inflict damage. There are only two ways to increase your stats; by completing quests for Lord British, and through the lizard man spell. The first is problematic because opportunities to do quests are finite, the initial quest to kill a carrion crawler is already taking me through gremlin territory, and subsequent quests can only send me down deeper. The second is problematic for reasons already discussed.

The mage might fare better. He can’t use rapiers or bows, but amulets’ Kill spell can out-damage both, is ranged, and by using ladder spells might just be able to evade gremlins by skipping floors where they appear.

Alas, this approach didn’t last long. Amulets are expensive, and thieves infest nearly every level. On any level deep enough to have worthwhile treasure, thieves would have lots of HP, and trying to avoid them while farming for chests wasn't practical. So I'd engage them in combat, get stolen from again and again, and suffer a net loss; what a single thief would steal from me would cost more to replace than what I'd gain from collecting all the treasure chests in the area.

So, Lizard Man it is. A player in 1980 might not be able to save scum, but one could try right at the start of the game, and restart if they don’t like the outcome. So that’s what I did. For reasons I’ll get into in my next post, you have to do this after accepting Lord British’s first quest. The outcome of the RNG is predetermined when you step into a dungeon, so if the outcome is bad (as it was when I entered the dungeon near Lord British’s castle), go to a different dungeon next time. One dungeon granted a successful roll.

I'm ready to punch a thief in his stupid face.

And the best part? If you leave the dungeon, come back to the same place any time later, and use the amulet again, you turn into a lizard man again, which I found it necessary to do when even my 62 strength wasn’t enough to contend with a gremlin on level 5 before he could spoil all my food.

With 160+ strength and 130+ dexterity it was pretty smooth sailing. No monster could harm me. I did have to kill a gremlin as a quest for Lord British, and I prepared for it by farming gold and buying 2000 food, but it only stole from me twice leaving me with 500 food.

Eventually, Lord British asked me to kill a balrog, which I found roaming on level 10.



Like all other monsters, I killed it without taking a scratch, and then I returned to the surface with my amulet spells, and visited Lord British for the last time.

The game continues, but unless you want to see how deep you can spelunk, there’s nothing else to do at this point.

Playing the original version of this game has not endeared it to me. Instead of beating it easily by abusing spells with savescumming, I tried to beat it honestly, failed, and then beat it easily by abusing spells with RNG manipulation. And I can’t see how you’re supposed to beat the game at level 10 otherwise; even with one successful Lizard Man transformation, which alone took my stats far beyond what they can reach by any other means, I still wasn’t killing gremlins fast enough to save my food.

Maybe it’s my fault for playing at level 10, and maybe it’s more fun at a lower level, but I think the fact that it’s presented as a viable gameplay option means it should have been programmed as one. If there had been some ingame guidance advising me to play it at, say, level 5, I’d have done so. The additional fact that at any lower level, Lord British will challenge you to win again at the next one, indicates that Garriott intended winning at level 10 to be an achievable feat, and unless he also intended it to be beaten through multiple Lizard Man transformations, then he failed.

Most popular posts