How does AutoSplitters work?
3 years ago
North Carolina, USA

I've always been curious, exactly how does your livesplit know when to do a split with the AutoSplitter thing? Does it know where you are in the game? How does it work? Also how do you make an AutoSplitter?

Israel

This is the documentation of the Livesplit Autosplitter: https://github.com/LiveSplit/LiveSplit.AutoSplitters/blob/master/README.md

For the basics, the autosplitter can read values from the RAM. So by finding the right memory addresses you can know if a new game was started, where you are in the game, is the game currently in a load screen, how many collectibles do you have, etc. The autosplitter features an automatic split, start or reset for the Livesplit timer. Also it can track in-game time, which is mostly used to track time without loads.

To make an autosplitter you need to write an ASL script (Auto Splitting Language). You can add this script to your Livesplit layout settings and it will work immediately. To make an "automatic" autosplitter for your game (where Livesplit detects the script automatically), you need to fork the working branch of the project on GitHub, and add your game script to the Xml file of all games, and it will be added when the changes are approved.

There is also a list of all the current ASL scripts for games: https://fatalis.pw/livesplit/asl-list/ You can learn by looking at what others wrote in the scripts for their game. If you see a file with complexity 1 and 6 lines of code, you know they only implemented a load-removal and nothing else.

Gaming_64 and werdwerdus like this
North Carolina, USA

@Oreo321 i really appreciate all the info, but gosh i really don't know what all that is. Like "working branch, memory address, ASL" i honestly don't understand any of that

Israel

Working Branch - This is a term which is relevant to GitHub, or working on any project with Git in general. Since you are focused on the autosplitter aspects, you can ignore that part.

ASL (short for Auto Splitting Language) - this is the programming language which you write the scripts for the autosplitter. The page I linked earlier has documentation for the autosplitter, the language, etc.

Memory address - What I said was the basics. Every game must handle data in the memory to be able to know the current state of the game. You can read memory values to gain access to the game's data. If you ask HOW do you know where to read the relevant memory values from, I'm not sure either; I was never really focused on writing a script myself.

Edit: from the Livesplit FAQ page, if you want better help, there is the Speedrun Tool Development Discord Server

Edited by the author 3 years ago
Gaming_64 and werdwerdus like this
New York, USA

There's also autosplitters that work just by watching the game window and splitting (or sometimes pausing) whenever it matches a stored image (and unpausing on another image if relevent). I think that the SM64 autosplitters work by counting the number of black screens and splitting on specific ones.

werdwerdus and Symystery like this
Australia

I'm in awe of this thread <3

franxufl, SioN, and Merl_ like this