Feature ASH location_accessible function.

Veracity

Developer
Staff member
Also from the PR documentation, the following are To Be Done:

--------------------
Observations:

HALF-ASTRAL should be a LimitMode; you must adventure for 5 turns in your chosen Astral zone
SHAPE_OF_MOLE should be a LimitMode; you must adventure for 12 turns on Mt. Molehill
FORM_OF_BIRD should be a LimitMode; replaces all combat skills and cannot use another llama lama gong
(So should FORM_OF_ROACH, except that is only in effect within a choice chain, so it is pointless)

Do LimitModes work correctly in Validation?
Write some tests!

The "LOV Entrance Pass" is the day pass to The Tunnel of L.O.V.E.
The "Deep Machine Tunnels snowglobe" is the day pass to The Deep Machine Tunnels
The "inflatable LT&T telegraph office" is the day pass to the LT&T office
KoLmafia does not support any of those yet.

Not yet accurately supported:
  • El Vibrato Island
  • Orchard Sidequest - progress depends on status effects and you can "finish" it.
  • Farm Sidequest - exactly 3 duck zones chosen and you can "finish" it.
  • Gingerbread City - limited daiiy turns
  • Spacegate - limited daiiy turns
  • FantasyRealm - limited daily turns
  • PirateRealm - limited daily turns
 

Veracity

Developer
Staff member
Pre (verge of) war or post war:

If you go into the Hippy Camp disguised as a hippy, you get all non-combats.
If you go into the Frat House disguised as a frat, you get all non-combats.
In either location, being disguised as the "other" is the same as not being disguised.

Once you have been given the L12 quest - you are now on the verge of war.
If you go into the Hippy Camp disguised as a frat, you are the enemy, and you get all combats.
If you go into the Frat House disguised as a hippy, you are the enemy, and you get all combats.
In either location, being disguised as a "friend" is the same as being not disguised, as far as encounters go.

Therefore, we now have:

Hippy Camp
Frat House
Hippy Camp (Hippy Disguise)
Frat Camp (Frat Disguise)
Wartime Hippy Camp
Wartime Frat House
Wartime Hippy Camp (Frat Disguise)
Wartime Frat House (Hippy Disguise)

Note that in every one of those cases, the script can simply go to

Hippy Camp
Frat House

and KoL will recognize what disguise you have (if any) and whether you are on the verge of war - or pre-war or post-war - and will give you the appropriate encounters. It doesn't even redirect to a different adventure number. You can just keep automating with the base adventure.

Now, the "Adventure Again" location on the fight page and the "Last Adventure" location in the charpane will point to the specific adventure ID whose encounters you got.

Fortunately, when I was investigating this, my multi who had recently started a Journeyman run had JUST been given the L12 quest to start the war. I have DEBUG logs to back up what I just said. :)
 
I suppose that means when the war has not been started but you have been given the L12 quest (on the verge of war) both locations are considered Wartime, in any disguise (edit removed question)
 
I do still have a question
Once you have been given the L12 quest - you are now on the verge of war.
If you go into the Hippy Camp disguised as a frat, you are the enemy, and you get all combats.
If you go into the Frat House disguised as a hippy, you are the enemy, and you get all combats.
In either location, being disguised as a "friend" is the same as being not disguised, as far as encounters go.

According to the wiki there are different encounters for being undisguised and being disguised as a friend , I believe the wiki is correct about this
 

Veracity

Developer
Staff member
According to the wiki there are different encounters for being undisguised and being disguised as a friend , I believe the wiki is correct about this
I can believe it. I don't think there are different adventure numbers, though. In fact, the Wiki agrees with that.

I am sending all my test multis - including three never-ascended ones - through a Journeyman run, now. One at a time. I am not a fool. :)
When I am done, I will have one of each class - including my main, who is a perma-AT, except when getting the yearly Standard rewards.

My formerly un-ascended AT who took DB is now happily farming in aftercore.
My other un-ascended AT is ready to start as a TT. I'll start her off and check this out, by and by.
 
So if one were looking for Frat House adventures in frat disguise on the verge of war, they should target Wartime Frat House (or just Frat House), and mafia will show the location as Wartime Frat House. Got it
 

Veracity

Developer
Staff member
Right. It is up to you to decide which outfit to put on before targeting the location, as you put it.

For locations which require a particular outfit, we will equip it, if you didn't already do so, but those locations do not require a particular outfit.
 

adeyke

Member
I'm getting some unexpected behavior right now. I'm wearing the Frat War Ensemble, at level 12, trying to start the war. However, if I adventure in "Wartime Hippy Camp (Frat Disguise)", whether through the adventure tab or the gcli, it'll change my outfit to the War Hippy Fatigues before adventuring, giving me the wrong sorts of adventures.
 

Tokoeka

Member
Probably an Unintended Consequence of the shifting of zones for IOTM locations (such as NEP) is that the choiceadventure options in the choice advs subtab of the adventure tab in mafia do not show up when selecting them, but only when selecting their old zone (Town in the instance of NEP)
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
Hm I think internally zones want to be an enum to avoid this issue. I'll work on that today.

EDIT: No that obviously doesn't sort this. Though maybe Zones do need some sort of splitting off from Adventures at some point.
 
Last edited:

Veracity

Developer
Staff member
Zones are tricky.

We have what I call "top level" zones - they are their own parent.

Code:
# zone    parent    description    [item or path]

Campground    Campground    Campground
Clan Basement    Clan Basement    Clan Basement

Signed Zones    Signed Zones    Signed Zones
Exploathing    Exploathing    Kingdom of Exploathing    Kingdom of Exploathing
Mothership    Mothership    The Bugbear Mothership    Bugbear Invasion
The Grey Goo Impact Site    The Grey Goo Impact Site    Grey Goo    Grey Goo

Town    Town    Seaside Town
Plains    Plains    Nearby Plains
Mountain    Mountain    Big Mountains
Woods    Woods    Distant Woods
Beach    Beach    Desert Beach
Island    Island    Mysterious Island
Volcano    Volcano    Secret Tropical Island Volcano Lair

IsleWar    IsleWar    Island War Quest
The Sea    The Sea    The Sea

Beanstalk    Beanstalk    Above the Beanstalk
BatHole    BatHole    Bat Hole
Knob    Knob    Cobb's Knob
Cyrpt    Cyrpt    Defiled Cyrpt
Friars    Friars    Deep Fat Friars
Pandamonium    Pandamonium    Pandamonium
Wormwood    Wormwood    Worm Wood    tiny bottle of absinthe

Item-Driven    Item-Driven    Item-Driven Zones
Antique Maps    Antique Maps    Antique Maps
Portal    Portal    El Vibrato Island    El Vibrato trapezoid
Astral    Astral    Astral Plane    astral mushroom
Memories    Memories    Memories    empty agua de vida bottle
Spaaace    Spaaace    Outer Space    transporter transponder
Suburbs    Suburbs    The Suburbs of Dis    devilish folio
Psychoses    Psychoses    Psychoses    psychoanalytic jar

Unsorted    Unsorted    No Category
Events    Events    Events
Removed    Removed    Removed Areas

We have many adventures which go right into those zones.

And then we have zones which are children of the above .
We put adventures into those, too.

And sometimes the nesting is deeper:

Code:
Manor    Town    Spookyraven Manor
Manor0    Manor    Spookyraven (Cellar)
Manor1    Manor    Spookyraven (First Floor)
Manor2    Manor    Spookyraven (Second Floor)
Manor3    Manor    Spookyraven (Third Floor)
or
Code:
A Monorail Station    Town    A Monorail Station
FantasyRealm    A Monorail Station    FantasyRealm    FantasyRealm membership packet
PirateRealm    A Monorail Station    PirateRealm    PirateRealm membership packet
PirateRealm Island    PirateRealm    PirateRealm Island
or
Code:
Removed    Removed    Removed Areas
PastEvents    Removed    Past Events
WhiteWed    PastEvents    White Wednesday

Choice Adventures are sorted by which zone you choose to associate them with.
And the Adventure GUI has two sorting options:

- By adventure name, displayed as ZONE:NAME
- by zone

So, if you want to see everything directly in Woods, you can search for Woods in either mode
But you will not find things that are in a subzone of Woods.
For example, all the grimstone map adventuring locations are in an appropriate zone which is a subzone of woods.

Psychoses is a top level zone.
All the various jar adventures used to be under that.
Now each jar has a subzone of that and that means you cannot simply search fo "Psychoses" if adventures are shown by name.

I think that is a degradation, so I've been musing
One idea was for adventures-by-name show the whole zone-nesting hierarchy, up to the "top level" zone.

I am nowhere near ready to tackle this.

If you are, I will be very interested to see what design you come up.
Both choice adventures and the Adventure frame will need to be at least as usable as they are now.
 

Veracity

Developer
Staff member
After a lot of work, here is (or soon will be) our workflow for automating adventuring.
If a step returns "false", automation stops at that point.

1) boolean pre_validate_adventure(location)

Certain locations may be available (or not) depending on properties which can change from day to day.

If can_adventure() will look at those and return true or false. However, perhaps you did something outside of KoLmafia and we don't know. If we think the answer will be false, but visiting a location and taking a look will definitively give us the answer, this function will do that - and return true or false.

2) boolean can_adventure(location)

Certain locations are either unavailable (wrong zodiac, path, class, standard restriction, retired zones, etc.).
Others are currently unavailable without advancing quests or using expensive resources.

For such cases, return false.

Other locations are currently available with your currently equipped gear or currently active effects.

Return true.

Some locations may be unavailable given your currently worn equipment or missing effects that can (cheaply) be created by equipping or using items in inventory.
If prepare_for_adventure() can do those things for you, return true.

Some locations may be available if you use an expensive item you have in inventory.
prepare_for_adventure will not use those. It's up to the user to do. Return false.

3) When automating, call user's betweenBattleScript.

I don't really know what that is expected or allowed to do at this point.
It could put on outfits - but prepare_for_adventure will do that.
It could use items to get effects - but unless prepare_for_adventure was willing to do that, you won't get here, since can_adventure would have returned false.

So, the current assumption is that this script can do nothing to make adventuring possible that the first two steps didn't know about.

4) boolean prepare_for_adventure(location)

In theory, this should always return true, since anything it wasn't willing to do - or didn't have the necessary (cheap) resources - was rejected by can_adventure.

I will detail how each of the KoLmafia-provided functions works in more details in follow up notes.

Comments/suggestions are welcome for all of these things.
 

Veracity

Developer
Staff member
boolean pre_validate_adventure(location)

*** This function does not exist yet. I putting it out for discussion here, first.
*** It will be trivial to implement

1) HiddenTemple -> KoLCharacter.getTempleUnlocked()

Why is this not a property? If you want to adventure here and this is false, we double check by looking at the woods.

2) Time Twitching Tower - timeTowerAvailable

If false, we can take a look in town.

3) Spring Break Beach - _sleazeAirportToday
Conspiracy Island - _spookyAirportToday
Dinsey Landfill - _stenchAirportToday
That 70's Volcano - _hotAirportToday
The Glaciest - _coldAirportToday
The Never Ending Party - _neverendingPartyToday
Spacegate - _spacegateToday
Gingerbread City - _gingerbreadCityToday
FantasyRealm - _frToday
PirateRealm - _prToday
// Deep Machine Tunnels snowglobe is the one day pass.
// inflatable LT&T telegraph office is the one-day pass.
// LOV Entrance Pass is the one-day pass.

If you say you want to adventure and don't have permanent access, we can visit a location - and QuestManager will set the "daily" properties appropriately.

Other things that have day passes that are not adventuring zones that can be picked up by peeking at locations.

_daycareToday
_voteToday
 

Veracity

Developer
Staff member
boolean can_adventure(location)

1) As I mentioned, for many locations, there is literally nothing you can do to adventure in them right now.

2) Many locations require an outfit or equipped gear or an active effect.
If you are all set up, return true.
If prepare_for_adventure can do it for you, return true.
Otherwise, return false.

Items/effects:

Harem Girl Outfit + Knob Goblin perfume (either)
Elite Guard Outfit + Knob Cake (or the ingredients)
Talisman of Namsilat (it might even make it from the ingredients)
Continuum transfunctioner (will talk to Crackpot Mystic to get it, if needed)
1-3 sonars-in-a-biscuit (will use from inventory if needed to open areas)
enchanted bean (will plant if necessary to grow Beanstalk)
filthworm glands (will use, as appropriate, if have in inventory and don't have effect)
Swashbuckling Getup or pirate fledges (will don the best you have and can equip)
bone with a price tag, hypnotic breadcrumbs, map to a cache of booze

3) Some locations can be activated by using an item.
If you have the item - and it is "too expensive" - by some measure - to be automated - return false.
Otherwise, if you have it, prepare_for_adventure will handle it, so return true.

Items that are "too expensive":

- any "day pass".
- most (but not all) IOTM drops.

These are OK:

- "DRINK ME" potion for the Red Queen's Garden. This was 100 Meat for a long time. Now it is 350~ Meat.
- astral mushroom. This is not cheap, but it is built in to how we handle the Astral zone: choose which trip you want, we use a mushroom and choose the appropriate trip, and voila! you are good to go for 5 turns of Half-Astral. I will be looking harder at this, by and by.

These we check for in can_adventure but do NOT currently use in prepare_for_adventure.

- llama lama gong for Mt. Molehill. I am inclined to treat this like the astral mushroom; if you express intent to go to Mt. Molehill and have the gong - even though it is not cheap - should we use it and choose the adventure for you?

- devilish folio. Opens Suberbs of Dis. Not cheap. Should we use it for you?

- tiny bottle of absinthe. Opens The Wormwood. Not cheap. Should we use it for you?

- transporter transponder. Opens Spaaace. Not cheap. Should we use it for you?

- jars of psychoses. These are almost as expensive as charters - and using one will close the currently active jar. We should not return true strictly on the basis of the appropriate jar in inventory.

- grimstone mask. Opens one of five tales. Not cheap. Should we use it for you and select the tale based on desired zone?
 

Veracity

Developer
Staff member
boolean prepare_for_adventure(location)

I mentioned all the special item usages that can_adventure() expects. Additionally:

- If you need to go to the Island and don't have a way to do it, if you do have dingy planks and dinghy plans, we will make a dinghy.

- For Fantasy Realm, if you have access but do not have the G. E. M., we report an error, since you need to visit the entrance and pick a hat first. Unlike the Astral zone or Mt. Molehill or a grimstone zone, that is not implied by the zone you are trying to go to.

- Can open initial Market quests either with the specific item (which does not start the quest) if you have it in inventory, or by going to the correct shopkeeper and accepting the quest.

- If your item requires an outfit and you have it (as detected in can_adventure), but are not wearing it, we will put it on.

- We will put on drip harness or Talisman of Namsilat or continuum transfunctioner, as needed

- If you want to adventure in Cola War Battlefield (No Uniform) and happen to be wearing a uniform, we will remove your shield. It's a 100% non-combat zone, so you are in no danger. :)

- And lastly, if "requireSewerTestItems" is true, we will check your inventory for the various Hobopolis sewer items that will speed your progress.
 

Magus_Prime

Well-known member
FWIW I am of the opinion that:
  1. if I have the ITOTM drop in inventory
  2. and have expressed a desire to go to the zone enabled by that drop
  3. that the can_adventure(location) logic should use the item
That said I can think of two, potential, exceptions:
  1. I'm currently in an adventure chain started by using a jar of psychosis
  2. I have set some user defined property that informs can_adventure(location) to never automatically use items deemed "expensive".
 

Veracity

Developer
Staff member
FWIW I am of the opinion that:
  1. if I have the ITOTM drop in inventory
  2. and have expressed a desire to go to the zone enabled by that drop
  3. that the can_adventure(location) logic should use the item
An IOTM “drop” is something like a tiny bottle of absinthe or a psychanalytical jar.

These are no longer “cheap” once fewer people run with the familiar to farm them.

Many “day passes” require the IOTM owner to farm for multiple days to acquire the currency to buy the pass. Hence, expensive.

I have a multi who bought a couple hundred Dinsey Landfill day passes. They give her about 600k extra income from VMF per day - and the mall price has now doubled. :)

A jar of psychoses drops once a day - and then you have to visit an NPC to fill it. For all except Jick, that is trivial. VMF will farm Jick jars…

I agree that a jar should not be autoused if you have another one at your campsite. Maaaaaybe not at all, like charters you have to farm and buy.

Astral mushroom, llama lama gong, and grimstone mask all require you to go through a choice adventure to pick which trip/path/tale to use. prepare_for_adventure should be able to use the item and process the choice for you, based on the desired adventure. You shouldn’t be allowed to automatically switch until you’ve used up the turns, perhaps. You can’t for the Astral or Mt. Molehill case. Those should be LimitModes.

I’m thinking any other actual “drops” should be used. When I say “not cheap”, I mean 10 or 20k - as opposed to 100k on up for day passes or jars.
 

Veracity

Developer
Staff member
The following PR does most of what I proposed for can_adventure and prepare_for_adventure. It also simplifies a number of things.

One user visible thing is that a $location in ASH has not only .zone and .parent proxy record fields, but now also .root for the top-level parent. Since all past events and such are now under “Removed”, that’s a quick way to eliminate a lot of permanently unavailable adventure areas.

As before, I reject item-provided areas if you are under Standard restrictions and the items are out of standard. It might be useful to provide is_restricted(location) - even though that is not shown on KoL’s standard.php page; it derived from items which are shown there.

More to come:

- pre_validate_adventure
- Using more items to open up zones.
- LimitModes
- tweaks and tests

And working around KoL bugs. I have noticed for years that if you dance with Lady Spookyraven and then immediately go somewhere else in the Relay Browser, next Spookyraven Lights Out warning for a 3rd floor location doesn’t work; KoL says “you can’t get there”. Turns out you have to have visited the third floor - and you can’t even do that if you haven’t looked at the 2nd floor again after dancing.

I have an idea for this, and will try it out soon, since I will be ascending another multi into Journeyman this morning.

 
Top