Skip to content

Port: sprint while holding R2 in towns and dungeons - #156

Open
VinLucero wants to merge 7 commits into
TheMoonPeople:masterfrom
VinLucero:town-sprint
Open

VinLucero wants to merge 7 commits into
TheMoonPeople:masterfrom
VinLucero:town-sprint

Conversation

@VinLucero

@VinLucero VinLucero commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Before: walking in a town or on a dungeon floor has one speed, and pressing R2 enters the first-person view at once.

After: with Sprint on (game.sprint, PC SETTINGS > Game, off by default), holding R2 (R by default) while walking sprints. The retail walk moves 1.8 times as far and its animation plays 1.4 times as fast, only while the player actually moves. A tap shorter than a quarter of a second still enters the first-person view, now on release instead of on press; only a release seen on the current frame is a tap, so a press left over from a menu opened on the same frame is dropped. With the setting off, R2 is the retail game's.

  • Towns: ladders, events, Georama, subgames, first-person and photo view keep their retail R2 handling, and R2 still leaves the first-person view as before.
  • Dungeons: Max and Monica sprint on foot, but not while locked on (the retail strafe keeps its speed), carrying or charging; the monster form, the Ridepod, menus, subgames and the first-person view keep retail R2.

How: SprintTimer (port/src/sprint.hpp) times the press for both.

  • Towns: EditControl (port/src/editctrl.cpp) takes R2 from the retail eye-view toggle while walking. The retail walk step (CharaControl) runs unchanged; EditMoveChara becomes a native seam that scales the ground velocity before delegating to the retail routine, preserved through RETAIL_BRIDGES as PortRetailEditMoveChara, so collision sees the sprint step. Its other callers (the ridepod, fishing) are unaffected.
  • Dungeons: DungeonSprintMainKey (port/src/dungeon_sprint.cpp, called from the DngMainKey override) hides R2's press edge from retail's first-person toggle, or makes one for a tap, around the retail key step. CActionChara::HumanMoveIF delegates to the retail step, preserved as PortRetailHumanMoveIF, then scales the velocity it set, which the action step moves with collision. Retail sets the walk's motion step every frame but leaves the run's, so the sprint remembers the step it set and unscales it before scaling again.

ps2/ is unchanged.

Tests:

  • TownSprint: a held R2 moves 1.8 times the walk distance per tick, a hold past the tap window neither enters the first-person view nor keeps sprinting after release, a press released while EditControl is not called is no tap, a tap enters the view, and with the setting off R2 walks and its press enters the view at once.
  • SprintTimer, DungeonSprint: the timer; R2 hidden from retail during a hold and handed over for a tap; the velocity and run step scaled without compounding; no sprint while locked on; retail R2 in the first-person view and with the setting off.
  • PlatformConfig.SprintDefaultsToOffAndRoundTrips, and the PC SETTINGS key list.
  • scripts/port/test_unit_copy.py: the editctrl bridge fixtures hold both bridged bodies, and the EditMoveChara bridge is checked against the real source.
  • Full Windows suite: the same 16 tests fail with and without this change on this machine (memory card, CD path, GPU, movie and texture tests); nothing new fails. TownEyeCamera.FixedRoomReseatCutsButForcedFollowInTheSameRoomDoesNot is among them; it passes alone and fails only in the full run, on master too.
  • Played on Windows in towns and dungeons: sprinting, tapping into first person and leaving it behave as described.

🤖 Generated with Claude Code

Holding R2 while walking in a town scales the retail walk step by 1.8 and
its animation by 1.4 while the player moves. A tap shorter than a quarter
second still enters the first-person view, now on release.

EditControl takes R2 from the retail eye-view toggle while walking and
times the press. EditMoveChara becomes a native seam that scales the
ground velocity before delegating to the retail routine, preserved as the
PortRetailEditMoveChara bridge, so collision sees the sprint step. The
ridepod and fishing callers are unaffected. ps2/ is unchanged.

TownSprint.* covers the speed, the hold and the tap; the editctrl bridge
fixtures in test_unit_copy.py hold both bridged bodies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T22:00:27.588752Z 861caf3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 861caf390d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread port/src/editctrl.cpp Resolved
Vincent and others added 2 commits October 25, 2026 15:25
An R2 press on the frame the walk menu opens was still being timed when
EditControl resumed after the menu, and its missing hold read as a tap
that entered the first-person view. A tap now needs R2's release on the
current frame; a stale press is dropped.

TownSprint covers a press released while EditControl is not called.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Holding R2 while Max or Monica walks a dungeon floor scales the retail
walk by 1.8 and its motion by 1.4, except while locked on; carrying,
charging, the monster form and the Ridepod keep their retail movement.
A tap shorter than a quarter second still enters the first-person view,
on release.

SprintTimer (port/src/sprint.hpp) now times the press for towns and
dungeons alike. DungeonSprintMainKey, called from the DngMainKey
override, hides R2's press edge from retail's first-person toggle, or
makes one for a tap, around the retail key step. HumanMoveIF delegates
to the retail step, preserved as PortRetailHumanMoveIF, then scales the
velocity it set; the scaled run step is remembered so it is not scaled
again, since retail leaves the run's step between frames. ps2/ is
unchanged.

SprintTimer.* and DungeonSprint.* cover the timer, the R2 masking, the
speed, the step and the lock-on exception.

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

Copy link
Copy Markdown
Contributor

Can i see a video of this? also, i don't think replacing R2 behaviour should be a default thing, if anything toggleable on "PC Settings" tab @VinLucero

@drkm9743

drkm9743 commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Not sure too what you mean with "walking in a town has one speed", you can walk/run how much you want just using the joystick? unless you mean the walk keyboard feature, but then what is the R2 button meaning?
Can you please explain this better without using AI? thanks!

@VinLucero

Copy link
Copy Markdown
Contributor Author

Hey! This just adds an optional sprint function to the dungeon and town. I'll make it toggleable in PC settings and default off.

game.sprint (PC SETTINGS > Game, "Sprint") turns the hold-R2 sprint on
in towns and on dungeon floors; off leaves R2 to the retail game, whose
press enters the first-person view at once. The row follows "Skip intro".

TownSprint and DungeonSprint turn the setting on through SprintSetting,
in a save root of their own, and check that with it off R2 walks and its
press reaches retail unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@VinLucero VinLucero changed the title Port: sprint while holding R2 in towns Port: sprint while holding R2 in towns and dungeons Oct 26, 2026
@drkm9743

Copy link
Copy Markdown
Contributor

Still not sure what you mean with the sprint thing, can you please make a quick video so we can see? @VinLucero

@VinLucero

Copy link
Copy Markdown
Contributor Author

drkm9743 pushed a commit to Lunatic-Wisdom-Laboratories/OpenCloud that referenced this pull request Oct 30, 2026
Ported from TheMoonPeople/ChronicleTwo#156:

* Port: sprint while holding R2 in towns

Holding R2 while walking in a town scales the retail walk step by 1.8 and
its animation by 1.4 while the player moves. A tap shorter than a quarter
second still enters the first-person view, now on release.

EditControl takes R2 from the retail eye-view toggle while walking and
times the press. EditMoveChara becomes a native seam that scales the
ground velocity before delegating to the retail routine, preserved as the
PortRetailEditMoveChara bridge, so collision sees the sprint step. The
ridepod and fishing callers are unaffected. ps2/ is unchanged.

TownSprint.* covers the speed, the hold and the tap; the editctrl bridge
fixtures in test_unit_copy.py hold both bridged bodies.

* Port: drop a town R2 press left over from suspended control

An R2 press on the frame the walk menu opens was still being timed when
EditControl resumed after the menu, and its missing hold read as a tap
that entered the first-person view. A tap now needs R2's release on the
current frame; a stale press is dropped.

TownSprint covers a press released while EditControl is not called.

* Port: sprint while holding R2 on dungeon floors

Holding R2 while Max or Monica walks a dungeon floor scales the retail
walk by 1.8 and its motion by 1.4, except while locked on; carrying,
charging, the monster form and the Ridepod keep their retail movement.
A tap shorter than a quarter second still enters the first-person view,
on release.

SprintTimer (port/src/sprint.hpp) now times the press for towns and
dungeons alike. DungeonSprintMainKey, called from the DngMainKey
override, hides R2's press edge from retail's first-person toggle, or
makes one for a tap, around the retail key step. HumanMoveIF delegates
to the retail step, preserved as PortRetailHumanMoveIF, then scales the
velocity it set; the scaled run step is remembered so it is not scaled
again, since retail leaves the run's step between frames. ps2/ is
unchanged.

SprintTimer.* and DungeonSprint.* cover the timer, the R2 masking, the
speed, the step and the lock-on exception.

* Port: make sprint a PC setting, off by default

game.sprint (PC SETTINGS > Game, "Sprint") turns the hold-R2 sprint on
in towns and on dungeon floors; off leaves R2 to the retail game, whose
press enters the first-person view at once. The row follows "Skip intro".

TownSprint and DungeonSprint turn the setting on through SprintSetting,
in a save root of their own, and check that with it off R2 walks and its
press reaches retail unchanged.
VinLucero and others added 3 commits October 30, 2026 08:30
Master flattened the PC port tree: the retail units are now native copies
under port/src/object, and the unit_copy retail bridges are gone. The
sprint hooks move with them, following master's Core pattern:

- Town: the retail EditMoveChara in object/world/editctrl.cpp is kept as
  EditMoveCharaCore, and EditMoveChara scales the sprint step before
  calling it; EditControl's R2 timing and step scaling move into the
  native EditControl.
- Dungeon: CActionChara::HumanMoveIF calls DungeonSprintMove as it ends,
  replacing the PortRetailHumanMoveIF bridge.
- Quick loadout's DngMainKey wraps dc2::dungeon::MainKeyCore.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Master added the Spheda handicap setting beside the sprint setting; both
config round-trip tests are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Master's CScene::AssignChara takes a dc2::scene::CharacterResource rather
than a bare character pointer, as its other town tests now do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants