Giter Site home page Giter Site logo

autosplit's Introduction

LiveSplit AutoSplit CodeQL Lint and build

SemVer Ruff autopep8 Checked with pyright Checked with mypy

Easy to use image comparison based auto splitter for speedrunning on console or PC.

This program can be used to automatically start, split, and reset your preferred speedrun timer by comparing images to a capture region. This allows you to focus more on your speedrun and less on managing your timer. It also improves the accuracy of your splits. It can be used in tandem with any speedrun timer that accepts hotkeys (LiveSplit, wsplit, etc.), and can be integrated with LiveSplit.

Example

TUTORIAL

DOWNLOAD AND OPEN

Compatibility

  • Windows 10 and 11.
  • Python 3.10+ (Not required for normal use. Refer to the build instructions if you'd like run the application directly in Python).

OPTIONS

Split Image Folder

  • Supported image file types: PNG, JPEG, bitmaps, WebP, and more.
  • Images can be any size and ratio.
  • Images are matched in alphanumerical order.
  • Recommended filenaming convention: 001_SplitName.png, 002_SplitName.png, 003_SplitName.png...
  • Custom split image settings are handled in the filename. See how here.
  • To create split images, it is recommended to use AutoSplit's Take Screenshot button for accuracy. However, images can be created using any method including Print Screen and Snipping Tool.

Capture Region

  • This is the region that your split images are compared to. Usually, this is going to be the full game screen.
  • Click "Select Region".
  • Click and drag to form a rectangle over the region you want to capture.
  • Adjust the x, y, width, and height of the capture region manually to make adjustments as needed.
  • If you want to align your capture region by using a reference image, click "Align Region".
  • You can freely move the window that the program is capturing, but resizing the window will cause the capture region to change.
  • Once you are happy with your capture region, you may unselect Live Capture Region to decrease CPU usage if you wish.
  • You can save a screenshot of the capture region to your split image folder using the Take Screenshot button.

Avg. FPS

  • Calculates the average comparison rate of the capture region to split images. This value will likely be much higher than needed, so it is highly recommended to limit your FPS depending on the frame rate of the game you are capturing.

Settings

Comparison Method

  • There are three comparison methods to choose from: L2 Norm, Histograms, and Perceptual Hash (or pHash).
    • L2 Norm: This method should be fine to use for most cases. It finds the difference between each pixel, squares it, sums it over the entire image and takes the square root. This is very fast but is a problem if your image is high frequency. Any translational movement or rotation can cause similarity to be very different.
    • Histograms: An explanation on Histograms comparison can be found here. This is a great method to use if you are using several masked images.

      This algorithm is particular reliable when the colour is a strong predictor of the object identity. The histogram intersection [...] is robust to occluding objects in the foreground.

    • Perceptual Hash: An explanation on pHash comparison can be found here. It is highly recommended to NOT use pHash if you use masked images, or it'll be very inaccurate.

Capture Method

  • Windows Graphics Capture (fast, most compatible, capped at 60fps)
    Only available in Windows 10.0.17134 and up.
    Due to current technical limitations, Windows versions below 10.0.0.17763 require having at least one audio or video Capture Device connected and enabled. Allows recording UWP apps, Hardware Accelerated and Exclusive Fullscreen windows.
    Adds a yellow border on Windows 10 (not on Windows 11). Caps at around 60 FPS.
  • BitBlt (fastest, least compatible)
    The best option when compatible. But it cannot properly record OpenGL, Hardware Accelerated or Exclusive Fullscreen windows.
    The smaller the selected region, the more efficient it is.
  • Direct3D Desktop Duplication (slower, bound to display)
    Duplicates the desktop using Direct3D.
    It can record OpenGL and Hardware Accelerated windows.
    About 10-15x slower than BitBlt. Not affected by window size.
    Overlapping windows will show up and can't record across displays.
    This option may not be available for hybrid GPU laptops, see D3DDD-Note-Laptops.md for a solution.
  • Force Full Content Rendering (very slow, can affect rendering)
    Uses BitBlt behind the scene, but passes a special flag to PrintWindow to force rendering the entire desktop.
    About 10-15x slower than BitBlt based on original window size and can mess up some applications' rendering pipelines.
  • Video Capture Device Uses a Video Capture Device, like a webcam, virtual cam, or capture card.

Capture Device

Select the Video Capture Device that you wanna use if selecting the Video Capture Device Capture Method.

Show Live Similarity

  • Displays the live similarity between the capture region and the current split image. This number is between 0 and 1, with 1 being a perfect match.

Show Highest Similarity

  • Shows the highest similarity between the capture region and current split image.

Current Similarity Threshold

  • When the live similarity goes above this value, the program hits your split hotkey and moves to the next split image.

Default Similarity Threshold

  • This value will be set as the threshold for an image if there is no custom threshold set for that image.

Default Delay Time

  • Time in milliseconds that the program waits before hitting the split hotkey for that specific split if there is no custom Delay Time set for that image.

Default Pause Time

  • Time in seconds that the program stops comparison after a split if there is no custom Pause Time set for that image. Useful for if you have two of the same split images in a row and want to avoid double-splitting. Also useful for reducing CPU usage.

Dummy splits when undoing / skipping

AutoSplit will group dummy splits together with a real split when undoing/skipping. This basically allows you to tie one or more dummy splits to a real split to keep it as in sync as possible with the real splits in LiveSplit/wsplit. If they are out of sync, you can always use "Previous Image" and "Next Image".

Examples: Given these splits: 1 dummy, 2 normal, 3 dummy, 4 dummy, 5 normal, 6 normal.

In this situation you would have only 3 splits in LiveSplit/wsplit (even though there are 6 split images, only 3 are "real" splits). This basically results in 3 groups of splits: 1st split is images 1 and 2. 2nd split is images 3, 4 and 5. 3rd split is image 6.

  • If you are in the 1st or 2nd image and press the skip key, it will end up on the 3rd image
  • If you are in the 3rd, 4th or 5th image and press the undo key, it will end up on the 2nd image
  • If you are in the 3rd, 4th or 5th image and press the skip key, it will end up on the 6th image
  • If you are in the 6th image and press the undo key, it will end up on the 5th image

Loop last Split Image to first Split Image

If this option is enabled, when the last split meets the threshold and splits, AutoSplit will loop back to the first split image and continue comparisons. If this option is disabled, when the last split meets the threshold and splits, AutoSplit will stop running comparisons. This option does not loop single, specific images. See the Custom Split Image Settings section above for this feature.

Start also Resets

If this option is enabled, a "Start" command (ie: from the Start Image) will also send the "Reset" command. This is useful if you want to automatically restart your timer using the Start Image. Since AutoSplit won't be running and won't be checking for the Reset Image.

Having the reset image check be active at all time would be a better, more organic solution in the future. But that is dependent on migrating to an observer pattern (#219) and being able to reload all images.

Enable auto Reset Image

This option is mainly meant to be toggled with the Toggle auto Reset Image hotkey. You can enable it to temporarily disable the Reset Image if you make a mistake in your run that would cause the Reset Image to trigger. Like exiting back to the game's menu (aka Save&Quit).

Custom Split Image Settings

  • Each split image can have different thresholds, pause times, delay split times, loop amounts, and can be flagged.
  • These settings are handled in the image's filename.
  • Custom thresholds are place between parenthesis () in the filename. This value will override the default threshold.
  • Custom pause times are placed between square brackets [] in the filename. This value will override the default pause time.
  • Custom delay times are placed between hash signs ## in the filename. Note that these are in milliseconds. For example, a 10 second split delay would be #10000#. You cannot skip or undo splits during split delays.
  • A different comparison method can be specified with their 0-base index between carets ^^:
    • ^0^: L2 Norm
    • ^1^: Histogram
    • ^2^: Perceptual Hash
  • Image loop amounts are placed between at symbols @@ in the filename. For example, a specific image that you want to split 5 times in a row would be @5@. The current loop # is conveniently located beneath the current split image.
  • Flags are placed between curly brackets {} in the filename. Multiple flags are placed in the same set of curly brackets. Current available flags:
    • {d} dummy split image. When matched, it moves to the next image without hitting your split hotkey.
    • {b} split when similarity goes below the threshold rather than above. When a split image filename has this flag, the split image similarity will go above the threshold, do nothing, and then split the next time the similarity goes below the threshold.
    • {p} pause flag. When a split image filename has this flag, it will hit your pause hotkey rather than your split hokey.
  • Filename examples:
    • 001_SplitName_(0.9)_[10].png is a split image with a threshold of 0.9 and a pause time of 10 seconds.
    • 002_SplitName_(0.9)_[10]_{d}.png is the second split image with a threshold of 0.9, pause time of 10, and is a dummy split.
    • 003_SplitName_(0.85)_[20]_#3500#.png is the third split image with a threshold of 0.85, pause time of 20 and has a delay split time of 3.5 seconds.
    • 004_SplitName_(0.9)_[10]_#3500#_@3@_{b}.png is the fourth split image with a threshold of 0.9, pause time of 10 seconds, delay split time of 3.5 seconds, will loop 3 times, and will split when similarity is below the threshold rather than above.

Special images

How to Create a Masked Image

Masked images are very useful if only a certain part of the capture region is consistent (for example, consistent text on the screen, but the background is always different). Histogram or L2 norm comparison is recommended if you use any masked images. It is highly recommended that you do NOT use pHash comparison if you use any masked images, or it'll be very inaccurate.

The best way to create a masked image is to set your capture region as the entire game screen, take a screenshot, and use a program like paint.net to "erase" (make transparent) everything you don't want the program to compare. More on creating images with transparency using paint.net can be found in this tutorial. For visualization, here is what the capture region compared to a masked split image looks like if you would want to split on "Shine Get!" text in Super Mario Sunshine:

Mask Example

Reset Image

You can have one (and only one) image with the keyword reset in its name. AutoSplit will press the reset button when it finds this image. This image will only be used for resets and it will not be tied to any split. You can set a threshold and pause time for it. The pause time is the amount of seconds AutoSplit will wait before checking for the Reset Image once the run starts. For example: Reset_(0.95)_[10].png.

Start Image

The Start Image is similar to the Reset Image. You can only have one Start Image with the keyword start_auto_splitter.You can reload the image using the "Reload Start Image" button. The pause time is the amount of seconds AutoSplit will wait before starting comparisons of the first split image. Delay times will be used to delay starting your timer after the threshold is met.

Profiles

  • Profiles use the extension .toml. Profiles can be saved and loaded by using File -> Save Profile As... and File -> Load Profile.
  • The profile contains all of your settings, including information about the capture region.
  • You can save multiple profiles, which is useful if you speedrun multiple games.
  • If you change your display setup (like using a new monitor, or upgrading to Windows 11), you may need to readjust or reselect your Capture Region.

Timer Integration

Timer Global Hotkeys

  • Click "Set Hotkey" on each hotkey to set the hotkeys to AutoSplit. The Start / Split hotkey and Pause hotkey must be the same as the one used in your preferred timer program in order for the splitting/pausing to work properly.
  • Make sure that Global Hotkeys are enabled in your speedrun timer.
  • All of these actions can also be handled by their corresponding buttons.
  • Note that pressing your Pause Hotkey does not serve any function in AutoSplit itself and is strictly used for the Pause flag.

LiveSplit Integration

The AutoSplit LiveSplit Component will directly connect AutoSplit with LiveSplit. LiveSplit integration is only supported in AutoSplit v1.6.0 or higher. This integration will allow you to:

  • Use hotkeys directly from LiveSplit to control AutoSplit and LiveSplit together
  • Load AutoSplit and any AutoSplit profile automatically when opening a LiveSplit layout.

LiveSplit Integration Tutorial

  • Click here to download the latest component.
  • Place the .dll file into your [...]\LiveSplit\Components folder.
  • Open LiveSplit -> Right Click -> Edit Layout -> Plus Button -> Control -> AutoSplit Integration.
  • Click Layout Settings -> AutoSplit Integration
  • Click the Browse buttons to locate your AutoSplit Path (path to AutoSplit executable) and Profile Path (path to your AutoSplit .toml profile file) respectively.
    • If you have not yet set saved a profile, you can do so using AutoSplit, and then go back and set your Settings Path.
  • Once set, click OK, and then OK again to close the Layout Editor. Right click LiveSplit -> Save Layout to save your layout. AutoSplit and your selected profile will now open automatically when opening that LiveSplit Layout .lsl file.

Known Limitations

  • For many games, it will be difficult to find a split image for the last split of the run.
  • The window of the capture region cannot be minimized.

Resources

Still need help?

Contributing

See CONTRIBUTING.md for our contributing standards.
Refer to the build instructions if you're interested in building the application yourself or running it in Python.

Not a developer? You can still help through the following methods:

Credits

  • Created by Toufool and Faschz.
  • Harutaka Kawamura for the snipping tool code that I used to integrate into the autosplitter.
  • amaringos for the icon.
  • Zana_G for motivating me to start this project back up and for all of the time spent testing and suggesting improvements.
  • Avasam for their continued work on making an incredible amount of improvements and changes to AutoSplit while I have not had the time/motivation to do so.
  • KaDiWa for the LiveSplit integration.
  • Tyron18 for assisting with Windows 11 testing.

Donate

If you enjoy using the program, please consider donating. Thank you!

paypal

autosplit's People

Contributors

avasam avatar faschz avatar gikkman avatar kadiwa4 avatar moliman avatar ontwikseltsaar avatar pre-commit-ci[bot] avatar tischel avatar toufool avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autosplit's Issues

Specify naming convention for image files

Image files do not accept certain characters, which is not much of an issue but would be nice if a warning is set so the user can be aware.

I had a file name with an umlaut ("23 Brachsenbrüke") and when trying to start the split I had an error saying "All files in split image folder must be valid image files" which was a bit confusing since they all were.

Optimization of current norm metric

Hey guys, I was curious about the convention you use for image check, and if I'm not mistaken, the relevant code is:

error = cv2.norm(split_image, sct_img, cv2.NORM_L2)
max_error = 255 * 255
for dimension in split_image.shape:
max_error *= dimension
max_error = max_error ** 0.5
similarity = 1 - (error / max_error)

I'm not sure if you realise, but most this can be summarised much more succinctly as

error = cv2.norm(split_image, sct_img, cv2.NORM_L2)
max_error = (split_image.size ** 0.5) * 255
similarity = 1 - (error / max_error)

as .size computes the product of the individual components of .shape and the second optimization is that the square root of 255*255 is 255, no need to reassign it every time. Hopefully this shaves off a few cycles :-P

Sorry for not doing a branch/pull request, it didn't seem worth it for a one-line change.

Cheers,
crazyjesse

Cross platform?

Will this tool work cross platform? looking at the code it seems to import windows only libraries such as win32gui.

Seeing as python is cross platform, could instead cross platform libraries be used to allow the tool to run on Linux and Mac too?

Feature request: Custom delay for each split key press

For some games its hard to find an image that works for every split (for example fadeouts).
Having the ability to use delays before each split key press would give users more flexibility. That way they could set up a good image 5 seconds before the fadeout (for example), and set the delay to 5 seconds on the split.
It could probably work the same way as custom thresholds or pause times in the split filenames.

Right now I'm planning on using a custom Autohoykey script to setup something like this, but It'd be great to have it as a feature in the actual tool.

Pause Time can only be integers

While testing I found that if I were to be exaggerated with the number of splits, if I put the Pause Time to two seconds it'll split twice during fade out but if I put it to three second it would split late for the next split.

While not necessarily an issue if you were doing normal splits that splits at a normal point, it would still be good if the Pause Time can be either counted in frames instead of seconds or allow you to use fractions such as 2.3 seconds !

Autosplit launches without saved settings when launched via Windows search

On Windows 10, when I open the program by pressing the Windows key and typing "autosplit", then selecting it to run, it opens without any of its saved settings.
image

I've checked that this is not a different instance of the executable. When I navigate to the exe file via Windows explorer and double click it, it opens with its saved settings as expected.
image

Option for different comparison methods per split

Would this be possible to add different comparison methods per split? As you point out in the readme, pHash is not great at detecting masked images. However, I find it much better for some splits where Histogram will give a 0.97 confidence on a false positive and pHash will give a more conservative 0.70.

Another question, would it be possible for it to tell the difference between two splits such as splitting on a HUD element disappearing rather than it appearing?

Numpad number key with numlock on as split hotkey does not split

For example: setting the Start / Split key to numpad0 will set it to 0 instead. When a match occurs, it will hit 0 instead of numpad0. The current workaround for this is to turn numlock off when setting your Start / Split hotkey for both AutoSplit and your preferred speedrun timer.

Save Selected Region Settings

Some of the screenshots I have set up are relatively specific and thus require the selected region capture to be in the exact same location. However, currently closing AutoSplit resets the region capture. Setting this up every time I open the program is fine, but it would be neat to be able to save region capture settings and perhaps set up different profiles for different games. Thanks for the hard work, loving this so far!

Load Time Remover

Hello, I've just tried out this tool for Mario Kart 8 Deluxe and it's working really well for splitting at the loading screen. However, I was wondering if there could be a feature in this tool to automatically pause whenever the loading screen shows. Loading times vary a lot in this game (especially between a Digital and Cartridge version), so it would be a lot more useful than automatically splitting.

Pause time does not apply to first split

The first split image I have is a full black screen, but right after the run starts there is also a black screen. This would be ignored if pause time applied to the first split but it doesn't seem to, so it autosplits a second after my run starts and I have to use undo split to line it back up.

Option to log live similarity [Feature Request]

Will be setting this up with every speedgame I run!

Would be awesome to be able to log the live similarity with a timestamp to test a set of images with a run without monitoring it during the run.

I was thinking about having the run play at x2 speed but unsure if this would create issues or not. I plan on sharing the image sets of the runs on sr.com after creating the sets so it would be great if it could automate the testing while I'm away.

Not Loading Pictures + Can't Resize Main Window

Hello,

I've got two issues, the first more important than the second.

image

image

Even though there are images in the folder, no picture is pulled up in the "Current Split Image", so nothing get can be compared against.

Additionally, I can't seem to resize the window, so it makes modifying some of these options rather awkward.

Finally, is it possible to have a "start" image as well as a "loop" image? Or is it tied to just having only "loop"?

Thank you.

Feature Request: Multiple possible images for 1 split

For some games, a cutscene one might split on may have a discrete number of variations (e.g. day and night). In these cases, it would be nice if AutoSplit could compare against multiple images at a time, and split if any of them were above the similarity threshold.

Because AutoSplit currently only cares about lexical order for deciding which images go with which splits, some way of linking images in file name would be needed, at least as a temporary solution. I suggest adding an "option" flag {o}, with flagged images being paired based on the first number in the filename, or something like that. E.g. 001a {o} Enter Area Day would be paired with 001b {o} Enter Area Night. Neither would be paired with 001c Leave Area because it isn't tagged {o}, or with 002a {o} Enter Dungeon 1 Day because it doesn't contain 001.

Splits aren't saving in LiveSplit

I am using AutoSplit with LiveSplit (no modifications) and Catastrophe Crow 64. The autosplitting is working fine - however, my splits are not saving. Not sure if this is a LiveSplit problem or an AutoSplit problem but I tried manually splitting with my keybinds and they saved just fine.
image
image

Feature Request: Loop Parameter

While nearly all of my split images are the same, I have a couple that are different which makes me unable to use the loop split images feature. I think this feature could be improved if looping was a parameter set in the filename (ex: 001_SplitImage|43| . this would make this split image loop 43 times before moving on to the next image in the folder.)

Can't set hotkeys as combos / with modifiers

If one of my global hotkeys in LiveSplit is, say, alt+q, I'm unable to select this as my hotkey in AutoSplit. If I attempt to input this combo into AutoSplit (or any other key-modifier combo, like shift+w or ctrl+e), the field remains unchanged (or blank if I haven't set that hotkey in autosplit yet).

I would prefer to use modifier combos in LiveSplit to reduce the chances of accidentally performing actions when I am, say, typing in chat or making notes.

This issue may be related to another currently open issue (#30), but I believe it is slightly different. I want to specifically use modifier combos in my hotkeys. This issue has to do with manually-pressed modifiers affecting recognition by LiveSplit.

Using the program with different window sizes

Hello,

I struggled a lot to crop out my region exactly and the problem that results in this, is that it can often come to a slightly different selected region which results into the autosplitter not working accurate.
A way to make the program run in a bigger window or to make the crop tool much bigger to get more precison in cropping the region would be really helpful.

Feature Request: Allow an image to become active when similarity is met and split when no longer similarity is met

So I was struggling while trying to get a final split picture in Sly 4 Episode 5 last night. The only thing that is consistent in that frame is the health bar of the boss. However, her health never goes to zero it stays at 1 hit off and then upon last hit the health bar dissapears immediately. I can easily get a picture that gets similarity with her health bar at 1 hp but there is no way to get similarity on the frame she dies with current options. So I was thinking if you could make an option so that the image could be selected upon similarity being hit and then upon there being no more similarity anymore, that's when it splits? That way it would actually be possible to get a split picture there since it could split upon health bar dissapearing

Same split image for every split. Region saving.

I love this idea!

Issue 1: It would be nice if there was an option to split indefinitely any time any single image is spotted in the region. With my game as it is, I have the same autosplit image for all my splits. Not a huge issue but a nice optimisation.

Issue 2: When I close and reopen autosplitter, it save the dimensions and I assume position of the region in OBS, but it does not exactly save the region fully. Every time I close autosplitter, I am to select the region every time.

The second issue is clearly more important, but I can think of a few games that have exactly the same save screen and therefore some sort of indefinite split option for a single image would be nice too.

Feature request: Option to split below a certain threshold

Hey love your software. We were hoping to use it as a load remover as well, and it certainly has the ability to fire a "pause the timer" hotkey when, say, some region of the screen goes full black, but we would also need the option to send the "unpause the timer" hotkey when "this region is NOT full black" is true following the previous positive comparison. So really all I'm asking for is to have the option of firing a hotkey when the similarity is BELOW some threshold, not just above.

Feature Request - Pause Timer on Split

Games like Sonic the Hedgehog have score counters that are removed for IGT. Is there a way a pause feature could be added?

Using sonic as an example, have a frame where you hit the sign that would pause the timer, then upon the next start frame, resumes timer.

Python to exe

Sorry for leaving an issue for this but I'm interested about how you convert your python source code into a lightweight .exe ?
Thanks a lot.

Feature Request: Retroactive Split (i.e. Negative Delay)

In some cases, it might be desirable to be able to split a fixed time before a good, consistent image or UI element is displayed on the screen.

For example, in Mario Kart 8 (at least as it was described to me; I don't actually run the game myself), standard IL timing involves stopping/pausing the timer as soon as the finish line is crossed, but there is no clear visual indicator this has happened until a few seconds later when the results screen appears. Because the display can vary greatly at the moment the finish line is crossed, there is no way to provide a consistent image to split at this moment or earlier.

Ideally, AutoSplit would be given a masked image of the "FINISH" text that appears on text later, or of the race results UI, then recognize that image, then split a fixed amount of time in the past, at the moment when the finish line was actually crossed.

In general, this feature could be used any time a split (especially the final split of a run) has no good images until after that split should be made.

Unfortunately, as far as I can tell, LiveSplit does not support retroactive splits or negative delay, and you can only really perform this sort of logic by editing the splits later. That said, maybe you can see a more reasonable way to achieve this. Perhaps this could be done through a LiveSplit component, which might also be a good way to remove the need for Auto-Split to use global hotkeys.

If no such thing can be done, then that's okay. This feature can be manually replicated by letting auto-split work when it works, then manually subtracting a fixed delay from the split files.

Fix tab order in interface

When filling out multiple fields at a time (e.g. the X, Y, Width, and Height fields for a particular source from a note that I have), it's helpful to quickly move between fields by pressing Tab.

In AutoSplit, this is difficult because the tab-order of interface elements defies what one visually expects. This is the actual order:

Split Image Folder text field (Not normally selectable)
Live Capture Region checkbox
Similarity Threshold number field
Show live similarity checkbox
Show highest similarity checkbox
Start / Split text field (Not normally selectable)
Undo Split text field (ibid)
Skip Split
Reset
Width
Height
FPS Limit
X
Y
Comparison Method selector
Pause time number field
Custom pause times checkbox
Custom thresholds checkbox

Notably, all the buttons in the interface (e.g. Select Region, Align Region, Browse, Take Screenshot) can't be accessed via tab navigation.

Here's a visual explanation:
Tab order

Skipping and undoing splits when using dummy splits causes a desync

If my next split image is a dummy split, and it's followed by the real image for that split, and I press the "skip split" hotkey, LiveSplit will move onto the next real split, but AutoSplit will move onto the next image, even though it's the "real image" for the split I just skipped. This causes LiveSplit and AutoSplit to become desynced. This can happen whenever dummy images are used, regardless of the number. This can also happen with dummy splits.

This can be worked around by using the "skip split" button in AutoSplit, which doesn't affect LiveSplit. This could be an issue during runs however, and makes the process of troubleshooting false splits via video more frustrating.

Using L2 Norm and a Masked image with complete transparency error's out

calculating the error in L2 Norm gives an error of 0 when using a masked image with complete transparency which, when returning 1 - (error / max_error) in this function throws a ZeroDivisionError and AutoSplit won't reset properly after throwing the error. I'm honestly going to ignore this for now because I don't see a situation where comparing an image with complete transparency would be useful, and you can still use the other comparison methods if it's really needed.

Splitting when holding shift

I've read that it was a known issue that holding shift, ctrl or alt prevent LiveSplit & WSplit from registering the splitkey correctly.

However, my speedgame implies having to hold shift at some point where a split will occur.

Which is why I'm asking, do you think this issue is likely to get a fix someday? Or is it an issue related to LiveSplit limitations?

If it's actually possible I could help doing so

Different metrics for image similarity

Hi!

First of all - nice job with the autosplitter, I haven't tested it much, but for many images it seems to work pretty well.

A problem with computing an image similarity using the L2 norm between images is that it's very sensitive to geometric transformations (rotation, translation...) since it simply compares pixel-wise, without taking larger contexts into account (i.e. moving an image just by a few pixels can result in a similarity result that's completely wrong, given enough high-frequency content in the compared images). Additionally, it is also very sensitive to global lighting changes, such as additive noise or a simple shift in mean color, which is very common for different setups due to e.g. different capture cards.

As an example, if you wanted to measure similarity to the loading screen images of the Crash N. Sane Trilogy, which consists of mostly black pixels, you would have an issue there, as you can't distinguish reliably between transitions (black screens) and the loading screen. If you restrict your capture region to just the "LOADING" part, the L2 norm will have issues due to it not being aligned perfectly, in addition to the "LOADING" text being animated as well.

I recommend to include multiple different similarity metrics, which users can choose from, to select the one that's the most stable and provides the least amount of false positives.
This stackoverflow answer provides a nice summary of metrics:
https://stackoverflow.com/a/11541587

For the Crash N. Sane Trilogy load remover, I compared histograms of patches to detect the load screens of the game (without detecting black screens), which worked very well. Template matching and/or feature matching might also work fine, but they might not work in real-time.

Maybe even a combination of multiple metrics could be nice, if the performance would still be reasonable. Ideally, a community would just provide a folder of images for their game, which can then be used by everyone, with the tool being robust enough against small differences in capture setup/capture region.

If you're not that familiar with that stuff about the similarity metrics, I can also play around with that and send you a pull request.

LiveSplit won't detect hotkey activation if not focused

Testing it in Dying Light, if the game is focused when Auto Split activates a split, LiveSplit does not accept it as input. Global Hot Keys is enabled in LiveSplit and the input works fine when pressed physically it just won't receive Auto Split's input unless it is focused. (I have tried multiple different hot keys)

Feature Request: Make custom thresholds optional

Currently, as stated in the readme "All images must have a custom threshold if the box is checked."

I would prefer if custom thresholds were not required on all images, as there are only a couple splits for which I find the default threshold (0.9) doesn't work well. I could batch rename my files, but I would prefer if this weren't necessary.

undoing a split during the cooldown throws screenshots off by one

the fadeout entering a boss room was too similar (compared to fadeout after beating said boss) and hit the split, so i pressed the undo split key, which undid the split in livesplit but not autosplit, making livesplit be on split n, but autosplit images be on n+1. I just now realize I could wait for the cooldown to be over before undoing the split as a workaround. So I think undo split (and probably skip split) should override+reset the cooldown.

Capture card as input

Sorry if issues are not the place for requests, but I was wondering if it would be possible to get the live capture region directly from a capture card for console games.

It would make for more accurate similarities, wouldn't depend on the size of the game or OBS, and overlays also wouldn't have to require nothing on top of the game.

Also I don't know if this is something I'm doing wrong, but when I try to select a live region on Streamlabs OBS all I get is a black screen but it does work when using OBS Studio, that would also not be a problem with capture card input.

No Images Appear When Selecting A Split Image Folder

Hey, Im really bad with computers, so its a big possibility im just not understanding something, but when I look for my split image on the autosplitter, i cant find it, and cant find any images at all, just a bunch of empty folders. Sorry if theres a really obvious solution

Feature Request: Split based on sound

Simply, instead of splitting based on the captured image, it might be beneficial to split when the game plays a certain sound effect. OBS supports monitoring the audio of individual sources (i.e. replaying the captured sound to the desktop), so a sound-based auto-splitter could simply listen to desktop audio. It would of course be disrupted if the user was, say, playing background music, but wouldn't be disrupted by a mic, since one would set OBS to only replay the game sound, and not the mic sound.

Sound effects can last much longer than images, so it might be beneficial to have the option to split when the first n milliseconds of a sound file match, rather than waiting until the whole sound is heard. This could also be achieved by the user just cutting the sound files themselves, though.

Splits do not work with some keys

split setup

I tried my normal setup and it did not work... When I changed the splitkey to a character (in my case: q) it worked. Maybe you can add this somewhere :)

Feature request: split delay

This is a simple feature request that is probably easy to implement.
Now that custom image settings are a thing, a very useful feature would be a parameter for delay.
That way you could customize the autosplitter to work with existing splits, e.g. ones that have utilized audio cues thus far.
A possible format could be: 001_SplitName_(0.9)_[10]_{2.2}.png (split image with a threshold of 0.9, a pause time of 10 seconds and a split delay of 2.2 seconds after the match).

Keep running when reset

I have a configuration for a short speedrun where resets are common that almost works well but having the ability to keep autosplit running when it is reset would make it even better. I will try to explain the situation so the feature request is understood.

I use autosplit to start the timer as well as to do splits, because there is a consistent image shown at a consistent time before timing starts. This is set image 001_start#2550#.png for example. I want to also have a reset(0.90).png file which detects when I reset the game. Unfortunately, the image I want using for this is the opening title screen of the game. This means I cannot start the comparisons running because it immediately detects the reset and stops it.

What would be ideal is if there was a way for autosplit to know that I was using it to start the timer and only check for resets when the timer is in the "running" state instead of the "waiting to start" state. Then timing could be fully automated.

Window is tiny

For me, the window is tiny. Probably because I have a 4k Screen. So I go to drag the window bigger, but I cannot :( However, this is useable, just really annoying.
image

Feature Request: Allow the split images to loop until manually stopping the Auto Splitter

Currently, I'm trying to use Auto Split to automatically remove load times by hitting the pause button when it sees a loading screen then hitting it again when it sees the loaded game again. This means I'm only using 2 total split images, and I'd like for the program to be able to loop between them automatically so I don't have to copy and paste them 100 times and number them.

Allow selecting the captured window without changing the region

Currently, if you want to change what window is captured (e.g. if you've accidentally opened AutoSplit before the program you want to capture), you have to use the "Select Region" button. If you then click the window you want to capture, you'll get a "Width and height cannot be 0." error. If you click and drag across that window, you'll correctly select it, but you will also modify the captured region's position and dimensions.

Currently, my workaround is to have a text file which contains the x, y, width, and height values for my current recording setup. Whenever I open AutoSplit this way, I have to select the window again, then manually re-enter those dimensions by reading from the text file. This is tedious and unnecessary.

Restarting AutoSplit with the desired program open does not solve the issue. Once AutoSplit fails to find the window even once, it must be manually reselected as described above.

My preferred solution would be a to add a selector dropdown to the menu which matches the title of the window to be captured, similar to how 'Window Capture" works in OBS.

Take Screenshot creates image with wrong resolution

When taking a screenshot of OBS' Windowed Projector, the dimensions of the image are incorrect (472 x 239 instead of 480 x 270).

Upon loading the settings file and selecting the Windowed Projector window, it seems the parameters of rect are
bottom: 270
left: 8
right: 480
top: 31
And after I readjust the X and Y values using the arrows in the spin box (8 to 7 to 8, 31 to 30 to 31):
bottom: 301
left: 8
right: 488
top: 31

Reproduced as follows with the attached settings file:

  1. Load settings.
  2. Select window (Windowed Projector (Source) - Game).
  3. Take Screenshot (472 x 239).
  4. Use the arrows in the spin box to adjust X to 7 and back again to 8, and Y to 30 and back again to 31.
  5. Take Screenshot (480 x 270).

settings.zip

Different similarity per split image

Great job on the tool, I love it!

The biggest improvement for me would definitely be being able to select a specific similarity per split image. I know this is in the 'known limitations', but I wanted to make an issue for it to be sure. In the game I play (Ocarina of Time), many cutscenes aren't pre-rendered and might be slightly different everytime. For those I'd have to put a lower similarity than more stable cues like a white fade.

Thanks for the good work!

Wrong custom checkbox is saved upon shutdown

If "Custom thresholds" is checked when AutoSplit is shutdown, it opens with "Custom pause times" checked. Conversely, if "Custom pause times" is checked when AutoSplit is shutdown, it opens with "Custom thresholds" checked.

If both are checked, they'll both be checked on restart, and if both are unchecked, they'll both be unchecked on restart.

Giving the code a quick browse, I think I found the error, and it resides here and here - namely, the reverse ordering of self.custom_pause_times_setting and self.custom_thresholds_setting in the save and load arrays.

Cheers!

Can't select region on a third monitor

I just started checking the tool and I have 3 monitors on this setup: 3 - 1 - 2. I can only select region on the first and second monitor (so center and right side) but not on the left side.

For now I'll just switch OBS to the second monitor but it'd be ideal if I could put the window where it is now.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.