Skip to content

add option to set right trigger as boost only during the day stages - #1760

Open
bluechilliz3 wants to merge 3 commits into
hedge-dev:mainfrom
bluechilliz3:main
Open

add option to set right trigger as boost only during the day stages#1760
bluechilliz3 wants to merge 3 commits into
hedge-dev:mainfrom
bluechilliz3:main

Conversation

@bluechilliz3

@bluechilliz3 bluechilliz3 commented May 11, 2026

Copy link
Copy Markdown

matches the modern boost sonic games like sonic frontiers and shadow generations. The entry in the config.toml file will be an enum with options for drift or boost under Config::RightTriggerAction

benefits

no need for remapping software

rather than the user using controller remapping software is this only effects the day stages so the trigger will function normally when the using plays the night stages

cohesive experience

the option especially works well in Eggmanland. The right trigger seamlessly de/activates when switching between sonics in that stage. This means the user no longer needs to go into the remapping software once completing a section in that stage

keeps the user in the moment

the user can still press square/X while sonic is boosting via the right trigger which is great for homing attacks or QTEs (with a caveat)

modernization

the config option in the game's option menu matches up with the official remaster of Sonic|Shadow Generations as they provide legacy or standard control schemes

Note

it looks like the house style of this project to provide descriptive options to the user, so i went with boost and drift as the option shown in the options meno rather than legacy and standard

caveats

responsiveness of square/X while holding right trigger

if the user is holding down the right trigger for boost the square/X button is only 95% until the user releases right trigger and the square/X button will function normally. this is why i added "EXPERIMENTAL" in the options description. to be able to reach 95% minimum responsiveness on square/X while right trigger is being held down I needed to add bool xWasHeldLastPoll and uint32_t xCancelUntilTick to the Controller class and add some checks on both Poll() and PollAxis else the square/X button would only respond 40% while right trigger is being held and either thumsticks were moving. I'd recommend the user to release the right trigger when doing QTEs or time sensitive homing attacks

localization

the description (in the option) is only available in English

Note

we welcome any translators to provide localization for this new option

playing as Chip in the final boss

as the option is making the use of App::s_isWerehog, as chip is technically not a werehog, the input diversion I added will also apply to Chip. this means the user can only throw punches on their left hand as the right trigger is still diverted to boost for Chip. this can be a benefit for someone who's too used to holding right trigger for boost/dash and it's one level with an unpopular play style. but this still does limit chips combat ability and doesn't match the button instructions on the bottom right corner match

edit: this is now fixed by checking if the active archive is BossDarkGaia1_1Air however one of the buttons are sticking out (see screenshot below).

the prompt to boost will still say to press square/X to boost

you can still boost with pressing square/X when Config::RightTriggerAction is boost so the prompt is still correct. this caveat is only cosmetic

Note

getting the prompt to boost to say "R2" or "RT" needs some research on the games PPC binaries

this is now fixed and the game will show the updated icon based on Config::RightTriggerAction

Note

the chip button overlay takes effect on game boot. This means if you change Config::RightTriggerAction after launching the game the overlay won't update on the fly (but the controls will which would mis-match the UI)

QTE will see the user pressing square/X while right trigger is being pressed

this is basically from how this option works. however, the good thing, if the user already has right trigger held down before the QTE prompt the section will work normally (other than the responsiveness caveat on square/X until the trigger is released)

update: the option will try and suspend the remap when detecting the QTE prompt but there's a small chance that some buttons will go through the suspension. I still recommend releasing R2/RT when the game wants the square/X pressed unless you really want the boost aura (which does look nice)

screenshots

Screenshot 2026-08-01 at 11 20 35

game prompting the user to press R2 to boost as Config::RightTriggerAction is boost, this is without any mods that changes the skin of the buttons

Screenshot 2026-08-01 at 11 15 02

game responding to the user pressing the boost button, with a modern button mod added

Screenshot 2026-08-01 at 11 17 30

control overlay for the Gaia colossus being updated

Screenshot 2026-05-11 at 14 09 20

the added UI option that configures Config::RightTriggerAction on the fly

matches the modern boost sonic games like sonic frontiers and shadow
generations. The entry in the config.toml file will be an enum with
options for "drift" or "boost" under "RightTriggerAction"

the benifits rather than the user using controller remapping software is
this ONLY effects the day stages so the trigger will function normally
when the using plays the night stages. The option especially works well
in Eggmanland. The right trigger seemlessly de/activates when switching
between sonics that stage
@wallbuilder

Copy link
Copy Markdown

This needs to be accepted because it seems awesome

@bluechilliz3

Copy link
Copy Markdown
Author

there was a commit to update the readme on my own fork which is making github into thinking I want to change hedgedev's readme. So I reverted mine to make it show I only want the right trigger functionality to be added to the main repo

Config::RightTriggerAction == ERightTriggerAction::Boost. This is a
conscious decision since the HUD will tell you to press the wrong button
if right trigger is set to boost. Super sonic will remain matching day
sonic's controls. Pressing right trigger won't also move the sun while
right trigger set to boost anymore thanks to `hasStage`.
@bluechilliz3

Copy link
Copy Markdown
Author

added a new commit that fixes chip's controls (in the final boss) so the HUD no longer tells you to press the wrong button

…on. this also works on skin mods set by the user. since the HUD for chip's section of the final boss too the remapping is restored when playing him

for adding `ChipOverlayCsdPatchMidAsmHook`
it rewrites the Gaia Colossus (Chip) control overlay icons when boost is remapped to the right trigger. 0x830C17A8 is the CSD project parser entry (r8 = raw yncp file bytes, checked against FAPC/CPAF magic at 0x830C17C8 before any offset fixups); the hook identifies ui_playscreen_su.yncp by its footer cast name table and retargets each button cast's sprite index, pixel box and quad (X->RT, LB->LT. In the function No code picks these icons, so when boost is remapped to the right trigger we rewrite the asset as it loads: this hook fires at the CSD project parser entry (r8 = raw file bytes, before offset fixups, so file offsets apply directly), identifies this exact file by its footer cast name table, then retargets each button cast's sprite index, pixel box and quad to show and lay out the remapped buttons (X->RT boost, LB->LT guard, LT->LB / RT->RB attack).No code picks these icons, so when boost is remapped to the right trigger we rewrite the asset as it loads: this hook fires at the CSD project parser entry (r8 = raw file bytes, before offset fixups, so file offsets apply directly), identifies this exact file by its footer cast name table, then retargets each button cast's sprite index, pixel box and quad to show and lay out the remapped buttons (X->RT boost, LB->LT guard, LT->LB / RT->RB attack).

for adding `QTEPromptActiveMidAsmHook`
per-frame update of the trick QTE prompt bar (0x823329F8, r3 = widget) using the new `App::s_lastQTEPromptMs` in `app.h`. The hook reads the widget's button sequence (this+120/124, position this+152) and stamps a timestamp while the currently expected button is X/Square, which the input driver uses to suspend the boost trigger remaps for just those prompts

for adding `BoostPromptCastMidAsmHook`
it swaps the day-stage boost nav sign prompt (sub_8239F4A8) from X to RT when boost is remapped to the right trigger. 0x8239F510 = "addi r5,r10,-8140" materializes r5 = 0x8200E034 "btn_1"; hook the next instruction (0x8239F514) so r5 is still the cast name before GetCast at 0x8239F51C consumes it

for adding `BoostPromptPatternMidAsmHook`
0x8239F5B8 = "li r4,2" (2 = X icon); hook the SetPatternIndex call at 0x8239F5BC where r4 is the pattern index passed to sub_830BF300 (btn_3 patterns: 0=LT, 1=RT)

also added the Config::RightTriggerAction option in the ui
@bluechilliz3

Copy link
Copy Markdown
Author

added a new commit that update the button prompt which will respect your settings and the QTE will be more forgiving if you accidentally press R2/RT. Chip controls are now remapped as his control is now also updated

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