Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: TR2+ Jump Mechanics #157

Closed
DanzaG opened this issue Oct 31, 2021 · 17 comments · Fixed by #864
Closed

Feature request: TR2+ Jump Mechanics #157

DanzaG opened this issue Oct 31, 2021 · 17 comments · Fixed by #864
Assignees
Labels
Data Requires injecting content / files that are not a part of the original game Feature New functionality TR1
Milestone

Comments

@DanzaG
Copy link

DanzaG commented Oct 31, 2021

Implement a config option that allows for TR2+ style running jumps i.e. you have freedom to jump at any point during a run once you start running.

@rr- rr- added Feature New functionality Help wanted Extra attention is needed labels Oct 31, 2021
@Richard-L
Copy link
Collaborator

Personally I'm not so much in favour of adding aspects of Laraphysics from TR2 to TR1. Just seems like the project's goals are on fidelity, accessibility, compatibility, and enhancements, whereas this feels more like an actual mod, because it mixes two games.

Just my two cents.

@rr-
Copy link
Collaborator

rr- commented Nov 1, 2021

There are many players who hate TR1-style jumps (source: Twitch streams) so I think if this change is not very intrusive, such as replace animation X with Y, I don't think it'll hurt to include it provided it can be toggled. But posix is right, this has lower priority than us breaking free of TombATI.

@DanzaG
Copy link
Author

DanzaG commented Nov 1, 2021

Yes it depends on the scope of the change. To me, it is purely the jump "delay" from input to jump action that would be under the scope of this change. To me that is fairly minor compared to actually changing the jump itself which i want to remain the same. So it is more input-focused rather than actual behaviour.

Also it can be disabled by default in the config.

But I agree that this is low priority and I also agree that if a significant deviation from the original code is needed then id be happy to bin this request.

@oziphantom
Copy link
Collaborator

the animation change points are defined in the animation it self. So the code just says, "anim goal = Jump" then when the animation command runs that can do said jump it will switch. Looking at Tomb2Main lara_as_run isn't reversed yet so can't see if it has any other logic, or they just added more commands to the animation.

@DanzaG
Copy link
Author

DanzaG commented Nov 5, 2021

In tr3 there is additional logic for a "jump_ok" boolean in lara_as_run. When I get to my PC i'll find the snippet.

Not sure if its the actual fix, but its the only significant change in the jump logic in lara_as_run afaik.

@DanzaG
Copy link
Author

DanzaG commented Nov 5, 2021

`
​        ​if​ (item->​anim_number​ == ​6​)
​                jump_ok = ​false​;
​        ​else​ ​if​ (item->​anim_number​ == ​0​)
​        {
​                ​if​ (item->​frame_number​ == ​4​)
​                        jump_ok = ​true​;
​        }
​        ​else​ jump_ok = ​true​;

​        ​if​ (input & IN_JUMP && jump_ok && !item->​gravity_status​)
​                item->​goal_anim_state​ = AS_FORWARDJUMP;
​        ​else​ ​if​ (input & IN_FORWARD)
​        {
​                ​if​ (lara.​water_status​ == LARA_WADE)
​                        item->​goal_anim_state​ = AS_WADE;
​                ​else​ item->​goal_anim_state​ = ((input & IN_SLOW) ? AS_WALK : AS_RUN);
​        }
​        ​else​ item->​goal_anim_state​ = AS_STOP;`

@oziphantom
Copy link
Collaborator

that is just checking of lara is able to jump and then it sets the goal anim state to be forwardjump.

This then tells the animation engine I want to change animations, and then when "anim change" command is reached in the animation it will check to see if you goal_anim_state != current_anim_state and then it will switch animations. This way you can only enter a jump if lara has a foot on the ground for example.

@DanzaG
Copy link
Author

DanzaG commented Nov 5, 2021

Looks like it is just additional commands to animation as you suggested then? I'm doing all this on mobile so the formatting is all wonky but comparing TR1 and TR3 lara_as_run thats the only real difference I can see (at least from a jumping perspective).

@rr- rr- added the Data Requires injecting content / files that are not a part of the original game label Nov 10, 2021
@walkawayy
Copy link
Collaborator

walkawayy commented Dec 7, 2021

TR1 state changes during Run animation:
image

TR5 state changes during Run animation:
image

It seems like TR5 animations have more freedom during the run to start the jump. These state changes are contained in the level files. If I understand this correctly which I might not.

@DanzaG
Copy link
Author

DanzaG commented Dec 7, 2021

sweet, makes sense. I can test this out by generating a level set using the TRLevelReader/Writer from rando.

@DanzaG
Copy link
Author

DanzaG commented Jan 3, 2022

https://streamable.com/phze2a - Natla's is normal jumping, caves is amended jumping using the JUMP_FORWARD state values taken from TR2 level files. I guess theres something else i'm missing? as you can see it's allowing a jump too early.

@DanzaG
Copy link
Author

DanzaG commented Jan 3, 2022

if​ (item->​anim_number​ == ​6​)​
    jump_ok = ​false​;​​
else​​ if​ (item->​anim_number​ == ​0​)​ {​​
    if​ (item->​frame_number​ == ​4​) {
        jump_ok = ​true​;
    }​
}​​ else {
    jump_ok = ​true​;
}

if​ (input &IN_JUMP && jump_ok && !item->​gravity_status​)​ {
    item->​goal_anim_state​ = AS_FORWARDJUMP;​​
} else if (input & IN_FORWARD)​ {
    if​ (lara.​water_status​ == LARA_WADE)​
        item->​goal_anim_state​ = AS_WADE;​​
    } else {​
        item->​goal_anim_state​ = ((input & IN_SLOW) ? AS_WALK : AS_RUN);​
    }​​
} else​ {
    item->​goal_anim_state​ = AS_STOP;
}

The code mentioned here will need to be implemented for it to work. I compared the animations and they match - I tested removing this logic from TR3 and it brings the same issue presented above. So I am pretty sure it's a combination of level modifications to make the animations and correct and that "hack" above to ensure the early jump is blocked.

Video of this logic enabled and disabled (first is enabled, second launch is disabled). https://streamable.com/6z9slv

@rr-
Copy link
Collaborator

rr- commented Jan 4, 2022

Thanks @DanzaG for the analysis (the formatting is a bit messed). Personally I am anything but ready to implement the data injection, but I'd welcome any PR that attempts to do this.

@Richard-L
Copy link
Collaborator

Just please keep this optional if you can

@DanzaG
Copy link
Author

DanzaG commented Jan 5, 2022

Yeah optional is a strict requirement. I think if it wasn't possible to be an option (it shouldn't be a problem to make optional - configurable via JSON) then it'd be better not to have this at all.

I agree in that the only choice for this feature should be optional, disabled by default.

@rr- rr- added this to the 2.16 milestone Jun 1, 2023
@lahm86 lahm86 self-assigned this Jun 1, 2023
@lahm86 lahm86 modified the milestones: 2.16, 2.15 Jun 1, 2023
@lahm86
Copy link
Collaborator

lahm86 commented Jun 1, 2023

Hi again @ajtudela - would you be able to translate the following new config option please?

"Title": "Responsive jumping",
"Description": "Allows Lara to jump at any point while running, similar to TR2+."

@ajtudela
Copy link
Contributor

ajtudela commented Jun 1, 2023

"Title": "Salto sensible",
"Description": "Permite que Lara salte en cualquier punto mientras corre, similar a TR2+."

lahm86 added a commit to lahm86/TRX that referenced this issue Jun 2, 2023
@lahm86 lahm86 mentioned this issue Jun 2, 2023
2 tasks
lahm86 added a commit to lahm86/TRX that referenced this issue Jun 2, 2023
lahm86 added a commit to lahm86/TRX that referenced this issue Jun 2, 2023
@walkawayy walkawayy removed the Help wanted Extra attention is needed label Jun 2, 2023
lahm86 added a commit to lahm86/TRX that referenced this issue Jun 5, 2023
lahm86 added a commit that referenced this issue Jun 5, 2023
@rr- rr- added the TR1 label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Data Requires injecting content / files that are not a part of the original game Feature New functionality TR1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants