Bug - Fixed Improve logging for opening the Hidden City

Veracity

Developer
Staff member
Unlike newer choice adventures for which certain options cost you turns, opening the Hidden City actually tells you it will take 3 turns if you take that option. Here's how we currently log it:

Code:
[561] The Hidden Temple
Encounter: Fitting In
Took choice 582/2: Hidden Heart of the Hidden Temple
choice.php?pwd&whichchoice=582&option=2
Encounter: The Hidden Heart of the Hidden Temple
You lose an effect: Stone-Faced
Took choice 580/2: choose Hidden Heart adventure
choice.php?pwd&whichchoice=580&option=2
Encounter: Unconfusing Buttons
Took choice 584/4: Hidden Temple (Pikachutlotal) - Hidden City unlock
choice.php?pwd&whichchoice=584&option=4
Encounter: The Hidden Heart of the Hidden Temple
Took choice 580/1: unlock Hidden City
choice.php?pwd&whichchoice=580&option=1
Encounter: At Least It's Not Full Of Trash
Took choice 123/2: Unlock Quest Puzzle
choice.php?pwd&whichchoice=123&option=2
Encounter: Now What?
Encounter: Beginning at the Beginning of Beginning
Give me a B!

tiles.php?action=jump&whichtile=4
Give me an A!
tiles.php?action=jump&whichtile=6
Give me an N!
tiles.php?action=jump&whichtile=3
Give me an A!
tiles.php?action=jump&whichtile=5
Give me an N!
tiles.php?action=jump&whichtile=7
Give me an A!
tiles.php?action=jump&whichtile=6
Give me an S!
tiles.php?action=jump&whichtile=3
Encounter: No Visible Means of Support
What's that spell? BANANAS!
Took choice 125/3: Unlock Hidden City
choice.php?pwd&whichchoice=125&option=3

[564] The Hidden Park
Here's how I'd like it to be logged:

Code:
[561] The Hidden Temple
Encounter: Fitting In
Took choice 582/2: Hidden Heart of the Hidden Temple
choice.php?pwd&whichchoice=582&option=2
Encounter: The Hidden Heart of the Hidden Temple
You lose an effect: Stone-Faced
Took choice 580/2: choose Hidden Heart adventure
choice.php?pwd&whichchoice=580&option=2
Encounter: Unconfusing Buttons
Took choice 584/4: Hidden Temple (Pikachutlotal) - Hidden City unlock
choice.php?pwd&whichchoice=584&option=4
Encounter: The Hidden Heart of the Hidden Temple
Took choice 580/1: unlock Hidden City
choice.php?pwd&whichchoice=580&option=1

[561] The Hidden Temple
Encounter: At Least It's Not Full Of Trash
Took choice 123/2: Unlock Quest Puzzle
choice.php?pwd&whichchoice=123&option=2

[561] The Hidden Temple
Encounter: Now What?

[562] The Hidden Temple
Encounter: Beginning at the Beginning of Beginning
Give me a B!
Give me an A!
Give me an N!
Give me an A!
Give me an N!
Give me an A!
Give me an S!
What's that spell? BANANAS!

[563] The Hidden Temple
Encounter: No Visible Means of Support
Took choice 125/3: Unlock Hidden City
choice.php?pwd&whichchoice=125&option=3

[564] The Hidden Park
(Yes, I know the cheerleading is silliness. I'd still like it to log better. In fact, if you take the wrong tile, it should log that too.)
 

Veracity

Developer
Staff member
A few days ago, I saved a DEBUG log to help me figure out exactly what made KoL decide a turn had been consumed: by looking at "turnsthisrun" in charpane.php (or api.php), we can tell when it increments.

Here is take 1, where I intentionally took a bad tile, just to see what would happen.

Code:
[486] The Hidden Temple
Encounter: Fitting In

Requesting: http://www.kingdomofloathing.com/charpane.php
Retrieved: http://www.kingdomofloathing.com/charpane.php
var turnsthisrun = 485
Requesting: http://www.kingdomofloathing.com/charpane.php
Retrieved: http://www.kingdomofloathing.com/charpane.php
var turnsthisrun = 485
Requesting: http://www.kingdomofloathing.com/choice.php?pwd&whichchoice=582&option=2
Retrieved: http://www.kingdomofloathing.com/choice.php?pwd&whichchoice=582&option=2
Encounter: The Hidden Heart of the Hidden Temple
You lose an effect: Stone-Faced
---
Requesting: http://www.kingdomofloathing.com/choice.php?pwd&whichchoice=580&option=1
Retrieved: http://www.kingdomofloathing.com/choice.php?pwd&whichchoice=580&option=1
Encounter: At Least It's Not Full Of Trash
Requesting: http://www.kingdomofloathing.com/choice.php?pwd&whichchoice=123&option=2
Retrieved: http://www.kingdomofloathing.com/choice.php?pwd&whichchoice=123&option=2
Encounter: Now What?
Requesting: http://www.kingdomofloathing.com/charpane.php
Retrieved: http://www.kingdomofloathing.com/charpane.php
var turnsthisrun = 486
Processing result:  Advs Used: -1
Requesting: http://www.kingdomofloathing.com/charpane.php
Retrieved: http://www.kingdomofloathing.com/charpane.php
var turnsthisrun = 486
Requesting: http://www.kingdomofloathing.com/choice.php
Location = [tiles.php]
Requesting: http://www.kingdomofloathing.com/tiles.php
Retrieved: http://www.kingdomofloathing.com/tiles.php
Encounter: Beginning at the Beginning of Beginning
Requesting: http://www.kingdomofloathing.com/charpane.php
Retrieved: http://www.kingdomofloathing.com/charpane.php
var turnsthisrun = 486
Requesting: http://www.kingdomofloathing.com/tiles.php?action=jump&whichtile=4
Retrieved: http://www.kingdomofloathing.com/tiles.php?action=jump&whichtile=4
Requesting: http://www.kingdomofloathing.com/charpane.php
Retrieved: http://www.kingdomofloathing.com/charpane.php
var turnsthisrun = 486
Requesting: http://www.kingdomofloathing.com/tiles.php?action=jump&whichtile=2
Retrieved: http://www.kingdomofloathing.com/tiles.php?action=jump&whichtile=2
You lose 6,236 hit points
Requesting: http://www.kingdomofloathing.com/charpane.php
Retrieved: http://www.kingdomofloathing.com/charpane.php
var turnsthisrun = 487
Processing result:  Advs Used: -1
It took all my HP and dumped me out of the temple.

Here is Take 2, after I'd spend another adventure and then decided to pull another stone wool. This time, I used the Dvorak solver to do the tiles for me:

Code:
[489] The Hidden Temple
Encounter: Fitting In

Requesting: http://www.kingdomofloathing.com/charpane.php
Retrieved: http://www.kingdomofloathing.com/charpane.php
var turnsthisrun = 488
Requesting: http://www.kingdomofloathing.com/charpane.php
Retrieved: http://www.kingdomofloathing.com/charpane.php
var turnsthisrun = 488
Requesting: http://www.kingdomofloathing.com/choice.php?pwd&whichchoice=582&option=2
Retrieved: http://www.kingdomofloathing.com/choice.php?pwd&whichchoice=582&option=2
Encounter: The Hidden Heart of the Hidden Temple
You lose an effect: Stone-Faced
---
Requesting: http://www.kingdomofloathing.com/choice.php?pwd&whichchoice=580&option=1
Retrieved: http://www.kingdomofloathing.com/choice.php?pwd&whichchoice=580&option=1
Encounter: At Least It's Not Full Of Trash
Requesting: http://www.kingdomofloathing.com/choice.php?pwd&whichchoice=123&option=2
Retrieved: http://www.kingdomofloathing.com/choice.php?pwd&whichchoice=123&option=2
Encounter: Now What?
Requesting: http://www.kingdomofloathing.com/charpane.php
Retrieved: http://www.kingdomofloathing.com/charpane.php
var turnsthisrun = 489
Processing result:  Advs Used: -1
Requesting: http://www.kingdomofloathing.com/charpane.php
Retrieved: http://www.kingdomofloathing.com/charpane.php
var turnsthisrun = 489
Requesting: http://www.kingdomofloathing.com/choice.php
Retrieved: http://www.kingdomofloathing.com/choice.php
Field: Location = [tiles.php]
Requesting: http://www.kingdomofloathing.com/tiles.php
Retrieved: http://www.kingdomofloathing.com/tiles.php
Encounter: Beginning at the Beginning of Beginning
Requesting: http://www.kingdomofloathing.com/tiles.php?action=jump&whichtile=4
Retrieved: http://www.kingdomofloathing.com/tiles.php?action=jump&whichtile=4
Requesting: http://www.kingdomofloathing.com/api.php?what=status&for=KoLmafia
Retrieved: http://www.kingdomofloathing.com/api.php?what=status&for=KoLmafia
"turnsthisrun":489
Requesting: http://www.kingdomofloathing.com/tiles.php?action=jump&whichtile=6
Retrieved: http://www.kingdomofloathing.com/tiles.php?action=jump&whichtile=6
Requesting: http://www.kingdomofloathing.com/api.php?what=status&for=KoLmafia
Retrieved: http://www.kingdomofloathing.com/api.php?what=status&for=KoLmafia
"turnsthisrun":489
Requesting: http://www.kingdomofloathing.com/tiles.php?action=jump&whichtile=3
Retrieved: http://www.kingdomofloathing.com/tiles.php?action=jump&whichtile=3
Requesting: http://www.kingdomofloathing.com/api.php?what=status&for=KoLmafia
Retrieved: http://www.kingdomofloathing.com/api.php?what=status&for=KoLmafia
"turnsthisrun":489
Requesting: http://www.kingdomofloathing.com/tiles.php?action=jump&whichtile=5
Retrieved: http://www.kingdomofloathing.com/tiles.php?action=jump&whichtile=5
Requesting: http://www.kingdomofloathing.com/api.php?what=status&for=KoLmafia
Retrieved: http://www.kingdomofloathing.com/api.php?what=status&for=KoLmafia
"turnsthisrun":489
Requesting: http://www.kingdomofloathing.com/tiles.php?action=jump&whichtile=7
Retrieved: http://www.kingdomofloathing.com/tiles.php?action=jump&whichtile=7
Requesting: http://www.kingdomofloathing.com/api.php?what=status&for=KoLmafia
Retrieved: http://www.kingdomofloathing.com/api.php?what=status&for=KoLmafia
"turnsthisrun":489
Requesting: http://www.kingdomofloathing.com/tiles.php?action=jump&whichtile=6
Retrieved: http://www.kingdomofloathing.com/tiles.php?action=jump&whichtile=6
Requesting: http://www.kingdomofloathing.com/api.php?what=status&for=KoLmafia
Retrieved: http://www.kingdomofloathing.com/api.php?what=status&for=KoLmafia
"turnsthisrun":489
Requesting: http://www.kingdomofloathing.com/tiles.php?action=jump&whichtile=3
Retrieved: http://www.kingdomofloathing.com/tiles.php?action=jump&whichtile=3
Field: Location = [choice.php?forceoption=0]
Requesting: http://www.kingdomofloathing.com/choice.php?forceoption=0
Retrieved: http://www.kingdomofloathing.com/choice.php?forceoption=0
Encounter: No Visible Means of Support
Requesting: http://www.kingdomofloathing.com/api.php?what=status&for=KoLmafia
Retrieved: http://www.kingdomofloathing.com/api.php?what=status&for=KoLmafia
"turnsthisrun":490
Processing result:  Advs Used: -1
Requesting: http://www.kingdomofloathing.com/charpane.php
Retrieved: http://www.kingdomofloathing.com/charpane.php
var turnsthisrun = 490
Requesting: http://www.kingdomofloathing.com/charpane.php
Retrieved: http://www.kingdomofloathing.com/charpane.php
var turnsthisrun = 490
Requesting: http://www.kingdomofloathing.com/choice.php?pwd&whichchoice=125&option=3
Retrieved: http://www.kingdomofloathing.com/choice.php?pwd&whichchoice=125&option=3
Requesting: http://www.kingdomofloathing.com/charpane.php
Retrieved: http://www.kingdomofloathing.com/charpane.php
var turnsthisrun = 491
Processing result:  Advs Used: -1
Notice that KoL is very fond of telling the browser to request 2 charpane updates - and even a charpane update between each tile jump, even though nothing had changed there; no turn was consumed until I finished the puzzle.

The puzzle solver dutifully requested an api.php request after each jump, and then returned the final frame to the Browser, which requested a charpane refresh. We could save a bunch of server hits by not doing those api.php calls.

I'm going to have to study this to figure out which choices advance the turn counter and, therefore, how to log it.
 

Veracity

Developer
Staff member
This kind of once-per-ascension thing is a pain to test. Revision 15339 improves the logging, but still has issues.

Here is manually pressing tiles and choosing a wrong tile:

Code:
[483] The Hidden Temple
Encounter: At Least It's Not Full Of Trash
Took choice 123/2: Unlock Quest Puzzle
choice.php?pwd&whichchoice=123&option=2
Encounter: Now What?
Encounter: Beginning at the Beginning of Beginning
Give me a B!
Give me an A!
Give me an N!
Give me a D!
You lose 6,461 hit points
Oops.

That should be:

Code:
[483] The Hidden Temple
Encounter: At Least It's Not Full Of Trash
Took choice 123/2: Unlock Quest Puzzle
choice.php?pwd&whichchoice=123&option=2
Encounter: Now What?

[484] The Hidden Temple
Encounter: Beginning at the Beginning of Beginning
Give me a B!
Give me an A!
Give me an N!
Give me a D!
You lose 6,461 hit points
Oops.
And here is doing the whole thing using the "Solve" button:

Code:
[485] The Hidden Temple
Encounter: At Least It's Not Full Of Trash
Took choice 123/2: Unlock Quest Puzzle
choice.php?pwd&whichchoice=123&option=2
Encounter: Now What?
Encounter: Beginning at the Beginning of Beginning
Give me a B!
Give me an A!
Give me an N!
Give me an A!
Give me an N!
Give me an A!
Give me an S!

[486] The Hidden Temple
Encounter: No Visible Means of Support
What's that spell? BANANAS!
Took choice 125/3: Unlock Hidden City
choice.php?pwd&whichchoice=125&option=3

[488] The Hidden Park
Encounter: Where Does The Lone Ranger Take His Garbagester?
Took choice 789/2: Relocate pygmy janitors to Hidden Park
choice.php?pwd&whichchoice=789&option=2
which is better than before, but which should be:

Code:
[485] The Hidden Temple
Encounter: At Least It's Not Full Of Trash
Took choice 123/2: Unlock Quest Puzzle
choice.php?pwd&whichchoice=123&option=2
Encounter: Now What?

[486] The Hidden City
Encounter: Beginning at the Beginning of Beginning
Give me a B!
Give me an A!
Give me an N!
Give me an A!
Give me an N!
Give me an A!
Give me an S!
What's that spell? BANANAS!

[487] The Hidden Temple
Encounter: No Visible Means of Support
Took choice 125/3: Unlock Hidden City
choice.php?pwd&whichchoice=125&option=3

[488] The Hidden Park
Encounter: Where Does The Lone Ranger Take His Garbagester?
Took choice 789/2: Relocate pygmy janitors to Hidden Park
choice.php?pwd&whichchoice=789&option=2
 

Veracity

Developer
Staff member
It took lots of iterations - one per ascension - but I got it.

Code:
[468] The Hidden Temple
Encounter: Fitting In
Took choice 582/2: Hidden Heart of the Hidden Temple
choice.php?pwd&whichchoice=582&option=2
Encounter: The Hidden Heart of the Hidden Temple
You lose an effect: Stone-Faced
Took choice 580/2: choose Hidden Heart adventure
choice.php?pwd&whichchoice=580&option=2
Encounter: Unconfusing Buttons
Took choice 584/4: Hidden Temple (Pikachutlotal) - Hidden City unlock
choice.php?pwd&whichchoice=584&option=4
Encounter: The Hidden Heart of the Hidden Temple
Took choice 580/1: unlock Hidden City
choice.php?pwd&whichchoice=580&option=1

[468] The Hidden Temple
Encounter: At Least It's Not Full Of Trash
Took choice 123/2: Unlock Quest Puzzle
choice.php?pwd&whichchoice=123&option=2
Encounter: Now What?

[469] The Hidden Temple
Encounter: Beginning at the Beginning of Beginning
Give me a B!
Give me an A!
Give me an N!
Give me an A!
Give me an N!
Give me an A!
Give me an S!
What's that spell? BANANAS!

[470] The Hidden Temple
Encounter: No Visible Means of Support
Took choice 125/3: Unlock Hidden City
choice.php?pwd&whichchoice=125&option=3

[471] The Hidden Park
Encounter: boaraffe
Each time I took a choice which actually cost me a turn, it logged the next encounter with the upped turn counter.
And it logged my cheerleading cries even though I manually clicked on tiles, rather than automating it.

This is done. Finally.
 
Top