Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
FredMSloniker
Jan 2, 2008

Why, yes, I do like Kirby games.


Raljak Lying-Jackal, A Shorter History of Allansia, 284 AC, the Year of the Fox, Salamonis: Scrolls from the Halls of Learning posted:

“The town of Bitterford lies in the valley of the Red River, on the southern edge of the Pagan Plains. Built on the ruins of an older settlement that dates from before the War of the Wizards, Bitterford is connected by road to the much larger settlements of Kaad, Mirewater and Port Blacksand (via Riverglade). As a result, much trade passes through the town, whether it be ore-barges from the Dwarfish mines upriver or merchant caravans carrying exotic wares to the Allansian interior. In addition to wealth from trade, the farmland surrounding Bitterford is rich and fertile, supporting a prosperous community of farmers and freeholders. Not surprisingly then, the town has been often raided by marauding tribes of nonhumans and bandits from the windswept Pagan Plains to the north.1
1 The name Bitterford actually dates from a recorded incident when a merchant caravan travelling from Kaad to Mirewater was attacked and almost destroyed whilst crossing the Red River, by a mongrel rabble of Orcs, Goblins, and the odd Centaur and Rhinoman exile.

quote:

After Bitterford was razed for the third time since its founding, merchants from both Kaad and Mirewater banded together to create the Bitterford Guard, a small but efficient unit led by a Human or Dwarf warrior appointed from either town. Since then, although the raids haven’t stopped, they have been limited instead to stealing the odd herd animal under cover of darkness, as opposed to wanton bloody destruction of the entire town. The current Marshal of the Bitterford Guard is Urad Blackaxe from Mirewater, a grizzled Dwarf skilled with either axe or crossbow and rumoured to have one time been a Trialmaster in Baron Sukumvit’s legendary Trial of Champions. As well as directing the operations of the Bitterford Guard, Urad is the face of law and order in Bitterford though he usually leaves the more mundane judgements and trials to a Bitterford Council made up of the more wealthy merchants and land-owners living in the town.

For the past week however, both Urad and the Council have been sorely troubled by rumours and portents emanating out of the trackless wastes that are the Pagan Plains. Thick intertwining columns of smoke have been spotted rising from the Plains, always an excellent indicator of a predatory warband on the move. A small family clan of Centaurs was found slaughtered on the northern road to Kaad by a merchant convoy from that town. Such was the scene of carnage they encountered that the convoy’s Strongarms were still grey-faced and shaking even as they crossed the Red River and left for Mirewater the next day. Then, Lael Whitebeard, a hermit and hedge-wizard who lived in a small stone hut about a day’s ride into the Plains, was found wandering towards Bitterford by a Guard rider out scouting. Most of his skin had been flayed and removed, apparently by a particularly blunt sword. He said just one thing before expiring, whispering slowly whilst clutching the Guard rider with his now-skinless fingers: “Gore! Gore will come!”

YOU however, still possess all your skin and have never strayed further than a day from Bitterford in the first fifteen years of your life. You were orphaned five years ago when a rogue band of Hill Trolls, raiding further west than is usual, got as far as the Bitterford outer reaches, slaying your parents and several other townsfolk in the process, before being wiped out by Urad Blackaxe and his Guard. The only reason you survived was that you were with the Guard at the time, pestering the younger ones for combat lessons. Since then, you have lived in the simple wooden hovel your father built, employed by the people of the town to do odd jobs and general labour about the town and its surrounding farmlands. Partly due to the fact you are significantly larger than a typical fifteen year-old Human, and partly due to the odd spot of combat practice with the Bitterford Guard, a large number of your jobs involve disposing of various weird Allansian creatures that wander into town in search of food. And there are a few. Darkwood Forest is not that far to the east, the Dawn Mounds and the woods around the Tower of Zanbar Bone to the south have long been a baneful area of ill repute, and then of course there are the Pagan Plains…

You are, in short, self-appointed peasant pest-destroyer of Bitterford, but also open to other forms of employment. Could an adventuring career be among them? Turn to 1 to find out…

Adbot
ADBOT LOVES YOU

FredMSloniker
Jan 2, 2008

Why, yes, I do like Kirby games.
IGNORANT PEASANT Character Sheet

SECTION: 10
SKILL: 7/7
STAMINA: 7/10
LUCK: 11/11
Equipment: a bow and quiver, a fine sword, an iron amulet, a lucky charm, and nose filters
Money: 4 Gold Pieces and 2 Silver Pieces
Meals: 0
Torches: 1
Arrows: 2
Day: Seaday

Statuses:
You foiled a robbery at the warehouse of Venquis Glint.

FredMSloniker fucked around with this message at 22:57 on Sep 26, 2022

FredMSloniker
Jan 2, 2008

Why, yes, I do like Kirby games.
It's been a while since I tackled trying to figure out exactly how likely it was for someone to be able to beat a Fighting Fantasy game book, specifically Creature of Havoc. With perfect play, but without fudging dice rolls or using information you didn't obtain in that run, you have about a one in five chance of beating that book. However, that's 'about' because my tools at the time weren't sufficient to the task of analyzing and scoring every possible game state (i.e., every possible combination of current numbered section, statistics, items, and so on), so in the end I punted, simulated a million runs through the game taking the optimal path, and kept track of each adventurer's fate.

I've picked up a bit of learning in the last year or so. Most significantly, I learned that Python has an SQLite library built in, and with a bit of experimentation I figured out how to use it so I don't have to store the entire state space (i.e., every possible game state) in memory simultaneously. That means that, time and hard drive space permitting, I should be able to completely solve any game with just a few tools.

'Time and hard drive space permitting' is a big ask, though. Even now, when chess programs can routinely beat grandmasters, they don't do it by storing literally every chess position; they just do what human players do, only with perfect memory and incredible speed. This is a brute force approach, running through the book over and over and over again, generating possible game states from one end and scoring them from the other. So just to make sure I don't make my laptop melt, I'm going to start with a smaller book.

Impudent Peasant! is one of a number of fan-made Fighting Fantasy books available at Fighting Fantasy Project. It can be played online, or you can download it in Word or PDF formats. I chose it because it's interesting, well-written, and short, with only 50 numbered sections. That said, that number is a cheat - a lot of the sections would be chopped up into multiple sections in a published book, which I'll discuss as we see them. Does my computer have the guts to solve this? Only time will tell.

We're going to start off playing this the 'right' way, rules as written. So what are the rules? Well, by and large they'll be familiar to Fighting Fantasy veterans. We have three primary stats: SKILL is your general 'how good are you at doing physical stuff' stat, STAMINA is your general 'how good are you at not dying' stat, and LUCK is your general 'how screwed are you right now' stat. One key thing to note, though, is that, because we're playing a callow youth instead of a seasoned adventurer, these stats start somewhat lower than they usually do. Specifically:

quote:

You are about to take the lead role in an adventure that will make you a quite generally respected person, at least in your neck of the woods. Before you take part in this quest, you must first determine your own strengths and weaknesses. You use dice to work out your initial scores. On page 11 is an Adventure Sheet, which you may use to record details of your adventure. On it, you will find boxes for recording your SKILL, STAMINA and LUCK scores, as well as other details. You are advised either to record your scores on the Adventure Sheet in pencil or to make photocopies of the sheet for use in future adventures. Take note that you begin this adventure as a fifteen-year old Human and your SKILL and STAMINA score are generated a little differently to other Fighting Fantasy gamebooks.

Skill, Stamina and Luck

Roll one die.
  • If you roll a 1 or a 2, your Initial SKILL score is 6. (0.0 - 1.0)
  • If you roll a 3 or a 4, your Initial SKILL score is 7. (0.0 - 1.0)
  • If you roll a 5 or a 6, your Initial SKILL score is 8. (0.0 - 1.0)

The numbers you see at the end of each choice are the program's prediction of our chances of success if we make that choice. If we've examined every possible outcome from making that choice, the numbers will be identical. 1 is the 'you win' value and 0 is the 'you lose' value. (I could choose other ones in case a book has degrees of winning.) The farther apart the numbers are, the less we know about the situation; the expected score from that choice is no less than the smaller number and no greater than the larger number.

As an aside, I'm going to use the term 'game state' or simply 'state' a lot; as I mentioned earlier, it encompasses everything about our current situation. Just because we've read a numbered section before doesn't mean we read it with the same stats, items, et cetera. I'll come back to why that's important, but not until our second go at the book.

We don't see our chances of success right now. (If we'd just made a choice, we would have seen it then.) If this were a situation where we could pick freely, we'd take whichever choice had the highest minimum value, breaking ties with the highest maximum value; since we'd pick that every time, those would be the values for this state. However, since we have to choose at random, the values for this state are the weighted average of the values for the states we can reach for here. (Weighted because rolling a 2 on two dice is much less likely than rolling a 7.) Since we might randomly pick a better or worse state than this one, the expected score for this position is somewhere in-between.

I could just put all of the book data into the program and tell it to calculate the scores now, starting with the known winning and losing states and working backwards to states that reach them, then to states that reach them, and so on until all the minimum and maximum values have converged and everything is known. I want to actually show you the content, though, so I won't be doing that yet. Instead, each time we visit a state, we'll update the scores of the states we can reach from there, and those updates will propagate back as we revisit states, getting more and more accurate as we gather more and more data.

None of that actually matters right now, because we haven't actually reached any winning or losing states - in fact, right now the program doesn't even know how to win or lose - so all of the scores are going to be (0 - 1) for a while. I'll omit them until they tell us something interesting. Anyway, we rolled a 4, so our Initial SKILL score is 7.

quote:

Enter your Initial SKILL score in the SKILL box on the Adventure Sheet.

Roll one die. Add 6 to the number rolled and enter this total in the STAMINA box.

We roll 4.

quote:

Roll one die. Add 6 to the number and enter this total in the LUCK box.

We roll 5. So our initial and current stats are SKILL 7, STAMINA 10, and LUCK 11. Could be worse!

quote:

For reasons that will be explained below, all your scores will change constantly during the adventure. You must keep an accurate record of these scores, and for this reason, you are advised to write small in the boxes or to keep an eraser handy. However, never rub out your Initial scores, except on those very rare occasions when the text specifically tells you so.

Although you may be rewarded with additional SKILL, STAMINA and LUCK points, these totals may never exceed your Initial scores, except on very rare occasions, when you will instructed [sic] on a particular page. [Editor's note: I'm not sure if there's an official term for the numbered bits in Fighting Fantasy books, but I don't think it's 'page', since that gets confusing with actual numbered pages in the instructions. From here on out, I'll call them 'numbered sections'.]

Your SKILL reflects your general expertise in fighting and combat; the higher the better. Your STAMINA score reflects your general constitution, your overall will to survive, your determination and overall fitness; the higher your STAMINA score, the longer you will be able to survive. Your LUCK score indicates how naturally lucky a person you are. Luck – and magic – are facts of life in the fantasy world you are about to explore.

There's a bunch more rules text about combat and testing your stats. I'm going to omit it for now (a) to keep this post from getting out of control and (b) because it isn't relevant yet. Anyway, most of it is stuff Fighting Fantasy veterans already know, and I'll be getting to the new stuff momentarily.

quote:

You will start your adventure with a bare minimum of equipment, but you may find or buy other items during your adventure. As you can see from the Adventure Sheet on page 11 there is a large box for the recording of general Equipment, such as weapons, armour, treasure, potions and the like, as well as four smaller boxes for recording quantities of Gold, Food, Torches, and Arrows, that you may acquire. [Editor's note: most (all?) Fighting Fantasy books use British spelling, and so does this fan book. As I'm American, don't be surprised if I'm inconsistent in this regard.] For now, note down that you have:
  • A wooden club (note this in the Equipment box).
  • 3 meals (note these in the Food box).
  • 6 Gold Pieces (note these in the Gold box and leave some space as you may also have to note Silver Pieces as well). Bear in mind that 10 Silver Pieces = 1 Gold Piece.
You can also choose ONE, and only ONE, of the following item groups:
  • Fishing gear (note this in the Equipment box). During the course of a day, you may choose to use the fishing gear to help replenish the number of meals you have, assuming you are successful and actually catch something. Details of how to do this will be given in the text.
  • 3 torches (note these in the Torches box). Torches can obviously be used for exploring dark or underground areas.
  • A bow, quiver, and 6 arrows (note the bow and quiver in the Equipment box, and note the 6 arrows in the Arrows box). Before the start of any battle, unless otherwise stated, you may fire an arrow at your opponent, using the bow. To do this, cross off one Arrow from your Arrow box and Test your Skill. If you succeed, you may subtract 2 points from your opponent’s STAMINA score. You may use LUCK here to do additional damage (see above: Using Luck in Battles). Obviously, if you do not succeed, you have missed with your shot. In any case, assuming your opponent still lives, you must then fight the battle as per normal.

And just so you don't make the choice entirely out of context...

Section 1 posted:

Write ‘Stormsday’ in the Day box on your Adventure Sheet. True to its name, the day begins under a slate-coloured sky, although the persistent drizzle of rain from above fails to develop into anything more spectacular, and gradually gives way to occasional bursts of bright sunlight. You rise early and in a foul temper, mainly due to several new leaks in the thatch roof above your straw pallet. If you wish, you could eat a meal at this time, though you will not gain any STAMINA points for it, as you have not yet lost any! However, by eating a meal now, you will avoid the consequences of losing STAMINA the following day due to hunger, and you do not yet know when your next chance to eat might be. Regardless, if you choose to eat a meal now, do not forget to deduct 1 meal from the number of meals in the Food box on your Adventure Sheet.

You remember me mentioning this book cheating the section count? Section 1 isn't actually done yet. This is a mild example compared to what comes later. Also, here's two of the new bits. The first is the day; we have to write down what day it is because - well, that would be spoilers.

The other is eating and sleeping. (Okay, that's two bits.) If we don't eat at least once a day, we lose STAMINA; when we have the opportunity to eat and do so, we gain STAMINA. We can also gain and lose STAMINA as a result of sleeping or sleeplessness. How much STAMINA is spelled out when the opportunity or necessity comes up.

Section 1, continued posted:

Afterwards, you stomp through the mud and puddles of the backroads, towards the main square of Bitterford, past both prosperous stone houses and the occasional crumbling ruin of a time long past, now almost submerged in overgrown vegetation. Presenting yourself at the chambers for the Bitterford Council, you are told by Gilfas the Scribe that there is little work today. Indeed, the Council chambers appear to be full of nervous merchants and farmers, all gossiping about the death of Lael Whitebeard and the possibility of a warband raid from the Pagan Plains.

Just as you are contemplating the prospect of a day of unpaid idle however, Farmer Corran appears, wearing his traditional sheepskin jerkin. Corran is not a particularly wealthy farmer, due in part to rambling and extensive woods on his land from which all manner of horrors have crawled. This time apparently, his best herding dog was carried off by some spindly robe-clad humanoid and presumably eaten – he wants you to enter the wood and dispose of the creature. Technically, you don’t deal with nonhumans – that being the Bitterford Guard’s job – but they are busy with the Pagan Plains nonsense and Corran is clearly a desperate man.

‘Please,’ he begs you. ‘I can’t afford to lose another dog! I’ll pay you 5 Gold Pieces, plus you can keep whatever you find!’ That sounds tempting. To accept Farmer Corran’s offer, turn to 34.

Alternatively, if you possess some fishing gear (i.e. you have ‘fishing gear’ written down in the Equipment box on your Adventure Sheet) you may instead prefer to cite the irrevocable ‘no humanoids’ clause of your contract to Farmer Corran, and spend the day fishing in the Red River, in which case turn to 25. Note that if you do NOT possess fishing gear then you MUST choose the option to help Farmer Corran.
  • If you choose to help Farmer Corran, turn to 34. (NO DATA)
  • If you have fishing gear and want to use it, turn to 25. (NO DATA)

What's the 'NO DATA', you ask? that just means that, not only haven't we been to that game state before, we haven't been to that section before. We're headed off the map! But before we do:
  • What piece of equipment should we select?
  • Should we eat a Meal? If we wait until later, when we're hurt, we can get healed up a bit - but if we wind up going to bed hungry, it'll hurt!
  • If we take the fishing gear, should we go fishing? You can say 'yes' even if you'd rather we didn't take the gear, for reasons I'm about to explain.
As I've done in previous LPs, decisions in this one will be made by raffle. This encourages participation without bandwagoning. Whenever I decide it's been long enough, I will randomly select one person's choice and use it - though in this case, I'll randomly select for each of the three options independently of each other (so I might use the same person's pick for more than one question). So if you don't want the fishing gear, but you want to use it if you get stuck with it, fill out your raffle ticket accordingly!

BraveLittleToaster
May 5, 2019
This looks interesting. I enjoyed following your LP of Creature of Havoc, so I'm looking forward to what's in store for this one.

Take the fishing gear, time to become a master angler or starve to death trying.
Eat the meal.
Go fishing, for great justice.

habituallyred
Feb 6, 2015

BraveLittleToaster posted:

This looks interesting. I enjoyed following your LP of Creature of Havoc, so I'm looking forward to what's in store for this one.

Take the fishing gear, time to become a master angler or starve to death trying.
Eat the meal.
Go fishing, for great justice.

Bow and Arrow Cheat the worst part of these games.
No Meal
No Fishing

AtomikKrab
Jul 17, 2010

Keep on GOP rolling rolling rolling rolling.

Bow, clearly we must become the MASTER POACHER

FredMSloniker
Jan 2, 2008

Why, yes, I do like Kirby games.
Right, time to roll whose picks I use. And the winners are... AtomikKrab, AtomikKrab, and AtomikKrab. Which, while amusing, wouldn't be a problem... except they failed to follow instructions and didn't answer all of the questions. I rolled again for the second question (the third now being irrelevant) and got BraveLittleToaster. So we're going to take the bow, eat a meal, and help with the problem.

Section 34 posted:

The tangled wood lies on a small piece of land to the east of Bitterford, near the Red River. Farmer Corran accompanies you most of the way, but stops some distance from the wood and refuses to walk any closer. His two remaining dogs shiver and whimper alongside him, their tails tightly curled downwards in abject fear.

‘There,’ he says, pointing to a break in the undergrowth that looks like a path. ‘It vanished down there, it did.’

You enter the wood, following what appears to be some sort of game trail. The surrounding trees are not especially tall or large, but the foliage on either side of the trail is thick and choked with thorny bushes and spiny thickets of bamboo. After a short while, the only sounds being the buzz of insects and the occasional strange birdcall, the trail splits into three. From the trail to your left, you seem to detect an increase in the volume of insect noise in the form of a distant buzzing drone. Directly ahead of you, another trail winds deeper into the wood, and from here you think to pick out a weird honking sound, like that of largish bird. To you right there are no sounds, though you spot what looks like a human-like footprint in the muddy path that forms this trail. Which direction will you go now?
  • Go straight ahead turn to 28 (NO DATA)
  • Turn left turn to 7 (NO DATA)
  • Turn right turn to 15 (NO DATA)
The format of choices through the book is a bit inconsistent. When possible and/or convenient, I'm following the text.

BraveLittleToaster
May 5, 2019
Turn right, the right way.

habituallyred
Feb 6, 2015
Left

:goleft: is a smilie for a reason!

Kristopher
Jun 28, 2006
Bugs to the left, goose dead ahead. Right isn't just progress on the quest, its the only safe option.

FredMSloniker
Jan 2, 2008

Why, yes, I do like Kirby games.

Kristopher posted:

Bugs to the left, goose dead ahead. Right isn't just progress on the quest, its the only safe option.

You'd think that, wouldn't you?

Section 15 posted:

The right-hand path is muddy and seems to run alongside the edge of the wood – from time to time you get glimpses, through breaks in the undergrowth, of green fields and the Red River sliding slowly past. There are few sounds, but further along the trail you notice the smell of woodsmoke and burning meat. Before long the path leads to a clearing that contains a crude mud and timber hut. Immediately in front of the hut is a warty-skinned humanoid clad in tattered robes tending to a small rock-rimmed firepit, above which cooks what appears to be the remains of Farmer Corran’s dog on a skewer.

The humanoid starts in surprise as you enter the clearing but that quickly turns into a ferocious scowl. ‘Yooman!’ it rants. ‘Come to steal my food, by Hashak!’ Its scrawny hand grabs a nail-studded cudgel, which it brandishes menacingly as it stalks towards you. You must fight!

HOBGOBLIN POACHER SKILL 6 STAMINA 6

You have enough time to fire an arrow at the HOBGOBLIN, should you wish to do so (and don’t forget to cross it off the Arrows box on your Adventure Sheet). If you reduce the HOBGOBLIN’s STAMINA to zero, turn to 37.

This is one of the simplest combats in the game - not the easiest, necessarily, but one with very few special rules. Which is a good thing, because combat is the biggest headache when it comes to both enumerating and scoring possible states. In fact, I haven't actually finished implementing it yet - but I've gotten far enough to give you a choice.

When it comes to finding where we can go from where we are, my code calls a function that takes the current game state and spits out a list of game states we can reach from there. (The details are more complicated than that - for starters, it isn't a Python list - but I don't want to get too deep into the minutiae again so soon.) However, in order to reduce the size of the code, there's a certain amount of consolidation. For instance, lots of sections have us freely choose to go to one of a number of other sections, so I have a function that simplifies that. Lots of sections have us roll dice and have one of two things happen as a result, so I have a function that simplifies that. So, since there's lots of combat, I should have a function that simplifies that, right?

Wrong. Because the list of game states we can reach from the current game state is based on one decision. And there are a ton of decisions to be made, both freely and as a result of rolling dice, in combat. So we have to jump from one state to the next throughout combat, and because every piece of information about the game in progress has to be in the game state, it has to have stuff like 'what section should I turn to if I win' and 'what did enemy #2 roll for its Attack Strength' and 'is this the fight where I take recurring damage starting on the second turn of combat unless I have a specific item, and, by the way, is it the first turn or not'. And I want to keep the state space as small as possible, partly because it saves on memory and partly because it saves on time. If we can get to the same place in the book on two paths, one of which has a fight, I have to make sure that, by the time we get to that place, I've erased any sign that we even had a fight, except its effects on our STAMINA and any other lingering aftereffects, from the state, so I don't need to score the state any differently than I would if we got there in the same condition by a different route.

I can, at least, break each decision out onto its own virtual section, so that's what I've done. The code for Section 15 does the following, in addition to displaying the section's text:
  • Stores the information about the HOBGOBLIN POACHER - name, Skill, and Stamina - in the state.
  • Stores the section we'll turn to if we win in the state.
  • Presents the option to turn to the "combat" section. (The code for every section presents one or more options and, if the selection is random, the likelihood of each being rolled.)
I feed in the state where we'd just turned to Section 15, and it sends me the 'choice' to start combat and the game state that goes with that. So after I press Enter to acknowledge the program's report, it takes that state and runs it through the machine again.

The code for section "combat", in addition to displaying an informational message, performs three checks:
  1. Do we have a bow and quiver?
  2. Do we have at least one arrow?
  3. Is this a fight in which we're allowed to open with a ranged attack?
If all three are true, it lets us know that we have a bow and asks if we wish to use it. If we do, the next section we'll go to is "Choose Ranged Target". If we don't, or if any of those three criteria are false, we'll go to "Start of Melee" instead.

So that's where we are now. We do have a bow and quiver, we do have at least one arrow, and this is a fight where we can use it. (The default assumption is that we can, but if that wasn't true, before heading to the "combat" section, I'd have to set the 'we can't use a bow in this fight' flag in the state.) So now you have to ask yourself: do we wish to use it?

Fearless_Decoy
Sep 27, 2001

You shall all soon witness the power of my Tragic 8-Ball!

FredMSloniker posted:

So now you have to ask yourself: do we wish to use it?
I would. It brought a club to a bow fight. Might as well snipe it while we can.

BraveLittleToaster
May 5, 2019
Use that bow. The poacher will become the poached.

Black Robe
Sep 12, 2017

Generic Magic User


Yes, we wish to use it.

habituallyred
Feb 6, 2015
Take a Bow, Notch every Arrow

Snorb
Nov 19, 2010
If we're being given a chance to start a fight with a cheap shot, we're taking the shot. Fair fights are for chumps, and the hobgoblin's the chump.

CzarChasm
Mar 14, 2009

I don't like it when you're watching me eat.
Johnny rosin up that bow and slay that goblin hard

FredMSloniker
Jan 2, 2008

Why, yes, I do like Kirby games.
Sounds like we have a consensus. Very well! After saying yes, we're taken to:

Section Choose Ranged Target posted:

Who will you fire an arrow at?
  • Will you attack the HOBGOBLIN POACHER (SKILL 6, STAMINA 6)? (score 0.0 - 1.0)

Well, you know what they say: when there's only one candidate, there's only one choice.

Section Fire Bow posted:

Test your SKILL of 7.
  • You hit the HOBGOBLIN POACHER. (58.333% likely; score 0 - 1)
  • You miss the HOBGOBLIN POACHER. (41.667% likely; score 0 - 1)

I'm not sure why the score predictions are sometimes integers and sometimes floats. Ultimately it doesn't matter; they'll become floats when they need to be. Anyway, we have a slightly better than 50-50 chance to roll a 7 on two dice. A quick trip to Random.org gives us a 4.

Section Request Combat LUCK Check posted:

You're going to deal 2 damage to the HOBGOBLIN POACHER's STAMINA (currently 6) from 1 source. Do you want to Test Your LUCK of 11 to increase it by one point? If you fail, you'll decrease it by one point instead!
  • No. (score 0 - 1)
  • Yes. (score 0 - 1)

Any time in combat that we either deal or receive damage (with one exception, which I'll deal with when it comes up), we can Test our LUCK to either increase or decrease that damage by one point. This involves rolling less than or equal to our LUCK on two dice; if successful, we move the number in the direction we want, but if unsuccessful, we move the number in the direction we don't want. Either way, our LUCK drops by one point (with, again, one exception I'll bring up when relevant). Technically speaking, this should allow our LUCK to move into the negatives, but I've put a minimum cap of 0 on our stats. I've also decided on a policy for this: we won't Test our Luck unless it's the only way to avoid dying, at least for now.

Oh, and I'm showing you these auto-pages since showing my work solving this game is as much a part of the LP as the book itself. You won't have to wade through them every combat.

Section Start of Melee posted:

It is the start of a new combat round. Who will you attack?
  • Will you attack the HOBGOBLIN POACHER (SKILL 6, STAMINA 4)? (score 0.0 - 1.0)

Another automatic choice. I'll talk more about combat with multiple enemies shortly.

Section Roll Your Attack Strength posted:

Roll your Attack Strength.
  • You rolled a 2 for an Attack Strength of 9. (2.778% likely; score 0.0 - 1.0)
  • You rolled a 3 for an Attack Strength of 10. (5.556% likely; score 0.0 - 1.0)
  • You rolled a 4 for an Attack Strength of 11. (8.333% likely; score 0.0 - 1.0)
  • You rolled a 5 for an Attack Strength of 12. (11.111% likely; score 0.0 - 1.0)
  • You rolled a 6 for an Attack Strength of 13. (13.889% likely; score 0.0 - 1.0)
  • You rolled a 7 for an Attack Strength of 14. (16.667% likely; score 0.0 - 1.0)
  • You rolled a 8 for an Attack Strength of 15. (13.889% likely; score 0.0 - 1.0)
  • You rolled a 9 for an Attack Strength of 16. (11.111% likely; score 0.0 - 1.0)
  • You rolled a 10 for an Attack Strength of 17. (8.333% likely; score 0.0 - 1.0)
  • You rolled a 11 for an Attack Strength of 18. (5.556% likely; score 0.0 - 1.0)
  • You rolled a 12 for an Attack Strength of 19. (2.778% likely; score 0.0 - 1.0)

Your Attack Strength, barring modifiers, is your SKILL plus the result of two dice. Random.org gives us a 3, which is... not good.

Section Roll Enemy Attack Strength posted:

Roll the Attack Strength of the HOBGOBLIN POACHER.
  • The HOBGOBLIN POACHER rolls a 2 for an Attack Strength of 8. (2.778% likely; score NO DATA)
  • The HOBGOBLIN POACHER rolls a 3 for an Attack Strength of 9. (5.556% likely; score NO DATA)
  • The HOBGOBLIN POACHER rolls a 4 for an Attack Strength of 10. (8.333% likely; score NO DATA)
  • The HOBGOBLIN POACHER rolls a 5 for an Attack Strength of 11. (11.111% likely; score NO DATA)
  • The HOBGOBLIN POACHER rolls a 6 for an Attack Strength of 12. (13.889% likely; score NO DATA)
  • The HOBGOBLIN POACHER rolls a 7 for an Attack Strength of 13. (16.667% likely; score NO DATA)
  • The HOBGOBLIN POACHER rolls a 8 for an Attack Strength of 14. (13.889% likely; score NO DATA)
  • The HOBGOBLIN POACHER rolls a 9 for an Attack Strength of 15. (11.111% likely; score NO DATA)
  • The HOBGOBLIN POACHER rolls a 10 for an Attack Strength of 16. (8.333% likely; score NO DATA)
  • The HOBGOBLIN POACHER rolls a 11 for an Attack Strength of 17. (5.556% likely; score NO DATA)
  • The HOBGOBLIN POACHER rolls a 12 for an Attack Strength of 18. (2.778% likely; score NO DATA)

Same deal for the HOBGOBLIN POACHER (Fighting Fantasy books are somewhat insistent on this ALL CAPS approach to enemies), who rolls a 6. And the reason we're seeing NO DATA? Well, that's because I haven't yet coded the next part of combat: comparing Attack Strengths. And the reason is probably the biggest headache that combat in Fighting Fantasy books is going to give me.

The way combat works is this. In combat with a single enemy, we compare our Attack Strength with the enemy's. If ours is higher than theirs, they lose 2 STAMINA (with various exceptions, like special gear or Testing our LUCK). If theirs is higher than ours, we lose 2 STAMINA. Rinse and repeat until someone dies.

Multiple foes are handled one of three ways. We might fight them one at a time, in order. We might fight them as an aggregate, essentially a single enemy that's a swarm of bees or what have you. Or we might fight them simultaneously. The third case is where choosing our target matters: each enemy rolls their own Attack Strength, and while any of them can damage us by beating our Attack Strength, we can only damage the one we chose by beating their Attack Strength. Otherwise we just don't get hurt by them.

Doesn't sound so complicated, does it? Well, here's the thing. As you may have noticed, it's entirely possible for no one to get hit in a particular combat round. And with a few exceptions, it doesn't matter how long it takes you to finish a fight, only that you do. Which means that, if neither we nor the HOBGOBLIN POACHER get hit this turn, we'll start another turn... in exactly the same condition we were at the start of this one.

That's bad.

In order to figure out what our expected score is at a given state, we have to figure out what our expected score is at all the states we can reach from that state. In this case, it's not an unsolvable problem with enough brute force. If a particular state has a 2/6 chance of winning (expected score 1), a 3/6 chance of losing (expected score 0), and a 1/6 chance of going right back to itself (expected score ???), we can iterate as follows:
  • We first reach this state, and we assign it the default (minimum score, maximum score) range.
  • We attempt to score this state, and we're given two chances of (1, 1), three chances of (0, 0), and one chance of (0, 1), which works out to an expected score range of (2/6, 3/6).
  • We attempt to score this state again, and we're given two chances of (1, 1), three changes of (0, 0), and one chance of (2/6, 3/6), which works out to an expected score range of (0.3888..., 0.41666...)
  • We attempt to score this state again and get a score range of (0.398148148148..., 0.402777...)
  • ...
  • We attempt to score this state again and find the range has converged onto (0.4, 0.4).
That "..." can get mighty long, though, and it doesn't help situations where you get into a loop you can't escape. We encountered several of those in the Creature of Havoc LP, as you may recall, and not all of them were visible to the naked eye. I don't remember whether any of them were truly inescapable - the most famous example of those would eventually kill you, statistically speaking - but getting stuck in an infinite loop in a game book happens more often than you'd like, especially when you're trying to assign scores to game states.

I'm going to be thinking on how to go about fixing this. If you have any helpful ideas, shout them out. Regardless, I'll run through the rest of the combat in a bit. For now, though, any dissenters to my policy of not Testing our LUCK unless we'd die otherwise?

FredMSloniker
Jan 2, 2008

Why, yes, I do like Kirby games.
I knew going into this that I'd need to deal with loops, so I've laid at least some theoretical foundation for solving the problems they present. I have a number of considerations to deal with.

The game state should contain all of the information about the game that matters. In a chess game, you not only care whose turn it is and where the pieces are; you care about things like 'have I ever moved my king' (for castling) and 'did he just move that pawn forward two spaces' (for the en passant rule). Most importantly for us, though, there's a threefold repetition rule: if the game enters the same state three times, either player can declare the game drawn.

Except tracking the number of times the game has entered a state is part of the information about the game that matters, right? But by that logic, no position would ever repeat. So I need to adjust my idea of what the game state should contain to exclude meta information, i.e. information about game states. In this case, I'll call this piece of meta information the game path: the list of game states we've visited, in order, this playthrough. (I actually already handle this info - it gets added to the save game along with the current game state. I'm just not doing anything else with it yet.)

With this information, we can deal with one kind of loop: the kind where you can get out of the loop. In short, I say that, if a choice would lead to a state we've already visited this game, it doesn't exist. It's not a losing choice; we simply can't choose it. And if that would leave us in a situation where we have no other moves, we back up a state, remove the choice that got us stuck, and repeat until we get somewhere we have another option. In this case, if the HOBGOBLIN ARCHER had rolled a 4, we would have had a draw and looped back to "Start of Melee", so we make rolling a 4 impossible. (The remaining possible rolls are still weighted accordingly, so we're not skewing the win/loss ratio, just eliminating the draws.)

That's good enough to get us to the end of the game so long as there aren't any inescapable loops. We will need to remember to keep tracks of states we had to back out of as well as states we visited, though that's an easy fix - in fact, we may not need to keep track of the order of visits at all, just which ones we've visited this game.

That leaves three problems for another day: how to deal with inescapable loops (ones where you can't die or win), how to more efficiently deal with dead-man-walking loops (loops that are technically escapable, but only by dying), and how to score loop-related situations. (I'll also want a solution for more general dead-man-walking situations, but I'll talk about what I mean by that in a different post). For now, we can at least advance the plot.

That said, I'm not out of the woods with regards to coding. There are a lot of special cases in combat in this book, and while I don't have to deal with them right now, I have to leave room to deal with them at a later date.

So the HOBGOBLIN POACHER hits us for 2 damage, and the game asks if we want to Test our LUCK to reduce that. We'll have 8 STAMINA after, though, and I'd rather have the LUCK for when it will literally save our life, so we take the hit. The next round goes better for us; we roll a 10, and the HOBGOBLIN POACHER only rolls a 7. Then we both roll 7, but our SKILL is higher, so we do damage - and, combined with the bow hit from earlier, that means we've beaten our first combat!

Section 37 posted:

The Hobgoblin collapses at your feet, gurgling blood. You quickly scan the hut in case there are others, but it appears that the creature was a lone hermit. A search of the hut turns up the following, which you may add to your Adventure Sheet if you wish:
  • 3 Silver Pieces (10 Silver Pieces equals 1 Gold Piece)
  • 1 Torch
  • 2 dead Tree Geese (these count as 2 meals and can be added to the Food box on your Adventure Sheet)
You disdain to take the Hobgoblin’s cudgel however, as it is far inferior to your own weapon.

Leaving the woods by retracing the game trail, you meet up with Farmer Corran and relate to him all that has happened. You even manage to convince him to enter the woods with you, to see with his own eyes that the dog-stealing Hobgoblin has been dealt with.

‘Arakor’s in a better world now,’ he sniffs, reaching down to scratch the necks of his two remaining dogs. ‘At least I’ve still got Ty and Gereth for company. Thank you, youngster. You helped me when the Bitterford Guard couldn’t.’

With that, he hands over 5 Gold Pieces as payment for your services. Note them on your Adventure Sheet and turn to 9.

Aww, doggo, no.

Section 9 posted:

To your mind, there is little better feeling than to return to your simple hovel to prepare a warm meal after a hard day’s graft. If you decide to eat, cross 1 meal off the total in the Food box on your Adventure Sheet. For eating this meal, you may restore 3 STAMINA points if it is your first meal today, or 2 STAMINA points if you have already eaten. Your STAMINA score may not increase to more than your Initial score however.
  • If you don't eat a meal, gain no STAMINA. (score 0 - 1)
  • If you eat a meal, gain 2 STAMINA. (score 0 - 1)

We could eat a meal here, but there's no point, because...

Section 9a posted:

Regardless of whether you eat or not, one thing that is inescapable after such a day is sleep. After shaking your pallet free from sundry minor pests and repositioning a series of pots and buckets to catch any leaks from the roof in the event of more rain, you sink into a deep slumber, for which you may restore a further 3 STAMINA. Again though, your STAMINA score may not go over your Initial score.

...as you can see, there's nothing wrong with us a good night's sleep won't fix.

Also, strap in... section 9 has four subsections in it. The first decision was whether we ate before going to bed.

Section 9a, continued posted:

Moonsday

Erase ‘Stormsday’ from the Day box on your Adventure Sheet and replace it with ‘Moonsday’. Did you eat at all yesterday? If you did not, then you must deduct 3 STAMINA points for going without food for the day.

The second is here. Mind you, the decision is automatic, but 'lose 3 STAMINA' isn't something you want to do in the middle of a section, since it could make the rest of the section irrelevant.

Section 9b posted:

Like yesterday, Moonsday is gloomy and overcast, with only the odd beam of sunlight piercing through the clouds to illuminate a lone tree, ivy-clad fence post, or crumbling mossy wall; all glistening with dew amidst the grey murk.

If you wish, you may eat a meal now, gaining a further 2 STAMINA points if you choose to do so (don’t forget to cross 1 meal from the number of meals in the Food box on your Adventure Sheet). By eating now, you will avoid the consequences of losing STAMINA the following day due to hunger, as you do not know when the next chance to eat may come. Alternatively, you may just hope for the best and wait until later.
  • If you don't eat a meal, gain no STAMINA. (score 0 - 1)
  • If you eat a meal, gain 2 no STAMINA (limited by your Initial STAMINA); you are now well-fed. (score 0 - 1)

So we have this decision to make, immediately followed...

Section 9c posted:

Unlike yesterday, you have barely finished pottering about your hovel, still just entertaining the idea of walking into town to see what work Gilfas the Scribe may have for you, when you are accosted at home by folk seeking help.

First comes the trail merchant Venquis Glint, complaining about thieves in the night, stealing from his warehouse out near the High Road to Kaad. ‘Packs, rope, harnesses, provisions – where will it end?’ he moans. ‘I suspect Strongarms from rival merchant convoys myself! Stealing equipment for future trading expeditions deeper into the Allansian hinterlands! Either that or a small army!’ Despite the fact Venquis’ face is mottled with rage and spittle flies from his mouth as he rants, he will only pay you 3 Gold Pieces to guard his warehouse. What’s worse, it will be an all-day, all-night job, until he can arrange a regular Bitterford Guard from the Council, meaning you will be dead tired tomorrow.

Barely has Venquis finished his tirade though, before Hieron Horsefriend, a rancher with property neighbouring Farmer Corran, wanders up to your front gate. Hieron’s property encompasses low cliffs looking out over the Red River valley floor, and apparently the recent wet weather has caused a minor rockslide. This has in turn revealed a small cave at the base of the cliff, from which something has emerged to slay one of Hieron’s prize foals. He is almost beside himself with grief, and between wracking sobs, reveals he will pay you 4 Gold Pieces to enter the cave and dispose of whatever lies within. He will allow you to claim whatever treasure you find inside the cave, if any, but you must supply your own torch for the exploration.

If neither of these missions appeal to you, you may of course go fishing in the Red River, but only if you possess fishing gear written down in the Equipment section of your Adventure Sheet.

What will you do?
  • Help Venquis Glint by guarding his warehouse: turn to 47. (score NO DATA)
  • Aid Hieron Horsefriend by entering the cave (you must have at least 1 Torch in the Torch box on your Adventure Sheet to choose this option): turn to 23. (score NO DATA)
  • Go fishing in the Red River, assuming you have fishing gear: turn to 25.

...by this one.

So. What'll it be? Since you may want to base your eating decision on your questing decision, make the choices together.

BraveLittleToaster
May 5, 2019
Eat a meal, and aid Hieron Horsefriend. Violently avenging beloved animals is a right and just cause to take up.

CzarChasm
Mar 14, 2009

I don't like it when you're watching me eat.

BraveLittleToaster posted:

Eat a meal, and aid Hieron Horsefriend. Violently avenging beloved animals is a right and just cause to take up.

Same answer, but do it to screw over the stingy merchant.

Snorb
Nov 19, 2010
Cram some rations in our food-hole and help out Hieron Horsefriend. Mostly because he'll pay more.

Ignatius M. Meen
May 26, 2011

Hello yes I heard there was a lovely trainwreck here and...

CzarChasm posted:

Same answer, but do it to screw over the stingy merchant.

Eh, this is actually a "why not both" kinda situation.

Black Robe
Sep 12, 2017

Generic Magic User


BraveLittleToaster posted:

Eat a meal, and aid Hieron Horsefriend. Violently avenging beloved animals is a right and just cause to take up.


CzarChasm posted:

Same answer, but do it to screw over the stingy merchant.

:agreed:

habituallyred
Feb 6, 2015
Eat and Glint You just know he'll dock our pay for eating on the job.

FredMSloniker
Jan 2, 2008

Why, yes, I do like Kirby games.
I was about to declare the decision unanimous, but then habituallyred spoke up. Lemme just hit up Random.org to see... *clatter*

...well! Congratulations, habituallyred! You beat the odds and won the raffle with:

habituallyred posted:

Eat and Glint You just know he'll dock our pay for eating on the job.

Which means I needed to do a fair bit of typing before presenting you all with this:

Section 47 posted:

You decide to help Venquis Glint guard his warehouse from the mysterious trailgear-stealing thieves. This entails following him through Bitterford, out to the partially-paved High Road that leads north-west, towards the city-state of Kaad, whilst listening to him complain about most things but especially the recent thefts.

‘See, normally I’ve got my own guards for this sort of stuff, by Fulkra!’ he explains. ‘But this current warband nonsense has got everybody spooked, and my guards signed on as extra Strongarms for that last caravan that was heading to Mirewater. The Bitterford Guard are too busy chasing their own shadows all over this corner of the Pagan Plains – I mean, I haven’t even seen Urad Blackaxe himself in town long enough to drain a tankard of Skullbuster these days – and so I need your help.’

Presently, you arrive at the warehouse, which is set some way back from the High Road, on the Pagan Plains side, and surrounded by a serviceable wooden stockade. Two stunted weeping willows grow just outside the back of the stockade. Framed beyond the willows, although you are still within Bitterford settlement proper, a seemingly endless expanse of greenish grassland stretches ever northwards – the infamous Pagan Plains. You shiver slightly at the sight – part in awe, part in dread. Somewhere, out there, beyond windswept stone circles where brutish nonhuman tribes gather to perform foul rites, and sickly poisoned waterholes choked with the weathered bones of the unwary, lies the River Kok, the Icefinger Mountains, and the far northern city of Fang...

Or so you amuse yourself, after Venquis has left, whilst you perform the tedious chore of guard duty at this quiet and somewhat eerie compound. The grey banality of an overcast day in Bitterford passes with agonising slowness and nothing untoward happens apart from the occasional passing of travellers on the High Road itself. With the advent of dusk, wind whistles off the high plains, carrying with it a few fireflies that glimmer haphazardly among the rustling threads of willow leaves. You busy yourself by lighting several slow-burning lanterns that Venquis has left for you to illuminate the compound with, though there are far too few lanterns for your liking, and several parts of the compound are now cloaked in growing darkness.

During guard duty, you may eat up to two meals if you wish – don’t forget to cross them off the Food box on your Adventure Sheet. If you have not yet eaten today, the first meal will restore 2 STAMINA points, but the second meal, if you eat it, will only restore 1 STAMINA point. If you have already eaten today, then both meals will only restore 1 STAMINA point each. Also, remember that your STAMINA may not increase to above its Initial score.
  • If you don't eat a meal, gain no STAMINA. (score 0 - 1)

Since we're fully healed and well-fed, there's no point in eating, so the program doesn't even offer the option.

Section 47a posted:

To see if you are now successful at guarding the warehouse of Venquis Glint, you must roll two dice and Test your Luck. However, you must add 1 to the dice roll for every meal you have eaten today, including if you ate breakfast at your hut this morning, as this may increase the chance of you sleeping on the job. On the other hand, if you possess at least 1 torch in the Torch box on your Adventure Sheet, you may use them to further illuminate the compound and thus detect anything suspicious. Therefore, for every torch you are prepared to cross from the Torch box on your Adventure Sheet, you may deduct 1 from the dice roll as you Test your Luck. So for example, if you ate 3 meals (+3) but lit two torches (-2), you would have to add 1 (+3-2=1) to the dice roll when you Test your Luck. Lastly, do not forget to deduct 1 from your LUCK score, after you have Tested your Luck, regardless of whether you are successful or not.
  • If you light 1 torch, your effective LUCK will be 11. (score 0 - 1)
  • If you light no torches, your effective LUCK will be 10. (score 0 - 1)

We have a pretty good LUCK value, but do we want to burn our only torch to offset the penalty from eating this morning?

Regallion
Nov 11, 2012

no, eat a carrot instead.

Black Robe
Sep 12, 2017

Generic Magic User


No torch, not for the sake of one measly point.

CzarChasm
Mar 14, 2009

I don't like it when you're watching me eat.
No Torch

I think you might have touched on this with your inescapable loop part, but would it be possible to set some kind of counter, where if two opponents "miss" attacks three times in the same encounter exit the loop?

So you would have MissCounter = 0 before every melee battle

Start Melee
Check for MissCounter = 3 before doing next roll. If so Exit Melee loop
If player and opponent whiff the attack, MissCounter = +1, else MissCounter = 0
Go back to Start Melee
MissCounter = 0

It's really simplified, but that way if both sides miss three times in a row the loop exits, but if either lands a hit, the counter resets to 0 again. That way you don't exit the loop too soon either. Either the loop ends because someone died, or it exits because no one can hit the broad side of a barn.

BraveLittleToaster
May 5, 2019
No torch for us.

Ignatius M. Meen
May 26, 2011

Hello yes I heard there was a lovely trainwreck here and...

No torch on this, whatever we might face is probably not going to have a replacement and we drat sure well won't get any from the merchant grumble grumble.

FredMSloniker
Jan 2, 2008

Why, yes, I do like Kirby games.

CzarChasm posted:

I think you might have touched on this with your inescapable loop part, but would it be possible to set some kind of counter, where if two opponents "miss" attacks three times in the same encounter exit the loop?

The problem here isn't 'exiting the loop' in the sense you mean. The loop has an exit: someone taking damage. And there's no reason to take the loop at all, let alone three times. What we want to do is avoid making choices that lead to loops; in this case, that meant preventing the HOBGOBLIN POACHER from rolling a 4 without affecting the relative chances of it rolling other numbers.

Anyway. Universal support for skipping lighting a torch.

Section 47b posted:

Test your Luck, with a -1 penalty.
  • You were Lucky. Turn to 19. (97.222% likely; score 0 - 1)
  • You were Unlucky. Turn to 4. (2.778% likely; score 0 - 1)

Pretty good chances here. Let's roll the dice. *clatter* We get a 6 and pass the Test!

Section 19 posted:

Somehow, you manage to keep your eyelids open, and stay up all night guarding the warehouse compound of Venquis Glint. As a result, you are awake and alert when several small shadowy figures, each clutching a large sack, climb over the back wall of the compound and begin sneaking towards the warehouse. Screaming a battlecry, you run towards them brandishing your club, which causes most of them to scatter, many clambering frantically back over the wall and off into the darkness, squealing in fear as they go. Only one remains, and it pulls a dagger from its boot and advances towards you. By the flickering lamplight you recognise its scowling warty face as that of a GOBLIN. You must fight!

GOBLIN THIEF SKILL 5 STAMINA 5

You have enough time to fire an arrow at the GOBLIN, should you wish to do so (and don’t forget to cross it off the Arrows box on your Adventure Sheet). If you reduce the GOBLIN’s STAMINA to two points or less, read on below.

Some Fighting Fantasy books have fights where you can subdue or be subdued if someone is reduced to two or less fewer

https://www.youtube.com/watch?v=RGWiTvYZR_w

STAMINA. It makes sense if you're the one being subdued, but if you're the one doing the subduing, just give it two less STAMINA and have the flavor be defeat and not death, says I. Indeed, that's how this fight is implemented in my program.

Section combat posted:

You are now fighting the GOBLIN THIEF (SKILL 5, STAMINA 3).

You have a bow and arrow; do you wish to use it?
  • No. (score 0 - 1)
  • Yes. (score 0 - 1)

Well? Do you?

Black Robe
Sep 12, 2017

Generic Magic User


yes

BraveLittleToaster
May 5, 2019
We wish to use the bow and arrow. Probably going to spam it at every chance until we run out of arrows.

Tendales
Mar 9, 2012
I don't know how well it would fit into your current model, but it might work to deal in weights instead of chances. That way, any choices that lead to no change in game state can just have their weight reduced to 0 without affecting anything else.

FredMSloniker
Jan 2, 2008

Why, yes, I do like Kirby games.

Tendales posted:

I don't know how well it would fit into your current model, but it might work to deal in weights instead of chances. That way, any choices that lead to no change in game state can just have their weight reduced to 0 without affecting anything else.

Maybe this is a terminology issue. The outcomes of Testing our Luck just then were stored in a Python dictionary as {success_string: 33, failure_string: 3}. (The strings are serialized versions of game states so we can (a) use them as keys, (b) store them in the database, and (3) compare them to see if we've hit a state again. Those familiar with Python will understand that I'm using json.dumps(t, sort_keys = True).) If we were in a situation where one of the options just led to an escapable loop, I could store it as {good_string: 1, bad_string: 1, looping_string: 0}, and while I was planning to remove looping_string from the dictionary entirely, maybe setting it to 0 is a better approach.

Anyway, I don't anticipate any resistance to using the bow. So!

Section Fire Bow posted:

Test your SKILL of 7.
  • You hit the GOBLIN THIEF. (58.333% likely; score 0 - 1)
  • You miss the GOBLIN THIEF. (41.667% likely; score 0 - 1)

Rolling... *clatter* Oooh, a 9. That's not good. Into melee we go.

Round 1: we roll 7 (Attack Strength 14); the GOBLIN THIEF rolls 5 (Attack Strength 10). The GOBLIN THIEF is at STAMINA 1. (Remember, we deducted two points earlier because we only have to subdue it.)
Round 2: we roll 5 (Attack Strength 12); the GOBLIN THIEF rolls 12 (Attack Strength 17). Ow. We're down to 8 STAMINA.
Round 3: we roll 8 (Attack Strength 15); the GOBLIN THIEF rolls 4 (Attack Strength 9). We are victorious!

Section 19a posted:

Your last blow knocks the Goblin senseless, and you stand silently for a moment, waiting to see if any of the other thieves are still there. It appears though that they have all fled into the night. Searching the Goblin reveals 2 Silver Pieces as well as his dagger and you may take both if you wish (don’t forget to add them to your Adventure Sheet). After that, you tie the Goblin up and wait for Venquis to arrive.

When he does arrive at dawn, it is with several members of the Bitterford Guard, who are clad in mail armour and black surcoats featuring the insignia of a grey stone bridge silhouetted against a red sun. Venquis is overjoyed to see you have successfully protected his warehouse against thieves and rewards you with 3 Gold Pieces as promised (don’t forget to add them to the Gold box on your Adventure Sheet), whilst the unfortunate Goblin is handed over to the Guardsmen for questioning.

Later, it transpires that the Goblin and his fellow thieves in the night are advance scouts for a Pagan Plains warband, and were stealing gear for a raid on Bitterford. As your actions have helped shed much light on this potential threat, you may add 1 Hero Point for you troubles, and also add 1 LUCK point for your good fortune. Update your Adventure Sheet and turn to 11.

Nice! I hadn't previously mentioned Hero Points; I'll explain what they're for when that becomes relevant. For now, I'll just note this down and take us to 11.

Section 11 posted:

Once again you return to your hovel in search of rest and recuperation. If you decide to eat, cross 1 meal off the total in the Food box on your Adventure Sheet. For eating this meal you may restore 3 STAMINA points if it is your first meal today, or 2 STAMINA points if you have already eaten. Your STAMINA score may not increase to more than your Initial score however.
  • If you don't eat a meal, gain no STAMINA. (score 0 - 1)
  • If you eat a meal, gain 2 STAMINA. (score 0 - 1)

This is one of those places where the book economizing on sections helps you cheat a little, because the section continues:

Section 11a posted:

Despite the ongoing saga of where best to place buckets to combat the leaky roof of your hovel, sleep is easy to achieve. You may restore 3 STAMINA points for the rest, but your STAMINA score may not go over your Initial score.

However, if you chose to help Venquis Glint guard his warehouse (regardless of whether you were successful or not), you get no rest and may not restore 3 STAMINA points as a result. Instead, you must deduct 2 STAMINA points for the lack of decent rest last night.

This will take us down to 6 STAMINA if we don't eat, or 8 STAMINA if we do.

Section 11b posted:

Fireday

Erase ‘Moonsday’ from the Day box on your Adventure Sheet and replace it with ‘Fireday’. Did you eat at all yesterday? If you did not, then you must deduct 3 STAMINA points for going without food for the day.

No problem here.

Section 11c posted:

Despite its name, Fireday is just as gloomy as those that have preceded it recently. Tendrils of grey mist stretch between tree-lined lanes, slowly dissipating into nothingness as the warming rays of Glantanka strike Bitterford and the Red River valley.

If you wish, you may eat a meal now, gaining a further 2 STAMINA points if you choose to do so (don’t forget to cross 1 meal from the number of meals in the Food box on your Adventure Sheet). By eating now, you will avoid the consequences of losing STAMINA the following day due to hunger, as you do not know when the next chance to eat may come. Alternatively, you may just hope for the best and wait for another opportunity.
  • If you don't eat a meal, gain no STAMINA. (score 0 - 1)
  • If you eat a meal, gain 2 STAMINA; you are now well-fed. (score 0 - 1)

Section 11d posted:

Somewhat later in the day, you arrive at the Bitterford Council chambers to see if there are any labours required of you. Ignoring the small groups of townsfolk clustered about and exchanging rumours, Gilfas the Scribe consults a thick Borrinskin-bound ledger, furtively scratching notes in the margin with an indigo-feathered quill.

‘Ah, yes,’ he says ruminatively, peering up at you over the edge of bottle-thick half-moon seeing lenses. ‘Mistress Jhaleph has need of you to help clear a swamp on her lands on the far bank of the Red River. I believe she has offered a stipend of 3 Gold Pieces for services rendered.’

Three Gold Pieces for wading about a swamp hunting mud beasts does not sound appealing, particularly in this weather. As if sensing your apprehension, Gilfas indicates a commotion in the Council chambers where a party of six Guardsmen are readying their equipment, which includes numerous tar-blackened torches.

‘Alternatively,’ he says, pointing towards the Guardsmen, ‘these warriors are preparing for burning off a fire-break, on the northern edge of Bitterford that faces the Pagan Plains. You job would be to help them dispose of whatever troublesome creatures may flee the fire, back towards town, but we can only offer 2 Gold Pieces for such work.’

Again, if neither of these assignments take your fancy, you may choose instead to go fishing in the Red River, but only if you have fishing gear written down in the Equipment section of your Adventure Sheet.
  • Aid Mistress Jhaleph in clearing swampland: turn to 36. (score NO DATA)
  • Help the Bitterford Guardsmen burn off a firebreak: turn to 27. (score NO DATA)

That's a big wodge of decisions, though some of them are automatic. So here's your two questions:
  • Should we not eat (leaving us at 6 STAMINA), eat breakfast (leaving us at 8 STAMINA and well-fed), or eat a very late dinner and breakfast (leaving us at 10 STAMINA and well-fed)? There's no point in just eating dinner, as that'd be 8 STAMINA but not well-fed.
  • Should we help with the swampland or help with the firebreak? We can't go fishing, obviously.

habituallyred
Feb 6, 2015
Breakfast and Swamp

Black Robe
Sep 12, 2017

Generic Magic User


eat breakfast, fight fires

BraveLittleToaster
May 5, 2019
Eat a hearty breakfast, and go to the swamp.

Adbot
ADBOT LOVES YOU

Ignatius M. Meen
May 26, 2011

Hello yes I heard there was a lovely trainwreck here and...

Breakfast since we probably should ration our meals, and... Firebreak since that will definitely let us get more hero points and we have no way of knowing what happens if we don't get enough of that currency.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply