Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pause time issues when using Reset and start_auto_splitter images #195

Closed
Toufool opened this issue Jan 14, 2023 · 4 comments
Closed

Pause time issues when using Reset and start_auto_splitter images #195

Toufool opened this issue Jan 14, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@Toufool
Copy link
Owner

Toufool commented Jan 14, 2023

use these three image filenames:

reset_(0.98)_[2].png
start_auto_splitter_(0.98)_[20]
001_split_image.png

Issue repro:

  1. start auto splitter
  2. in Similarity Viewer, Reset Image does not show as paused (should pause for 2 seconds)
  3. after the 20 second pause, the Reset Image also pauses for 20 seconds

I believe this is expected behavior:

  1. start auto splitter
  2. in Similarity Viewer, Reset Image triggers a 2 second pause for itself (does not check reset image for 2 seconds) while start_auto_splitter triggers a 20 sec pause before it starts comparing 001_split_image.png.
@Toufool
Copy link
Owner Author

Toufool commented Feb 11, 2023

@Avasam when the start image threshold is met, after its done pausing, it goes right back to the start image. and when the start image threshold is met again, it does nothing.

images:
reset_(0.92).png
start_auto_splitter_(0.98)
split_image_001.png
default pause time of 10 sec

8mb.video-NSZ-vvFOAsCp.mp4

@Toufool
Copy link
Owner Author

Toufool commented Feb 19, 2023

@Avasam still some issues here. If you use the example I provided:

reset_(0.98)_[2].png
start_auto_splitter_(0.98)_[20].png

the reset image will still pause for 20 seconds. It seems like its only if the pause value for the reset image < pause valuee for the start auto splitter image. For example, if you do this instead

reset_(0.98)_[30].png
start_auto_splitter_(0.98)_[20].png

The reset image will pause for 30 seconds as expected.

@Avasam
Copy link
Collaborator

Avasam commented Feb 19, 2023

@Avasam still some issues here. If you use the example I provided:

reset_(0.98)_[2].png start_auto_splitter_(0.98)_[20].png

the reset image will still pause for 20 seconds. It seems like its only if the pause value for the reset image < pause valuee for the start auto splitter image. For example, if you do this instead

reset_(0.98)_[30].png start_auto_splitter_(0.98)_[20].png

The reset image will pause for 30 seconds as expected.

This one is working as intended, you don't want the reset image to be active immediatly after starting the autosplitter.

AutoSplit/src/AutoSplit.py

Lines 809 to 812 in eeac963

pause_times = [self.reset_image.get_pause_time(self)]
if self.start_image:
pause_times.append(self.start_image.get_pause_time(self))
paused = time() - self.run_start_time <= max(pause_times)

Pausing the comparison is used to avoid re-triggering actions too fast when the same in-game image lingers for a while.
So a pause time of 20 on start means you consider you should wait 20 seconds after starting because it's safe to compare again.
This is especially true when the reset and start images are the same! (this can happen in games when you can't reset on a game's main menu, but you want to reset your run and start a new one on "Play a new game")

If your default pause time is 10 seconds, and your start pause time is 20, you don't want the reset image to trigger midway through.


If you see a use-case where it makes sense to have the reset image active before the end of the start pause time, let me know about it and I can special-case it when it's explicitly set in the filename. (as well as document that behaviour).

@Toufool
Copy link
Owner Author

Toufool commented Feb 19, 2023

okay yea that all makes sense! Thanks for explaining. This is fixed then.

@Toufool Toufool closed this as completed Feb 19, 2023
@Avasam Avasam added bug Something isn't working and removed 2.0.0 Bug labels Apr 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants