Skip to content

Commit

Permalink
Subnautica: 2.0 compatibility (ArchipelagoMW#1329)
Browse files Browse the repository at this point in the history
  • Loading branch information
Berserker66 authored Dec 17, 2022
1 parent 37b7f0d commit e0be796
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 34 deletions.
71 changes: 48 additions & 23 deletions worlds/subnautica/Items.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ class ItemDict(TypedDict):
35007: {'classification': ItemClassification.filler,
'count': 1,
'name': 'Stillsuit',
'tech_type': 'Stillsuit'},
'tech_type': 'WaterFiltrationSuitFragment'},
35008: {'classification': ItemClassification.progression,
'count': 2,
'name': 'Alien Containment Fragment',
'tech_type': 'BaseWaterParkFragment'},
'count': 1,
'name': 'Alien Containment',
'tech_type': 'BaseWaterPark'},
35009: {'classification': ItemClassification.useful,
'count': 1,
'name': 'Creature Decoy',
Expand Down Expand Up @@ -91,15 +91,15 @@ class ItemDict(TypedDict):
'name': 'Bioreactor Fragment',
'tech_type': 'BaseBioReactorFragment'},
35020: {'classification': ItemClassification.progression,
'count': 3,
'count': 4,
'name': 'Cyclops Bridge Fragment',
'tech_type': 'CyclopsBridgeFragment'},
35021: {'classification': ItemClassification.progression,
'count': 3,
'count': 4,
'name': 'Cyclops Engine Fragment',
'tech_type': 'CyclopsEngineFragment'},
35022: {'classification': ItemClassification.progression,
'count': 3,
'count': 4,
'name': 'Cyclops Hull Fragment',
'tech_type': 'CyclopsHullFragment'},
35023: {'classification': ItemClassification.filler,
Expand All @@ -111,11 +111,11 @@ class ItemDict(TypedDict):
'name': 'Laser Cutter Fragment',
'tech_type': 'LaserCutterFragment'},
35025: {'classification': ItemClassification.filler,
'count': 1,
'count': 2,
'name': 'Light Stick Fragment',
'tech_type': 'TechlightFragment'},
35026: {'classification': ItemClassification.progression,
'count': 4,
'count': 5,
'name': 'Mobile Vehicle Bay Fragment',
'tech_type': 'ConstructorFragment'},
35027: {'classification': ItemClassification.progression,
Expand All @@ -139,7 +139,7 @@ class ItemDict(TypedDict):
'name': 'Power Transmitter Fragment',
'tech_type': 'PowerTransmitterFragment'},
35032: {'classification': ItemClassification.progression,
'count': 5,
'count': 6,
'name': 'Prawn Suit Fragment',
'tech_type': 'ExosuitFragment'},
35033: {'classification': ItemClassification.useful,
Expand All @@ -163,7 +163,7 @@ class ItemDict(TypedDict):
'name': 'Scanner Room Fragment',
'tech_type': 'BaseMapRoomFragment'},
35038: {'classification': ItemClassification.progression,
'count': 4,
'count': 5,
'name': 'Seamoth Fragment',
'tech_type': 'SeamothFragment'},
35039: {'classification': ItemClassification.progression,
Expand Down Expand Up @@ -196,8 +196,8 @@ class ItemDict(TypedDict):
'tech_type': 'PrecursorIonPowerCell'},
35046: {'classification': ItemClassification.filler,
'count': 2,
'name': 'Exterior Growbed Fragment',
'tech_type': 'FarmingTrayFragment'},
'name': 'Exterior Growbed',
'tech_type': 'FarmingTray'},
35047: {'classification': ItemClassification.filler,
'count': 1,
'name': 'Picture Frame',
Expand All @@ -219,23 +219,23 @@ class ItemDict(TypedDict):
'name': 'Plant Shelf',
'tech_type': 'PlanterShelfFragment'},
35052: {'classification': ItemClassification.filler,
'count': 2,
'name': 'Observatory Fragment',
'tech_type': 'BaseObservatoryFragment'},
'count': 1,
'name': 'Observatory',
'tech_type': 'BaseObservatory'},
35053: {'classification': ItemClassification.progression,
'count': 2,
'name': 'Multipurpose Room',
'tech_type': 'BaseRoom'},
35054: {'classification': ItemClassification.useful,
'count': 2,
'name': 'Bulkhead Fragment',
'tech_type': 'BaseBulkheadFragment'},
'count': 1,
'name': 'Bulkhead',
'tech_type': 'BaseBulkhead'},
35055: {'classification': ItemClassification.filler,
'count': 1,
'name': 'Spotlight',
'tech_type': 'Spotlight'},
35056: {'classification': ItemClassification.filler,
'count': 2,
'count': 1,
'name': 'Desk',
'tech_type': 'StarshipDesk'},
35057: {'classification': ItemClassification.filler,
Expand All @@ -251,7 +251,7 @@ class ItemDict(TypedDict):
'name': 'Command Chair',
'tech_type': 'StarshipChair3'},
35060: {'classification': ItemClassification.filler,
'count': 2,
'count': 1,
'name': 'Counter',
'tech_type': 'LabCounter'},
35061: {'classification': ItemClassification.filler,
Expand All @@ -267,11 +267,11 @@ class ItemDict(TypedDict):
'name': 'Quilted Double Bed',
'tech_type': 'Bed2'},
35064: {'classification': ItemClassification.filler,
'count': 2,
'count': 1,
'name': 'Coffee Vending Machine',
'tech_type': 'CoffeeVendingMachine'},
35065: {'classification': ItemClassification.filler,
'count': 2,
'count': 1,
'name': 'Trash Can',
'tech_type': 'Trashcans'},
35066: {'classification': ItemClassification.filler,
Expand Down Expand Up @@ -338,6 +338,28 @@ class ItemDict(TypedDict):
'count': 1,
'name': 'Ultra High Capacity Tank',
'tech_type': 'HighCapacityTank'},
# these currently unlock through some special sauce in Subnautica, unlike any established other
# keeping here for later
35082: {'classification': ItemClassification.progression,
'count': 0,
'name': 'Large Room',
'tech_type': 'BaseLargeRoom'},
35083: {'classification': ItemClassification.filler,
'count': 0,
'name': 'Large Room Glass Dome',
'tech_type': 'BaseLargeGlassDome'},
35084: {'classification': ItemClassification.filler,
'count': 0,
'name': 'Multipurpose Room Glass Dome',
'tech_type': 'BaseGlassDome'},
35085: {'classification': ItemClassification.filler,
'count': 0,
'name': 'Partition',
'tech_type': 'BasePartition'},
35086: {'classification': ItemClassification.filler,
'count': 0,
'name': 'Partition Door',
'tech_type': 'BasePartitionDoor'},
}

advancement_item_names: Set[str] = set()
Expand All @@ -351,6 +373,9 @@ class ItemDict(TypedDict):
non_advancement_item_names.add(item_name)

if False: # turn to True to export for Subnautica mod
from .Locations import location_table
itemcount = sum(item_data["count"] for item_data in item_table.values())
assert itemcount == len(location_table), f"{itemcount} != {len(location_table)}"
payload = {item_id: item_data["tech_type"] for item_id, item_data in item_table.items()}
import json

Expand Down
6 changes: 5 additions & 1 deletion worlds/subnautica/Rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ def has_stasis_rifle(state: "CollectionState", player: int) -> bool:


def has_containment(state: "CollectionState", player: int) -> bool:
return state.has("Alien Containment Fragment", player, 2) and state.has("Multipurpose Room", player)
return state.has("Alien Containment", player) and has_utility_room(state, player)


def has_utility_room(state: "CollectionState", player: int) -> bool:
return state.has("Large Room", player) or state.has("Multipurpose Room", player)


# Either we have propulsion cannon, or prawn + propulsion cannon arm
Expand Down
4 changes: 2 additions & 2 deletions worlds/subnautica/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class SubnauticaWorld(World):
location_name_to_id = all_locations
option_definitions = Options.options

data_version = 7
required_client_version = (0, 3, 6)
data_version = 8
required_client_version = (0, 3, 7)

creatures_to_scan: List[str]

Expand Down
14 changes: 6 additions & 8 deletions worlds/subnautica/docs/setup_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@
## Required Software

- Subnautica from: [Subnautica Steam Store Page](https://store.steampowered.com/app/264710/Subnautica/)
- QModManager4 from: [QModManager4 Nexus Mods Page](https://www.nexusmods.com/subnautica/mods/201)
- Archipelago Mod for Subnautica
from: [Subnautica Archipelago Mod Releases Page](https://github.com/Berserker66/ArchipelagoSubnauticaModSrc/releases)

## Installation Procedure

1. Install QModManager4 as per its instructions.
1. Unpack the Archipelago Mod into your Subnautica folder, so that `Subnautica/BepInEx` is a valid path.

2. The Subnautica game directory should now contain a `QMods` folder. Unpack the Archipelago Mod into this folder, so that `Subnautica/QMods/Archipelago/` is a valid path.

3. Start Subnautica. You should see a connect form with three text boxes in the top left of your main menu.
2. Start Subnautica. You should see a connect form with three text boxes in the top left of your main menu.

## Connecting

Expand All @@ -36,6 +33,7 @@ Warning: Currently it is not checked whether a loaded savegame belongs to the mu
## Console Commands

The mod adds the following console commands:
- `say` sends the text following it to Archipelago as a chat message. ! is not an allowed character, use / instead.
- `silent` toggles Archipelago chat messages appearing.
- `deathlink` toggles death link.

Expand All @@ -51,6 +49,6 @@ To enter a console command, press `Enter`.

## Troubleshooting

If you don't see the connect form on the main menu screen, check whether you see a file named `qmodmanager_log-Subnautica.txt` in the Subnautica game directory. If not,
QModManager4 is not correctly installed, otherwise open it and look for `Loading [Archipelago`. If the file doesn't contain this text, then
QModManager4 didn't find the Archipelago mod, so check your paths.
If you don't see the connect form on the main menu screen, check whether you see a file named `LogOutput.txt` in the Subnautica/BepInEx directory.
If not, BepInEx is not correctly installed, otherwise open it and look for `Plugin Archipelago is loaded!`.
If the file doesn't contain this text, then BepInEx didn't find the Archipelago mod, so check your paths.

0 comments on commit e0be796

Please sign in to comment.