Fork of Archipelago Multi-Game Randomizer and Server that runs on https://ap.hollymcfarland.com
Go to file
Bryce Wilson 0d38b41540
BizHawkClient: Add support for multiple concurrent instances (#2475)
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.
2023-11-23 15:00:46 +01:00
.github CI: run tests multi-threaded (#2251) 2023-10-02 08:47:28 +02:00
WebHostLib WebHost: Refactor `tracker.py`, removal of dead code, and tweaks to layouts of some tracker pages. (#2438) 2023-11-18 12:29:35 -06:00
data BizHawkClient: Add support for multiple concurrent instances (#2475) 2023-11-23 15:00:46 +01:00
docs WebHost, Core: Developer-defined game option presets. (#2143) 2023-11-16 04:37:06 -06:00
test WebHost, Core: Developer-defined game option presets. (#2143) 2023-11-16 04:37:06 -06:00
typings/kivy Zillion: map tracker in client (#1136) 2022-10-27 02:30:22 -07:00
worlds BizHawkClient: Add support for multiple concurrent instances (#2475) 2023-11-23 15:00:46 +01:00
worlds_disabled OriBF: Move Ori and the Blind Forest to `worlds_disabled`. (#1906) 2023-06-29 13:36:48 -05:00
.gitignore Git: Added file type .smc to gitignore (#2476) 2023-11-22 08:15:35 -06:00
AdventureClient.py CI: add a workflow to show flake8/mypy violations in modified files of a PR (#1513) 2023-05-20 14:40:51 +02:00
BaseClasses.py Core: fix item links around core changes (#2452) 2023-11-16 04:55:18 -06:00
BizHawkClient.py BizHawkClient: Add BizHawkClient (#1978) 2023-10-03 02:44:19 +02:00
ChecksFinderClient.py ChecksFinder: Linux support via wine (#795) 2022-07-19 07:44:04 +02:00
CommonClient.py CommonClient: make IncompatibleVersion more explicit. (#2350) 2023-11-15 06:13:41 +01:00
FF1Client.py Docs: Revise all docs mentioning Lua in EmuHawk (which are in English), and other misc. corrections (#1782) 2023-06-26 08:53:44 +02:00
FactorioClient.py Factorio: Client in folder, TextClient: always available (#1829) 2023-06-25 02:31:25 +02:00
Fill.py Fill: fix swap error found in CI (#2397) 2023-11-11 10:54:51 +01:00
Generate.py Core: Provide a better error message if only weights.yaml is provided with players: 0 (#2227) 2023-11-22 11:13:02 -06:00
KH2Client.py KH2: AntipointReset (#1815) 2023-05-18 15:28:35 +02:00
LICENSE update Copyright 2022-02-17 19:03:11 -08:00
Launcher.py Launcher: Allow opening patches for clients without an exe (#2176) 2023-10-02 20:52:00 +02:00
LinksAwakeningClient.py LADX: Fix getting old items over and over again in Bizhawk (#2011) 2023-07-27 16:08:14 +02:00
LttPAdjuster.py LttP: Adjuster no longer breaks when sprite path doesn't exist. 2023-10-07 15:57:05 +02:00
MMBN3Client.py MMBN3: Fixes hint spam when receiving a hint (#2087) 2023-08-11 11:01:24 +02:00
Main.py Core: check that location address is unique per player (#2429) 2023-11-15 20:50:00 +01:00
MinecraftClient.py Core: Add settings API ("auto settings") for host.yaml (#1871) 2023-07-05 22:39:35 +02:00
ModuleUpdate.py Core: allow multi-line and --hash in requirements.txt 2023-10-25 00:52:57 +02:00
MultiServer.py MultiServer: exit console task when console thread dies (#2068) 2023-08-04 10:01:51 +02:00
NetUtils.py Speedups: fix file date check when frozen (#2211) 2023-09-22 23:05:04 +02:00
OoTAdjuster.py Main: add __all__ and change wrong imports (#1824) 2023-05-20 19:21:39 +02:00
OoTClient.py Core: Add settings API ("auto settings") for host.yaml (#1871) 2023-07-05 22:39:35 +02:00
Options.py Options: have as_dict return set values as lists to reduce JSON footprint (#2354) 2023-10-24 22:50:53 +02:00
Patch.py Core: SNI Client Refactor (#1083) 2022-10-25 19:54:43 +02:00
PokemonClient.py Pokémon Red and Blue: Progressive Card Key and auto hint bug fixes (#2076) 2023-08-02 19:51:53 +02:00
README.md Pokemon Emerald: Implement New Game (#1813) 2023-11-12 15:39:34 -06:00
SNIClient.py SNIClient, ALttP: expose death_text to SNI client, add message to alttp (#1793) 2023-10-31 11:11:18 +01:00
Starcraft2Client.py SC2 WoL - Mod, Item and Location update (#2113) 2023-09-15 02:22:10 +02:00
UndertaleClient.py Docs, Undertale: Added Suggestions Missed in #2285 (#2435) 2023-11-07 14:41:13 -06:00
Utils.py Core: Increment Archipelago Version (#2483) 2023-11-22 10:04:10 -06:00
WargrooveClient.py Wargroove: Fixed WargrooveClient retaining victory and location information and minor doc fix (#2464) 2023-11-16 04:35:20 -06:00
WebHost.py Core, WebHost: lazy-load worlds in unpickler, WebHost and WebHostLib (#2156) 2023-09-20 16:05:56 +02:00
Zelda1Client.py Docs: Revise all docs mentioning Lua in EmuHawk (which are in English), and other misc. corrections (#1782) 2023-06-26 08:53:44 +02:00
ZillionClient.py Zillion: Python 3.11 compatibility fix (#2105) 2023-08-16 09:00:10 -05:00
_speedups.pyx Speedups: ignore warning C4551 for pyximport+MSVC (#2054) 2023-07-30 10:33:00 +02:00
_speedups.pyxbld MultiServer: speed up location commands (#1926) 2023-07-04 19:12:43 +02:00
inno_setup.iss Installer: Fix invalid component error in inno_setup.iss (#2455) 2023-11-12 19:21:17 -06:00
kvui.py CommonClient: Add a hints tab (#2392) 2023-11-07 14:51:35 -06:00
meta.yaml meta.yaml: update progression balancing (#1283) 2022-12-05 22:26:44 +01:00
playerSettings.yaml LTTP: Key Drop Shuffle (#282) 2023-09-27 05:24:10 +02:00
pytest.ini pytest: run tests on non-windows with new names (#2349) 2023-10-24 10:59:15 +02:00
requirements.txt Core: update modules (#2440) 2023-11-13 06:48:50 +01:00
settings.py BizHawkClient: Add autostart setting (#2322) 2023-10-19 07:07:15 +02:00
setup.py Setup: fix orjson import on frozen py3.8 (#2458) 2023-11-13 22:42:34 +01:00

README.md

Archipelago Discord Shield | 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:

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.

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.