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

Selectable Enemies, Unconditional Bird Monsters and SFX Updates #328

Merged
merged 11 commits into from
Apr 26, 2022

Conversation

lahm86
Copy link
Collaborator

@lahm86 lahm86 commented Apr 26, 2022

#272 Selectable Enemy Pool

It is now possible to select which enemies you wish to appear and not appear in the game. The randomizer will make a best effort attempt to honour these choices, but there will be times when this isn't possible. The exclusion list can be edited from Options in Enemy Randomization.

image

The system works as follows.

  • The closer to the top of the exclusion list an enemy is, the higher its exclusion priority.
  • When the randomizer selects the enemy pool for a level, it may need to allocate an enemy type that can drop pickups and one that can be positioned in water. In these cases, if it can't pick an enemy from the available enemy pool, it will pick one from the excluded enemy pool based on priority status (so those towards the end of the list will be picked).
  • Some enemies are required for levels to work as standard, such as the Bird Monster in Ice Palace and Shotgun Goon in HSH. Although these can be excluded from other levels, they will always be included for these levels.
  • If the available enemy pool is smaller than the number of enemy types that normally appear in a level, the enemy type capacity count will be reduced to match the pool. This happens after required enemies are added.

One Enemy Mode

If all enemies are excluded apart from one, the randomizer will also do its best to support this type of single-enemy playthrough. In some cases this may imply a "No Restrictions" game, so this setting may become overridden as a result.

Skidoo Drivers

An additional check is now done when in "No Restrictions" mode, to ensure that the skidoo driver count in a level doesn't exceed the maximum. This applies to standard "No Restrictions" selection or that implied by One Enemy Mode if only skidoo drivers are chosen.

Restricted Enemies

Enemies whose appearance across the game is normally restricted, like Winston and the bird monster, will tend to appear more often if they are included in the available pool and the pool count is low. This is another example of "No Restrictions" being enforced.

The Dragon and Willard

These enemies are not selectable in the exclusions dialog, mainly because supporting a one-enemy game with them is impossible, but the rules and logic around their inclusion is quite involved so at the moment it's easier to handle them separately.

Maximum Dragons

If "Maximize Dragon Appearance" is selected, this can take priority over exclusions in that some levels have predefined combinations of enemies the randomizer chooses from (Barkhang, Temple of Xian and HSH). The randomizer will again try to pick a combination that doesn't contain any exclusions, but there may be some that will slip through the net. An example is HSH in Default restrictions mode - every possible combination that allows the dragon to appear also contains the Giant Spider, so if Giant Spiders are in the exclusion list, they will end up appearing in this level.

Exclusion Failures

The exclusions dialog contains an option to Show a warning if exclusions fail during randomization. In this case, a check is done at the end of enemy randomization and if any enemies in the exclusion list have been assigned to actual entities in any level, a (blocking) confirmation dialog will appear asking if you wish to proceed. Selecting No will cancel the operation.

image

This feature is available in any of the randomizer classes (or anything that implements AbstractLevelProcessor). Just call SetWarning with the appropriate message and the randomizer progress window will show the alert and wait for user input before continuing/cancelling.

Normal Enemy Randomization

If cross level enemy randomization is switched off, all exclusions will currently be ignored.

#327 Unconditional Bird Monsters

It is now possible to have aggressive bird monsters that do not end the level when killed. This is done by tricking the game into never reaching the final frame of the death animation (which is where the check is performed to end the level). Thanks to @chreden who suggested this.
So there are now three options to choose from for the behaviour of bird monsters. Note that in Ice Palace, the default behaviour will always remain (although environment modifications can continue to change the level ending).

image

A downside to unconditional bird monsters is that there is no death animation at all - they change from being upright to lying on their back instantly when their hitpoints value reaches 0.

Docile bird monsters can now appear in Barkhang. They had been excluded prior to the fix for the freezing issue in this level, when it was thought at the time that both monk types were required, but this is no longer the case so there are guisers available for this level.

The internal variable name DocileBirdMonsters has been renamed to DocileWillard because it only applies to TR3 now - there is a separate enum variable for the bird monster behaviour. This means that this setting will reset on the next release, so if docile Willard was previously chosen, it will need to be re-selected manually.

#326 Uncontrolled SFX Randomization

It is now possible to randomize SFX with no constraints - no categorisation is performed and every sound effect in the level is targeted. There is an option to apply this to a certain number of levels - the recommendation is to keep it low as the results can be very...random.

image

Other Updates

  • Fixes a softlock in Offshore Rig (closes TR2 - Softlock in Rig #323).
  • Fixes a landmark import issue when the number of object textures is exactly the limit for the level (closes Landmark Import Failure #324).
  • If enemy 52 in Floating Islands can't fly, he will be moved to a platform to avoid dropping to the level floor (closes TR2 - Lost enemy in Floating Islands #325).
  • Added a UI option for swapping enemy appearance in relation to Swap enemy meshes #314.
  • Randomizing in development mode will add the level select option to the script for TR2 (this was already in place for TR3).
  • Some preparations made for TR1-5: Cross-game levels #304.
    • Zones/ZoneGroups implemented for TR1 as per TR2&3. Unit test added for adding to zones.
    • Ability to set the number of sounds in TRSoundDetails.
    • Ability to find tile segments from texture indices in texture packer.
    • Ability to add faces to meshes in MeshEditor.
    • Several general models made available for import (bridges, keys, some traps etc).
    • Fixes some texture deduplication issues in GW.

lahm86 added 11 commits April 16, 2022 09:36
Ensures the flipmap is off if the end level trigger for Rig has been moved to avoid a softlock.
If trying to import landmarks and the number of object textures is already at the maximum for a level, the packing attempt will now no longer proceed as this expects at least one rectangle - otherwise it throws an exception.
Ensures that enemy 52 won't drop to the level floor by moving him if he can't fly.
Some preparations for cross-game level support.
- Zones/ZoneGroups implemented for TR1 as per TR2&3. Unit test added for adding to zones.
- Ability to set the number of sounds in TRSoundDetails.
- Ability to find tile segments from texture indices in texture packer.
- Ability to add faces to meshes in MeshEditor.
- Several general models made available for import (bridges, keys, some traps etc).
- Fixes some texture deduplication issues in GW.
- Adds support to allow choosing which enemies are available in the randomization pool. This does work mainly on "best effort", but exclusion priority can be defined so that enemies that the randomizer has a chance to focus on excluding any that are particularly undesirable. An option is in place to show a warning message if an excluded enemy has ended up in the game.
- Ensures skidoo drivers are limited if they are heavily present in any level.
- Rotates an enemy in Floaters if the type is flamethrower for a better chance of killing him.
Adds an option to have SFX randomized without categorisation, so producing a very surreal result. This can be limited to a chosen number of levels - the recommendation is to keep the value low.
Chicken behaviour can now be default, docile or unconditional - the latter meaning that they will be aggressive and the level won't end whey die. This replaced DocileBirdMonsters in the settings, which has been renamed to DocileWillard as it only applies to TR3 now.
Adds a UI option for swapping enemy appearances.
Move animation manipulation to method.
Adds a fix to ensure non-cross level enemy randomization can still be performed is selected.
If enemies take on Lara's appearance, we don't target them for texture randomization (can cause issues with Lara's model). Also reduces the enemy count for Floaters as we can't remove the existing Marco model because of precompiled deduplication (classic Floater texture bug).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TR2 - Lost enemy in Floating Islands Landmark Import Failure TR2 - Softlock in Rig
2 participants