Almost all of the events have been eradicated, which significantly improves both generation speed and playthrough calculation.
Previously, checking for access to a location involved checking for access to each panel in the location, as well as recursively checking for access to any panels required by those panels. This potentially performed the same check multiple times. The access requirements for locations are now calculated and flattened in generate_early, so that the access function can directly check for the required rooms, doors, and colors.
These flattened access requirements are also used for Entrance checking, and register_indirect_condition is used to make sure that can_reach(Region) is safe to use.
The Mastery and Level 2 rules now just run a bunch of access rules and count the number of them that succeed, instead of relying on event items.
Finally: the Level 2 panel hunt is now enabled even when Level 2 is not the victory condition, as I feel that generation is fast enough now for that to be acceptable.
- Removes the Pokémon Client, adding support for Red and Blue to the Bizhawk Client.
- Adds `/bank` commands that mirror SDV's, allowing transferring money into and out of the EnergyLink storage.
- Adds a fix to the base patch so that the progressive card key counter will not increment beyond 10, which would lead to receiving glitch items. This value is checked against and verified that it is not > 10 as part of crash detection by the client, to prevent erroneous location checks when the game crashes, so this is relevant to the new client (although shouldn't happen unless you're using !getitem, or putting progressive card keys as item link replacement items)
More speed optimizations for The Messenger. Moves Figurines into their own region, so their complicated access rule only needs to be calculated once when doing a sweep. Removes a redundant loop for shop locations by just directly assigning the access rule in the class instead of retroactively. Reduces slot_data to only information that can't be derived, and removes some additional extraneous data. Removes some unused sets and lists. Removes a redundant event location, and increments the required_client_version to prevent clients that don't expect the new slot_data. Drops data version since it's going away soon anyways, to remove conflicts.
This allows multiple client/connector pairs to run at the same time. It also includes a few other miscellaneous small changes that accumulated as I went. They can be split if desired
- Whatever the `client_socket:send` line (~440) was doing with that missing operator, it's no longer doing. Don't ask me how it was working before. Lua is witchcraft.
- Removed the `settimeout(2)` which causes the infamous emulator freeze (and replaced it with a `settimeout(0)` when the server socket is created). It appears to be unnecessary to set a timeout for discovering a client. Maybe at some point in time it was useful to keep the success rate for connecting high, but it seems to not be a problem if the timeout is 0 instead.
- Also updated the Emerald setup to remove mention of the freezing.
- Connector script now picks the first port that's not in use in a range of 5 ports.
- To summarize why I was previously under the impression that multiple running scripts would not detect when a port was in use:
1. Calling `socket.bind` in the existing script will first create an ipv6 socket.
2. A second concurrent script trying to bind to the same port would I think fail to create an ipv6 socket but then succeed in creating an ipv4 socket on the same port.
3. That second socket could never communicate with a client; extra clients would just bounce off the first script.
4. The third concurrent script will then fail on both and actually give an `address already in use` error.
- I'm not _really_ sure what's going on there. But forcing one or the other by calling `socket.tcp4()` or `socket.tcp6()` means that only one script will believe it has the port while any others will give `address already in use` as you'd expect.
- As a side note, our `socket.lua` is much wonkier than I had previously thought. I understand some parts were added for LADX and when BizHawk 2.9 came out, but as far back as the file's history in this repo, it has provided a strange, modified interface as compared to the file it was originally derived from, to no benefit as far as I can tell.
- The connector script closes `server` once it finds a client and opens a new one if the connection drops. I'm not sure this ultimately has an effect, but it seems more proper.
- If the connector script's main function returns because of some error or refusal to proceed, the script no longer tries to resume the coroutine it was part of, which would flood the log with irrelevant errors.
- Creating `SyncError`s in `guarded_read` and `guarded_write` would raise its own error because the wrong variable was being used in its message.
- A call to `_bizhawk.connect` can take a while as the client tries the possible ports. There's a modification that will wait on either the `connect` or the exit event. And if the exit event fires while still looking for a connector script, this cancels the `connect` so the window can close.
- Related: It takes 2-3 seconds for a call to `asyncio.open_connection` to come back with any sort of response on my machine, which can be significant now that we're trying multiple ports in sequence. I guess it could fire off 5 tasks at once. Might cause some weirdness if there exist multiple scripts and multiple clients looking for each other at the same time.
- Also related: The first time a client attempts to connect to a script, they accept each other and start communicating as expected. The second client to try that port seems to believe it connects and will then time out on the first message. And then all subsequent attempts to connect to that port by any client will be refused (as expected) until the script shuts down or restarts. I haven't been able to explain this behavior. It adds more time to a client's search for a script, but doesn't ultimately cause problems.
Changelog:
Features:
- New goal
- Chaos Chao
- Raise a Chaos Chao to win!
- New optional Location Checks
- Chao Animal Parts
- Each body part from each type of animal is a location
- Chao Stats
- 0-99 levels of each of the 7 Chao stats can be locations
- The frequency of Chao Stat locations can be set (every level, every 2nd level, etc)
- Kindergartensanity
- Classroom lessons are locations
- Either all lessons or any one of each category can be set as locations
- Shopsanity
- A specified number of locations can be placed in the Chao Black Market
- These locations are unlocked by acquiring `Chao Coin`s
- Ring costs for these items can be adjusted
- Chao Karate can now be set to one location per fight, instead of one per tournament
- Items
- If any Chao locations are active, the following will be in the item pool:
- Chao Eggs
- Garden Seeds
- Garden Fruit
- Chao Hats
- Chaos Drives
- The starting eggs in the garden can be a random color
- Chao World entrances can be shuffled
- Chao are given default names
- New Traps
- Reverse Trap
Quality of Life:
- Chao Save Data is now separate per-slot in addition to per-seed
- This allows a single player to have multiple slots in the same seed, each having separate Chao progress
- Chao Race/Karate progress is now displayed on Stage Select (when hovering over Chao World)
- All Chao can now enter the Hero and Dark races
- Chao Karate difficulty can be set separately from Chao Race difficulty
- Chao Aging can be sped up at will, up to 15×
- New mod `config` option to fine-tune Chao Stat multiplication
- Note: This does not mix well with the Mod Manager "`Chao Stat Multiplier`" code
- Pong Traps can now activate in Chao World
- Maximum range for possible number of Emblems is now 1000
- General APWorld cleanup and optimization
- Option access has moved to the new options system
- An item group now exists for trap items
Bug Fixes:
- Dry Lagoon now has all 11 Animals
- Eternal Engine - 2 (Standard and Hard Logic) now requires only `Tails - Booster`
- Lost Colony - 2 (Hard Logic) now requires no upgrades
- Lost Colony - Animal 9 (Hard Logic) now requires either `Eggman - Jet Engine` or `Eggman - Large Cannon`
Modifies various access rules in the lufia2ac world with the aim of making them evaluate quicker.
Instead of having to determine the reachability of another location, they now only have to count items in state, which is faster.
(Also made it reuse the identical lambda for multiple locations, which might save a smidgen of memory.)
In a lot of cases, Factorio would write data to file first, then attach that file into zip. It now directly attaches the data to the zip and encapsulation was used to allow earlier GC in places (rendered templates especially).
* Lingo: Fix painting shuffle logic issue in The Wise
* Lingo: More generic painting cycle prevention
* Lingo: okay how about now
* Lingo: Consider Owl Hallway blocked painting areas in vanilla doors
* Lingo: so honestly I should've seen this one coming
* Lingo: Refined req_blocked for vanilla doors
* Lingo: Orange Tower Basement is also owl-blocked
* Lingo: Rewrite randomize_paintings to eliminate rerolls
Now, mapping is done in two phases, rather than assigning everything at once and then rerolling if the mapping is non-viable.
* Add Unique Locals Commands to ChecksFinder
* Add Unique Locals Commands to MMBN3 Game Page
* Add Unique Locals Commands to Ocarina of Time Game Page
* Add Unique Locals Commands to Undertale Game Page
* Add Unique Locals Commands to Wargroove Game Page
* Add Unique Locals Commands to The Legend of Zelda Game Page
* Add Unique Locals Commands to Zillion Game Page
* Amend Unique Locals Commands on Final Fantasy 1 Game Page
* Add Unique Locals Commands to Pokemon R/B Game Page
* Grammar fix for FF1
* Corrected sections names to match
* Added commands to Starcraft 2 Wings of Liberty game page
Co-authored-by: Bicoloursnake <60069210+bicoloursnake@users.noreply.github.com>
---------
Co-authored-by: Bicoloursnake <60069210+bicoloursnake@users.noreply.github.com>
- Entrance randomizer no longer grows with multiworld
- Improved ER success rate again by prioritizing Temple of Time even more
- Prefill is faster, has slightly reduced failure rate when map/compass are in dungeon but previous items in any_dungeon (which consumed all available locations), no longer removes items from the main itempool; itemlinked prefill items removed to accomodate improvements
- Now triggers only one recache after `generate_basic` instead of one per oot world
- Avoids recaches during `create_regions`
- All ER temp entrances have unique names (so the entrance cache does not break)
this allows skipping multiple simplifications of the same object, e.g. item_rules
also update the logic simplification tests to be a proper unittest.TestCase
* add missing groups
* remove set comprehensions
* fix boss essence
* reorganized them
* combine boss essence on creation instead of update
* rename to match option names
* Add missing groups
* add PoP totem
* Stardew Valley: Test: unify mods
* Stardew Valley: Test: don't use SVTestBase where setUp is unused
* Stardew Valley: Test: remove duplicate backpack test
* Stardew Valley: Test: remove 2,3,4 heart tests
assume the math is correct with just 2 points on the curve
* Stardew Valley: Test: reduce duplicate test/gen runs
* Stardew Valley: Test: Change 'long' tests to not use TestBase
TestBase' setUp is not being used in the changed TestCases
* Stardew Valley: Test: Use subtests and inheritance for backpacks
* Stardew Valley: Test: add flag to skip some of the extensive tests by default
* Stardew Valley: speed up rules creation by 4%
No class should ever inherit from And, Or, False_ or True_ and isinstance is not free.
Sadly there is no cheap way to forbid inheritance, but it was tested using metaclass.
* Stardew Valley: save calls to type()
Local variable is a bit faster than fetching type again
* Stardew Valley: save calls to True_() and False_(), also use 'in' operator
* Stardew Valley: optimize And and Or simplification
* Stardew Valley: optimize logic constructors
* bumpstik: treasure/booster location rules
* bumpstik: oop missed a bit
* bumpstik: apply access rule to Hazards check
* bumpstik: move completion cond. to set_rules
* bumpstik: tests?
I have literally never written these before so 🤷
* bumpstik: oops
* bumpstik: how about this?
* bumpstik: fix some logic
* bumpstik: this almost works but not quite
* bumpstik: accurate region boundaries for BBs
since we're using rules now
* bumpstik: holy heck it works now
* SoE: create regions cleanup and speedup
keep local reference instead of hitting multiworld cache
also technically fixes a bug where all locations are in 'menu', not 'ingame'
* SoE: somplify region connection
* WebHost: unify references to options
* it was just an extra s the whole time...
* grammar
* redirect from old pages
* redirect stuff correctly
* use url_for
* use " for modified strings
* remove redirect cache
* player_settings
* update site map
Sweep only current player's locations so that more players does not slow it down.
Fix a slight possibility of Full door shuffle crash by only sorting for outdoor dead ends only when connecting from a non-dead end.
- Added location name groups, so you can make your entire Water Temple priority to annoy everyone else
- Significant improvement to ER generation success rate (~80% to >99%)
- Changed `adult_trade_start` option to a choice option instead of a list (this shouldn't actually break any YAMLs though, due to the lesser-known property of lists parsing as a uniformly-weighted choice)
- Major improvements to the option tooltips where needed. (Possibly too much text now)
- Changed default hint distribution to `async` to help people's generation times. The tooltip explains that it removes WOTH hints so people hopefully don't get tripped up.
- Makes stick and nut capacity upgrades useful items
- Added shop prices and required trials to spoiler log
- Added Cojiro to adult trade item group, because it had been forgotten previously
- Fixed size-modified chests not being moved properly due to trap appearance changing the size
- Fixed Thieves Hideout keyring not being allowed in start inventory
- Fixed hint generation not accurately flagging barren locations on certain dungeon item shuffle settings
- Fixed bug where you could plando arbitrarily-named items into the world, breaking everything
This PR adds a new, optional aspect to the Ancient Cave experience:
During their run, players can have the opportunity to purchase some additional items or spells to improve their party. If enabled, a shop will appear everytime a certain (configurable) number of floors in the dungeon has been completed. The shop inventories are generated randomly (taking into account player preference as well as a system to ensure that more expensive items can only become available deeper into the run).
For customization, 3 new options are introduced:
- `shop_interval`: Determines by how many floors the shops are separated (or keeps them turned off entirely)
- `shop_inventory`: Determines what's possible to be for sale. (Players can specify weights for general categories of things such as "weapon" or "spell" or even adjust the probabilities of individual items)
- `gold_modifier`: Determines how much gold is dropped by enemies. This is the player's only source of income and thus controls how much money they will have available to spend in shops
"Added a bunch of tests to make sure I don't break anything during refactoring
Huge cleanup in the Regions file, extract methods, remove code duplicate, fix typos, fix variable naming conventions, etc.
Small cleanup in other places, minor stuff just what was needed for Regions"
- Fix generation failing with certain gesture shuffle options
- Fixed passing ItemDict to multidata instead of item code
- Don't allow CHARGE UP to be placed at Foglast: TV
- APWorld support by removing LogicMixin from Rules.py
🤞
* map option objects to a `World.options` dict
* convert RoR2 to options dict system for testing
* add temp behavior for lttp with notes
* copy/paste bad
* convert `set_default_common_options` to a namespace property
* reorganize test call order
* have fill_restrictive use the new options system
* update world api
* update soe tests
* fix world api
* core: auto initialize a dataclass on the World class with the option results
* core: auto initialize a dataclass on the World class with the option results: small tying improvement
* add `as_dict` method to the options dataclass
* fix namespace issues with tests
* have current option updates use `.value` instead of changing the option
* update ror2 to use the new options system again
* revert the junk pool dict since it's cased differently
* fix begin_with_loop typo
* write new and old options to spoiler
* change factorio option behavior back
* fix comparisons
* move common and per_game_common options to new system
* core: automatically create missing options_dataclass from legacy option_definitions
* remove spoiler special casing and add back the Factorio option changing but in new system
* give ArchipIDLE the default options_dataclass so its options get generated and spoilered properly
* reimplement `inspect.get_annotations`
* move option info generation for webhost to new system
* need to include Common and PerGame common since __annotations__ doesn't include super
* use get_type_hints for the options dictionary
* typing.get_type_hints returns the bases too.
* forgot to sweep through generate
* sweep through all the tests
* swap to a metaclass property
* move remaining usages from get_type_hints to metaclass property
* move remaining usages from __annotations__ to metaclass property
* move remaining usages from legacy dictionaries to metaclass property
* remove legacy dictionaries
* cache the metaclass property
* clarify inheritance in world api
* move the messenger to new options system
* add an assert for my dumb
* update the doc
* rename o to options
* missed a spot
* update new messenger options
* comment spacing
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
* fix tests
* fix missing import
* make the documentation definition more accurate
* use options system for loc creation
* type cast MessengerWorld
* fix typo and use quotes for cast
* LTTP: set random seed in tests
* ArchipIdle: remove change here as it's default on AutoWorld
* Stardew: Need to set state because `set_default_common_options` used to
* The Messenger: update shop rando and helpers to new system; optimize imports
* Add a kwarg to `as_dict` to do the casing for you
* RoR2: use new kwarg for less code
* RoR2: revert some accidental reverts
* The Messenger: remove an unnecessary variable
* remove TypeVar that isn't used
* CommonOptions not abstract
* Docs: fix mistake in options api.md
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
* create options for item link worlds
* revert accidental doc removals
* Item Links: set default options on group
* change Zillion to new options dataclass
* remove unused parameter to function
* use TypeGuard for Literal narrowing
* move dlc quest to new api
* move overcooked 2 to new api
* fixed some missed code in oc2
* - Tried to be compliant with 993 (WIP?)
* - I think it all works now
* - Removed last trace of me touching core
* typo
* It now passes all tests!
* Improve options, fix all issues I hope
* - Fixed init options
* dlcquest: fix bad imports
* missed a file
* - Reduce code duplication
* add as_dict documentation
* - Use .items(), get option name more directly, fix slot data content
* - Remove generic options from the slot data
* improve slot data documentation
* remove `CommonOptions.get_value` (#21)
* better slot data description
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
---------
Co-authored-by: el-u <109771707+el-u@users.noreply.github.com>
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
Co-authored-by: Doug Hoskisson <beauxq@yahoo.com>
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
Co-authored-by: Alex Gilbert <alexgilbert@yahoo.com>
* Tests: Add a test for fill to WorldTestBase
* test items and minimal accessibility, only bailing out when no reachable locations exist.
* put egg shard max/goal at sane values
114 locations - 35 always-present progression items - 25 excluded locations from settings <= 74 egg shards
past me can't do arithmetic
* f
* i'm bad at git
* make fill import local to prevent circular imports
---------
Co-authored-by: espeon65536 <espeon65536@gmail.com>
* set display_name throughout Options.py
* drop whitespace changes
---------
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
* added setup_es.md
setup_en 100% translated (with a bit of adaptation to spanish linguistics)
* Update __init__.py
add reference to the spanish tutorial
* Update setup_es.md
removed temporary "wip translation" header
* Update setup_es.md
formatting cleanup
* Update setup_es.md
translated "alias for" on lines 73 and 74, which I just forgot to
* Update setup_es.md
fixed a bunch of punctuation/grammar and fixed bold format in Configuring Bizhawk section
* Update worlds/pokemon_rb/docs/setup_es.md
updated bold format as per nicholassaylor's suggestion
Co-authored-by: Nicholas Saylor <79181893+nicholassaylor@users.noreply.github.com>
---------
Co-authored-by: Nicholas Saylor <79181893+nicholassaylor@users.noreply.github.com>
* Update commands_en.md
Commands re-ordered and put into categories
Some commands were better documented / explained more clearly
Other formatting changes
* Status command moved to General category and elaboration on getitem command
* "Multi-world" -> "Multiworld"
* Moved game-specific local commands to game pages
Adds a generic client that can communicate with BizHawk. Similar to SNIClient, but for arbitrary systems and doesn't have an intermediary application like SNI.
* added setup_es.md
setup_en 100% translated (with a bit of adaptation to spanish linguistics)
* Update __init__.py
add reference to the spanish tutorial
* Update setup_es.md
removed temporary "wip translation" header
* Update setup_es.md
formatting cleanup
* Update setup_es.md
translated "alias for" on lines 73 and 74, which I just forgot to
* Update SC2 setup guide
Removed a sentence that made sense when I included sudo in the command in the previous sentence, but does not make sense otherwise.
* Update en_Super Mario 64.md
It turns out castle has a lowercase l in it.
* Docs: SMW: Updated SNIClient Connector Lua Directory
* Docs: DKC3: Updated SNIClient Connector Lua Directory
* Docs: Lufia2AC: Updated SNIClient Connector Lua Directory
* Docs: SM: Updated SNIClient Connector Lua Directory
* Docs: SMZ3: Updated SNIClient Connector Lua Directory
* Cleaned up Undertale documentation
Standardized file names
* Outlined Terraria installation more clearly
Other minor edits to setup guide
* Minor edits to DOOM 1993 set-up guide
* Update worlds/terraria/docs/setup_en.md
Co-authored-by: kindasneaki <ryandj67@hotmail.com>
* Suggested changes from @Seldom-SE
Co-authored-by: Seldom <38388947+seldom-se@users.noreply.github.com>
* Code block to quotation change from code review
Co-authored-by: Seldom <38388947+seldom-se@users.noreply.github.com>
Co-authored-by: Chris Wilson <chris@legendserver.info>
* Code review from @LegendaryLinux
Co-authored-by: Chris Wilson <chris@legendserver.info>
---------
Co-authored-by: kindasneaki <ryandj67@hotmail.com>
Co-authored-by: Seldom <38388947+seldom-se@users.noreply.github.com>
Co-authored-by: Chris Wilson <chris@legendserver.info>
Expert Swamp Maze currently thinks it needs Red Underwater 4 instead of the door. This could lead to an unbeatable seed in door shuffle, although it's very unlikely.
* Changed the pathing code to use os.path.join, instead of adding strings together, also fixed the savepath command using UndertaleContext instead of self.ctx (Credit to Wackerly for finding the self.ctx issue and fix)
* Undertale: Fixed a debug function in the game not requiring debug to be enabled.
* Undetale: Fixed a logic bug with the location "Letter Quest"
* - Added a rule to vault bundles that require access to the wizard
- Fixed the region required to meet the wizard
* - Updated the location count in a test due to a previous coffee bean bugfix that added a location
Migrates SC2 WoL world to the new mod with new items and locations. The new mod has a different architecture making it more future proof (with planned adding of other campaigns). Also gets rid of several old bugs
Adds new short game formats intended for sync games (Tiny Grid, Mini Gauntlet). The final mission isn't decided by campaign length anymore but it's configurable instead. Allow excluding missions for Vanilla Shuffled, corrected some documentation.
NOTE: This is a squashed commit with Salz' HotS excluded (not ready for the release and I plan multi-campaign instead)
---------
Co-authored-by: Matthew <matthew.marinets@gmail.com>
* - Added missing logic rules where, to earn hearts above 8 and 10, you need access to dating and marriage respectively.
* - Slight cleanup based on Black Sliver's suggestion
* Add the rest of the Terraria settings to slot data
* Update worlds/terraria/__init__.py
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
---------
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
* Fix typo in Factorio options tooltip
* Fix typo, add details
* Apply code review suggestion
It doesn't let me apply more than one change to the same line in a batch.
Co-authored-by: Scipio Wright <scipiowright@gmail.com>
* Apply code review suggestion from @nicholassaylor
It doesn't let me apply more than one change to the same line in a batch.
---------
Co-authored-by: Scipio Wright <scipiowright@gmail.com>