* CounterOption
* bring back the negative exception for ItemDict
* Backwards compatibility
* ruff on witness
* fix in calls
* move the contains
* comment
* comment
* Add option min and max values for CounterOption
* Use min 0 for TrapWeights
* This is safe now
* ruff
* This fits on one line again now
* OptionCounter
* Update Options.py
* Couple more typing things
* Update Options.py
* Make StartInventory work again, also make LocationCounter theoretically work
* Docs
* more forceful wording
* forced line break
* Fix unit test (that wasn't breaking?)
* Add trapweights to witness option presets to 'prove' that the unit test passes
* Make it so you can order stuff
* Update macros.html
* Only consider usable exits when calculating whether or not a region is a dead-end
* Update EntranceLookup unit tests
* Add new dead-end test
* Add additional explanation to the new test
* minor formatting tweak
based on review feedback
---------
Co-authored-by: CodeGorilla <3672561+Ars-Ignis@users.noreply.github.com>
* [Core][GER] Allow and require user-provided target name when splitting 1-way entrances
* Move target naming onto a parameter of disconnect_entrance_for_randomization
* Tests: unroll test_multiworlds.TestTwoPlayerMulti
Also adds a helper function that other tests can use to unroll tests.
* Docs: add more details to docs/tests.md
* Explain parametrization, subtests and link to the new helper
* Mention some performance details and work-arounds
* Mention multithreading / pytest-xdist
* Tests: make param.classvar_matrix accept sets
* CI: add test/param.py to type checking
* Tests: add missing typing to test/param.py
* Tests: fix typo in test/param.py doc comment
Co-authored-by: qwint <qwint.42@gmail.com>
* update docs
* Docs: reword note on performance
---------
Co-authored-by: qwint <qwint.42@gmail.com>
* Add test that stage1 ER will not fail due to speculative sweeping an indirect conditioned dead end
* Skip speculative sweep if it's the last entrance placement
* Better implementation of needs_speculative_sweep
* pep8
* CI: ctest: fix trigger on CMakeLists change
* CI: ctest: update cmake version
this removes a warning
and matches gtest
* CI: ctest: remove explicit build mode for MSVC
gtest switched to dynamic libc (/MD), which is default, so this just works now
* uses itempool count vs unfilled location count instead of counting prog_items values which could have custom counters
* move unfilled location check to before can_reach
* add tests for successful minimal GER call with extra collect override prog_items in the pool to regression test issue fixed in this PR
* Tests: massively improve the memory leak test performance
With the growing number of worlds, GC becomes the bottleneck and slows down the test.
* Tests: fix typing in general/test_memory
* unit test that get all state is called with partial entrances before connect_entrances
* fix the two worlds doing it
* lol
* unused import
* Update test/general/test_entrances.py
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
* Update test_entrances.py
---------
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
* Add connect_entrances
* update ER docs
* fix that test, but also ew
* Add a test that asserts the new finalization
* Rewrite test a bit
* rewrite some more
* blank line
* rewrite rewrite rewrite
* rewrite rewrite rewrite
* RE. WRITE.
* oops
* Bruh
* I guess, while we're at it
* giga oops
* It's been a long day
* Switch KH1 over to this design with permission of GICU
* Revert
* Oops
* Bc I like it
* Update locations.py
* Core: some low-hanging fruit on the strict type check
* bump pyright version
* bump pyright version
* bump pyright and remove file that's no longer easy
* Initial implementation of Generic ER
* Move ERType to Entrance.Type, fix typing imports
* updates based on testing (read: flailing)
* Updates from feedback
* Various bug fixes in ERCollectionState
* Use deque instead of queue.Queue
* Allow partial entrances in collection state earlier, doc improvements
* Prevent early loops in region graph, improve reusability of ER stage code
* Typos, grammar, PEP8, and style "fixes"
* use RuntimeError instead of bare Exceptions
* return tuples from connect since it's slightly faster for our purposes
* move the shuffle to the beginning of find_pairing
* do er_state placements within pairing lookups to remove code duplication
* requested adjustments
* Add some temporary performance logging
* Use CollectionState to track available exits and placed regions
* Add a method to automatically disconnect entrances in a coupled-compliant way
Update docs and cleanup todos
* Make find_placeable_exits deterministic by sorting blocked_connections set
* Move EntranceType out of Entrance
* Handle minimal accessibility, autodetect regions, and improvements to disconnect
* Add on_connect callback to react to succeeded entrance placements
* Relax island-prevention constraints after a successful run on minimal accessibility; better error message on failure
* First set of unit tests for generic ER
* Change on_connect to send lists, add unit tests for EntranceLookup
* Fix duplicated location names in tests
* Update tests after merge
* Address review feedback, start docs with diagrams
* Fix rendering of hidden nodes in ER doc
* Move most docstring content into a docs article
* Clarify when randomize_entrances can be called safely
* Address review feedback
* Apply suggestions from code review
Co-authored-by: Aaron Wagener <mmmcheese158@gmail.com>
* Docs on ERPlacementState, add coupled/uncoupled handling to deadend detection
* Documentation clarifications
* Update groups to allow any hashable
* Restrict groups from hashable to int
* Implement speculative sweeping in stage 1, address misc review comments
* Clean unused imports in BaseClasses.py
* Restrictive region/speculative sweep test
* sweep_for_events->advancement
* Remove redundant __str__
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
* Allow partial entrances in auto indirect condition sweep
* Treat regions needed for logic as non-dead-end regardless of if they have exits, flip order of stage 3 and 4 to ensure there are enough exits for the dead ends
* Typing fixes suggested by mypy
* Remove erroneous newline
Not sure why the merge conflict editor is different and worse than the normal editor. Crazy
* Use modern typing for ER
* Enforce the use of explicit indirect conditions
* Improve doc on required indirect conditions
---------
Co-authored-by: qwint <qwint.42@gmail.com>
Co-authored-by: alwaysintreble <mmmcheese158@gmail.com>
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
* Core: fix settings API for removal of Python 3.8, 3.9
This is fixing 2 problems:
- The `World` class has the annotation:
`settings: ClassVar[Optional["Group"]]`
so `MyWorld.settings` should not raise an exception like it does for some worlds.
With the `Optional` there, it looks like it should return `None` for the worlds that don't use it. So that's what I changed it to.
- `Group.update` had some code that required `typing.Union` instead of the Python 3.10 `|` for unions.
added unit test for this fix
added change in Zillion that I used to discover this problem and used it to test the test
* fix copy-pasted stuff
* tuple instead of set
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
---------
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
* WebHost: use new safe yaml template filename
this mirrors the change in ArchipelagoMW/#4106 in WebHost
* WebHost: install docs into safe filename and require docs to be named safe
* Test: update doc test for safe name
* WebHost: fix import order to not break ModuleUpdate
* add quotes around strings containing {{ game }}
* do the actually correct thing instead of a hack
thanks berserker66 for pointing out to me that I was doing this the
completly wrong way, so I fixed it up
* Clean up filenames to prevent illegal chars
* Use %s substitution instead of concatenation
* whoops
somehow i removed a space from the comment for the regex, so this adds
it back
* Use pre-existing function in Utils.py
* Test: add test for option yaml with colon
---------
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
* Tests: Add a test that weights file generates different results per player correctly
* Update test/programs/test_generate.py
* Generate.main() return and accessibility options were changed
The "filling multiworld" subtest was at the wrong indentation, so was
only running for the last world_type.
"games" has additionally been added to the subtest to help better
identify failures.
Now that the subtest is actually being run for each world type, this
adds about 20 seconds to the duration of the test on my machine.
* WebHost: add spinner to room command
and show error message if fetch fails due to NetworkError
* WebHost: don't update room log while tab is inactive
* WebHost: don't include log for automated requests
* WebHost: refresh room also for re-spinups
and do that from javascript
* Test, WebHost: send fake user-agent where required
* WebHost: remove wrong comment in host room
* Rename sweep_for_events to sweep_for_advancements
* more event->advancement renames
* oops accidentally deleted the deprecation thing in the force push
* Update TestDungeon.py
* Update BaseClasses.py
* Update BaseClasses.py
* oops
* utils.deprecate
* treble, you had no idea how right you were
* Update test_panel_hunt.py
* Update BaseClasses.py
Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com>
---------
Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com>
* Blasphemous: WIP overhaul
* Entrance rule mistake
* stuff
* Getting closer
* Real?? Maybe??
* Don't fail me now 🙏
* Add starting location tests
* More tests (it still doesn't work actually 😔)
* REAL
* Add unreachable regions to test_reachability.py
* PR ready
- Remove unused functions from init
- Use group exclusive functions in rules
- Style changes
* Bump required client version
* Clean up unused imports
* Change slot data
* Review fixes
- Prevent strength calculations from including excess items
- Add new lines to ends of files
- Fix missed deprecated option and random usage in init
* Update option docstrings, add groups
* Add preprocessor files
* Update option docstrings again actually
* Update player strength calculation
* Rename group methods
* Fix missing logic for RESCUED_CHERUB_06
* Register indirect conditions
* Register indirect conditions (part 2)
* Update extracted logic, change slot data key
* Add region to excluded list
* A capital letter
* Use camelCase keys in preprocessor
* Write some of new setup guide
* Remove indents before list points
* Change locationinfo to list of dictonaries
* Finish docs, update extractor config and data
* Mark region_data.py as generated
* Suggested changes
* More suggested changes
* Suggested changes again
- Use OptionError
- Create list of disabled locations before looping
- Check if options are equal to str instead of int
- Clean up start location override
- Reword some of setup guide
- Organize location list
- Remove unnecessary escaped quotes from option docstrings
- Add world type to test base
* C# moment
* Requested changes
* Update .gitattributes
---------
Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>