-
Notifications
You must be signed in to change notification settings - Fork 45
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
rooms: move height vars and functions to TRX #2542
Conversation
This moves TR2's no floor indicator to TRX's room module.
This adds support for no floor in TR1, in the same style as TR2's Floating Islands. Resolves LostArtefacts#2541.
This moves Room_GetHeight to TRX, which in turn allows us to eliminate g_HeightType.
This moves Room_GetCeiling to TRX.
Download the built assets for this pull request: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and thank you.
This renames the no floor internal concept to abyss.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM.
A potential issue I noticed is when I use the disable_floor
in Great Pyramid, there's also invisible collision around the top platform that Lara will bump into if she flies around. Is that to be expected?
Thanks @aredfan. That's a good point, and could cause issues in TR2 customs as well; the hard-coding of 16384 as the absolute abyss maximum causes this, as the height at the top of the platform in GP causes things to overflow (note there is other collision here just beyond the scion platform and near the sloped ceiling, but that's OG). I've adjusted it now so it calculates the absolute floor, based on the difference between 16384 and OG floater abyss value. It'd be worth flying around near the roof in Floater to see if everything looks ok with this, and see how GP looks too. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for explaining. The issue is fixed, and the Floater and GP levels both looks good. 👍
src/libtrx/game/rooms/common.c
Outdated
@@ -511,12 +512,14 @@ SECTOR *Room_GetSkySector( | |||
|
|||
void Room_SetAbyssHeight(const int16_t height) | |||
{ | |||
m_AbyssHeight = height; | |||
m_AbyssMinHeight = height; | |||
m_AbyssMaxHeight = height == 0 ? 0 : m_AbyssMinHeight + 30 * STEP_L; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, what does 30 * STEP_L
signify? Asking cause it doesn't match 16384 (16 tiles).
Also would be good to explain what is the min and max role in the calculations, as it's become quite confusing to me. I always thought it's a simple plane.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, I got my numbers muddled. I've set it now to 26 * STEP_L
, so this is the difference between 16384 and Floater abyss height of 9728. This allows time when Lara is falling between setting her HP to 0 and the inventory showing, so that we don't hear Lara hit the floor. Although I've noticed that in OG, you can just hear the crunch SFX begin as the inventory opens, but we can perhaps address that separately.
We also clamp to just under the max height; in TombEditor in theory you could build a room this low.
I've added comments, hopefully they clear things up.
558e189
to
7164ca9
Compare
Rather than hardcoding the maximum abyss height to 16384, we calculate it based on the OG difference between this and Floating Islands abyss height. This avoids potential collision issues near the top of the level.
7164ca9
to
b7faeef
Compare
Resolves #2541.
Checklist
Description
This primarily replaces
g_HeightType
andg_GF_NoFloor
with function calls in TRX, but also movesRoom_GetHeight
andRoom_GetCeiling
together as well for consistency. There remains some height specific logic in the separate modules, for example altering floor height, but that's linked with #2036 so can be handled separately there.It seemed sensible to offer
disable_floor
in TR1 as part of this as it's quite a straight-forward feature.For testing, we can check floor and ceiling heights are OK, including slopes, plus the abyss in Floating Islands. You can also try an abyss in TR1; one I tried was setting the value to 4096 in Great Pyramid and then dropping off the starting ledge. It doesn't really make sense in OG environments though, so it's definitely more of a custom level feature.