LaneDibello / Kotor-Randomizer

The Kotor Randomizer. A randomizer for Star Wars: Knights of the Old Republic. Intended for challenge runs and general fun.
4 stars 1 forks source link

Module goal-based reachability #19

Closed glasnonck closed 3 years ago

glasnonck commented 3 years ago

3 Implements goal-based reachability verification using an XML file to describe all game modules and transitions between modules.

Three goals are currently available for use: Malak, Star Maps, and Pazaak. These are represented as tags on the module elements in the XML file. For a goal to be achievable, all modules with the associated tag must be reachable. New goals will be easy to add in the future.

Before module randomization, a digraph representing the entire game is created from the module information. The module shuffle is generated as usual, but before it is used to copy module files, the random shuffle is passed to the digraph to verify if the currently selected goals are reachable. If the goal is not achievable, another shuffle is generated and verified. This continues until a reachable solution is found or until 10,000 attempts have been made. This might be an excessively high number, but time will tell if another end condition would be better suited.

Reachability, and all associated settings, can be enabled or disabled at the bottom of the Modules form. Single-use transitions can be explicitly ignored to improve the user's experience.

In addition to this, popup tool tips have been added for the checkboxes on the Modules form. More of these will be added in the future for other forms to improve the user's understanding of the available settings.

glasnonck commented 3 years ago

I'll fix the conflicts as best I can in my next push.

glasnonck commented 3 years ago

Should be good now.