Skip to content

Input: scripted keys from the world's first frame (VICTORY_KEYS_FROM=world) - #1098

Open
ballsimulation wants to merge 1 commit into
trustno1-coder:mainfrom
ballsimulation:input/keys-from-world
Open

ballsimulation wants to merge 1 commit into
trustno1-coder:mainfrom
ballsimulation:input/keys-from-world

Conversation

@ballsimulation

Copy link
Copy Markdown
Contributor

Summary

VICTORY_KEYS times count from when input starts. Boot and save loading take a different time on each run, so the same script walks a different path each run. With VICTORY_KEYS_FROM=world, the times count from the first presented frame of 500 or more draws instead, the same test VICTORY_CAPTURE_WORLD uses. No scripted key is pressed before that frame. Off unless set.

VICTORY_KEYS_FILE is not held back, because a driver (such as bench.ps1) uses it to get through the menus.

Changes

  • victory-gpu: world_since(), set once at the present that ends the first such frame. Cost: one atomic swap per present, in every build. It logs the world: the first frame of 500 draws or more.
  • victory-hle (gameinput.rs): script_base() picks what VICTORY_KEYS counts from.
  • docs/README-fxceless.md: one row in the table of switches.

Checked

  • Unit tests: keys_from_the_world, a_frame_of_500_draws_is_the_world. cargo test -p victory-hle --lib -- gameinput: 27 passed.
  • cargo clippy -p victory-gpu -p victory-hle --all-targets (with and without --all-features, -D warnings) passes for this change. main has three lints of its own that fail first: manual_is_multiple_of in shadow.rs and descriptor.rs, and some_filter in gameinput.rs:1372.
  • In the same run, the log shows scripted keys count from the world's first frame at the start and the world: the first frame of 500 draws or more frames=14355 43 s later.
  • Two bench runs from the Request: Post-prologue / early free-roam save for cross-fork testing #332 save: the world came after 45 s and 39 s, and the same route ended at the same spot with the same camera angle in both. Without this switch, the second run would have started walking 6 s earlier in the scene.

🤖 Generated with Claude Code

VICTORY_KEYS times count from when input starts, so a route lands somewhere
else whenever the boot or the save's load takes longer. With
VICTORY_KEYS_FROM=world they count from the first presented frame of 500
draws or more (the test VICTORY_CAPTURE_WORLD uses), and no scripted key is
pressed before it. VICTORY_KEYS_FILE is not held back: a driver passes the
menus with it.

- victory-gpu: world_since(), set once at the present that ends the first
  such frame (one atomic swap a present, every build).
- victory-hle: script_base() picks what VICTORY_KEYS counts from.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ballsimulation

Copy link
Copy Markdown
Contributor Author

Used by #1099: bench.ps1 -Route passes the route as VICTORY_KEYS with VICTORY_KEYS_FROM=world.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant