Skip to content

Commit 1f55963

Browse files
authored
Cram-o-matic: Increase wait time between dialog checks (#1247)
* fix physical orbeetle attack debug images being saved twice * add config option for wait time between checking the receive dialog
1 parent fa7400e commit 1f55963

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

SerialPrograms/Source/PokemonSwSh/Inference/RNG/PokemonSwSh_OrbeetleAttackAnimationDetector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ OrbeetleAttackAnimationDetector::Detection OrbeetleAttackAnimationDetector::run(
8989
return Detection::SPECIAL;
9090
}
9191
if (save_screenshot){
92-
animation_image->save("orbeetle-attack-physical-" + now_to_filestring() + ".png");
92+
//animation_image->save("orbeetle-attack-physical-" + now_to_filestring() + ".png");
9393
dump_debug_image(m_stream.logger(), "rng", "orbeetle-physical", animation_image);
9494
}
9595
m_stream.log("Orbeetle Attack Animation: Physical animation detected.");

SerialPrograms/Source/PokemonSwSh/Programs/RNG/PokemonSwSh_CramomaticRNG.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,13 @@ CramomaticRNG::CramomaticRNG()
146146
LockMode::LOCK_WHILE_RUNNING,
147147
"80 ms"
148148
)
149+
, DIALOG_RELEASE_DURATION(
150+
"<b>Dialog Release Duration:</b><br>"
151+
"After releasing the button, wait this long before checking the dialog.<br>"
152+
"<font color=\"red\">For tick-imprecise controllers, this number will be increased automatically.</font>",
153+
LockMode::LOCK_WHILE_RUNNING,
154+
"1840 ms"
155+
)
149156
, SAVE_SCREENSHOTS(
150157
"<b>Save Debug Screenshots:</b>",
151158
LockMode::LOCK_WHILE_RUNNING,
@@ -174,6 +181,7 @@ CramomaticRNG::CramomaticRNG()
174181
PA_ADD_OPTION(MAX_UNKNOWN_ADVANCES);
175182
PA_ADD_OPTION(ADVANCE_PRESS_DURATION);
176183
PA_ADD_OPTION(ADVANCE_RELEASE_DURATION);
184+
PA_ADD_OPTION(DIALOG_RELEASE_DURATION);
177185
PA_ADD_OPTION(SAVE_SCREENSHOTS);
178186
PA_ADD_OPTION(LOG_VALUES);
179187
}
@@ -348,7 +356,7 @@ std::pair<bool, std::string> CramomaticRNG::receive_ball(SingleSwitchProgramEnvi
348356

349357
while (presses < 30 && !arrow_detected){
350358
presses++;
351-
pbf_press_button(context, BUTTON_B, 80ms, 1320ms);
359+
pbf_press_button(context, BUTTON_B, 80ms, DIALOG_RELEASE_DURATION);
352360
context.wait_for_all_requests();
353361

354362
VideoSnapshot screen = env.console.video().snapshot();

SerialPrograms/Source/PokemonSwSh/Programs/RNG/PokemonSwSh_CramomaticRNG.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class CramomaticRNG : public SingleSwitchProgramInstance{
6262
SimpleIntegerOption<uint16_t> MAX_UNKNOWN_ADVANCES;
6363
MillisecondsOption ADVANCE_PRESS_DURATION;
6464
MillisecondsOption ADVANCE_RELEASE_DURATION;
65+
MillisecondsOption DIALOG_RELEASE_DURATION;
6566
BooleanCheckBoxOption SAVE_SCREENSHOTS;
6667
BooleanCheckBoxOption LOG_VALUES;
6768

0 commit comments

Comments
 (0)