* fix(docker): Correct copy command to use recursive flag for EnemizerCLI
- Changed 'cp' to 'cp -r' to properly copy EnemizerCLI directory
* docs(deployment): Update container deployment documentation
- Specify minimum versions for Docker and Podman
- Add requirement for Docker Buildx plugin
* Sweep events per-player to reduce sweep iterations
By finding all accessible locations per player and then collecting the
items from those locations, if any collected items belong to a different
player, then that player may be able to access more locations the next
time all of their accessible locations are found. This reduces the
number of iterations necessary to sweep through and collect from all
accessible locations.
* Also sweep per-player in MultiWorld.can_beat_game
* Deduplicate code by using sweep_for_events in can_beat_game
sweep_for_events has been modified to be able to return a generator and
to be able to change the set of locations that are filtered out. This
way, the same code can be used by both functions.
* Skip checking locations by assuming each world only logically depends on itself
While this assumption almost always holds true, worlds are allowed to
logically depend on other worlds, so the sweep always double checks at
the end by checking the locations of every world before finishing.
* Fix missed update to CollectionState.collect implementation
Collecting items with prevent_sweep=True (previously event=True) no
longer always returns True, so the return value should now be checked.
* Comment and variable name consistency/clarity
accessible/inaccessible -> reachable/unreachable
final sweep iteration -> extra sweep iteration
maybe_final_sweep -> checking_if_finished
* Apply suggestions from code review
Use Iterator in return type hint instead of Iterable to help indicate that the returned value can only be iterated once.
Be consistent in return statements. Because sweep_for_events can return a value now, the conditional branch that has no intended return value should explicitly return None.
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
* Update terminology from 'event' to 'advancement'
* Add typing overloads for sweep_for_advancements
This makes it so type-checkers and IDEs can see which calls return
`None` and which calls return `Iterator` so that it doesn't complain
about returning an `Iterator` from `sweep_for_events` or about iterating
through `None` in `can_beat_game`.
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
* Update comment for why discard the player after finding their locations
A lack of clarity was brought up in review.
* Update for removed typing import
---------
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
Since this does not have versions anymore, we check the sha256
and require manual intervention if it changed.
TODO: look for a way to do reproducible appimages again.
* chore(ci): exclude deployment and Docker files from unit test workflow triggers
- Modify unittests workflow to ignore changes in deploy directory and Docker-related files
* CreateHint command
* Docs
* oops
* forgot an arg
* Update MultiServer.py
* Add documentation on what happens when the hint already exists but with a different status (nothing)
* Early exit if no locations provided
* Add a clarifying comment to the code as well
* change wording a bit
* UPDATE: Dark Souls 3 setup docs to be more clear
* UPDATE: DS3 Setup docs to make offline mode more explicit
* UPDATE: Dark Souls 3 setup docs to be more clear
* UPDATE: DS3 Setup docs to make offline mode more explicit
* EDIT: DS3 setup docs to be up to date
Collecting an item into a CollectionState without sweeping, finding all
reachable locations, removing that item from the state, and then finding
all reachable locations again could result in more locations being
reachable than before the item was initially collected into the
CollectionState.
This issue was present because OoT was not invalidating its reachable
region caches for the different ages when items were removed from the
CollectionState.
To fix the issue, this PR has updated `OOTWorld.remove()` to invalid its
caches, like how `CollectionState.remove()` invalidates the core
Archipelago caches.
* fix(env): Prevent module update during requirements processing
- Add environment variable SKIP_REQUIREMENTS_UPDATE check
- Ensure update is skipped if SKIP_REQUIREMENTS_UPDATE is set to true
* squash! fix(env): Prevent module update during requirements processing - Add environment variable SKIP_REQUIREMENTS_UPDATE check - Ensure update is skipped if SKIP_REQUIREMENTS_UPDATE is set to true
* feat(docker): Add initial Docker configuration for project
- Add .dockerignore file to ignore unnecessary files
- Create Dockerfile with basic build and deployment configuration
* feat(docker): Updated Docker configuration for improved security and build efficiency
- Removed sensitive files from .dockerignore
- Moved WORKDIR to /app in Dockerfile
- Added gunicorn==23.0.0 dependency in RUN command
- Created new docker-compose.yml file for service definition
* feat(deployment): Implement containerized deployment configuration
- Add additional environment variables for Python optimization
- Update Dockerfile with new dependencies: eventlet, gevent, tornado
- Create docker-compose.yml and configure services for web and nginx
- Implement example configurations for web host settings and gunicorn
- Establish nginx configuration for reverse proxy
- Remove outdated docker-compose.yml from root directory
* feat(deploy): Introduce Docker Compose configuration for multi-world deployment
- Separate web service into two containers, one for main process and one for gunicorn
- Update container configurations for improved security and maintainability
- Remove unused volumes and network configurations
* docs: Add new documentation for deploying Archipelago using containers
- Document standalone image build and run process
- Include example Docker Compose file for container orchestration
- Provide information on services defined in the `docker-compose.yaml` file
- Mention optional Enemizer feature and Git requirements
* fixup! feat(docker): Updated Docker configuration for improved security and build efficiency - Removed sensitive files from .dockerignore - Moved WORKDIR to /app in Dockerfile - Added gunicorn==23.0.0 dependency in RUN command - Created new docker-compose.yml file for service definition
* feat(deploy): Updated gunicorn configuration example
- Adjusted worker and thread counts
- Switched worker class from sync to gthread
- Changed log level to info
- Added example code snippet for customizing worker count
* fix(deploy): Adjust concurrency settings for self-launch configuration
- Reduce the number of world generators from 8 to 3
- Decrease the number of hosters from 5 to 4
* docs(deploy using containers): Improve readability, fix broken links
- Update links to other documentation pages
- Improve formatting for better readability
- Remove unnecessary sections and files
- Add note about building the image requiring a local copy of ArchipelagoMW source code
* Update deploy/example_config.yaml
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
* Update deploy/example_selflaunch.yaml
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
* Update Dockerfile
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
* Update deploy/example_selflaunch.yaml
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
* fixup! Update Dockerfile
* fix(Dockerfile): Update package installations to use latest versions
- Remove specific version pins for git and libc6-dev
- Ensure compatibility with newer package updates
* feat(ci): Add GitHub Actions workflow for building and publishing Docker images
- Create a new workflow for Docker image build and publish
- Configure triggers for push and pull_request on main branch
- Set up QEMU and Docker Buildx for multi-platform builds
- Implement Docker login for GitHub Container Registry
- Include Docker image metadata extraction and tagging
* feat(healthcheck): Update Dockerfile and docker-compose for health checks
- Add health check for the Webhost service in Dockerfile
- Modify docker-compose to include a placeholder health check for multiworld service
- Standardize comments and remove unnecessary lines
* Revert "feat(ci): Add GitHub Actions workflow for building and publishing Docker images"
This reverts commit 32a51b272627d99ca9796cbfda2e821bfdd95c70.
* feat(docker): Enhance Dockerfile with Cython build stage
- Add Cython builder stage for compiling speedups
- Update package installation and organization for efficiency
- Improve caching by copying requirements before installing
- Add documentation for rootless Podman
* fixup! feat(docker): Enhance Dockerfile with Cython build stage - Add Cython builder stage for compiling speedups - Update package installation and organization for efficiency - Improve caching by copying requirements before installing - Add documentation for rootless Podman
---------
Co-authored-by: Adrian Priestley <apriestley@gmail.com>
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
Co-authored-by: Adrian Priestley <apriestley@bob.localdomain>
* Options: forbid worlds just dumping every single option they don't need
* make the equal proper
---------
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
* update the id formatter to use staticmethods to not fake the unused self arg, and then use the formatter for the user session endpoints
* missed an id (ty treble)
* clean up duplicate code
* Update WebHostLib/__init__.py
Co-authored-by: Aaron Wagener <mmmcheese158@gmail.com>
* keep the BaseConverter format
* lol, change all the instances
* revert this
---------
Co-authored-by: Aaron Wagener <mmmcheese158@gmail.com>
* Add new deprioritized item flag
* 4 retries
* indent
* .
* style
* I think this is nicer
* Nicer
* remove two lines again that I added unnecessarily
* I think this test makes a bit more sense like this
* Idk how to word this lol
* Add progression_deprioritized_skip_balancing bc why not ig
* More text
* Update Fill.py
* Update Fill.py
* I am the big stupid
* Actually collect the other half of progression items into state when filling without them
* More clarity on the descriptions (hopefully)
* visually separate technical description and use cases
* Actually make the call do what the comments say it does
The previous swap_state can often be used as the base state to create
the next swap_state. This previous swap_state will already have
collected all items in item_pool and is likely to have checked many
locations, meaning that creating the next swap_state from it instead of
from base_state is faster.
From generating with extra code to raise an exception if more than 2
previous swap states were used, and using A Hat in Time and Pokemon
Red/Blue yamls that often result in lots of swapping in progression
fill, I could not get a single seed go through more than 2 previous swap
states. A few worlds' pre-fills do often use more than 2 previous swap
states, notably LADX which sometimes goes through over 20.
Given a 20 player Pokemon Red/Blue multiworld that usually generates in
around 16 or 17 seconds, but on a specific seed that results in 56
swaps, generation went from about 260 seconds before this patch to about
104 seconds after this patch (generated with a meta.yaml to disable
progression balancing and `python -O Generate.py --skip_output`).
Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
Calling the dunder method has to:
1. Look up the dunder method for that object/class
2. Bind a new method instance to the object instance
3. Call the method with its arguments
4. Run the appropriate operation on the object
Whereas running the appropriate operation on the object from the start
skips straight to step 4.
Region.Register.__getitem__ is called a lot without #4583. In that case,
generation of 10 template Blasphemous yamls with
`--skip_output --seed 1` and progression balancing disabled went from
19.0s to 18.8s (1.3% reduction in generation duration).
From profiling with `timeit`
```py
def __getitem__(self, index: int) -> Location:
return self._list[index]
```
appears to be about twice as fast as the old code:
```py
def __getitem__(self, index: int) -> Location:
return self._list.__getitem__(index)
```
Besides this, there is not expected to be any noticeable difference in
performance, and there is not expected to be any difference in semantics
with these changes.
Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
* Assert at the beginning of distribute items restrictive that no items in the itempool already have locations associated with them
* actual message
* placement
* oops
* Update Fill.py
* first working single-world randomized SM rom patches
* - SM now displays message when getting an item outside for someone else (fills ROM item table)
This is dependant on modifications done to sm_randomizer_rom project
* First working MultiWorld SM
* some missing things:
- player name inject in ROM and get in client
- end game get from ROM in client
- send self item to server
- add player names table in ROM
* replaced CollectionState inheritance from SMBoolManager with a composition of an array of it (required to generation more than one SM world, which is still fails but is better)
* - reenabled balancing
* post rebase fixes
* updated SmClient.py
* + added VariaRandomizer LICENSE
* + added sm_randomizer_rom project (which builds sm.ips)
* Moved VariaRandomizer and sm_randomizer_rom projects inside worlds/sm and done some cleaning
* properly revert change made to CollectionState and more cleaning
* Fixed multiworld support patch not working with VariaRandomizer's
* missing file commit
* Fixed syntax error in unused code to satisfy Linter
* Revert "Fixed multiworld support patch not working with VariaRandomizer's"
This reverts commit fb3ca18528bb331995e3d3051648c8f84d04c08b.
* many fixes and improovement
- fixed seeded generation
- fixed broken logic when more than one SM world
- added missing rules for inter-area transitions
- added basic patch presence for logic
- added DoorManager init call to reflect present patches for logic
- moved CollectionState addition out of BaseClasses into SM world
- added condition to apply progitempool presorting only if SM world is present
- set Bosses item id to None to prevent them going into multidata
- now use get_game_players
* first working (most of the time) progression generation for SM using VariaRandomizer's rules, items, locations and accessPoint (as regions)
* first working single-world randomized SM rom patches
* - SM now displays message when getting an item outside for someone else (fills ROM item table)
This is dependant on modifications done to sm_randomizer_rom project
* First working MultiWorld SM
* some missing things:
- player name inject in ROM and get in client
- end game get from ROM in client
- send self item to server
- add player names table in ROM
* replaced CollectionState inheritance from SMBoolManager with a composition of an array of it (required to generation more than one SM world, which is still fails but is better)
* - reenabled balancing
* post rebase fixes
* updated SmClient.py
* + added VariaRandomizer LICENSE
* + added sm_randomizer_rom project (which builds sm.ips)
* Moved VariaRandomizer and sm_randomizer_rom projects inside worlds/sm and done some cleaning
* properly revert change made to CollectionState and more cleaning
* Fixed multiworld support patch not working with VariaRandomizer's
* missing file commit
* Fixed syntax error in unused code to satisfy Linter
* Revert "Fixed multiworld support patch not working with VariaRandomizer's"
This reverts commit fb3ca18528bb331995e3d3051648c8f84d04c08b.
* many fixes and improovement
- fixed seeded generation
- fixed broken logic when more than one SM world
- added missing rules for inter-area transitions
- added basic patch presence for logic
- added DoorManager init call to reflect present patches for logic
- moved CollectionState addition out of BaseClasses into SM world
- added condition to apply progitempool presorting only if SM world is present
- set Bosses item id to None to prevent them going into multidata
- now use get_game_players
* Fixed multiworld support patch not working with VariaRandomizer's
Added stage_fill_hook to set morph first in progitempool
Added back VariaRandomizer's standard patches
* + added missing files from variaRandomizer project
* + added missing variaRandomizer files (custom sprites)
+ started integrating VariaRandomizer options (WIP)
* Some fixes for player and server name display
- fixed player name of 16 characters reading too far in SM client
- fixed 12 bytes SM player name limit (now 16)
- fixed server name not being displayed in SM when using server cheat ( now displays RECEIVED FROM ARCHIPELAGO)
- request: temporarly changed default seed names displayed in SM main menu to OWTCH
* Fixed Goal completion not triggering in smClient
* integrated VariaRandomizer's options into AP (WIP)
- startAP is working
- door rando is working
- skillset is working
* - fixed itemsounds.ips crash by always including nofanfare.ips into multiworld.ips (itemsounds is now always applied and "itemsounds" preset must always be "off")
* skillset are now instanced per player instead of being a singleton class
* RomPatches are now instanced per player instead of being a singleton class
* DoorManager is now instanced per player instead of being a singleton class
* - fixed the last bugs that prevented generation of >1 SM world
* fixed crash when no skillset preset is specified in randoPreset (default to "casual")
* maxDifficulty support and itemsounds removal
- added support for maxDifficulty
- removed itemsounds patch as its always applied from multiworld patch for now
* Fixed bad merge
* Post merge adaptation
* fixed player name length fix that got lost with the merge
* fixed generation with other game type than SM
* added default randoPreset json for SM in playerSettings.yaml
* fixed broken SM client following merge
* beautified json skillset presets
* Fixed ArchipelagoSmClient not building
* Fixed conflict between mutliworld patch and beam_doors_plms patch
- doorsColorsRando now working
* SM generation now outputs APBP
- Fixed paths for patches and presets when frozen
* added missing file and fixed multithreading issue
* temporarily set data_version = 0
* more work
- added support for AP starting items
- fixed client crash with gamemode being None
- patch.py "compatible_version" is now 3
* commited missing asm files
fixed start item reserve breaking game (was using bad write offset when patching)
* Nothing item are now handled game-side. the game will now skip displaying a message box for received Nothing item (but the client will still receive it).
fixed crash in SMClient when loosing connection to SNI
* fixed No Energy Item missing its ID
fixed Plando
* merge post fixes
* fixed start item Grapple, XRay and Reserve HUD, as well as graphic beams (except ice palette color)
* fixed freeze in blue brinstar caused by Varia's custom PLM not being filled with proper Multiworld PLM address (altLocsAddresses)
* fixed start item x-ray HUD display
* Fixed start items being sent by the server (is all handled in ROM)
Start items are now not removed from itempool anymore
Nothing Item is now local_items so no player will ever pickup Nothing. Doing so reduces contribution of this world to the Multiworld the more Nothing there is though.
Fixed crash (and possibly passing but broken) at generation where the static list of IPSPatches used by all SM worlds was being modified
* fixed settings that could be applied to any SM players
* fixed auth to server only using player name (now does as ALTTP to authenticate)
* - fixed End Credits broken text
* added non SM item name display
* added all supported SM options in playerSettings.yaml
* fixed locations needing a list of parent regions (now generate a region for each location with one-way exits to each (previously) parent region
did some cleaning (mainly reverts on unnecessary core classes
* minor setting fixes and tweaks
- merged Area and lightArea settings
- made missileQty, superQty and powerBombQty use value from 10 to 90 and divide value by float(10) when generating
- fixed inverted layoutPatch setting
* added option start_inventory_removes_from_pool
fixed option names formatting
fixed lint errors
small code and repo cleanup
* Hopefully fixed ROR2 that could not send any items
* - fixed missing required change to ROR2
* fixed 0 hp when respawning without having ever saved (start items were not updating the save checksum)
* fixed typo with doors_colors_rando
* fixed checksum
* added custom sprites for off-world items (progression or not)
the original AP sprite was made with PierRoulette's SM Item Sprite Utility by ijwu
* - added missing change following upstream merge
- changed patch filename extension from apbp to apm3 so patch can be used with the new client
* added morph placement options: early means local and sphere 1
* fixed failing unit tests
* - fixed broken custom_preset options
* - big cleanup to remove unnecessary or unsupported features
* - more cleanup
* - moved sm_randomizer_rom and all always applied patches into an external project that outputs basepatch.ips
- small cleanup
* - added comment to refer to project for generating basepatch.ips (https://github.com/lordlou/SMBasepatch)
* fixed g4_skip patch that can be not applied if hud is enabled
* - fixed off world sprite that can have broken graphics (restricted to use only first 2 palette)
* - updated basepatch to reflect g4_skip removal
- moved more asm files to SMBasepatch project
* - tourian grey doors at baby metroid are now always flashing (allowing to go back if needed)
* fixed wrong path if using built as exe
* - cleaned exposed maxDifficulty options
- removed always enabled Knows
* Merged LttPClient and SMClient into SNIClient
* added varia_custom Preset Option that fetch a preset (read from a new varia_custom_preset Option) from varia's web service
* small doc precision
* - added death_link support
- fixed broken Goal Completion
- post merge fix
* - removed now useless presets
* - fixed bad internal mapping with maxDiff
- increases maxDiff if only Bosses is preventing beating the game
* - added support for lowercase custom preset sections (knows, settings and controller)
- fixed controller settings not applying to ROM
* - fixed death loop when dying with Door rando, bomb or speed booster as starting items
- varia's backup save should now be usable (automatically enabled when doing door rando)
* -added docstring for generated yaml
* fixed bad merge
* fixed broken infinity max difficulty
* commented debug prints
* adjusted credits to mark progression speed and difficulty as Non Available
* added support for more than 255 players (will print Archipelago for higher player number)
* fixed missing cleanup
* added support for 65535 different player names in ROM
* fixed generations failing when only bosses are unreachable
* - replaced setting maxDiff to infinity with a bool only affecting boss logics if only bosses are left to finish
* fixed failling generations when using 'fun' settings
Accessibility checks are forced to 'items' if restricted locations are used by VARIA following usage of 'fun' settings
* fixed debug logger
* removed unsupported "suits_restriction" option
* fixed generations failing when only bosses are unreachable (using a less intrusive approach for AP)
* - fixed deathlink emptying reserves
- added death_link_survive option that lets player survive when receiving a deathlink if the have non-empty reserves
* - merged death_link and death_link_survive options
* fixed death_link
* added a fallback default starting location instead of failing generation if an invalid one was chosen
* added Nothing and NoEnergy as hint blacklist
added missing NoEnergy as local items and removed it from progression
* reduced slot_data to only what should be needed by PopTracker (for https://github.com/ArchipelagoMW/Archipelago/pull/5039)