pawREP / ZHM5Randomizer

Smart Item Randomizer for Hitman 3 (2021)
MIT License
45 stars 16 forks source link

ZHM5Randomizer


ZHM5Randomizer is a smart item randomizer for Hitman 3 (2021) that allows randomization of world, hero, npc and stash inventories. It's easy to use, customize and extend.

All main missions from Hitman 1, 2 and 3 as well as all side missions are supported. Escalations are currently not randomized.

How to install / use:

Limitations / Bugs / Troubleshooting

How to extend the randomizer with custom randomization logic

The randomizer was build with easy extendablity in mind. Randomizers have to implement the RandomizationStrategy interface and they have to be added as part of a randomizer collection in RandomisationMan::configureRandomizerCollection(). The central functionality of any randomizer is implemented in RepositoryID* RandomizationStrategy::randomize(const RepositoryID*). This function gets called by a hook into the game code whenever the game tries to spawn an item. The input id, represents the item the game attempted to spawn, the returned id is the, potentially randomized, id the game will spawn instead. If randomizers implement RandomisationStrategy::initialize, they will be notified when a new game scenario is loaded and they will be provided with the default item pool for this scenario. This can be very helpful when writing stateful randomizers where knowledge of the complete item pool is required before randomize is called for the first time. WorldInventoryRandomisation is an example where this is the case.