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

tr1/lara: add wading support #1728

Merged
merged 3 commits into from
Oct 21, 2024

Conversation

lahm86
Copy link
Collaborator

@lahm86 lahm86 commented Oct 19, 2024

Resolves #1537.

Checklist

  • I have read the coding conventions
  • I have added a changelog entry about what my pull request accomplishes, or it is an internal change

Description

This adds support for wading, taken from TR2, with the required animations and SFX provided in the updated lara_animations.bin injection.

Attached are a couple of test levels - TR1 and TR2 with identical geometry for easy comparison. Note there are no changes in this PR to the way TR2 Lara behaves.
WadingTests.zip

This was quite involved and required some minor changes in such things as normal swim collision, so it'd be good to check OG swim behaviour as well. And there are a couple of locations at the end of Tihocan that Lara can now reach. I haven't made this optional as I'm not sure that we could efficiently separate out the logic, but LMK if you think it's needed and I'll take a deeper look.

One thing that came to light was the TR2 code has logic to make Lara bonk against a wall if she wades into it, but the frame checks there are wrong. I've corrected that for TR1, and can follow up with a fix for TR2 later.

This also highlights how we can fix another TR1 annoyance where Lara can get stuck against a wall (on land) if you bump into it but keep holding forward and a direction. In TR2 she deflects properly in the direction you're holding, the code for which is in M_CollideStop in lara/col.c. I'll tackle this separately too to provide the fix for TR1 and to make it optional there.

@lahm86 lahm86 added Data Requires injecting content / files that are not a part of the original game Enhancement Improvement of an existing feature TR1 labels Oct 19, 2024
@lahm86 lahm86 self-assigned this Oct 19, 2024
@lahm86 lahm86 requested review from a team as code owners October 19, 2024 15:05
@lahm86 lahm86 requested review from rr-, walkawayy and aredfan and removed request for a team October 19, 2024 15:05
src/tr1/game/lara/common.c Outdated Show resolved Hide resolved
src/tr1/game/lara/common.c Outdated Show resolved Hide resolved
@rr-
Copy link
Collaborator

rr- commented Oct 19, 2024

Are the now-reachable places in Tihocan important gameplay-wise?

@lahm86 lahm86 force-pushed the issue-1537-tr1-wading branch from 93b925f to f2b2568 Compare October 20, 2024 08:48
@lahm86
Copy link
Collaborator Author

lahm86 commented Oct 20, 2024

Are the now-reachable places in Tihocan important gameplay-wise?

I would say no, if anything it gives it a bit more polish as it avoids Lara getting embedded in the floor (although you can recover from that by swimming away). It maybe gives a slight advantage for killing the crocodile, but I think that's negligible as the ledge where you're supposed to exit the water is pretty close anyway.

Here is a comparison: https://youtu.be/gScRYMtgWno

@lahm86 lahm86 requested a review from rr- October 20, 2024 09:07
@lahm86
Copy link
Collaborator Author

lahm86 commented Oct 20, 2024

One side effect from the swim col updates is that the fly cheat suffered from the same issue we originally had in TR2 (LostArtefacts/TR2X#166). where Lara faces upwards. I've pushed a fix for that in line with LostArtefacts/TR2X#167.

@aredfan aredfan self-requested a review October 20, 2024 10:01
Copy link
Collaborator

@aredfan aredfan left a comment

Choose a reason for hiding this comment

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

One side effect from the swim col updates is that the fly cheat suffered from the same issue we originally had in TR2 (LostArtefacts/TR2X#166). where Lara faces upwards. I've pushed a fix for that in line with LostArtefacts/TR2X#167.

Good catch.

@rr-
Copy link
Collaborator

rr- commented Oct 20, 2024

Are the now-reachable places in Tihocan important gameplay-wise?

I would say no, if anything it gives it a bit more polish as it avoids Lara getting embedded in the floor (although you can recover from that by swimming away). It maybe gives a slight advantage for killing the crocodile, but I think that's negligible as the ledge where you're supposed to exit the water is pretty close anyway.

Here is a comparison: https://youtu.be/gScRYMtgWno

Thank you for the video. The bonk at 00:57 looked a bit awkward – I think Lara should just stop. The only similar place in TR2 I was able to find is Catacombs of Talion, room 21, tile 6/4/59 but it collides with a static rather than a ceiling slope. Can we confirm if this is in line with TR2 behavior?

@lahm86
Copy link
Collaborator Author

lahm86 commented Oct 20, 2024

Are the now-reachable places in Tihocan important gameplay-wise?

I would say no, if anything it gives it a bit more polish as it avoids Lara getting embedded in the floor (although you can recover from that by swimming away). It maybe gives a slight advantage for killing the crocodile, but I think that's negligible as the ledge where you're supposed to exit the water is pretty close anyway.
Here is a comparison: https://youtu.be/gScRYMtgWno

Thank you for the video. The bonk at 00:57 looked a bit awkward – I think Lara should just stop. The only similar place in TR2 I was able to find is Catacombs of Talion, room 21, tile 6/4/59 but it collides with a static rather than a ceiling slope. Can we confirm if this is in line with TR2 behavior?

You know, thank bonk didn't even register with me 😄

I found the issue, the collision check was wrong for this, so it's now fixed to check for HT_WALL in line with the same in Lara_Col_Run. Bonking while wading isn't a thing in TR2 because the anim frame checks that are there are wrong (and it's an OG issue, not anything from decompiling). My plan was to fix TR2 after this.

@Richard-L
Copy link
Collaborator

I'm super confused by this. What is the point?

Lahm's video of Tihocan is incredibly awkward. She either sticks in the ground (this was OG behaviour??), or slides off ledges back into water which is also totally weird.

I'm also confused why this wouldn't be made optional. So far the focus has always been that an "absolutely vanilla" mechanic and physic of TR1 could still be maintained. This would now be a departure from that stance which I'd regret a lot. I understand that mixing the games has potential to reduce workload, but please let's not lose the truthfulness of every individual game along the way.

@rr-
Copy link
Collaborator

rr- commented Oct 21, 2024

I'm super confused by this. What is the point?

Lahm's video of Tihocan is incredibly awkward. She either sticks in the ground (this was OG behaviour??), or slides off ledges back into water which is also totally weird.

I'm also confused why this wouldn't be made optional. So far the focus has always been that an "absolutely vanilla" mechanic and physic of TR1 could still be maintained. This would now be a departure from that stance which I'd regret a lot. I understand that mixing the games has potential to reduce workload, but please let's not lose the truthfulness of every individual game along the way.

I understand your concerns and appreciate your passion for maintaining the authenticity of TR1. Let me clarify a few points: The specific issue you're mentioning mainly affects Tomb of Tihocan, particularly the first three ledges, as there are no other places in the original game levels that would let Lara wade. In the original game, Lara's behavior was obviously glitched, which is highlighted in the first half of Lahm's video. The second half shows the improvements with new code.

The purpose of this update isn't just about fixing glitches but also giving custom level builders the flexibility to use more diverse geometries. Our goal is to support TR1 and TR2 levels with different engine features using a single exe. For example, in a future update it can be expected that we'll include flares code in TR1, though it won't be noticeable – simply because the original levels don't have flares. Your feedback is valuable, and I hope this helps explain our intentions.

EDIT: Upon discussing it internally a bit more, we'll look into making this feature optional for TR1 to maintain the OG visual experience and be in line with the optional nature of other OG glitch fixes.

This adds support for wading, taken from TR2, with the required
animations and SFX provided in lara_animations.bin.

Resolves LostArtefacts#1537.
@lahm86 lahm86 force-pushed the issue-1537-tr1-wading branch from d9142e5 to 4a8be8d Compare October 21, 2024 09:25
@lahm86
Copy link
Collaborator Author

lahm86 commented Oct 21, 2024

This is now optional, so with the config option disabled, Lara will behave per OG.

@lahm86 lahm86 requested review from rr- and aredfan October 21, 2024 09:30
@lahm86 lahm86 force-pushed the issue-1537-tr1-wading branch from 4a8be8d to 7c1781c Compare October 21, 2024 10:14
@aredfan
Copy link
Collaborator

aredfan commented Oct 21, 2024

  • If wading is disabled - Lara gets softlocked in Tomb of Tihocan 13/4/64 if you have her swim up the slope as far as possible. I'm not able to to reproduce this in the latest dev snapshot. save_tr1_01.zip

@lahm86
Copy link
Collaborator Author

lahm86 commented Oct 21, 2024

  • If wading is disabled - Lara gets softlocked in Tomb of Tihocan 13/4/64 if you have her swim up the slope as far as possible. I'm not able to to reproduce this in the latest dev snapshot. save_tr1_01.zip

Thank you. This should be fixed now, but note that you won't be able to recover from that save - it shouldn't have allowed you to go so far up the slope and so Lara is effectively clamped. Latest push re-implements the original check for this scenario, meaning you shouldn't be able to get into that position in the first place.

@Richard-L
Copy link
Collaborator

Richard-L commented Oct 21, 2024

Thanks a lot for clarifying, and sorry if my message was a bit dramatic.

I tested this on PS1 and I see the troublesome OG behaviour. A fix for the mesh embed softlock itself is of course super welcome 🙏

I'm glad this is now optional. I'm afraid it's very easy for us to miss a would-become-wade spot in TR1 and UB.

One unrelated question I had: when it says "your review was requested" on this, does that mean a comment alone is sufficient?

This provides a config option for wading, so the original shallow water
behaviour can be retained if desired.
This sets Lara one click from the floor when entering the fly
cheat to avoid the swim collision adjusting her X rotation from the
desired 30 degrees.
@lahm86 lahm86 force-pushed the issue-1537-tr1-wading branch from 5371d26 to f707c08 Compare October 21, 2024 12:25
@lahm86 lahm86 merged commit c02f89f into LostArtefacts:develop Oct 21, 2024
5 checks passed
@lahm86 lahm86 deleted the issue-1537-tr1-wading branch October 21, 2024 12:29
@rr-
Copy link
Collaborator

rr- commented Oct 21, 2024

One unrelated question I had: when it says "your review was requested" on this, does that mean a comment alone is sufficient?

Yes – that is correct. Thanks

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 Enhancement Improvement of an existing feature TR1
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Feature request: Allow Lara to go from deep water to one-click water like in TR2+
4 participants