LiveSplit / LiveSplit/asr

Godot SceneTree get root not working

Open
#101 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
13
Forks
16
Avg merge
16d 9h
Merged PRs (30d)
15

Description

I am trying to make an autosplitter for a game made in Godot.
When I start the wasm file it can locate the SceneTree but then when I call `scene_tree.wait_get_root(&process).await;` it hangs and never finds the root.

This is the rust code:
```rs
#![allow(dead_code)]

use asr::future::{next_tick, retry};
use asr::game_engine::godot::SceneTree;

use::asr::Address;
use::asr::Process;

asr::async_main!(stable);
static BLOODTHIEF_NAMES: [&str; 2] = [
"bloodthief_v0.0", // linux
"bloodthief_v0.01.exe", // windows
];

async fn main() {
let p_name = "bloodthief_v0.01.x86_64";
// TODO: Set up some general state and settings.
asr::set_tick_rate(1.0);

loop {
let process = wait_attach_bloodthief().await;
if let Ok(base_address) = process.get_module_address(p_name) {
process.until_closes(async {
// TODO: Load some initial information from the process.
asr::print_message("Locating SceneTree");
let scene_tree = SceneTree::wait_locate(&process, base_address).await;
asr::print_message("Locating root");
let root = scene_tree.wait_get_root(&process).await;
asr::print_message("Found root");
asr::print_limited::<4096>(&root.print_tree::<64>(&process));

loop {
// TODO: Do something on every tick.
asr::print_message("On tick");
next_tick().await;
every_tick(base_address);
}
}).await;
}
}
}

fn every_tick(base_address: Address) {
}

async fn wait_attach_bloodthief() -> Process {
retry(|| {
attach_bloodthief()
}).await
}

fn attach_bloodthief() -> Option {
BLOODTHIEF_NAMES.into_iter().find_map(Process::attach)
}
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Godot SceneTree::wait_locate and wait_get_root calls shown in the Rust example, then reproduce the hang while attaching to the specified Bloodthief process and module. Trace why wait_get_root never resolves for the WASM game; done means the root is found and root.print_tree produces output before the tick loop.

Written by the indexing model from the issue text.

Assessment

Tech stack
godot, rust
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.