add option to set right trigger as boost only during the day stages - #1760
Open
bluechilliz3 wants to merge 3 commits into
Open
add option to set right trigger as boost only during the day stages#1760bluechilliz3 wants to merge 3 commits into
bluechilliz3 wants to merge 3 commits into
Conversation
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
|
This needs to be accepted because it seems awesome |
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`.
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
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
driftorboostunderConfig::RightTriggerActionbenefits
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
legacyorstandardcontrol schemesNote
it looks like the house style of this project to provide descriptive options to the user, so i went with
boostanddriftas the option shown in the options meno rather thanlegacyandstandardcaveats
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 xWasHeldLastPollanduint32_t xCancelUntilTickto theControllerclass and add some checks on bothPoll()andPollAxiselse 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 attackslocalization
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 ofApp::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 matchedit: this is now fixed by checking if the active archive is
BossDarkGaia1_1Airhowever 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 whenConfig::RightTriggerActionisboostso the prompt is still correct. this caveat is only cosmeticNote
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::RightTriggerActionNote
the chip button overlay takes effect on game boot. This means if you change
Config::RightTriggerActionafter 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
game prompting the user to press R2 to boost as
Config::RightTriggerActionisboost, this is without any mods that changes the skin of the buttonsgame responding to the user pressing the boost button, with a modern button mod added
control overlay for the Gaia colossus being updated
the added UI option that configures
Config::RightTriggerActionon the fly