X2CommunityCore / X2WOTCCommunityHighlander

https://steamcommunity.com/workshop/filedetails/?id=1134256495
MIT License
60 stars 68 forks source link

MinLinksPerRegion is not properly respected when spawning region links #1303

Open Tedster59 opened 8 months ago

Tedster59 commented 8 months ago

Relevant discord discussion: https://discord.com/channels/165245941664710656/273238884433788928/1210722316166897756

When the game starts a new campaign, it generates all region links and then removes them based on the max links per region setting. However, there are two issues with this:

  1. GraphIsValid does not check if the region has below the minimum number of links, so when links are removed, it does not fail if links go below the minimum.
  2. IsEligibleStartRegion hardcodes the min region links to 2 instead of using the config value in its return (Count > 1); statement.

For LWoTC, I'm trying to ensure that the starting region has a minimum of 3 links.

Potential solutions:

  1. Add an override event to IsEligibleStartRegion to allow mods to change whether a region is valid starting region.
  2. Adjust IsEligibleStartRegion to use the Min regions config instead of hardcoding it
  3. Adjust GraphIsValid to check the minimum regions when validating whether removing a link is acceptable.
Tedster59 commented 8 months ago

Example from a LWoTC campaign. The starting region is New Arctic, it does not have a connection to Western US because Western US has 4 links and I believe the link to New Arctic was removed during the campaign creation. LWoTC sets the min links per region to 3 and the max links to 4. image