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. |
||
---|---|---|
.github | ||
WebHostLib | ||
data | ||
docs | ||
test | ||
typings/kivy | ||
worlds | ||
worlds_disabled | ||
.gitignore | ||
AdventureClient.py | ||
BaseClasses.py | ||
BizHawkClient.py | ||
ChecksFinderClient.py | ||
CommonClient.py | ||
FF1Client.py | ||
FactorioClient.py | ||
Fill.py | ||
Generate.py | ||
KH2Client.py | ||
LICENSE | ||
Launcher.py | ||
LinksAwakeningClient.py | ||
LttPAdjuster.py | ||
MMBN3Client.py | ||
Main.py | ||
MinecraftClient.py | ||
ModuleUpdate.py | ||
MultiServer.py | ||
NetUtils.py | ||
OoTAdjuster.py | ||
OoTClient.py | ||
Options.py | ||
Patch.py | ||
PokemonClient.py | ||
README.md | ||
SNIClient.py | ||
Starcraft2Client.py | ||
UndertaleClient.py | ||
Utils.py | ||
WargrooveClient.py | ||
WebHost.py | ||
Zelda1Client.py | ||
ZillionClient.py | ||
_speedups.pyx | ||
_speedups.pyxbld | ||
inno_setup.iss | ||
kvui.py | ||
meta.yaml | ||
playerSettings.yaml | ||
pytest.ini | ||
requirements.txt | ||
settings.py | ||
setup.py |
README.md
Archipelago
| Install
Archipelago provides a generic framework for developing multiworld capability for game randomizers. In all cases, presently, Archipelago is also the randomizer itself.
Currently, the following games are supported:
- The Legend of Zelda: A Link to the Past
- Factorio
- Minecraft
- Subnautica
- Slay the Spire
- Risk of Rain 2
- The Legend of Zelda: Ocarina of Time
- Timespinner
- Super Metroid
- Secret of Evermore
- Final Fantasy
- Rogue Legacy
- VVVVVV
- Raft
- Super Mario 64
- Meritous
- Super Metroid/Link to the Past combo randomizer (SMZ3)
- ChecksFinder
- ArchipIDLE
- Hollow Knight
- The Witness
- Sonic Adventure 2: Battle
- Starcraft 2: Wings of Liberty
- Donkey Kong Country 3
- Dark Souls 3
- Super Mario World
- Pokémon Red and Blue
- Hylics 2
- Overcooked! 2
- Zillion
- Lufia II Ancient Cave
- Blasphemous
- Wargroove
- Stardew Valley
- The Legend of Zelda
- The Messenger
- Kingdom Hearts 2
- The Legend of Zelda: Link's Awakening DX
- Clique
- Adventure
- DLC Quest
- Noita
- Undertale
- Bumper Stickers
- Mega Man Battle Network 3: Blue Version
- Muse Dash
- DOOM 1993
- Terraria
- Lingo
- Pokémon Emerald
For setup and instructions check out our tutorials page. Downloads can be found at Releases, including compiled windows binaries.
History
Archipelago is built upon a strong legacy of brilliant hobbyists. We want to honor that legacy by showing it here. The repositories which Archipelago is built upon, inspired by, or otherwise owes its gratitude to are:
- bonta0's MultiWorld
- AmazingAmpharos' Entrance Randomizer
- VT Web Randomizer
- Dessyreqt's alttprandomizer
- Zarby89's and sosuke3's contributions to Enemizer, which make the vast majority of Enemizer contributions.
We recognize that there is a strong community of incredibly smart people that have come before us and helped pave the path. Just because one person's name may be in a repository title does not mean that only one person made that project happen. We can't hope to perfectly cover every single contribution that lead up to Archipelago but we hope to honor them fairly.
Path to the Archipelago
Archipelago was directly forked from bonta0's multiworld_31
branch of ALttPEntranceRandomizer (this project has a long legacy of its own, please check it out linked above) on January 12, 2020. The repository was then named to MultiWorld-Utilities to better encompass its intended function. As Archipelago matured, then known as "Berserker's MultiWorld" by some, we found it necessary to transform our repository into a root level repository (as opposed to a 'forked repo') and change the name (which came later) to better reflect our project.
Running Archipelago
For most people all you need to do is head over to the releases page then download and run the appropriate installer. The installers function on Windows only.
If you are running Archipelago from a non-Windows system then the likely scenario is that you are comfortable running source code directly. Please see our doc on running Archipelago from source.
Related Repositories
This project makes use of multiple other projects. We wouldn't be here without these other repositories and the contributions of their developers, past and present.
Contributing
For contribution guidelines, please see our Contributing doc.
FAQ
For Frequently asked questions, please see the website's FAQ Page.
Code of Conduct
Please refer to our code of conduct.