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

Miscellaneous TRR fixes #704

Merged
merged 20 commits into from
Jun 18, 2024
Merged

Miscellaneous TRR fixes #704

merged 20 commits into from
Jun 18, 2024

Conversation

lahm86
Copy link
Collaborator

@lahm86 lahm86 commented Jun 9, 2024

Checklist

Description

Fixes some loose ends for TRR, plus a couple of fixes for classic too.

TRR

  • Further documentation updates
  • Modified by TRRando stamp is now just TRRando as TRR font size is comparatively large
  • Ambient and title screen tracks can now be randomized (or strictly speaking, shuffled)
  • Fixed a data alias priority issue on import where pre-existing types were being ignored, so resulting in overwrites
  • Made PDP cache thread-safe
  • Added TR2R patch 3 Vegas checksum
  • Fixed TRG reading in published build (and a related bug in TR5 texture building)
  • Fixed texture corruption in some cases when the imported level set is larger than the existing set
  • Included cutscenes and Vilcabamba darts in texture randomization
  • Extra pistols at the start of HSC could not be picked up (assume item limit related) so we now just move another item here and convert to pistols. Pistols in Rig will always be in the default position too.
  • Lara's start position won't be changed in HSC to avoid camera going OOB during start animation.

Classic

  • Fixed the application of Any environment mods so they match the order they're written in. These are normally independent mods, but there was a group in Atlantis where the order did matter, so safest just to assume the written order is fact.
  • Fixed Lara's default outfit colour not being changed if a different outfit fails to import into the level (TR2 only).

Both

  • Added enemy relocations for the T-rex and bird monster in TR2.

@lahm86 lahm86 added bug Something isn't working enhancement New feature or request TRR labels Jun 9, 2024
@lahm86 lahm86 added this to the 1.9.0 milestone Jun 9, 2024
@lahm86 lahm86 self-assigned this Jun 9, 2024
@lahm86 lahm86 changed the title Miscellaneos TRR fixes Miscellaneous TRR fixes Jun 9, 2024
@lahm86 lahm86 force-pushed the trr-fixes branch 10 times, most recently from 39ca469 to 6852961 Compare June 17, 2024 13:10
@lahm86 lahm86 marked this pull request as ready for review June 17, 2024 16:59
@lahm86 lahm86 requested review from rr-, chreden and makotocchi June 17, 2024 16:59
Copy link

@rr- rr- left a comment

Choose a reason for hiding this comment

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

LGTM, but IMO the previous screenshots were more attractive.

lahm86 added 8 commits June 17, 2024 20:21
Thanks to Zenuriko for the tip here on playing outwith Steam.
Also added some general FAQs and updated showcases.
TRR uses bigger font. This is more succinct anyway.
TRGE will just swap the OGG files around, so it's not as random as classic, but it's something.
Slight change in patch 3, although we don't use these files yet we still back them up.
This only affected TRR because of the way we merge the PDP files, but ultimately this performs a better check on alias priorities before import i.e. if the level already has an alias of a type and it's the "chosen one", remove the other's blob before proceeding.
TR3 aliases for Lara misc are ignored because none contain critical commands like ending the level.
One of those "only happens in production" issues.
The added item in HSC could not be picked up, assume it's related to item limit. OG pistols moved instead. In Rig, pistols guaranteed in OG position too.
lahm86 added 8 commits June 17, 2024 20:21
This animation was restored in TR3R, so don't move Lara in this case - similarly handled already in Rig and HSH in TR2.
If an outfit import attempt fails, and the subsequent allocation is the level's default outfit, texture mapping will have been wiped out on the first attempt. This restores it. Only applicable to TR2.
@lahm86
Copy link
Collaborator Author

lahm86 commented Jun 17, 2024

LGTM, but IMO the previous screenshots were more attractive.

Looking at them again, I agree. I've restored the originals but kept a second one for each game, just to showcase texture rando mainly. The originals are brighter and do stand out better.

@lahm86 lahm86 requested a review from rr- June 17, 2024 19:24
Consider enemies 71/72 in Wreck - if they are allocated either of the first two keys, it's a softlock. While the room is valid en-route, the enemies' trigger is beyond the keyhole. For shuffled mode, it's too complicated to re-allocate, so we just disable key drops in that scenario. For normal mode, the triggers are taken into consideration.
T-rex and bird monster relocations defined.
@@ -118,6 +118,17 @@ private void CleanRemovalList()
cleanedEntities.Add(type);
}
}

for (int i = cleanedEntities.Count - 1; i >= 0; i--)
Copy link
Collaborator

@chreden chreden Jun 18, 2024

Choose a reason for hiding this comment

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

This seems safer and easier to understand than the reverse iteration through a list that is being modified.

var dependencies = TypesToImport.SelectMany(t => Data.GetDependencies(t)).Select(t => Data.TranslateAlias(t));
TypesToRemove = cleanedEntities.Where(e => !dependencies.Contains(e)).ToList();

Alternatively could the check be added above? Aanother entityClean step - then it just wouldn't be added in the first place.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, I've gone with the approach suggested. I think it's safest to do this at the end so that the full list is iterated first in case there are two types with the same dependency, like MaskedGoon2 and MaskedGoon3, who both depend on MaskedGoon1. Then we're not doing the same dependency check twice.

}
}

return triggerRooms;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This could be a fairly simple looking Linq one-liner if Room knew what number room it was - but perhaps something for the future.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, that would be good to implement. I don't think we shuffle rooms around anywhere so it's probably not something that would need management, but can have a think about it for the future. I've tidied it up for now anyway with some Linq so it's less loopy, and there is a test to cover it as well.

Copy link
Collaborator

@chreden chreden left a comment

Choose a reason for hiding this comment

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

Couple of suggestions and notes

@lahm86 lahm86 merged commit d47b78c into LostArtefacts:master Jun 18, 2024
2 checks passed
@lahm86 lahm86 deleted the trr-fixes branch June 18, 2024 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request TRR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants