loudsmilestudios/TetraForce

implement optional item randomization

IQGobo opened this issue · 1 comments

Depends on #253 (central loot distribution)

Once named loot locations and items are implemented, item randomization can be done as well. The job of the randomizer is to generate a new loot table and write it to a file. To be able to do that, there needs to be a file with the requirements for each loot location, as defined in #253. The requirements must contain every unique loot location that is defined in the default loot table file. For example, if there is a chest behind a blast wall in the lakeside cave, there should be a line in the file that reads like "lakesidecave_collapsedtunnel": "has[\"bombs\"]" to make sure, the player needs to have a bomb to be able to access this chest.

Additionally, the game needs a bit of GUI modification to both generate a new randomized loot table and select to use it for a new game. That GUI should start simple: when a player starts a game, it should provide two buttons, one for the default loot distribution (the "vanilla" game) and another one that generates a new loot table, saves it to a fixed name and uses it instead of the default loot table file.

High level tasks:

  • a basic implementation of the randomizer from July 2020 can be found at IQGobo/TetraForce branch randomizer. For the first working implementation the generator should always write to the same file name, e.g. always use "randomizer.json". The file should be put into the user resource directory, to not interfere with the main game package file that gets generated by Godot. The content of the .json files should contain the names defined for loot locations and items from #253.
  • The single player start button needs to be duplicated to generate and start a randomized game. The vanilla new game button selects the normal loot table file, the new button sets the loot table to the randomizer.json file. This might require some updates to the function that loads the loot table from issue #253. There should also be a vanilla and randomizer start button for multiplayer games on the host side. Clients joining a session should not be concerned about the distinction, as the hosting instance is the only one that determines loot drops from chests or notable kills.

Later versions could show a new dialogue panel to either generate a new item distribution or select a saved one from a list of files in the user resource directory. Newly generated distributions should get a unique name automatically (based on the contents of the file generated).

Players can share their generated loot tables with their friends and they would simply save them to their own user resource directory to play with that new loot table.

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.