Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sc2: Adding a max supply reduction trap item; added an option to control filler ratios #374

Conversation

MatthewMarinets
Copy link

@MatthewMarinets MatthewMarinets commented Dec 13, 2024

What is this fixing or adding?

  • Adding an option filler_ratio to allow controlling the ratio of filler items
  • Adding a new filler trap item to reduce the supply cap from 200
    • Default appearance is 0 (controlled by filler_ratio)
    • Includes option to change impact per item
    • Includes option to affect minimum floor, beyond which the maximum supply cannot drop further
    • These options are all controllable with /option

Plus other minor improvements:

  • enable_x_locations: resources can now spawn shield regen items, and is subject to filler_ratio
  • Many mypy fixes

How was this tested?

New unit tests. Did a test generation and checked the spoiler for filler ratios. Just setting amounts to 1~3, items marked with 3 appeared approximately 3 times as often as items marked 1, and items marked 2 appeared twice as much as marked 1. (1 -> ~50, 2 -> ~100, 3 -> ~150)

Started a game, used /send to give a max supply reduction item. Went into the mission, built a ton of supply depots, and changed the lowest_max_supply and reduced_supply_per_item options in the client, doing a /send phaneros additional starting minerals to get the client to send another message to the game. Verified the max supply capped where it should -- lowest supply 100 supply reduction 100 went to 100; lowest 180 reduction 100 went to 180; lowest 180 reduction 5 went to 195.

Screenshot2024-12-13 00_05_14

If this makes graphical changes, please attach screenshots.

Here's how the new options generate in the template:

  maximum_supply_reduction_per_item:
    # Configures how much maximum supply is reduced per trap item.
    #
    # You can define additional values between the minimum and maximum values.
    # Minimum value is 1
    # Maximum value is 10
    1: 50
    random: 0
    random-low: 0
    random-high: 0

  lowest_maximum_supply:
    # Controls how far max supply reduction traps can reduce maximum supply.
    #
    # You can define additional values between the minimum and maximum values.
    # Minimum value is 100
    # Maximum value is 200
    180: 50
    random: 0
    random-low: 0
    random-high: 0

  filler_ratio:
    # Controls the relative probability of each filler item being generated over others.
    Additional Maximum Supply: 1
    Additional Starting Minerals: 1
    Additional Starting Supply: 1
    Additional Starting Vespene: 1
    Decreased Maximum Supply: 0
    Increased Building Construction Speed: 1
    Increased Shield Regeneration: 1

@MatthewMarinets
Copy link
Author

Got an email notification that test_item_filtering.test_excluding_one_item_of_multi_parent_doesnt_filter_children failed; bumped up the exclusions slightly to make it less likely to fail for spurious reasons.

@MatthewMarinets
Copy link
Author

Another test run failed, this time due to 2 flaky tests. The first was Overcooked!, which I didn't touch. The second was test_custom_mission_orders.py::TestCustomMissionOrders::test_locked_and_necessary_item_appears_once, which I think was failing because the key item was being pushed to start inventory, and push_precollected_items_to_multiworld() wasn't sending the filter_flags and thus precollected items weren't accounting for ForceProgression. This should now be fixed, start inventory key items will properly display as prgoression, and the test should be less flaky.

@Ziktofel Ziktofel merged commit fe2505c into Ziktofel:sc2-next Dec 14, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants