Skip to content

Commit 630a3bd

Browse files
authored
Merge pull request ArchipelagoMW#10 from ArchipelagoMW/main
Merge main into branch
2 parents 8477d3c + 5e57920 commit 630a3bd

File tree

241 files changed

+19132
-2970
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

241 files changed

+19132
-2970
lines changed

CommonClient.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -643,13 +643,13 @@ async def server_loop(ctx: CommonContext, address: typing.Optional[str] = None)
643643
ctx.username = server_url.username
644644
if server_url.password:
645645
ctx.password = server_url.password
646-
port = server_url.port or 38281
647646

648647
def reconnect_hint() -> str:
649648
return ", type /connect to reconnect" if ctx.server_address else ""
650649

651650
logger.info(f'Connecting to Archipelago server at {address}')
652651
try:
652+
port = server_url.port or 38281 # raises ValueError if invalid
653653
socket = await websockets.connect(address, port=port, ping_timeout=None, ping_interval=None,
654654
ssl=get_ssl_context() if address.startswith("wss://") else None)
655655
if ctx.ui is not None:

Fill.py

+24-9
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,16 @@ def fill_restrictive(multiworld: MultiWorld, base_state: CollectionState, locati
198198
# There are leftover unplaceable items and locations that won't accept them
199199
if multiworld.can_beat_game():
200200
logging.warning(
201-
f'Not all items placed. Game beatable anyway. (Could not place {unplaced_items})')
201+
f"Not all items placed. Game beatable anyway.\nCould not place:\n"
202+
f"{', '.join(str(item) for item in unplaced_items)}")
202203
else:
203-
raise FillError(f'No more spots to place {unplaced_items}, locations {locations} are invalid. '
204-
f'Already placed {len(placements)}: {", ".join(str(place) for place in placements)}')
204+
raise FillError(f"No more spots to place {len(unplaced_items)} items. Remaining locations are invalid.\n"
205+
f"Unplaced items:\n"
206+
f"{', '.join(str(item) for item in unplaced_items)}\n"
207+
f"Unfilled locations:\n"
208+
f"{', '.join(str(location) for location in locations)}\n"
209+
f"Already placed {len(placements)}:\n"
210+
f"{', '.join(str(place) for place in placements)}")
205211

206212
item_pool.extend(unplaced_items)
207213

@@ -273,8 +279,13 @@ def remaining_fill(multiworld: MultiWorld,
273279

274280
if unplaced_items and locations:
275281
# There are leftover unplaceable items and locations that won't accept them
276-
raise FillError(f'No more spots to place {unplaced_items}, locations {locations} are invalid. '
277-
f'Already placed {len(placements)}: {", ".join(str(place) for place in placements)}')
282+
raise FillError(f"No more spots to place {len(unplaced_items)} items. Remaining locations are invalid.\n"
283+
f"Unplaced items:\n"
284+
f"{', '.join(str(item) for item in unplaced_items)}\n"
285+
f"Unfilled locations:\n"
286+
f"{', '.join(str(location) for location in locations)}\n"
287+
f"Already placed {len(placements)}:\n"
288+
f"{', '.join(str(place) for place in placements)}")
278289

279290
itempool.extend(unplaced_items)
280291

@@ -457,7 +468,9 @@ def mark_for_locking(location: Location):
457468
fill_restrictive(multiworld, multiworld.state, defaultlocations, progitempool, name="Progression")
458469
if progitempool:
459470
raise FillError(
460-
f'Not enough locations for progress items. There are {len(progitempool)} more items than locations')
471+
f"Not enough locations for progression items. "
472+
f"There are {len(progitempool)} more progression items than there are available locations."
473+
)
461474
accessibility_corrections(multiworld, multiworld.state, defaultlocations)
462475

463476
for location in lock_later:
@@ -470,7 +483,9 @@ def mark_for_locking(location: Location):
470483
remaining_fill(multiworld, excludedlocations, filleritempool, "Remaining Excluded")
471484
if excludedlocations:
472485
raise FillError(
473-
f"Not enough filler items for excluded locations. There are {len(excludedlocations)} more locations than items")
486+
f"Not enough filler items for excluded locations. "
487+
f"There are {len(excludedlocations)} more excluded locations than filler or trap items."
488+
)
474489

475490
restitempool = filleritempool + usefulitempool
476491

@@ -481,13 +496,13 @@ def mark_for_locking(location: Location):
481496

482497
if unplaced or unfilled:
483498
logging.warning(
484-
f'Unplaced items({len(unplaced)}): {unplaced} - Unfilled Locations({len(unfilled)}): {unfilled}')
499+
f"Unplaced items({len(unplaced)}): {unplaced} - Unfilled Locations({len(unfilled)}): {unfilled}")
485500
items_counter = Counter(location.item.player for location in multiworld.get_locations() if location.item)
486501
locations_counter = Counter(location.player for location in multiworld.get_locations())
487502
items_counter.update(item.player for item in unplaced)
488503
locations_counter.update(location.player for location in unfilled)
489504
print_data = {"items": items_counter, "locations": locations_counter}
490-
logging.info(f'Per-Player counts: {print_data})')
505+
logging.info(f"Per-Player counts: {print_data})")
491506

492507

493508
def flood_items(multiworld: MultiWorld) -> None:

Generate.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from worlds.alttp.Text import TextTable
2727
from worlds.AutoWorld import AutoWorldRegister
2828
from worlds.generic import PlandoConnection
29+
from worlds import failed_world_loads
2930

3031

3132
def mystery_argparse():
@@ -458,7 +459,11 @@ def roll_settings(weights: dict, plando_options: PlandoOptions = PlandoOptions.b
458459

459460
ret.game = get_choice("game", weights)
460461
if ret.game not in AutoWorldRegister.world_types:
461-
picks = Utils.get_fuzzy_results(ret.game, AutoWorldRegister.world_types, limit=1)[0]
462+
picks = Utils.get_fuzzy_results(ret.game, list(AutoWorldRegister.world_types) + failed_world_loads, limit=1)[0]
463+
if picks[0] in failed_world_loads:
464+
raise Exception(f"No functional world found to handle game {ret.game}. "
465+
f"Did you mean '{picks[0]}' ({picks[1]}% sure)? "
466+
f"If so, it appears the world failed to initialize correctly.")
462467
raise Exception(f"No world found to handle game {ret.game}. Did you mean '{picks[0]}' ({picks[1]}% sure)? "
463468
f"Check your spelling or installation of that world.")
464469

Launcher.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def update_settings():
100100
# Functions
101101
Component("Open host.yaml", func=open_host_yaml),
102102
Component("Open Patch", func=open_patch),
103-
Component("Generate Template Settings", func=generate_yamls),
103+
Component("Generate Template Options", func=generate_yamls),
104104
Component("Discord Server", icon="discord", func=lambda: webbrowser.open("https://discord.gg/8Z65BR2")),
105105
Component("18+ Discord Server", icon="discord", func=lambda: webbrowser.open("https://discord.gg/fqvNCCRsu4")),
106106
Component("Browse Files", func=browse_files),

README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ Currently, the following games are supported:
6262
* Kirby's Dream Land 3
6363
* Celeste 64
6464
* Zork Grand Inquisitor
65+
* Castlevania 64
66+
* A Short Hike
67+
* Yoshi's Island
6568

6669
For setup and instructions check out our [tutorials page](https://archipelago.gg/tutorial/).
6770
Downloads can be found at [Releases](https://github.com/ArchipelagoMW/Archipelago/releases), including compiled
@@ -83,9 +86,9 @@ We recognize that there is a strong community of incredibly smart people that ha
8386
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.
8487

8588
## Running Archipelago
86-
For most people all you need to do is head over to the [releases](https://github.com/ArchipelagoMW/Archipelago/releases) page then download and run the appropriate installer. The installers function on Windows only.
89+
For most people, all you need to do is head over to the [releases](https://github.com/ArchipelagoMW/Archipelago/releases) page then download and run the appropriate installer, or AppImage for Linux-based systems.
8790

88-
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](docs/running%20from%20source.md).
91+
If you are a developer or are running on a platform with no compiled releases available, please see our doc on [running Archipelago from source](docs/running%20from%20source.md).
8992

9093
## Related Repositories
9194
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.

WebHostLib/check.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def check():
2828
results, _ = roll_options(options)
2929
if len(options) > 1:
3030
# offer combined file back
31-
combined_yaml = "---\n".join(f"# original filename: {file_name}\n{file_content.decode('utf-8-sig')}"
31+
combined_yaml = "\n---\n".join(f"# original filename: {file_name}\n{file_content.decode('utf-8-sig')}"
3232
for file_name, file_content in options.items())
3333
combined_yaml = base64.b64encode(combined_yaml.encode("utf-8-sig")).decode()
3434
else:

WebHostLib/templates/tracker__Starcraft2.html

+8-6
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ <h3>{{ player_name }}&apos;s Starcraft 2 Tracker</h3>
106106
<td>{{ sc2_icon('Neosteel Bunker (Bunker)') }}</td>
107107
<td>{{ sc2_icon('Shrike Turret (Bunker)') }}</td>
108108
<td>{{ sc2_icon('Fortified Bunker (Bunker)') }}</td>
109-
<td colspan="3"></td>
109+
<td></td>
110110
<td>{{ sc2_icon('Missile Turret') }}</td>
111111
<td>{{ sc2_icon('Titanium Housing (Missile Turret)') }}</td>
112112
<td>{{ sc2_icon('Hellstorm Batteries (Missile Turret)') }}</td>
@@ -121,12 +121,13 @@ <h3>{{ player_name }}&apos;s Starcraft 2 Tracker</h3>
121121
<td>{{ sc2_icon('Planetary Fortress') }}</td>
122122
<td {% if augmented_thrusters_planetary_fortress_level == 1 %}class="tint-terran"{% endif %}>{{ sc2_progressive_icon_with_custom_name('Progressive Augmented Thrusters (Planetary Fortress)', augmented_thrusters_planetary_fortress_url, augmented_thrusters_planetary_fortress_name) }}</td>
123123
<td>{{ sc2_icon('Advanced Targeting (Planetary Fortress)') }}</td>
124+
<td colspan="2"></td>
125+
<td>{{ sc2_icon('Micro-Filtering') }}</td>
126+
<td>{{ sc2_icon('Automated Refinery') }}</td>
124127
<td></td>
125128
<td>{{ sc2_icon('Advanced Construction (SCV)') }}</td>
126129
<td>{{ sc2_icon('Dual-Fusion Welders (SCV)') }}</td>
127-
<td></td>
128-
<td>{{ sc2_icon('Micro-Filtering') }}</td>
129-
<td>{{ sc2_icon('Automated Refinery') }}</td>
130+
<td>{{ sc2_icon('Hostile Environment Adaptation (SCV)') }}</td>
130131
</tr>
131132
<tr>
132133
<td>{{ sc2_icon('Sensor Tower') }}</td>
@@ -180,7 +181,7 @@ <h3>{{ player_name }}&apos;s Starcraft 2 Tracker</h3>
180181
<td>{{ sc2_icon('Nano Projector (Medic)') }}</td>
181182
<td colspan="6"></td>
182183
<td>{{ sc2_icon('Vulture') }}</td>
183-
<td>{{ sc2_progressive_icon_with_custom_name('Progressive Replenishable Magazine (Vulture)', replenishable_magazine_vulture_url, replenishable_magazine_vulture_name) }}</td>
184+
<td class="{{ sc2_tint_level(replenishable_magazine_vulture_level) }}">{{ sc2_progressive_icon_with_custom_name('Progressive Replenishable Magazine (Vulture)', replenishable_magazine_vulture_url, replenishable_magazine_vulture_name) }}</td>
184185
<td>{{ sc2_icon('Ion Thrusters (Vulture)') }}</td>
185186
<td>{{ sc2_icon('Auto Launchers (Vulture)') }}</td>
186187
<td>{{ sc2_icon('Auto-Repair (Vulture)') }}</td>
@@ -293,7 +294,8 @@ <h3>{{ player_name }}&apos;s Starcraft 2 Tracker</h3>
293294
<td>{{ sc2_icon('HERC') }}</td>
294295
<td>{{ sc2_icon('Juggernaut Plating (HERC)') }}</td>
295296
<td>{{ sc2_icon('Kinetic Foam (HERC)') }}</td>
296-
<td colspan="5"></td>
297+
<td>{{ sc2_icon('Resource Efficiency (HERC)') }}</td>
298+
<td colspan="4"></td>
297299
<td>{{ sc2_icon('Widow Mine') }}</td>
298300
<td>{{ sc2_icon('Drilling Claws (Widow Mine)') }}</td>
299301
<td>{{ sc2_icon('Concealment (Widow Mine)') }}</td>

WebHostLib/tracker.py

+19-11
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,13 @@ def get_player_received_items(self, team: int, player: int) -> List[NetworkItem]
124124
@_cache_results
125125
def get_player_inventory_counts(self, team: int, player: int) -> collections.Counter:
126126
"""Retrieves a dictionary of all items received by their id and their received count."""
127-
items = self.get_player_received_items(team, player)
127+
received_items = self.get_player_received_items(team, player)
128+
starting_items = self.get_player_starting_inventory(team, player)
128129
inventory = collections.Counter()
129-
for item in items:
130+
for item in received_items:
130131
inventory[item.item] += 1
132+
for item in starting_items:
133+
inventory[item] += 1
131134

132135
return inventory
133136

@@ -358,10 +361,13 @@ def get_enabled_multiworld_trackers(room: Room) -> Dict[str, Callable]:
358361
def render_generic_tracker(tracker_data: TrackerData, team: int, player: int) -> str:
359362
game = tracker_data.get_player_game(team, player)
360363

361-
# Add received index to all received items, excluding starting inventory.
362364
received_items_in_order = {}
363-
for received_index, network_item in enumerate(tracker_data.get_player_received_items(team, player), start=1):
364-
received_items_in_order[network_item.item] = received_index
365+
starting_inventory = tracker_data.get_player_starting_inventory(team, player)
366+
for index, item in enumerate(starting_inventory):
367+
received_items_in_order[item] = index
368+
for index, network_item in enumerate(tracker_data.get_player_received_items(team, player),
369+
start=len(starting_inventory)):
370+
received_items_in_order[network_item.item] = index
365371

366372
return render_template(
367373
template_name_or_list="genericTracker.html",
@@ -1606,6 +1612,7 @@ def render_Starcraft2_tracker(tracker_data: TrackerData, team: int, player: int)
16061612
"Hellstorm Batteries (Missile Turret)": github_icon_base_url + "blizzard/btn-ability-stetmann-corruptormissilebarrage.png",
16071613
"Advanced Construction (SCV)": github_icon_base_url + "blizzard/btn-ability-mengsk-trooper-advancedconstruction.png",
16081614
"Dual-Fusion Welders (SCV)": github_icon_base_url + "blizzard/btn-upgrade-swann-scvdoublerepair.png",
1615+
"Hostile Environment Adaptation (SCV)": github_icon_base_url + "blizzard/btn-upgrade-swann-hellarmor.png",
16091616
"Fire-Suppression System Level 1": organics_icon_base_url + "Fire-SuppressionSystem.png",
16101617
"Fire-Suppression System Level 2": github_icon_base_url + "blizzard/btn-upgrade-swann-firesuppressionsystem.png",
16111618

@@ -1673,6 +1680,7 @@ def render_Starcraft2_tracker(tracker_data: TrackerData, team: int, player: int)
16731680
"Resource Efficiency (Spectre)": github_icon_base_url + "blizzard/btn-ability-hornerhan-salvagebonus.png",
16741681
"Juggernaut Plating (HERC)": organics_icon_base_url + "JuggernautPlating.png",
16751682
"Kinetic Foam (HERC)": organics_icon_base_url + "KineticFoam.png",
1683+
"Resource Efficiency (HERC)": github_icon_base_url + "blizzard/btn-ability-hornerhan-salvagebonus.png",
16761684

16771685
"Hellion": "https://static.wikia.nocookie.net/starcraft/images/5/56/Hellion_SC2_Icon1.jpg",
16781686
"Vulture": github_icon_base_url + "blizzard/btn-unit-terran-vulture.png",
@@ -2333,12 +2341,12 @@ def render_Starcraft2_tracker(tracker_data: TrackerData, team: int, player: int)
23332341
"Progressive Zerg Armor Upgrade": 106 + SC2HOTS_ITEM_ID_OFFSET,
23342342
"Progressive Zerg Ground Upgrade": 107 + SC2HOTS_ITEM_ID_OFFSET,
23352343
"Progressive Zerg Flyer Upgrade": 108 + SC2HOTS_ITEM_ID_OFFSET,
2336-
"Progressive Zerg Weapon/Armor Upgrade": 109 + SC2WOL_ITEM_ID_OFFSET,
2337-
"Progressive Protoss Weapon Upgrade": 105 + SC2HOTS_ITEM_ID_OFFSET,
2338-
"Progressive Protoss Armor Upgrade": 106 + SC2HOTS_ITEM_ID_OFFSET,
2339-
"Progressive Protoss Ground Upgrade": 107 + SC2HOTS_ITEM_ID_OFFSET,
2340-
"Progressive Protoss Air Upgrade": 108 + SC2HOTS_ITEM_ID_OFFSET,
2341-
"Progressive Protoss Weapon/Armor Upgrade": 109 + SC2WOL_ITEM_ID_OFFSET,
2344+
"Progressive Zerg Weapon/Armor Upgrade": 109 + SC2HOTS_ITEM_ID_OFFSET,
2345+
"Progressive Protoss Weapon Upgrade": 105 + SC2LOTV_ITEM_ID_OFFSET,
2346+
"Progressive Protoss Armor Upgrade": 106 + SC2LOTV_ITEM_ID_OFFSET,
2347+
"Progressive Protoss Ground Upgrade": 107 + SC2LOTV_ITEM_ID_OFFSET,
2348+
"Progressive Protoss Air Upgrade": 108 + SC2LOTV_ITEM_ID_OFFSET,
2349+
"Progressive Protoss Weapon/Armor Upgrade": 109 + SC2LOTV_ITEM_ID_OFFSET,
23422350
}
23432351
grouped_item_replacements = {
23442352
"Progressive Terran Weapon Upgrade": ["Progressive Terran Infantry Weapon",

docs/CODEOWNERS

+10-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
# Bumper Stickers
2929
/worlds/bumpstik/ @FelicitusNeko
3030

31+
# Castlevania 64
32+
/worlds/cv64/ @LiquidCat64
33+
3134
# Celeste 64
3235
/worlds/celeste64/ @PoryGone
3336

@@ -131,6 +134,9 @@
131134
# Shivers
132135
/worlds/shivers/ @GodlFire
133136

137+
# A Short Hike
138+
/worlds/shorthike/ @chandler05
139+
134140
# Sonic Adventure 2 Battle
135141
/worlds/sa2b/ @PoryGone @RaspberrySpace
136142

@@ -171,7 +177,7 @@
171177
/worlds/tloz/ @Rosalie-A @t3hf1gm3nt
172178

173179
# TUNIC
174-
/worlds/tunic/ @silent-destroyer
180+
/worlds/tunic/ @silent-destroyer @ScipioWright
175181

176182
# Undertale
177183
/worlds/undertale/ @jonloveslegos
@@ -185,6 +191,9 @@
185191
# The Witness
186192
/worlds/witness/ @NewSoupVi @blastron
187193

194+
# Yoshi's Island
195+
/worlds/yoshisisland/ @PinkSwitch
196+
188197
# Zillion
189198
/worlds/zillion/ @beauxq
190199

0 commit comments

Comments
 (0)