Merged
Conversation
Fixed Newtonsoft references in WPF projects following upgrade.
TR1 textures/colours can now be transported. This works by rebuilding the palette once texture bitmaps have been updated. All duplicates are removed by default, and if a colour can't be slotted in, the nearest match will be used instead. FaceMapper also updated for TR1 to draw quad/tri indices in rooms.
- Improved palette manager efficiency by not scanning through tiles twice. - Added ability while exporting to handle specific models just before writing, so any tweaks can be made. For TR1, we fix some colouring in Kold and SkateboardKid.
Updated TREnvironmentEditor so that all functions and conditions support TR1.
Placeholder JSON files added for all levels, along with some basic mirroring mods required for certain levels.
All enemy models exported and individually tested, so sprite, sound, other model etc dependencies have been added to the data provider.
Enemy exclusion file added.
Basic list of unarmed locations.
Tracks and SFX categorized for TR1. SFX definition is slightly different - we reference the source level file instead of keeping the WAV data in the project. New categories added for doors and switches, TR2 and 3 updated accordingly.
Limits the combined total of Winston and either type of monk to 20 for trap-heavy levels in TR2.
Texture dependencies calculated for TR1.
- Texture dependencies updated for Atlanteans (issue with null meshes). - Null meshes being imported will take on meshes for Lara's hips as default.
Some resource updates for enemy randomization.
Fixes a problem if importing the centaur statue into a level that already has the centaur (a dependency). Previous dependency checks assume the parent model would already be present, so the bug was that the dependency would be removed. Also fixes explosion sprite in Vilcabamba (it already exists there but is empty).
Passes level name to data provider when checking for ignorable textures.
Updated LaraMiscAnim_H_Valley to include textures (injured Lara after T-Rex death). Specific locations for Atlantean eggs added.
Handles cyclic dependencies so that levels that already contain a master model will still try to import the dependencies.
Texture limits are now defined in ITransportDataProvider, which allows amendments to be made based on the TR version.
- Updated TRGE included, which supports reading/writing gameflow and config JSON. - TombATI folders can also be opened/backed-up, but obviously no scripting functonality available. - Created basic structure classes for TR1 level randomization.
Further implementation of enemy rules.
Moved version support checks out of main controller to a separate class. There are now dedicated lists per version rather than complicated include/exclude lists, and the checker can detect if a community patch - e.g. Tomb1Main - is in use via TRGE.
Added editor type for TR1 to coordinator.
Added setting for door SFX to all versions and finer control for showing different text in UI based on version.
Added options to randomize Lara's starting health for T1M. Mediless level starts are WIP in T1M, so this option is currently visible but disabled.
Audio randomizer implemented, which includes a change to the shared audio class for all 3 randomizers. This resolves an issue when setting trigger tracks if a group of triggers spans more than one room (good example is the T-Rex trigger in Lost Valley). The previous implementation was grouping tracks by room, so it was possible here to end up with different tracks. Trigger groups are now detected and handled.
Environment randomizer implemented for TR1. Similar to TR3, the only option available is mirroring for the time being, although default/non-purist packs can still be applied.
Enemy randomizer implemented for TR1.
Minor wording update for TR1 ammoless.
Added room restrictions for Adam, plus a guaranteed key in ToT if Pierre isn't at the end of the level.
Location generation logic made generic. Locations tested up to Khamoon and necessary exclusions added via trview. Note the TR2 class is only required for TR2 enemy randomization and does not replace the already defined locations.
Fixes a crash if duplicated sound details indices are present in the sound map. Removes the Atlantis PowerUp SFX as a weapon sound as it doesn't work well.
Support for ammoless/mediless added ahead.
Amendment to T1M option for removing medi packs.
Start position randomizer implemented with some basic locations to begin with. Default environment mods will adjust triggers as necessary.
Night mode randomization implemented. This works in exactly the same way as TR2.
Sets the physical secret reward seed to the default value if opening a folder for the first time.
Removes room 68 as a potential room for key1 so that it can be picked up before triggering the flipmap. Also adds dummy triggers for the trapdoor in room 96 so the bridge can still be used after triggering the flipmap.
Adds an extra trigger for the mines if the gondola route is not taken.
6th mine was missed.
Removed duplicated frame in grey lava. Fixed sideways gold secret so its base doesn't bleed into whatever is next to it in the tile.
Added the ability to change most T1M settings via the UI.
AnisotropyFilter was missed and corrected a typo.
Ability to randomize water colour per level.
A little mesh swapping in the Atlantis cutscene.
Ability to exclude rooms from having their lighting changed - currently targeted at the flipmap rooms at the start of Atlantis so we can retain the flicker effect here.
Ability to modify title screen and to add credit picture. Fix for water colour rounding.
Disables demos on individual levels if they are mirrored because it can cause the game to crash.
More generous allocation of ammo/medis based on enemy difficulty.
Added details regarding TR1 cross-level enemies.
Secret documentation for TR1-3.
Disabled braid options if not using T1M.
Future-proofing for glitched secrets.
Fixes an issue if eggs are added as a "safe" enemy type if the import list is populated with restricted enemies only. Ensures at least one Atlantean is available for the egg.
Ensures Lara's hips are always included in palette reconstruction - so if other reliant null meshes are removed, for example.
Fixes an issue with Pierre if he's made one shot in levels where his model is already in place, but there is no scion pickup sprite.
Remove secrets.md from output.
Null check for Lara's hips - e.g. cutscenes.
- Amends an underwater corner secret in Khamoon. - Added a little documentation on corner secrets. - Replaces the Khamoon and Vilcabamba secret rooms so zoning is at the same level to avoid enemies glitching. - Fixed Secret Lead Bar name.
Ensures that item randomizer does not touch secrets - this was possible in Sanctuary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TR1 Support
TR1 is now supported. TRGE will allow opening a TombATI installation or a Tomb1Main installation - the recommendation is to use Tomb1Main as this allows all options in the randomizer to be enabled.
Only the current development build of Tomb1Main is supported in the randomizer. So at the time of writing, 2.10.2 and lower are not supported.
As per TR2 and TR3, you need only point the randomizer to the DATA folder and it will work out the rest. This update includes an editor for the T1M configuration, so the recommendation is to not modify these JSON files manually after having opened them in the randomizer, as this can cause issues with the backups and so can lead to obscure results during randomization. Either make all edits to the files before opening the folder in the randomizer, or use the built-in editor described below.
Huge thanks to rr- and walkawayy for their support with some amendments to Tomb1Main (#599, #603, #605 and #611).
Version Detection
The
ScriptEditorobject passed to the main randomizer editors (e.g.TR1RandoEditor) now has details on the detected version, so this is where we can apply different logic. The handling of the different elements that are supported has been moved out ofTRRandomizerControllerintoTRVersionSupport; the lists in here are now explicit types that are supported rather than the previous implementation which had supported and unsupported lists. Although this is "wordier", it's much more explicit.For TR1, most of the individual randomizer implementations follow suit with TR2 and TR3, so I won't go into too much detail on those, but the following is worth commenting on.
Unavailable Options
If not using Tomb1Main, the following will not be available to select in the randomizer, or otherwise will not apply.
Secrets
Secret randomization works in the same way as TR3, so artefacts are imported and reward rooms added. @eycore1 implemented secret locations previously, and additional locations for Natla's Mines and Atlantis have been added. All secrets are currently glitchless and none are classed as hard.
SECRETS.md contains more detailed notes about the artefact types to find in each level and the option for changing the number of secrets.
Items
Locations are generated automatically for standard items, similar to TR3, so there is also an exclusion list to avoid unreachable rooms (around 17,000 valid locations possible across the game).
Key item randomization is also implemented, and again this works the same as TR3, so there are defined locations set for these in
Resources\TR1\Locations\item_locations.json.This update also adds UI options to change item types as well as their positions, so this applies to TR2 and TR3 as well (although for TR2, HSH items will still remain in their default locations).
Enemies
Full details of enemy restrictions are in ENEMIES.md. Some additional comments:
Eggs
There is additional handling added for eggs so that they always appear against a wall. These are standard locations exported from trview (
Resources\TR1\Locations\egg_locations.json), but with the addition of an angle. The trviewResources\Shared\randomizer.jsonconfig file has been updated with this variable.They spawn different types of Atlantean based on the value of
TREntity.CodeBits:Centaur Statues
As Lara needs to get close to these to trigger them, any enemies allocated as centaur statues will be grounded. The randomizer will move them down until they hit the floor.
Audio
The way trigger tracks are randomized has been updated for all 3 versions. Previously we would group triggers by room and allocate the same track to that room, but this didn't work too well for TR1 (consider Caves room 26). Now, when allocating to a sector, a tracker will reference each neighbouring sector regardless of room, so if we come to one of those other sectors while scanning through other rooms, we will use the track already allocated.
Environment
Currently only mirroring is available to choose, but all supported EM functions have been implemented for TR1. The secret reward rooms use these heavily, similar to TR3.
Model Transport / Textures
One of the challenges with TR1 is that we are obviously restricted to 255 colours so this needs to be handled carefully when importing additional models and textures. The import logic works identically to other versions, so all the texture packing is handled using bitmaps and it's not until it comes to writing back to the level that things get a little trickier. This works by scanning every pixel across all tiles and collecting the unique colours until the palette is filled. If the palette is full but there are still more colours to add, instead of bombing out, it will try to find the nearest suitable match. So the result is that some textures may have slightly different appearances than normal.
The above process is also quite slow (e.g. 16 tiles per level = ~1million pixels to scan) but it doesn't appear any worse than TR2.
Only Lara is currently targeted for texture randomization, and this uses the same approach as TR2/3. For other models it might be better to choose a different approach and instead of defining external bitmaps to allocate, we just use the existing palette.
Lara's Appearance
Tomb1Main Config Editor
The UI has a button in the Global Options section to allow editing the Tomb1Main settings. TRGE handles the IO here between the
Tomb1Main.json5andTomb1Main_gameflow.json5- together these make up theTR1Scriptobject. The editor is targeted at the current T1M build, but if there are new releases of Tomb1Main that add additional options, these will not be lost.TR1Scripthas additional variables,GameflowDataandConfigData, which areJObjects. When it's parsing the files these objects are filled and it then removes the elements it knows about and puts them into the defined instance variables. So anything that's left in these objects can still be edited and will be merged when writing back, there are just no defined variables for them. The idea would be that the randomizer could still support uprevs of Tomb1Main that include new options until there was the opportunity to make the relevant UI settings for them.The output files don't contain comments, but the original comments have been replicated in the UI.
Note that some settings can be overridden by individual randomizers. These are as follows.
water_color- colour can be changed per level during texture randomizationfix_descending_glitch,fix_wall_jump_glitch,fix_qwop_glitch- disabled if glitched secrets are enabled (for the future)fix_pyramid_secret_trigger- disabled if secret randomization is enableddisable_trex_collision- enabled if enemy randomization is enabledThese are "soft" overrides, meaning that if you explicitly choose the opposite, then enable a randomizer that would override the setting, if you at a later date re-randomize such that the randomizer doesn't need to set these values, your original choice will persist.
Other Fixes