Releases: LostArtefacts/TR-Rando
V1.2.2
Incorporates: https://github.com/lahm86/TRGameflowEditor/releases/tag/v0.9.3-beta
- Flares have been removed from the randomization pool (for external editors) until the sprite issue is resolved.
- Fairer secret reward allocation in randomization (for external editors).
- Minor optimisation in the data folder restore window.
V1.2.1
Includes new Textures.
Provided by Lahm's PR as it summarises the changes well:
There are quite a few changes but I’ll describe them all below. The solution (TR2RandomizerCore only) now needs a reference to TRGE.Core.dll and TRGE.Coord.dll, which you can get from TRGE. Feel free to clone and build it to get the debug versions or just use the current beta release.
Below is a list of each of the issues referenced in this PR.
#29, #31, #39, #47, #48, #76, #77, #80, #93, #98, #99, #100, #101, #102, #103, #104
Script Editing
The main change is introducing the ability to edit TOMBPC.dat via TRGE, which allows modification of the following.
- Rewards for collecting all secrets (#48).
- The sequence that levels are played in (#39).
- The levels where Lara loses her weapons (#98).
- The levels where Lara loses her ammo/health/flares (#99).
- The ambient soundtrack in each level (including the title screen) (#77 – partially, does not change in-level sounds, like trigger music, enemies etc).
- The track to play when a secret is found. This is a global setting in the script file, and cannot be modified per level (#77, again partially).
- The levels that have sunsets e.g., Bartoli’s Hideout by default (#100).
The script can be edited to modify several other bits and pieces, but the above covers the main features relevant to TR2-Rando.
So now when opening a data folder to edit, that folder must contain the TOMBPC.dat file and each of the level files described in the dat file. The easiest thing to do is just point it directly to the main data folder e.g., C:\Program Files (x86)\Steam\steamapps\common\Tomb Raider (II)\data. The UI now tracks folder history (#103), so you can re-select the same folder easily when re-opening the application.
Backup and Restore #102
All level files and the script file are backed up automatically when a data folder is opened. TRGE needs a backed-up script file so it knows how to restore information (e.g., if we randomize level sequencing, but then in the next session choose not to, it needs to know the default order) so it was straight-forward to extend this to include the level files too. There is an option in the UI to restore a folder to default, which will copy the entire backup to the original directory. If you empty the recent history items, it will delete all backups.
UI & Coord Updates #104
I’ve separated the logic from the UI, so TR2RandomizerCore now holds all the logic and TR2RandomizerView is the new UI. I left the current TR2Randomizer project in case there is anything in there you want to keep.
The main updates to the UI were to include the new script editing options, but I’ve also added in new seed controls with the ability to randomize each individually, all at once (as you had in place already) and also an option to apply the same seed to all elements. This is linked to the mockup in #29 mainly. There are three container controls as follows.
TR2RandomizerView.Controls.ManagedSeedControl
- contains a checkbox, title, descriptive text and a seed control.TR2RandomizerView.Controls.ManagedSeedBoolControl
- contains a checkbox, title, descriptive text, a seed control plus an additional checkbox (used for 'hard secrets', for example).TR2RandomizerView.Controls.ManagedIntControl
- contains a checkbox, title, descriptive text, a seed control, plus an additionalNumericUpDown
control (used for example when choosing the number of unarmed levels).
TR2RandomizerView.Model.ControllerOptions
contains the settings for the UI, and is the main interop between the UI and the core.
Hitting Randomize will bring up a progress dialog, and the user can now cancel this. All writes are done to a temporary directory first and only at the very end of the process is everything copied to the target directory (so if anything fails, the target directory’s integrity isn’t affected). The user can’t cancel the operation once it starts the commit.
The UI theme colours are in App.xaml so feel free to change. I got the app icon from flaticon.com, but again feel free to adjust! I’ve tested the UI in Win7, Win8.1 and Win10.
The UI only speaks to TR2RandomizerCore. Core is linked to TRGE and it registers TR2RandomizerCore.Randomizers.TR2LevelRandomizer
as the level editor to use. TRGE works by first saving the script data, applying any initial changes to level files (such as adding pistols to default locations for unarmed levels – more info on this below) and then passes control to TR2LevelRandomizer.SaveImpl
to begin the main randomization. I’ve only had to alter the randomizers themselves slightly, described further below.
Update Checker #76
I was doing this for TRGE anyway, so have just copied the same across to the new UI. It works by looking at the Product value in the Assembly information for the main exe and compares this with the latest tag_name from GitHub. So the Product field in VS just needs to end with the current release tag in GitHub and if it finds that a different release is available, it will show an “Update Available” menu option. At the moment, it is set to TR2Rando V1.1b2, so it pulls out V1.1b2 from this string. See TR2RandomizerView.Updates.UpdateChecker
.
Import/Export #93
You can now export settings to a compressed json file, and import again via the Tools menu in the UI. You can also import by dropping a valid file onto the main window. I had a look at making a profile string as mentioned in the issue, but haven’t incorporated this yet (TR2RandomizerView.Model.ProfileString
– it’s a messy class just now and needs more work to make it robust). I think the file import/export is sufficient for now anyway.
In TR2LevelRandomizer
, there are methods for handling importing and exporting config (it just needs to set the data that is supplied to it, or provide the data that needs to be exported – the rest is handled by TRGE). So ApplyConfig
is called either when importing a new config file or simply when a data folder is reopened normally from a previous session. StoreConfig
is used to save the current config after a rando session, as well as during export.
Unarmed Levels #98
Any level can now start unarmed, not just Offshore Rig/HSH. When a level’s state changes to being unarmed, TRGE will inject the pistols into predefined locations in the relevant level file before any randomisation takes place. These locations are in TR2RandomizerCore\Resources\unarmed_locations.json. The logic for looking in the plane cargo for Rig has been extended to cover all levels. It might be good to check if we need to be a bit more generous if replacing the pistols with something different in the more difficult levels (e.g., tackling Dragon’s Lair with the Harpoon might not be popular).
Main Randomizers
TR2RandomizerCore.Randomizers.RandomizerBase
now stores a List of TRGE.Core.TR23ScriptedLevel
objects instead of level name strings. These represent each level in the script file and contain all relevant information, such as the name, file name, whether or not the level starts unarmed etc. So the randomizers iterate over this list now instead of the strings. I’ve added a LoadLevelInstance
method to set the instance variable for the TR2Level
, plus an extra instance variable of type TR23ScriptedLevel
as this is useful in ItemRandomizer
for example, when checking for unarmed levels outwith the main looping method.
Each randomizer has a reference to a TRGE.Core.SaveMonitor
, which is used to track progress of the randomization. The main looping methods check the SaveMonitor
on each iteration to see if the operation has been cancelled by the user. You can also fire custom progress messages here if necessary (I've left them commented out for now). TR2LevelRandomizer
sets the overall text before starting each randomizer anyway.
At the moment, TR2LevelRandomizer
passes the TR23ScriptedLevel
list to the individual randomizers in the original game sequence for these levels. If you want to instead pass the list in whichever sequence the levels have been randomized to, you can uncomment the sorting code in TR2LevelRandomizer.SaveImpl
.
Successive Rando
A bit of a side effect with import/export and the auto backups is that randomization is now always done based on the original level files. So, if you randomize twice or more successively with the same seed/settings you will always get the same results. If this is a big drawback, I can have a look at trying to allow successive again, but I think for import/export it would be difficult – I think the idea with that is people could share their settings, but if someone had randomized successively, exported, then the other person imported and randomized once, it wouldn’t match.
Home Sweet Home and Textures
For HSH, I had to get all textures, animations, moveables etc. into the level because it could potentially no longer start with Lara losing her weapons/ammo. I used TRViewer to build what was needed, and TRGE handles getting this in place before any randomization. You can see when it copies the level files to the backup folder, it creates a new house.tr2 file with these extra items included and renames the original to .bak. If restoring, the .bak file is used to put things back to normal. So in relation to #47, any weapon can now be added to this level. ItemRandomizer.PopulateHSHCloset
is still empty for the time being.
Unfortunately, adjusting HSH had the side effect of changing the textiles, as TRViewer optimises the layout going from largest to smallest. So effectively I broke the texture randomization for this level. Regardless, I worked through the images and got them all updated, so it’s working properly again for the dressing gown and secrets. I also added another couple of dr...
V1.1b2
Test version covering the following issues:
#61 QoL improvements
#68 Extra ammo provided for OR
#67 Floater and Lair secrets should be corrected
#65 #75 Fixed Dragons Lair softlock with Jade soldier being allocated a cracker
#62 Enemy randomization logic has changed to avoid a softlock in HSH
#60 Ice Palace will now always spawn a guardian at EOL rooms so you can end the level
#74 Removed original textures from Randomization pool
#64 Diving suit textures improved
#66 #71 Fixed bugged secret locations
TR2 Rando V1.0
Initial release of basic TR2 Randomizer
TR2Rando Release Candidate 5
Full, basic, randomization.
TR2Rando Release Candidate 4
Randomizes ammo items, fixed a bug where items would be placed far OOB
TR2Rando Release Candidate 3
Basic item randomization, but every level will probably soft lock 😆
TR2Rando Release Candidate 2
Includes debug feature, leave seed blank to place all secrets.
TR2Rando Release Candidate 1
Release Candidate for the initial version of the TR2 Randomizer.