Bug - Fixed Goal does not update with location change

shazbot

Member
Running R9191, though I believe I was it back with 9172 or thereabouts when I first started using it.

The basic gist is if I'm adventuring in a location with a goal set (it might only be if it's a goal that I personally set, I'm not 100% confirmed), stop adventuring, and select a different location, my goal still shows the old one and the drop down menu still reflects that of the other location. Furthermore, it seems to be quite confused about where I am.

For a more specific example that JUST occured-
Adventuring in Fernswarthy ruins for 3 disembodied brains. Goal gets altered to +3 disembodied brains, as it should. I decide to change my path and adventure at the pirate cove for 1 outfit. I select pirate cove from the location list and it still says +3 disembodied brain for my goal. I select the drop down and the only option is 1 disembodied brain. I then type in 1 outfit and hit adventure, where I get the message "No outfit corresponds to Menagerie 1". I have had the first part (goal not updating) occur in other circumstances, but I cannot recall specifics. I never had the Menagerie issue hit before, but I rarely adventure for "1 outfit".
 

fronobulax

Developer
Staff member
I have seen some things with goals that didn't seem quite right recently, as well, although I wasn't paying enough attention to have a useful report.
 

Theraze

Active member
This behaviour is good though in cases of automated semi-rare adventuring, dance card, or anything else that involves a mood/counter adventuring somewhere. You don't want conditions cleared when you have a single adventure somewhere else for some reason...
 

fronobulax

Developer
Staff member
I forgot to take notes.

The currently selected area had goals selected. I had an unfinished bounty from the day before. I went to the Cellar, where the bounty was. My goals did not change for the cellar and, I think, they even remained what they had been for the other area. The bounty was not listed in the drop down goal options and I had some unremembered difficulty in trying to set it manually. I finally got what I wanted by selecting the cellar and revisiting the Hunter, at which point my area was selected with the expected goal.

I had a similar problem with a different character. I got a bounty for the Gallery and then mafia pretty much would not allow the condition to be set until I selected the Gallery and visited the hunter again.

I'm going by memory so if anyone tells me the above should not have happened based upon the code then I will believe them and pay closer attention next time.

That said, something has changed with goals and I am not convinced it was a good change for me.

In a perfect world, mafia would always remember the last goal I had used in an area. When I switch to that area that goal would be set and the status of the use goals checkbox would be unchanged. My last goal, as well as the area defaults would always appear as a dropdown in goals. If I had an active bounty then it would appear as an option in the dropdown as well. Perfection being what it is, mafia would also check a goal to see if it made sense for the area and tell me if it didn't. Looking for disintegrating corks in the haunted Pantry is probably an error.

I understand the amount of work required to achieve perfection and I am not really making this a feature request, but I do stand by my belief that something changed recently that moved away from this goal. I understand I may be opposed in this desire by folks who auto-adventure for semi-rares. :)
 

Theraze

Active member
Not just autoadventure... if you're relay adventuring, paying attention, either get the FC warning or go adventure for it yourself carefully... you don't want your bounty/quest condition wiped. I just mention it in terms of autoadventuring because !adventure(1, $location) gets used for that a lot currently to avoid having it fail on unfulfilled conditions.
 
.... "No outfit corresponds to Menagerie 1". I have had the first part (goal not updating) occur in other circumstances, but I cannot recall specifics. I never had the Menagerie issue hit before, but I rarely adventure for "1 outfit".
Did you try just
outfit
instead of
1 outfit
for the goal?
I'm pretty sure I've never seen KoLmafia fill in "1 outfit," and always just "outfit" in that field.
¯/(°_o)/¯
I don't know about Menagerie, though -- unless you made a booboo. ;-)
 

fronobulax

Developer
Staff member
Looking forward to it. Today I visited the Bounty Hunter. Mafia did not update the location nor the goals. I somewhat stupidly told mafia to adventure in what was the wrong place. I stopped automation when I realized my mistake and manually set to the correct area. The Goal drop down for the bounty area did not have the bounty and then claimed not to recognize the item when I tried to enter it manually as a goal. I futzed around and finally got the goal set but I remember with blissful longing the days when accepting and getting a bounty went a little more smoothly :)
 

Veracity

Developer
Staff member
On my radar for this weekend.
How about this weekend? ;)

(It's time to spin a new release soon, since Closet and Storage are busted in the current official release. I am inclined to wait a bit for the Valhalla revamp world event, but, there's always one more thing to wait for, so maybe not. But this is an issue that was introduced with the goal refactoring, and it would be nice to get things back to working as well as they did before the refactoring...)
 

holatuwol

Developer
I couldn't figure out how to fix my combat code, so I decided to undo it and commit the fix for this issue first. Might need to re-add the logic that was mentioned earlier about caching the goals per location, but I'll do that once I request my KoL passwords again since I keep forgetting to keep them around.
 

Theraze

Active member
Won't get to try it until rollover, but does this change break goals when you have a counter script do something like collecting a semi-rare or running a dance card adventure?
 

Veracity

Developer
Staff member
Won't get to try it until rollover, but does this change break goals when you have a counter script do something like collecting a semi-rare or running a dance card adventure?
How about if you try it tomorrow and tell us?

Actually, I just tried this and I see something odd:

I selected Giant's Castle
KoLmafia set the default goals: "2 choiceadv, castle map items, 1 heavy D"
I changed the goal to "+1 Warm Subject gift certificate"
I set the adventure counter to 10 and clicked "begin"
KoLmafia changed the displayed goals to "2 choiceadv, castle map items, 1 heavy D" and started adventuring.
After 4 adventures, I got a Warm Subject gift certificate and KoLmafia reported "Conditions satisfied after 4 adventures."

I'll try the same with a multi who uses CounterChecker:

> counters

Last semirare found 176 turns ago (on turn 12961) in Outskirts of The Knob

Unexpired counters:
Fortune Cookie (1)

> get counterScript

CounterChecker.ash

I selected Giant's Castle
KoLmafia set the default goals: "2 choiceadv, castle map items, 1 heavy D"
I set goals of "+3 Warm Subject gift certificate"
I set adventure count to 30
I pressed the "begin" button
KoLmafia changed the displayed goals to "2 choiceadv, castle map items, 1 heavy D" and started adventuring.
It adventured once in the Giant's Castle
It adventured once in the Limerick Dungeon and got a cyclops eyedrops
It adventured 7 more times in the Giant's Castle and stopped when it acquired the 3rd Warm Subject gift certificate with the message "Conditions satisfied after 8 adventures."

In other words, KoLmafia obeys your selected goals, even in the presence of a counterScript, but does not display them correctly during adventuring.
 

Veracity

Developer
Staff member
I just submitted an attempted fix in revision 9274: I think half of hola's fix was good, but I reverted the other half. With that, whenever you switch adventuring location, we reset to the default goals for that location. And it seems to count down the goals fine.

I did notice one oddness with my counter script, though: it properly switched from the Giant's Castle to the Outskirts to get a lunchbox and then back to the Giant's Castle to continue adventuring, but it flashed a red message after getting the lunchbox: "Conditions not satisfied after 1 adventures." I have no idea if it used to behave that way or not; I can't remember the last time I ran a counter script when adventuring with goals.
 

Veracity

Developer
Staff member
(It's time to spin a new release soon, since Closet and Storage are busted in the current official release. I am inclined to wait a bit for the Valhalla revamp world event, but, there's always one more thing to wait for, so maybe not. But this is an issue that was introduced with the goal refactoring, and it would be nice to get things back to working as well as they did before the refactoring...)
I'm going to spin the release now. I have a list of api.php changes that I asked CDM for. He says he'll get to them "soon" - and clarified that as being "10ish days or so." The world event will certainly introduce new items, but we handle those quite nicely with overrides.

I suppose we could automatically make adventure.php overrides, now that Jick has said he has no problem with instantly supporting new areas, if you adventure in an unrecognized place. If the world event introduces new areas, I will do exactly that, which will only help people who use daily builds. Oh, well.

And when the world event (and valhalla update) items are all spaded and the api.php changes are in, perhaps I'll make another release.
 

Theraze

Active member
Thanks Veracity. I was going to test and respond, but since you were wanting to spin 14.6 it seemed like something to query first if anyone had turns left to check. Thanks for the testing and fixing the display. :)
 
Top