Bug - Waiting for Info _universeCalculated not incremented

ckb

Minion
Staff member
If you Calculate the Universe with numberology 51 to fight War Frat 151st Infantryman with a Saber and Use the Force, then the "fight" never actually happens. I believe Mafia increments "_universeCalculated" only after the fight, but because the fight never happens, I don't think it is incremented correctly.

My scripts have been aborting with "You already Calculated the Universe today" and I believe this is why.
 
I'm not sure if saber is the cause, I thought I noticed something similar during my KoE runs.
And I think timespinning for a fight has the same tracking problem.
 

ckb

Minion
Staff member
FWIW, This was all done in KOE runs, both during and after the season.
 

Veracity

Developer
Staff member
The only place that _universeCalculated is incremented is in the response to a choice. ChoiceManager.postChoice2:

Code:
		case 1103:
			// Doing the Maths
			if ( !text.contains( "Try again" ) )
			{
				Preferences.increment( "_universeCalculated" );
			}
			break;
I assume the choice redirects to a fight without an intermediate page announcing it is doing so? (Genie wishes give you an intermediate page with a "Fight" link).
Does time spinning a monster also do that?
 
Numberology and timespinner both lead you directly into the fight (as does rain man, though that's probably not relevant).
The strange thing is that this used to work, I'll can see if my timespun drunk pygmy session logs can narrow down when it stopped working.

Code:
> debug on

> numberology 51

numberology 51
Preference lastEncounter changed from Choose a Soundtrack to War Frat 151st Infantryman
Encounter: War Frat 151st Infantryman
Preference _lastCombatStarted changed from 20191211211400 to 20191211211440
Round 0: the dictator wins initiative!
Round 1: You lose 1 hit point

> debug off
 

Attachments

  • DEBUG_20191211.txt
    44.3 KB · Views: 19
Last edited:
Apparently the change happened from the 20th to the 21th of september. The time-spinner tracking has built-in error correction, which is why it took me a while to notice (no obvious aborts or anything). But in hindsight it's noticeable when the tracking timing shifted (from increment on start of fight to increment the next time you see the choice adventure).

Checking my update logs, that puts the change between r19551 and r19556 so I'm gonna guess it's "If you redirect to a fight you are no longer in a choice" from r19554.

the_dictator_20190920.txt
Code:
[10629] Time-Spinner
Took choice 1195/1: (secret choice)
choice.php?whichchoice=1195&option=1&pwd
Preference lastEncounter changed from Midnight in the Civic Center to Travel to a Recent Fight
Encounter: Travel to a Recent Fight
Took choice 1196/1: Spin and Fight!
choice.php?option=1&pwd&whichchoice=1196&option=1&monid=1431

[10629] A Recent Fight
Preference lastEncounter changed from Travel to a Recent Fight to drunk pygmy
Encounter: drunk pygmy
Preference _timeSpinnerMinutesUsed changed from 0 to 3
Preference _lastCombatStarted changed from 20190920171006 to 20190920171027
Round 0: the dictator wins initiative!

Versus the_dictator_20190921.txt:
Code:
[11325] Time-Spinner
Took choice 1195/1: (secret choice)
choice.php?whichchoice=1195&option=1&pwd
Preference lastEncounter changed from Midnight in the Civic Center to Travel to a Recent Fight
Encounter: Travel to a Recent Fight
Took choice 1196/1: Spin and Fight!
choice.php?option=1&pwd&whichchoice=1196&option=1&monid=1431

[11325] A Recent Fight
...

[11325] Time-Spinner
Preference _timeSpinnerMinutesUsed changed from 0 to 3
Took choice 1195/1: (secret choice)
choice.php?whichchoice=1195&option=1&pwd
Preference lastEncounter changed from Using the Force to Travel to a Recent Fight
Encounter: Travel to a Recent Fight
Took choice 1196/1: Spin and Fight!
choice.php?option=1&pwd&whichchoice=1196&option=1&monid=1431

[11325] A Recent Fight
Preference lastEncounter changed from Travel to a Recent Fight to drunk pygmy
Encounter: drunk pygmy
Preference _lastCombatStarted changed from 20190921150844 to 20190921150921
Round 0: the dictator wins initiative!

....

use 1 Time-Spinner

[11325] Time-Spinner
Preference _timeSpinnerMinutesUsed changed from 3 to 6
Took choice 1195/1: (secret choice)
choice.php?whichchoice=1195&option=1&pwd
Preference lastEncounter changed from drunk pygmy to Travel to a Recent Fight
Encounter: Travel to a Recent Fight
Took choice 1196/1: Spin and Fight!
choice.php?option=1&pwd&whichchoice=1196&option=1&monid=1431

[11325] A Recent Fight
Preference lastEncounter changed from Travel to a Recent Fight to drunk pygmy
Encounter: drunk pygmy
Preference _lastCombatStarted changed from 20190921150921 to 20190921150930
Round 0: the dictator wins initiative!
 
Last edited:

Veracity

Developer
Staff member
I bet I did this by adding the following to ChoiceManager.handleWalkingAway:

Code:
		// If taking a choice redirects to a fight, we are no longer in a choice
		if ( redirectLocation.startsWith( "fight.php" ) )
		{
			ChoiceManager.handlingChoice = false;
			return;
		}
I don't recall doing it, but it probably seemed like a good idea. Doing that would make postChoice2 NOT be called if we are looking at a fight.
 

Veracity

Developer
Staff member
Ha

Code:
 r19554 | veracity0 | 2019-09-20 10:56:23 -0400 (Fri, 20 Sep 2019) | 5 lines

If you log in during a multifight, wait until all fights are finished before completing login.
Fix NPE if there is no decorated response for a fight or choice available in relay browser
Do not double decorate the response if taking a choice leads to another choice
[b]If you redirect to a fight you are no longer in a choice[/b]
I'll undo that. I wonder what I was fixing?
 

Veracity

Developer
Staff member
I am sure it had to do with saving ChoiceManager.lastResponseText and ChoiceManager.lastDecoratedResponseText - which, presumably, shoyld not be saved unless we were really processing the result of choice.php.

Revision 19636 will let postChoice1 and postChoice2 execute in response to a fight that was redirected from a choice, but will not save the responsetext
 
My 51 frat warrior from numberology did get counted. But I also had a marmot clover slip through the clover protection, because it dropped during a god lobster fight and couldn't be disassembled immediately (because of the follow-on choice adventure).
 

Veracity

Developer
Staff member
Yeah, I’ve seen that. Without rewriting clover protection, that’s just the way it works.
 
Top