Repository navigation
mods: gate_driver takes a run from the menus into the world (D3D12-GATE-DRIVER-MOD) - #2784
Conversation
…TE-DRIVER-MOD) A Lua mod for in-game gates and A/Bs: it presses Enter through the title's menus only once frames have moved on since the last press, shows control by holding W (the player must walk 1 to 30 m in 3 s; more is the title placing the player, which it waits out without a press), then stands still (idle) or walks a fixed loop (roam). It logs GATE PRESS/PROBE/CONTROL/MARK/SHOT/FAIL lines with distances only, never a position. It ships disabled; a run enables a copy with LEONIDA_MODS and needs LEONIDA_GAME_ACTIONS=1 for the player's position. The logic is in driver.lua and takes the calls it uses as an argument, so leonida-lua's tests run it on a stub with a simulated clock: menus, control, roam, no position, no control, a jump.
|
Verified by OreoFR (another owner than TheGeogeo) on macOS 27.2.1, Apple M5, Rust (rustup), Python 3.12.16,
AI-assisted: Claude Code |
|
RUN - independent verification (Verified by OreoFR) - RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 Pro 10.0.26300.
In game. A diag
Safe to merge into main? Yes.
The 3 findings concern what CONTROL means on a prologue start and how often Enter is pressed. They matter for using the mod as a gate, not for merge safety. They can be a follow-up. Verdict:
Not covered:
This run was AI-assisted (Claude Code, oreofr-agent). |
… no move (review) A probe that showed no move pressed Enter at once, and the menus then probed again at once: Enter came every 3 to 5 s (68 times in 6 min on a cold cache), with no press_every and no check that frames had moved on. It now asks the menus for one press at their pace, and a probe waits for Enter to be up. The docs say what idle cannot tell (a held player) and what a cold cache does to CONTROL.
|
Thanks for the in-game check. Point 3 was a real bug, fixed in 8b79ed2:
Docs and |
|
Re-checked by OreoFR on the new head AI-assisted: Claude Code |
|
I cannot run this one, so this is triage rather than verification - posted so nobody reads silence as coverage. What is not available here: no What I could check, by reading:
What a reviewer with cargo should run, if that is useful: What I would look at in the docs: AI-assisted: yes - DeepSeek v4.1 (flash), reading only, no execution claimed. Written with an AI assistant. |
|
RUN - re-check on the new head
AI-assisted (Claude Code, oreofr-agent). |
|
In-game run on 8b79ed2: RTX 3080 10 GB, driver 32.0.16.2140, Series S profile, a copy of the mod in
|
|
RUN - re-check on
This run was AI-assisted (Claude Code, oreofr-agent). |
|
Merged by OreoFR (maintainer) on head Tested before merging:
AI-assisted (Claude Code, oreofr-agent). |
Claimed in the coordination issue as: D3D12-GATE-DRIVER-MOD (#2570 (comment))
What and why
In-game gates and A/Bs need someone at the keyboard to press through the title's menus, and to say when the player is in control. Without that, a run measures the menus. The testers asked for a run that gets into the world on its own. This adds
mods/gate_driver, a Lua mod that does it with the calls the mod API already has (hold_keys,release_keys,player_position,screenshot,frame,time,log).The menus. It presses Enter only once frames have moved on since the last press, every 25 s, until the player's position is known. A start that spends minutes on pipeline compiles does not waste its presses.
Control. Holding W for 3 s must move the player at least 1 m and at most 30 m.
GATE PROBE ... placedand tries again without pressing.GATE PROBE ... still, presses once more, and tries again.The first in-game run showed why the upper bound is needed. Without it, control was "seen" at 54 s, before the world: the load had moved the player 2.6 km in those 3 s.
Then.
idle(the default) stands still, for measuring.roamwalks a fixed loop: W, with short J and L turns (the stand-in pad's right stick).Log lines.
GATE PRESS,GATE PROBE,GATE CONTROL t=... moved=... mode=...,GATE MARK ... from_control_m=...every 10 s,GATE SHOTat 10 s and 120 s after control, andGATE FAIL no position|no controlafter 900 s. They give distances only, never a position.Settings. The mod ships disabled. A run enables a copy in a mods folder of its own (
LEONIDA_MODS), withLEONIDA_GAME_ACTIONS=1for the player's position. An optionalgate.txtbeside the copy setsmodeand any numeric default.Docs.
docs/lua-modding.mdhas a new section, "The gate's driver mod". It also notes that a cutscene can still follow control: the title moves the player kilometres away for it, then puts them back.The logic is in
driver.lua, which takes the calls it uses as an argument, soleonida-lua's tests run it on a stub with a simulated clock. It works with any run that setsLEONIDA_MODS. It does not need #2782 (the game gate), which I used below to run it.Not in this one: a saved place to start from, routes per scene, and an ABBA runner.
Tested
On Windows 11 Pro 10.0.26300:
cargo test -p leonida-lua --locked: 40 passed. 5 tests are new:GATE FAIL;gate.txt.With
mods/gate_drivertaken away, those 5 fail and the other 35 pass.cargo fmt -p leonida-lua --checkshows no difference in the new code. The one difference it reports, inapi.rs:413, is already onmain.cargo clippy -p leonida-lua --all-targetsreports the same 5 errors as onmain(input.rs,memory.rs,tests.rslines 356 and 370), none in the new code.tests/test_docs_repo_paths.py,tests/test_docs_cli_flags.pyandtests/test_leonida_mods.pypass.scripts/check_no_game_data.pyon the changed files andgit diff --checkare clean.In game: RTX 3080 10 GB, driver 32.0.16.2140, Series S profile. The
leonida.exediag build (diagnostics, dlss, mimalloc) was run throughscripts/game-gate.ps1(d3d12: an in-game gate: one command, one run folder, one summary.json (D3D12-GAME-GATE) #2782), with a copy of the mod inidleand no key pressed by hand:PROBE placedtwice (2614.9 m, then 1397.9 m) andPROBE stillonce (0.0 m), followed by a third press.CONTROLat 69.9 s withmoved=7.69.GPUs tested: NVIDIA GeForce RTX 3080 10 GB, driver 32.0.16.2140, Windows 11 Pro 10.0.26300
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)