Skip to content

About

NSLT Autosplitter and load removal ported to LiveSplit One to work on Linux

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

New Super Lucky's Tale — auto splitter for LiveSplit One

Disclaimer: Done with Claude

A cross-platform port of the original LiveSplit.NewSuperLuckysTale component to a LiveSplit One auto splitter. It compiles to WebAssembly, so it runs the same way on Windows, Linux and macOS — including under Proton/Wine on Steam Deck.

What it does

Reads the same four fields from the game's Mono runtime that the original component read:

  • UiLoadingScreen.<Instance>k__BackingField._spinningImage — whether a loading screen is on screen (also used to pause/resume game time).
  • GameScenesInterface._persistentLevelName — the current scene name.
  • CutsceneSequence.<HasActiveCutscene>k__BackingField — used for the one cutscene-based split (the Jinx boss fight).
  • GameConfiguration.Instance._currentFps — exposed as a FPS timer variable, since LiveSplit One has no equivalent of scanning the layout for a text component to write into.

Start/split/load rules match the original:

  • Starts when a loading screen appears while on the title screen or the intro cinematic (or on any level, in "Any Level" mode).
  • Splits when a selected level's scene is left for a Chapter* hub (or for no scene at all).
  • The "Split at every regular/boss level" and "Split at every puzzle level" catch-alls work the same way, including puzzle detection (_Marble_*_Outro or _SlidingBlock_* scene names).
  • Game time is paused during loads and through LW_Intro_Cinematic.

All four of the original's presets (Any%, All Main Levels, All Pages, 100%) are available as a dropdown, plus a Custom option that uses the individual checkboxes — LiveSplit One doesn't have a separate preset UI, so this is folded into the settings themselves.

Building

You'll need a Rust toolchain with the wasm32-unknown-unknown target:

rustup target add wasm32-unknown-unknown
cargo build --release --target wasm32-unknown-unknown

The output is at target/wasm32-unknown-unknown/release/new_super_luckys_tale_auto_splitter.wasm.

Using it

  • LiveSplit One (desktop, web, or the Linux build): Layout Editor → Add → Auto Splitting Runtime, then point it at the .wasm file.
  • Original LiveSplit (Windows) with the ASR Auto Splitter Runtime plugin: same idea — add the "Auto Splitting Runtime" component and load the .wasm file. This lets you use this same file even on Windows instead of the old .NET-only component.

Testing

The split/start logic is covered by unit tests that don't need the game or a process attached:

cargo test

18 tests cover level splits, the puzzle-detection predicate used by the "every level"/"every puzzle" catch-alls, the cutscene rising-edge/counter logic, load-state detection, start conditions, and that the generated Any% preset matches the original Presets.xml byte-for-byte.

Regenerating src/settings.rs

src/settings.rs is generated from the original component's Splits.xml and Presets.xml rather than hand-typed, so none of the 60+ split keys can be mistyped. If you have an updated Splits.xml/Presets.xml, adjust the generator script referenced in this repo's history and rerun it — don't hand-edit the generated sections.

Known differences from the original

  • FPS display: shown as a LiveSplit One timer variable (FPS) instead of being written into a text component found by scanning the layout for the word "FPS". Add a text/variable component in your layout to see it.
  • Tooltip images (Resources/Tooltips/*.jpg) aren't ported — LiveSplit One's settings UI doesn't have an equivalent hover-tooltip-with-image mechanism.
  • A latent quirk in the original is preserved rather than "fixed": selecting only a catch-all (e.g. "Split at every regular/boss level") with no individual splits checked behaves the same way it did originally.

Troubleshooting

no global memory allocator found ... link to std or add #[global_allocator] This means your src/lib.rs predates the #[global_allocator] / panic_handler!() setup — make sure you're building from this version of the project (it uses dlmalloc as the heap allocator, required because the crate is no_std). If you edited the project yourself and hit this, check that Cargo.toml lists dlmalloc under [dependencies] and that src/lib.rs has both the #[global_allocator] static and asr::panic_handler!(); near the top.

Build errors mentioning core, Ok, Err, Some "not found in this scope" Your Rust installation doesn't have the standard library components for the wasm32-unknown-unknown target. Run rustup target add wasm32-unknown-unknown (see "Building" above) — this is different from just having Rust installed.

cargo test tries to build for wasm and fails cargo test should use your normal host target, not wasm32. The included .cargo/config.toml only applies its wasm-specific flags when you explicitly pass --target wasm32-unknown-unknown, so plain cargo test shouldn't be affected — if it is, make sure you don't have a different target set globally (e.g. in ~/.cargo/config.toml or the CARGO_BUILD_TARGET environment variable).

About

NSLT Autosplitter and load removal ported to LiveSplit One to work on Linux

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages