Speedrunning

From Cassette Beasts
Revision as of 21:49, 19 April 2023 by Tomc (talk | contribs)

This page describes how to use various features in Cassette Beasts that may be of interest to the speedrunning community.

In-Game Timer

On all platforms, Cassette Beasts features an in-game timer that can be enabled from the settings menu: Gameplay > Speedrun Timer.

Speedrun timer.png

The timer counts from the start of your playthrough to the end and persists between sessions. So if you save and quit, and later come back, it continues from where it left off. It will also helpfully display the message "(Cheated)" on your screen if it detects that you've enabled the cheat command console at any time during your playthrough.

The in-game timer will automatically pause on loading screens and during character customisation.

While the in-game timer is enabled, you can hold the middle mouse button (or Y on an Xbox controller / X on a Nintendo controller) to speed up dialogue, and automatically select the first dialogue option.

Seeding, Randomisation, and Permadeath

Once you've beaten the game, Cassette Beasts unlocks a number of options that can be used to customise subsequent playthroughs.

Of most interest to speedrunners will be the Random Seed option here, which will ensure chests and scripted battles reward you with the same items other players on the same seed get.

Custom modes.png

While we recommend that speedrunners familiarise themselves with the game with a normal playthrough first, these options can be unlocked with a cheat code--handy if you're playing the game on a different machine.

LiveSplit Integration

LiveSplit is a popular timer program used by speedrunners, available for Windows. A major feature of LiveSplit is the ability to use 'splits', which separately records time for different sections of a game. For example, speedrunners can split each time they complete a level in a level-based game, and then see how they fared in each level separately, compared with past playthroughs.

Various plugins for LiveSplit have been developed that can peek into the memory of a game and automatically split when things happen in the game. These plugins are useful because they allow the speedrunner to focus entirely on the game - they no longer need to worry about remembering to use key combinations to split manually.

Cassette Beasts has LiveSplit integration built in. No custom plugins or mods are necessary, and splits can be triggered by the game completely automatically. It's flexible, and fully configurable through an INI file. Almost anything you do in the game can be used to trigger a split if you want it to.

Prerequisites

  1. LiveSplit (available only for Windows).
  2. The LiveSplit Server component.
  3. Own Cassette Beasts on either Steam or the Microsoft Store.

Setup

To get LiveSplit ready you'll need to add some splits, and set up a layout that includes the LiveSplit Server component.

  1. We'll just add one split for this example (you can add more later). Right click the LiveSplit window > Edit Splits... Then under Segment Name enter the text "Credits" and click OK.
  2. To enable the LiveSplit Server component, add it to your layout: right click the LiveSplit window > Edit Layout... > Click the + button > Control > LiveSplit Server, then click OK.

Next you can start to configure the game. Create a text file called autosplit.cfg in this location: C:\Users\<username>\AppData\Roaming\CassetteBeasts\

In autosplit.cfg add the following text:

[client]
server_host="127.0.0.1"
server_port=16834

[options]
pause_while_loading=true
pause_for_character_creation=true

[splits]
story_starting=1
story_ending=1

Connecting LiveSplit and Cassette Beasts

With both LiveSplit and Cassette Beasts configured you can now start to test their connection. While LiveSplit is running, right click the window > Control > Start Server. Then start Cassette Beasts.

As it starts up, Cassette Beasts will attempt a TCP connection with the LiveSplit server using the host and port configuration set in its autosplit.cfg file. After a few seconds it'll display a message across the top of the screen to tell you if the connection was successful or not.

If connection was unsuccessful, you can hold Ctrl and type livesplit to reload autosplit.cfg and attempt connection again.

Configuration

Let's take a look at some of the settings in the autosplit.cfg file:

[client]
server_host="127.0.0.1"
server_port=16834

These settings tell Cassette Beasts how to connect to the LiveSplit Server. The values here assume LiveSplit is running on the same machine as Cassette Beasts, and that the server is using its default port number. If you're running LiveSplit on a different computer you'll want to change these values.

[options]
pause_while_loading=true
pause_for_character_creation=true

As mentioned earlier, the in-game timer pauses for loading screens and character creation. In autosplit.cfg you can decide whether you want the game to send pause commands to LiveSplit for loading screens and character creation. These settings also affect the in-game timer.

[splits]
story_starting=1
story_ending=1

This section is the most important part. It's here that you define the conditions that trigger a split.

The first condition in the list - story_starting=1, which is met when you start a new run - is what's used to start the timer running.

The second (and further) conditions cause split commands to be sent to LiveSplit when met.

So the example here is extremely simple: the timer starts when you begin a new playthrough, and a split command is sent when story_ending=1 happens, which is when you enter the final input that locks you into the credits. Since it's the last split of the list, LiveSplit will stop the timer and mark your run finished.

You can insert as many conditions you like into this list, and they don't have to start and end with story_starting=1 and story_ending=1. However, you must make sure to add the same splits, in the same order, to LiveSplit, so that the game and LiveSplit are in sync.

Each condition takes the format STAT_NAME=THRESHOLD or STAT_NAME:STAT_KEY=THRESHOLD. Cassette Beasts tracks a huge number of stats about your playthrough in your save file, which we use to unlock achievements when their conditions are met. LiveSplit integration also uses these stats - split commands are sent when a stat's value meets or exceeds the configured threshold.

The full list of available stats contains spoilers and won't be posted on the wiki until some time after the game is out. But if you take a look at the list of achievements in Cassette Beasts you'll get some idea of the sorts of conditions that can be set.

If you're unafraid of digging around in the game's files, you can decompress your save file and check the stats section. Or decompile the game and check the list in Achievements.gd.