SC2: Greater variety on short generations (#1367)

Originally, short generations used an artificial cull to create balanced mission distributions. This resulted in campaigns that were somewhat too consistent, and on some standard settings combinations, this resulted in campaigns having The Outlaws as the second mission 100% of the time. It also caused generation to fail a bit too easily if the player excluded too many missions.

This removes the cull and adds an additional early Easy mission slot to all of the reduced sized campaigns.

When playing on No Build settings, this also pushes many of the missions down a difficulty level to ensure greater variety, and pushes additional missions down on Advanced Tactics.

Additional small fixes:

The in-world Excluded Missions validation check is replaced by the core OptionSet check.
Fixed issue with Existing Items not getting their upgrades locked with Units Always Have Upgrades on.
This commit is contained in:
Magnemania
2023-03-07 08:14:49 -05:00
committed by GitHub
parent 016157a0eb
commit 17e90ce12c
8 changed files with 273 additions and 264 deletions

View File

@@ -1,6 +1,7 @@
from typing import Dict
from typing import Dict, FrozenSet, Union
from BaseClasses import MultiWorld
from Options import Choice, Option, Toggle, DefaultOnToggle, ItemSet, OptionSet, Range
from .MissionTables import vanilla_mission_req_table
class GameDifficulty(Choice):
@@ -110,6 +111,7 @@ class ExcludedMissions(OptionSet):
Only applies on shortened mission orders.
It may be impossible to build a valid campaign if too many missions are excluded."""
display_name = "Excluded Missions"
valid_keys = {mission_name for mission_name in vanilla_mission_req_table.keys() if mission_name != 'All-In'}
# noinspection PyTypeChecker
@@ -130,19 +132,10 @@ sc2wol_options: Dict[str, Option] = {
}
def get_option_value(multiworld: MultiWorld, player: int, name: str) -> int:
option = getattr(multiworld, name, None)
def get_option_value(multiworld: MultiWorld, player: int, name: str) -> Union[int, FrozenSet]:
if multiworld is None:
return sc2wol_options[name].default
if option is None:
return 0
player_option = getattr(multiworld, name)[player]
return int(option[player].value)
def get_option_set_value(multiworld: MultiWorld, player: int, name: str) -> set:
option = getattr(multiworld, name, None)
if option is None:
return set()
return option[player].value
return player_option.value