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

Generate: Add skip progression balancing argument. #1876

Merged

Conversation

ThePhar
Copy link
Member

@ThePhar ThePhar commented Jun 19, 2023

What is this fixing or adding?

Adds a command line argument for Generate.py to skip progression balancing step, regardless of individual player progression_balancing settings. Argument is called --skip_prog_balancing.

Run with command line: python Generate.py (No changes)

Archipelago (0.4.1) logging initialized on Windows-10-10.0.22621-SP0 running Python 3.10.8
P1 Weights: Test1.yaml >> Generated by https://archipelago.gg/
P2 Weights: Test2.yaml >> Generated by https://archipelago.gg/
Generating for 2 players, 48891933062538200934 Seed 99530657785344493820 with plando: bosses
Archipelago Version 0.4.1  -  Seed: 99530657785344493820

[...Worlds Info...]

Creating World.
Creating Items.
Calculating Access Rules.
Running Item Plando
Running Pre Main Fill.
Filling the world with 145 items.
Balancing multiworld progression for 2 Players.
Beginning output...
Generating output files (2/2).
Calculating playthrough.
Creating final archive at C:\Users\Phar\PycharmProjects\archipelago\output\AP_48891933062538200934.zip
Done. Enjoy. Total Time: 0.2825881000026129

Run with command line: python Generate.py --skip_prog_balancing (Note: skipped message and faster generation time)

Archipelago (0.4.1) logging initialized on Windows-10-10.0.22621-SP0 running Python 3.10.8
P1 Weights: Test1.yaml >> Generated by https://archipelago.gg/
P2 Weights: Test2.yaml >> Generated by https://archipelago.gg/
Generating for 2 players, 42643419601722786858 Seed 50354090084942403599 with plando: bosses
Archipelago Version 0.4.1  -  Seed: 50354090084942403599

[...Worlds Info...]

Creating World.
Creating Items.
Calculating Access Rules.
Running Item Plando
Running Pre Main Fill.
Filling the world with 145 items.
Progression balancing skipped.
Beginning output...
Generating output files (2/2).
Calculating playthrough.
Creating final archive at C:\Users\Phar\PycharmProjects\archipelago\output\AP_42643419601722786858.zip
Done. Enjoy. Total Time: 0.10602330000256188

Changes to help: python Generate.py --help

usage: Generate.py [-h] [--weights_file_path WEIGHTS_FILE_PATH] [--samesettings] [--player_files_path PLAYER_FILES_PATH] [--seed SEED] [--multi MULTI] [--spoiler SPOILER] [--outputpath OUTPUTPATH] [--race] [--meta_file_path META_FILE_PATH] [--log_level LOG_LEVEL] [--yaml_output YAML_OUTPUT] [--plando PLANDO] [--skip_prog_balancing]

CMD Generation Interface, defaults come from host.yaml.

options:
  -h, --help            show this help message and exit
  --weights_file_path WEIGHTS_FILE_PATH
                        Path to the weights file to use for rolling game settings, urls are also valid
  --samesettings        Rolls settings per weights file rather than per player
  --player_files_path PLAYER_FILES_PATH
                        Input directory for player files.
  --seed SEED           Define seed number to generate.
  --multi MULTI
  --spoiler SPOILER
  --outputpath OUTPUTPATH
                        Path to output folder. Absolute or relative to cwd.
  --race
  --meta_file_path META_FILE_PATH
  --log_level LOG_LEVEL
                        Sets log level
  --yaml_output YAML_OUTPUT
                        Output rolled mystery results to yaml up to specified number (made for async multiworld)
  --plando PLANDO       List of options that can be set manually. Can be combined, for example "bosses, items"
  --skip_prog_balancing
                        Skip progression balancing step during generation.

How was this tested?

Ran multiple generations to confirm progression balancing was skipped with argument and not skipped without.

If this makes graphical changes, please attach screenshots.

N/A

@ThePhar ThePhar added the is: enhancement Issues requesting new features or pull requests implementing new features. label Jun 19, 2023
@el-u
Copy link
Collaborator

el-u commented Jun 23, 2023

This seems oddly specific. What's the usecase for this?
Do you really need a way to override the players' options even harder than meta.yaml?

@ThePhar
Copy link
Member Author

ThePhar commented Jun 23, 2023

This seems oddly specific. What's the usecase for this? Do you really need a way to override the players' options even harder than meta.yaml?

2 reasons:

  1. This, in my opinion, is an easier interface for completely disabling progression balancing than just plugging in a meta.yaml and many times I see people (including Berserker) just comment out the call to balance_multiworld_progression. This is very helpful in cases of generating asyncs or games that need progression balancing disabled, a fairly common requirement.

https://discord.com/channels/731205301247803413/731205301818359821/1120271608116944926
image

  1. Triggers can bypass a meta.yaml. Run a generation with the following meta.yaml:
meta_description: Test
null:
  progression_balancing: 0

And let's say a Minecraft yaml with the following trigger:

# ...
Minecraft:
  # ...
  progression_balancing: 0  # although it really doesn't matter.
  force_prog_balancing: true
  triggers:
    - option_name: force_prog_balancing
      option_category: Minecraft
      option_result: true
      options:
        Minecraft:
          progression_balancing: 50

Even though you "meta"ed it disabled, progression balancing will still run for this world:

[...]
Creating World.
Creating Items.
Calculating Access Rules.
Running Item Plando
Running Pre Main Fill.
Filling the world with 145 items.
Balancing multiworld progression for 1 Players.
Beginning output...
Generating output files (2/2).
Calculating playthrough.
Creating final archive at C:\Users\Phar\PycharmProjects\archipelago\output\AP_80978563092342486569.zip
Done. Enjoy. Total Time: 0.07495069998549297

The only other solution is to run triggers first, then run meta, which may be more desirable, but is outside the scope of this change.

@Berserker66
Copy link
Member

Full disclosure: I will continue commenting it out. I can do that faster than adding a cmd arg.

@ThePhar
Copy link
Member Author

ThePhar commented Jun 23, 2023

Full disclosure: I will continue commenting it out. I can do that faster than adding a cmd arg.

To each their own, I would just have something like so set up lol
image

@ThePhar ThePhar merged commit 71bfb6b into ArchipelagoMW:main Jun 26, 2023
@ThePhar ThePhar deleted the no-progression-balancing-cli-option branch June 26, 2023 21:14
Zunawe pushed a commit to Zunawe/Archipelago that referenced this pull request Jun 30, 2023
FlySniper pushed a commit to FlySniper/Archipelago that referenced this pull request Nov 14, 2023
Jouramie pushed a commit to Jouramie/Archipelago that referenced this pull request Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is: enhancement Issues requesting new features or pull requests implementing new features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants