AFH Spading: Friars and crypt mechanics (October 2008)
AFH Spading: Friars and crypt mechanics (October 2008)
Friars and Crypt Mechanic by QuantumNightmare
EDIT: Some preliminary results are up for other zones, which will be posted on the AFH spading forum.
I've been collecting several hundred mafia logs from different players, and seem to have found the mechanism for the Crypt and Friars subzones.
Before I go on, I'm always looking for more mafia logs to help increase the accuracy of my results. Let me know if anyone has general mafia logs they can email me for analysis.
Simple mechanics:
All bosses occur 5 to 7 turns after any variable floors expire. You need a noncombat in all zones to unlock the boss adventure, so +noncombats help unlock the superlikely boss adventures despite not changing the odds of the boss adventure occuring.
Each Friars subzone has a floor of 0, and all quest adventures are regular noncombats.
Seekrit NS13 mechanic in place in both zone:
A variable floor of 09 turns is applied in each subzone. So the overall floor in the friars is 09, and the overall floor in the crypt is 514.
What does this mean?
You can run +29% noncombats in the friars, and if the game decides it's your unlucky day you won't get a quest noncombat for at least 9 turns. But you'll still get the quest noncombat faster if you run +29% noncombats than if you run none. And you can get 1turn friars subzones, but the best you can do in the crypt is 6 turns per subzone.
Where's the math?
Here are two pretty pictures describing the variable 09 floor. The basic crypt behaviour has been described many times in the past, and I will not go over the data here.
First the Friars:
In this graph I show the % chance that if a noncombat occured on turn X, that noncombat would be a quest adventure. You can see that after you've spent 9 turns in a subzone, you have a ~65% chance of any noncombat being a quest noncombat, which makes sense accounting for the queue. From turn 09, your odds of a noncombat being a quest adventure slowly increase from ~0 to the maximum of ~65%. Sample size here is ~450 individual friars subzones.
Next, the Crypt:
Here, I graph the odds of encountering a boss adventure on your Xth turn adventuring in a crypt subzone. In this graph, you see that no bosses were fought in the first 5 turns. Once at least 15 turns were spent, bosses have a 33% of occurring. Between 5 and 14 turns, the odds of a boss occurring slowly increase from 0% to the final maximum value of 33%. Sample size here is ~700 individual crypt subzones.
Both of these zones show a "ramping up" effect, where your odds of a quest adventure occurring begin at a minimum and increase up to a constant maximum after 9 turns. This can be explained by a random floor of length 0 to 9 being applied to each zone. In both cases, I did not graph the "long tail" of results that show the odds have reached a constant value due to small sample sizes at individual values of X, but the constand value does seem to have occurred. I can produce data if desired.
These are the first two zones I have analyzed, due to getting 34 samples per ascension. Once I collect more logs, I will begin to analyze other zones and see how prevalent this "ramping up" is, how often Jick reused this idea of variable floors with a magnitude of 09. The odds are good this mechanic is present in many/most questing zones.
Finally, I'd like to thank all the players in AFH, HCO, and /hardcore who provided me with mafia logs to produce these results.
Addendum to the crypt:
Jick hates us, and so he placed floors on each crypt zone.
Jick also loves us, and so he placed ceilings on each crypt zone.
The net effect is that the crypt is a padded playground, as Jick said earlier. You can't get very good luck, but you also can't get very bad luck.
I've previously posted about the random floor of 09 which is added to the zone. Once this random floor expires, the game randomly selects a number between 5 and 7. After that many turns expire, the subzone boss *will* occur. If you have not received a noncombat by this time, the boss will be rejected, and will occur the turn after you receive a noncombat.
In other words: The game rolls a number X between 0 and 9, and a number Y between 5 and 7. The boss will occur on turn X+Y, and all you can do is make sure to have received a noncombat by the time your boss is scheduled.
Note1: Every time the boss combat is rejected, a new number between 5 and 7 is rolled.
Note2: Getting and skipping noncombats past the first does not speed up this zone, since if you received a nonboss adventure, your boss wasn't scheduled for that turn anyways.
EDIT: Some preliminary results are up for other zones, which will be posted on the AFH spading forum.
I've been collecting several hundred mafia logs from different players, and seem to have found the mechanism for the Crypt and Friars subzones.
Before I go on, I'm always looking for more mafia logs to help increase the accuracy of my results. Let me know if anyone has general mafia logs they can email me for analysis.
Simple mechanics:
All bosses occur 5 to 7 turns after any variable floors expire. You need a noncombat in all zones to unlock the boss adventure, so +noncombats help unlock the superlikely boss adventures despite not changing the odds of the boss adventure occuring.
Each Friars subzone has a floor of 0, and all quest adventures are regular noncombats.
Seekrit NS13 mechanic in place in both zone:
A variable floor of 09 turns is applied in each subzone. So the overall floor in the friars is 09, and the overall floor in the crypt is 514.
What does this mean?
You can run +29% noncombats in the friars, and if the game decides it's your unlucky day you won't get a quest noncombat for at least 9 turns. But you'll still get the quest noncombat faster if you run +29% noncombats than if you run none. And you can get 1turn friars subzones, but the best you can do in the crypt is 6 turns per subzone.
Where's the math?
Here are two pretty pictures describing the variable 09 floor. The basic crypt behaviour has been described many times in the past, and I will not go over the data here.
First the Friars:
In this graph I show the % chance that if a noncombat occured on turn X, that noncombat would be a quest adventure. You can see that after you've spent 9 turns in a subzone, you have a ~65% chance of any noncombat being a quest noncombat, which makes sense accounting for the queue. From turn 09, your odds of a noncombat being a quest adventure slowly increase from ~0 to the maximum of ~65%. Sample size here is ~450 individual friars subzones.
Next, the Crypt:
Here, I graph the odds of encountering a boss adventure on your Xth turn adventuring in a crypt subzone. In this graph, you see that no bosses were fought in the first 5 turns. Once at least 15 turns were spent, bosses have a 33% of occurring. Between 5 and 14 turns, the odds of a boss occurring slowly increase from 0% to the final maximum value of 33%. Sample size here is ~700 individual crypt subzones.
Both of these zones show a "ramping up" effect, where your odds of a quest adventure occurring begin at a minimum and increase up to a constant maximum after 9 turns. This can be explained by a random floor of length 0 to 9 being applied to each zone. In both cases, I did not graph the "long tail" of results that show the odds have reached a constant value due to small sample sizes at individual values of X, but the constand value does seem to have occurred. I can produce data if desired.
These are the first two zones I have analyzed, due to getting 34 samples per ascension. Once I collect more logs, I will begin to analyze other zones and see how prevalent this "ramping up" is, how often Jick reused this idea of variable floors with a magnitude of 09. The odds are good this mechanic is present in many/most questing zones.
Finally, I'd like to thank all the players in AFH, HCO, and /hardcore who provided me with mafia logs to produce these results.
Addendum to the crypt:
Jick hates us, and so he placed floors on each crypt zone.
Jick also loves us, and so he placed ceilings on each crypt zone.
The net effect is that the crypt is a padded playground, as Jick said earlier. You can't get very good luck, but you also can't get very bad luck.
I've previously posted about the random floor of 09 which is added to the zone. Once this random floor expires, the game randomly selects a number between 5 and 7. After that many turns expire, the subzone boss *will* occur. If you have not received a noncombat by this time, the boss will be rejected, and will occur the turn after you receive a noncombat.
In other words: The game rolls a number X between 0 and 9, and a number Y between 5 and 7. The boss will occur on turn X+Y, and all you can do is make sure to have received a noncombat by the time your boss is scheduled.
Note1: Every time the boss combat is rejected, a new number between 5 and 7 is rolled.
Note2: Getting and skipping noncombats past the first does not speed up this zone, since if you received a nonboss adventure, your boss wasn't scheduled for that turn anyways.
I know these are all resurrected old posts (and thank you for collecting them together!), and so might have a few niggling inaccuracies, but I wanted to call out one bit on the cyrpt:
You don't have a 57 roll for each zone; what you have is 4 turns where no boss can happen, then 2 turns where boss has a chance of happening, then one turn where boss is guaranteed (assuming you have already encountered the choice NC in this zone, and spent delay() turns). This means skipping choice NCs after the 413 turns are spent actually does help, as it gives you another chance at getting the boss adventure on those two 'maybe boss' turns.
So... The fully optimal way to handle the cyrpt is generally to adventure in each zone with +NCs until you get the choice adventure or you've spent 4 turns (using a free runaway does count as spending a turn there; skipping a choice NC does not). After meeting those conditions in all 4 zones, if you have any zones you've spent less than 4 turns in, you can spend turns there not worrying about +NCs (it's not worth actually dropping +NC effects, but it might be worth replacing them with other things, e.g. swapping a ring of conflict for a carnivore), unless it's your mainstat zone and you want the choice stats. After you've spent at least 4 turns in each zone, you want to max out +NCs again and skip the choices (unless you want mainstat choices stats again for that zone); a lot of it will probably be wasted on turns below your delay() counter, but if you happen to get a choice NC on one of the two 'maybe boss' turns, skipping it gives you another roll on the boss.
So... Assuming you get at least one choice sometime before you're eligible for the boss encounter, here's what your boss encounter timeline in each zone looks like, based on turns spent (turns spent = combats encountered, free run away or not, + each nonskipped choice), with delay() counter of Y:
Not sure if anyone has a clue what the X% chance is; it may even vary between the two turns, but hasn't been spaded. Spending a few hundred turns in a zone, accepting regular choice NCs but refusing the boss adventure each time (which adds another 4 noboss counter, then seems to go back into the 2 turns with a chance, third turn guaranteed), could be illuminating.
You don't have a 57 roll for each zone; what you have is 4 turns where no boss can happen, then 2 turns where boss has a chance of happening, then one turn where boss is guaranteed (assuming you have already encountered the choice NC in this zone, and spent delay() turns). This means skipping choice NCs after the 413 turns are spent actually does help, as it gives you another chance at getting the boss adventure on those two 'maybe boss' turns.
So... The fully optimal way to handle the cyrpt is generally to adventure in each zone with +NCs until you get the choice adventure or you've spent 4 turns (using a free runaway does count as spending a turn there; skipping a choice NC does not). After meeting those conditions in all 4 zones, if you have any zones you've spent less than 4 turns in, you can spend turns there not worrying about +NCs (it's not worth actually dropping +NC effects, but it might be worth replacing them with other things, e.g. swapping a ring of conflict for a carnivore), unless it's your mainstat zone and you want the choice stats. After you've spent at least 4 turns in each zone, you want to max out +NCs again and skip the choices (unless you want mainstat choices stats again for that zone); a lot of it will probably be wasted on turns below your delay() counter, but if you happen to get a choice NC on one of the two 'maybe boss' turns, skipping it gives you another roll on the boss.
So... Assuming you get at least one choice sometime before you're eligible for the boss encounter, here's what your boss encounter timeline in each zone looks like, based on turns spent (turns spent = combats encountered, free run away or not, + each nonskipped choice), with delay() counter of Y:
Code: Select all
1 No boss
2 No boss
3 No boss
4 No boss
5 X% Chance of boss if Y=0, no boss if Y>0
6 X% Chance of boss if Y=0 or 1, no boss if Y>1
7 Boss if Y=0, X% chance of boss if Y=1 or 2, no boss if Y>2
8 Boss if Y=1, X% chance of boss if Y=2 or 3, no boss if Y>3
9 Boss if Y=2, X% chance of boss if Y=3 or 4, no boss if Y>4
10 Boss if Y=3, X% chance of boss if Y=4 or 5, no boss if Y>5
11 Boss if Y=4, X% chance of boss if Y=5 or 6, no boss if Y>6
12 Boss if Y=5, X% chance of boss if Y=6 or 7, no boss if Y>7
13 Boss if Y=6, X% chance of boss if Y=7 or 8, no boss if Y>8
14 Boss if Y=7, X% chance of boss if Y=8 or 9
15 Boss if Y=8, X% chance of boss if Y=9
16 Boss if Y=9
 stupac2
 Oh my! Guy with Pie!
 Posts: 3027
 Joined: Mon Dec 08, 2008 10:04 pm
 Location: Stanford, CA
 Contact:
Hmmm, I thought I recalled having a cyrpt zone last fewer than 5 turns once. It was exceptionally fast, but I'm not positive how fast, and have NO IDEA which run it happened in. If someone has a good way of parsing mounds of mafia logs for that kind of thing, I'd gladly submit my whole archive (and eleron already has them).
You can get a boss earlier than the 5th turn by using free runaways (and being lucky).
As for finding it... For currently existing tools, you could Visualize batches of them, and look at the turns per area breakdown, though that would still take a while. Otherwise you could probably do it with some clever regex business, which is not my forte.
As for finding it... For currently existing tools, you could Visualize batches of them, and look at the turns per area breakdown, though that would still take a while. Otherwise you could probably do it with some clever regex business, which is not my forte.
 zombiepops
 My Pie Blown Sky High
 Posts: 483
 Joined: Thu Jan 22, 2009 8:18 pm
 Location: North Carolina
 Contact:
So I've been toying around a little with a Monte Carlo experiment for modeling how long to expect the friars to take, given running no combat modifiers, running smooth and sonata, and waiting five turns before running smooth and sonata. Source code is here. I think I've implemented the model correctly, but if someone sees an error (esp in how I'm doing the queue, since I'm not certain about that), please let me know.
On to the results. These numbers were generated from 10,000 Monte Carlo samples. The average time to get the quest adventure ranges from a little over 12 adventures for running no noncombats, to eight and a half for running +10% noncombats. A small improvement. But it decrease the standard deviation from about 8.5 to 5.3, which I think is the biggest gain.
If anyone is interested in other data points, let me know, i'll knock it up quick, or if anyone is interesting in me spinning this code out into a more general set of classes for doing Monte Carlo simulations for adventuring, I'd probably be willing to do that.
On to the results. These numbers were generated from 10,000 Monte Carlo samples. The average time to get the quest adventure ranges from a little over 12 adventures for running no noncombats, to eight and a half for running +10% noncombats. A small improvement. But it decrease the standard deviation from about 8.5 to 5.3, which I think is the biggest gain.
If anyone is interested in other data points, let me know, i'll knock it up quick, or if anyone is interesting in me spinning this code out into a more general set of classes for doing Monte Carlo simulations for adventuring, I'd probably be willing to do that.
I'm brainy for Zombiepops!

 Just Plain Old Pie
 Posts: 2
 Joined: Mon Mar 02, 2009 1:43 pm
 zombiepops
 My Pie Blown Sky High
 Posts: 483
 Joined: Thu Jan 22, 2009 8:18 pm
 Location: North Carolina
 Contact:
I assume each zone is the same (they have the same number of noncombats, one quest, one nonquest, and I assumed the difference combat frequency differences listed on the wiki were sampling error, and used thier mean 85.5%) . I can knock together a similar chart for running all three.Deathprog23 wrote:Wow, cool graphs zombiepops!
Nice to see exactly how unlikely my 42 turn dark neck was the other day (Well, I suppose it would be interesting to see the pdf for each zone separately, and the cummulative distributions too.)
I'm brainy for Zombiepops!
You can almost certainly use a noncombat rate of 85%; I don't think the game code can even handle noninteger combat rates (based on spading done when ML affected combat rate), or even has any base rates that aren't a multiple of 5.
I also assume each zone is identical, but the cumulative for all 3 might be intresting, as I think that would affect things like the standard deviation? My stats clases seem an age ago.
It'd also be interesting to see the breakdown for the cyrpt using various +NC on/off strategies, heh... mostly to see what the potential turn differences are between running NCs only until you get each zone's NC once, vs. keeping them up the whole time (basically, is the MP worth it). I guess we need to know the chance rate on the boss superlikely in that 2turn range for this to make sense, though. I may send a multi to spade that when I have time...
Also interesting would be a simulation of various strategies in the spooky forest, heh... That zone is quite a mess.
I also assume each zone is identical, but the cumulative for all 3 might be intresting, as I think that would affect things like the standard deviation? My stats clases seem an age ago.
It'd also be interesting to see the breakdown for the cyrpt using various +NC on/off strategies, heh... mostly to see what the potential turn differences are between running NCs only until you get each zone's NC once, vs. keeping them up the whole time (basically, is the MP worth it). I guess we need to know the chance rate on the boss superlikely in that 2turn range for this to make sense, though. I may send a multi to spade that when I have time...
Also interesting would be a simulation of various strategies in the spooky forest, heh... That zone is quite a mess.
I seem to remember Jick saying that the fertilizer and sapling are regular noncombats and the map is a scheduled with delay(). Which would mean that you would run noncombats after the map. Not sure if that has been confirmed.salien wrote:Also interesting would be a simulation of various strategies in the spooky forest, heh... That zone is quite a mess.

 Fie the Pie
 Posts: 1175
 Joined: Sat Feb 03, 2007 12:02 am
 Location: Kent, OH
 zombiepops
 My Pie Blown Sky High
 Posts: 483
 Joined: Thu Jan 22, 2009 8:18 pm
 Location: North Carolina
 Contact:
 deusnoctum
 Statistically likely to return
 Posts: 820
 Joined: Wed May 07, 2008 4:00 pm
The mean for all three zones will be 3*mean, while the standard deviation will be sqrt(sum(stdev^2)) = stdev*sqrt(3). So:salien wrote:I also assume each zone is identical, but the cumulative for all 3 might be intresting, as I think that would affect things like the standard deviation? My stats clases seem an age ago.
no nc: n = 33.34, sigma = 14.61
10 nc: n = 25.96, sigma = 09.17
10 >5: n = 28.19, sigma = 08.95
Because these distributions are asymmetric (badumpsh), I would also be interested in seeing quantiles.
 zombiepops
 My Pie Blown Sky High
 Posts: 483
 Joined: Thu Jan 22, 2009 8:18 pm
 Location: North Carolina
 Contact:
I forgot to mention that for the comparison between these two, we really need to know average number of 'useless' NCs received. I mean, always running NCs is definitely going to be less total turns than not running them until 5 turns are spent, but if it's 2 turns faster and you recieve 3 more 'useless' NCs, then you've really lost a turn overall (sort of... I guess even combats here really count as like .5 'useless' turns, since stat gains are low).deusnoctum wrote:10 nc: n = 25.96, sigma = 09.17
10 >5: n = 28.19, sigma = 08.95
In particular, it'd be nice to see for:
20 nc
5 nc <= 5 turns, 20 nc > 5 turns
because those are my usual options in softcore, heh. I strongly suspect it's still better to always run NCs, but actual simulation to back it up is always good.
EDIT: Durr, those numbers are obvious for the given conditions, I are smart. For anyone else wondering:
10 nc: 6.49 total noncombats, 3.49 useless
10 nc > 5: 5.55 total noncombats, 2.55 useless
Though that doesn't properly count the rare cases in situation 2 where you finish a zone in 5 turns or less, so I guess the simulation numbers would still be nice. Still, always running NCs comes out about 1 turn faster, 1.5 if you consider the combats to be halfuseless.
I'd still love to see the softcore simulations, though, including NC counts.
 zombiepops
 My Pie Blown Sky High
 Posts: 483
 Joined: Thu Jan 22, 2009 8:18 pm
 Location: North Carolina
 Contact:
I did track number of noncombats seen on average, I just didn't post it.
for no +nc it was 1.767, for +10% nc it was 2.1204, and for +10% after turn 5 it was 1.8286
defining a utility function is left as an exercise for the reader.
quantiles will get uploaded later tonight, and I'll see about modeling the SC options for you. (And if my paper writing goes exceptionally well tonight I might even try modeling the crypt)
for no +nc it was 1.767, for +10% nc it was 2.1204, and for +10% after turn 5 it was 1.8286
defining a utility function is left as an exercise for the reader.
quantiles will get uploaded later tonight, and I'll see about modeling the SC options for you. (And if my paper writing goes exceptionally well tonight I might even try modeling the crypt)
I'm brainy for Zombiepops!
At first I was super confused as to why those numbers differed so greatly from what I'd guessed, then I realized I was talking about the 3 zone cumulative, and you're talking about what you actually simulated, 1 zone. Multiply your numbers by 3 and they're very close to mine, so good, I'm not a complete idiot.
And thanks in advance for considering my requests!
And thanks in advance for considering my requests!
 Turtle Juice
 Inscrutable Pi
 Posts: 222
 Joined: Tue Nov 17, 2009 1:58 pm
 Location: Frozen Northlands
I spent ~ 36 adventures in the Defiled Cranny before I got the noncombat while running both smooth movements and sneakiness.
However, I got the noncombat the first adventure in each of the other 3 side areas after that one...although I didn't keep track of how quickly the bosses came up.
And, unfortunately, in a fit of rage I deleted that (and a few other) logs ... long story.
However, I got the noncombat the first adventure in each of the other 3 side areas after that one...although I didn't keep track of how quickly the bosses came up.
And, unfortunately, in a fit of rage I deleted that (and a few other) logs ... long story.
 zombiepops
 My Pie Blown Sky High
 Posts: 483
 Joined: Thu Jan 22, 2009 8:18 pm
 Location: North Carolina
 Contact:
Hm, checking the noncombat counts for those, it looks like 2.5 for alwaysNC, 2 for the hybrid, so 4.65 combats vs. 5.83, or 2.33 'useful' turns vs. 2.92. So you save 0.68 turns at the cost of 0.59 turns of stats. Awfully close, so it probably just doesn't matter either way, but technically always running NCs is better by 0.09 turns, heh.
Wait, what? Wouldn't a better strategy be to run +NC until you get both the fertilizer and sapling, and if you get both of those without getting the map, THEN you can stop running +NC (or even switch to +combats)?Awsomo wrote:I seem to remember Jick saying that the fertilizer and sapling are regular noncombats and the map is a scheduled with delay(). Which would mean that you would run noncombats after the map. Not sure if that has been confirmed.salien wrote:Also interesting would be a simulation of various strategies in the spooky forest, heh... That zone is quite a mess.
Also, more on topic, I can't express this with math, but waiting until after 5 turns to start boosting noncoms in the friars has always seemed like a bad idea to me. Sure, on average, you avoid more of the shit noncoms, but on that rare occasion when you actually have 0turn delay() in a zone, you're pissing away that good fortune.
[quote="Serra725"]What did you use for the structural part of the bear?[/quote]
You cannot get the fertilizer and sapling encounters until you get the map, so what you propose would be impossible.Pantsless wrote:Wait, what? Wouldn't a better strategy be to run +NC until you get both the fertilizer and sapling, and if you get both of those without getting the map, THEN you can stop running +NC (or even switch to +combats)?
Ah, didn't know that, thanks.Flolle wrote:You cannot get the fertilizer and sapling encounters until you get the map, so what you propose would be impossible.Pantsless wrote:Wait, what? Wouldn't a better strategy be to run +NC until you get both the fertilizer and sapling, and if you get both of those without getting the map, THEN you can stop running +NC (or even switch to +combats)?
[quote="Serra725"]What did you use for the structural part of the bear?[/quote]