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

Add support for Unfinished Business #580

Merged
merged 18 commits into from
Dec 10, 2023

Conversation

lahm86
Copy link
Collaborator

@lahm86 lahm86 commented Dec 1, 2023

Resolves #579.

Checklist

Description

This is largely a data PR for the TRUB levels, but there have been a few key changes in the code to support this, and to add further enhancements.

  • Game Mode is now available (for TR1 only) to allow picking the original level set, the gold levels, or to combine them into a single gameplay. Most of the work is in TRGE, and in the randomizer adjustments were mainly needed in the UI and controller classes.
  • FDControl has undergone a refactor because the TRUB level files seem to have been compiled with aggressive floor data packing, and our library wasn't configured to handle this. I've also removed a lot of the duplication in this class so it's easier to manage.
  • Lara's gym outfit is no longer restricted to levels that already contain the model - we will import it where needed. The only time it cannot be used now is when a T-Rex is present, due to the mesh swap with Lara's model there. There is also a gold touch gym outfit, so it can even appear in Midas now.
  • There are a few new and updated environment functions to match some of the changes we make in TRUB. This includes the ability to specify alias priority when importing models for environment mods - for example, importing the Midas hand for trap rando needs to ensure the associated LaraMiscAnim model is also imported, regardless of whether or not a different alias is already in the level.
  • The option for allowing enemies to drop keys has been updated to take into account scenarios when you randomize enemies but not items. This means you can convert default key drops such as Pierre's into regular pickups if, for example, you are attempting a pacifist challenge (thanks to @eycore1 for highlighting this).
  • Secret reward allocation is now fairer, so the player should feel properly rewarded for their efforts. This came about as there is only one default reward item in The Hive, but the level could potentially have five secrets.

All that should remain for full TRUB support is text translation - the current entries are effectively placeholders, so whichever language is chosen, the randomizer will fall back to these English defaults for the time being.

@lahm86 lahm86 added enhancement New feature or request TR1 labels Dec 1, 2023
@lahm86 lahm86 added this to the 1.8.0 milestone Dec 1, 2023
@lahm86 lahm86 self-assigned this Dec 1, 2023
@lahm86 lahm86 force-pushed the issue-579-trub-support branch from 891d619 to 7c108c8 Compare December 1, 2023 18:41
The level sequencing option has been reworked to take game mode into account, so all options are now in a dialog box. Game mode only applies to TR1 for now; the concept is there in TRGE for TR/3 though.
TRUB level file hashes added, these are the ones that ship with TR1X.
Fixed gamestring checks always expecting Cistern and Mines to be present.
Altered rando logo overlay for title screen.
TRUB has packed floor data, so our current method was failing as it always expected each sector to point to a unique entry. I've streamlined the class overall, removing lots of duplication, and updated the tests to run against every level. We can't test byte-for-byte in TRUB, so we ensure that each sector continues to point to a valid entry. There was also one snag with Antarctica in TR3 which has a single unused triangulation entry, so there is a workaround in the test to get by this. GIGO.
@lahm86 lahm86 force-pushed the issue-579-trub-support branch from 7c108c8 to b16a9a8 Compare December 5, 2023 16:42
@lahm86
Copy link
Collaborator Author

lahm86 commented Dec 5, 2023

There have been a few bugs identified and fixed after testing, so I think this is good for review now.
I've pre-squashed a few commits already, I'm not decided yet on doing a full squash on merge as there is quite a lot. I might do some further squashing after review for similar groups of files.

@lahm86 lahm86 requested review from rr-, chreden and makotocchi December 5, 2023 16:53
lahm86 added 12 commits December 9, 2023 11:57
Added texture fixes, lever/keyhole changes, water changes, trap rando and puzzle/challenge rooms. Made several more trap models available for import, including the Midas touch which needed some extra adjustments in model transport to allow correct import via environment mods.
Updated room creation to allow omitting textures (for boulder trigger rooms mainly).

Improvements added to the underwater maze puzzle at the end of Natla's Mines - better lighting, some texture hints, and a slightly more lenient timed swim. Improved lighting in other rooms as well.
Improved the lighting in the Folly return path.
A tweak to enemy randomization to ensure we don't write back floor data too early while we're still scanning over it.
Texture dependencies calculated for model import.
Some room restrictions defined for Adam in default mode.
Locations defined for eggs.
Adjusted the enemy key drop option to allow keys to be shifted if the player wants to play pacifist. For TR1, Pierre's items in Tihocan are adjusted to add them to the level for trview lookup.
Locations defined for tweaking Lara's starting position. Added more to the OG levels too.
Added some English placeholders for now until translations are implemented.
The next version of TR1X will fix a bug where pushblocks could be moved onto slopes. We used this for two glitched secrets, so these have been swapped out with alternatives.
Updated outfit randomization to allow the gym outfit to appear in all levels, unless a T-Rex is present.
Routes and invalid item locations defined for TRUB. Key item IDs defined and adjustments made to always calculate the correct base for level sequencing regardless of game mode.
Updated location generation to skip over triggers for Thor's hammer - we just assume the trigger is below the hammer head for ease. Fixed a couple of routing issues in Folly too.
Full texture rando support added. Some tweaks needed to wireframing to avoid too many lava textures on walls in the end levels. Not as noticeable in the original levels, but I've updated those too. Also fixed Bacon Lara not remaining solid when the option is picked for solid enemies.
Reward rooms created and reward items earmarked.
Locations marked for each TRUB level.
Added a method of pinpointing entity indices from environment mods, which we use to adjust some secrets after they have been placed.
Added some minimums and potentially some bonus secret rewards to be fairer to players. The Hive for example has one reward item by default, but could potentially have 5 secrets to collect.
@lahm86 lahm86 force-pushed the issue-579-trub-support branch from b16a9a8 to 6221a9c Compare December 9, 2023 11:57
Pierre dies immediately underwater, so predefined alternative locations have been marked for him. An extra check is also done in Temple of the Cat to avoid setting one-shot on a timed switch trigger, as it can lead to softlock. This is the only instance of this.
Mimics the FD injections in TR1X to avoid looping tracks (especially noticeable with short speech tracks).
Added functionality to create custom textures, and to lock those textures to avoid wireframing replacing them. This is used in a puzzle room in The Hive where texture hints are needed. This also uses a mechanism to lock audio tracks, as again this room uses audio hints so we want to guarantee specific tracks.

More boulders added to Stronghold.
@lahm86 lahm86 force-pushed the issue-579-trub-support branch from 6221a9c to 6d4b580 Compare December 10, 2023 11:39
@lahm86 lahm86 merged commit ba5a8a0 into LostArtefacts:master Dec 10, 2023
2 checks passed
@lahm86 lahm86 deleted the issue-579-trub-support branch December 10, 2023 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request TR1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for TRUB
2 participants