Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Witness: Panel Hunt Mode #3265

Merged
merged 100 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
2dbd088
Add panel hunt options
NewSoupVi Jun 1, 2024
41fac34
Make sure all panels are either solvable or disabled in panel hunt
NewSoupVi May 4, 2024
b55191b
Pick huntable panels
NewSoupVi May 4, 2024
bdc4b23
Discards in disable non randomized
NewSoupVi May 4, 2024
6105912
Set up panel hunt requirement
NewSoupVi May 4, 2024
859a96b
Panel hunt functional
NewSoupVi May 4, 2024
4aaa8eb
Make it so an event can have multiple names
NewSoupVi May 4, 2024
710a73b
Panel hunt with events
NewSoupVi May 4, 2024
6295bac
Add hunt entities to slot data
NewSoupVi May 4, 2024
6039a84
ruff
NewSoupVi May 4, 2024
5ca98f7
add to hint data, no client sneding yet
NewSoupVi May 4, 2024
ad8b033
encode panel hunt amount in compact hint data
NewSoupVi May 4, 2024
f36eb95
Remove print statement
NewSoupVi May 4, 2024
974ba64
my b
NewSoupVi May 4, 2024
4be2f61
consistent
NewSoupVi May 4, 2024
dd81ed2
meh
NewSoupVi May 4, 2024
51a5fc7
additions for lcient
NewSoupVi May 5, 2024
9b129d1
Nah
NewSoupVi May 6, 2024
1794d1f
Victory panels ineligible for panel hunt
NewSoupVi May 6, 2024
db1f76f
Panel Hunt Postgame option
NewSoupVi May 6, 2024
6f3b369
cleanup
NewSoupVi May 6, 2024
5b16d8a
Add data generation file
NewSoupVi May 7, 2024
744068b
pull out set
NewSoupVi May 11, 2024
6d69fc9
always disable gate ep in panel hunt
NewSoupVi May 16, 2024
c3cd3c7
Disallow certain challenge panels from being panel hunt panels
NewSoupVi May 16, 2024
822d91a
Make panelhuntpostgame its own function, so it can be called even if …
NewSoupVi May 16, 2024
65bdccf
disallow PP resets from panel hunt
NewSoupVi May 18, 2024
bb5da58
Disable challenge timer and elevetor start respectively in disable hu…
NewSoupVi May 18, 2024
3640cb7
Fix panelhunt postgame
NewSoupVi May 20, 2024
5bda99c
lol
NewSoupVi May 20, 2024
532e373
When you test that the bug is fixed but not that the non-bug is not u…
NewSoupVi May 21, 2024
fbdef88
Prevent Obelisks from being panel hunt panels
NewSoupVi May 26, 2024
0a4f3ca
Make picking panels for panel hunt a bit more sophisticated, if less …
NewSoupVi May 27, 2024
d61df58
Better function maybe ig
NewSoupVi May 27, 2024
4a2c6f0
Ok maybe that was a bit too much
NewSoupVi May 27, 2024
dcc0ca3
Give advanced players some control over panel hunt
NewSoupVi May 27, 2024
0119707
lint
NewSoupVi May 27, 2024
0694eaa
correct the logic for amount to pick
NewSoupVi May 27, 2024
e9954ef
decided the jingle thing was dumb, I'll figure sth out client side. S…
NewSoupVi May 27, 2024
4010878
comment
NewSoupVi May 27, 2024
45ee6ff
Make the option visible
NewSoupVi May 28, 2024
1052217
Safety
NewSoupVi May 28, 2024
be40226
Change assert slightly
NewSoupVi May 28, 2024
e51e02d
We do a little logging
NewSoupVi May 28, 2024
35b4ae3
number tweak & we do a lil logging
NewSoupVi May 28, 2024
d4eeb95
we do a little more logging
NewSoupVi May 28, 2024
877ba25
Ruff
NewSoupVi Jun 1, 2024
4449309
Panel Hunt Option Group
NewSoupVi Jun 1, 2024
471bb33
Idk how that got here
NewSoupVi Jun 1, 2024
81cac0b
Update worlds/witness/options.py
NewSoupVi Jun 5, 2024
057d615
Update worlds/witness/__init__.py
NewSoupVi Jun 5, 2024
eac934a
remove merge error
NewSoupVi Jun 5, 2024
25e9868
Update worlds/witness/player_logic.py
NewSoupVi Jun 5, 2024
bc009fc
True
NewSoupVi Jun 5, 2024
bf9c050
Merge branch 'panel_hunt_r' of https://github.com/NewSoupVi/Archipela…
NewSoupVi Jun 5, 2024
3ff4630
Don't have underwater sliding bridge when you have above water slidin…
NewSoupVi Jun 6, 2024
dda1f57
Merge branch 'main' into panel_hunt_r
NewSoupVi Jun 6, 2024
46263ef
These are not actually connected lol
NewSoupVi Jun 6, 2024
acd449c
Merge branch 'panel_hunt_r' of https://github.com/NewSoupVi/Archipela…
NewSoupVi Jun 6, 2024
f5f53d0
get rid of unnecessary variable
NewSoupVi Jun 8, 2024
3d206f8
Refactor compact hint function again
NewSoupVi Jun 8, 2024
ab5fc2b
lint
NewSoupVi Jun 8, 2024
2ff6422
Pull out Entity Hunt Picking into its own class, split it into many f…
NewSoupVi Jun 8, 2024
815c009
forgot to actually add the new file
NewSoupVi Jun 8, 2024
1ff9bdc
some more refactoring & docstrings
NewSoupVi Jun 8, 2024
df4553f
consistent naming
NewSoupVi Jun 8, 2024
5c65c1a
flip elif change
NewSoupVi Jun 8, 2024
e27126d
Comment about naming
NewSoupVi Jun 8, 2024
6fe0d6f
Make static eligible panels a constant I can refer back to
NewSoupVi Jun 16, 2024
0b8ddf2
slight formatting change
NewSoupVi Jun 16, 2024
4d3e380
pull out options-based eligibility into its own function
NewSoupVi Jun 16, 2024
28db47c
better text and stuff
NewSoupVi Jun 16, 2024
d105ef4
lint
NewSoupVi Jun 16, 2024
10eb090
Merge remote-tracking branch 'upstream/main' into panel_hunt_r
NewSoupVi Jun 16, 2024
20989b2
this is not necessary
NewSoupVi Jun 17, 2024
d0b6268
capitalisation
NewSoupVi Jun 17, 2024
e05d945
Fix same area discouragement 0
NewSoupVi Jun 20, 2024
873dbf5
Simplify data file generation
NewSoupVi Jun 21, 2024
1eb0f4c
Simplify data file generation
NewSoupVi Jun 21, 2024
3baca53
prevent div 0
NewSoupVi Jun 22, 2024
3de40b2
Add Vault Boxes -> Vault Panels to replacements
NewSoupVi Jun 22, 2024
ba59de2
Update options.py
NewSoupVi Jun 28, 2024
df7bea6
Update worlds/witness/entity_hunt.py
NewSoupVi Jun 29, 2024
edc8cef
Update entity_hunt.py
NewSoupVi Jun 29, 2024
a377515
Fix some events not working
NewSoupVi Jun 30, 2024
93351d3
assert
NewSoupVi Jun 30, 2024
279f8b2
Merge branch 'panel_hunt_r' of https://github.com/NewSoupVi/Archipela…
NewSoupVi Jun 30, 2024
bb763cd
remove now unused function
NewSoupVi Jun 30, 2024
faa791b
lint
NewSoupVi Jun 30, 2024
1804442
Lasers Activate, Lasers don't Solve
NewSoupVi Jun 30, 2024
1645125
Merge remote-tracking branch 'upstream/main' into panel_hunt_r
NewSoupVi Jul 2, 2024
4931ba3
lint
NewSoupVi Jul 2, 2024
5420110
oops
NewSoupVi Jul 2, 2024
03062e8
mypy
NewSoupVi Jul 2, 2024
5390960
lint
NewSoupVi Jul 2, 2024
01330c4
Merge branch 'main' into panel_hunt_r
NewSoupVi Jul 6, 2024
1419036
Add simple panel hunt unit test
NewSoupVi Jul 6, 2024
b15c9fc
Add Panel Hunt Tests
NewSoupVi Jul 6, 2024
6185a01
Add more Panel Hunt Tests
NewSoupVi Jul 6, 2024
f071a49
Disallow Box Short for normal panel hunt
NewSoupVi Jul 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions worlds/witness/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from .data import static_logic as static_witness_logic
from .data.item_definition_classes import DoorItemDefinition, ItemData
from .data.utils import get_audio_logs
from .hints import CompactItemData, create_all_hints, make_compact_hint_data, make_laser_hints
from .hints import CompactHintData, create_all_hints, make_compact_hint_data, make_laser_hints
from .locations import WitnessPlayerLocations
from .options import TheWitnessOptions, witness_option_groups
from .player_items import WitnessItem, WitnessPlayerItems
Expand Down Expand Up @@ -68,12 +68,14 @@ class WitnessWorld(World):
player_items: WitnessPlayerItems
player_regions: WitnessPlayerRegions

log_ids_to_hints: Dict[int, CompactItemData]
laser_ids_to_hints: Dict[int, CompactItemData]
log_ids_to_hints: Dict[int, CompactHintData]
laser_ids_to_hints: Dict[int, CompactHintData]

items_placed_early: List[str]
own_itempool: List[WitnessItem]

panel_hunt_required_count: int

def _get_slot_data(self) -> Dict[str, Any]:
return {
"seed": self.random.randrange(0, 1000000),
Expand All @@ -83,12 +85,14 @@ def _get_slot_data(self) -> Dict[str, Any]:
"door_hexes_in_the_pool": self.player_items.get_door_ids_in_pool(),
"symbols_not_in_the_game": self.player_items.get_symbol_ids_not_in_pool(),
"disabled_entities": [int(h, 16) for h in self.player_logic.COMPLETELY_DISABLED_ENTITIES],
"hunt_entities": [int(h, 16) for h in self.player_logic.HUNT_ENTITIES],
"log_ids_to_hints": self.log_ids_to_hints,
"laser_ids_to_hints": self.laser_ids_to_hints,
"progressive_item_lists": self.player_items.get_progressive_item_ids_in_pool(),
"obelisk_side_id_to_EPs": static_witness_logic.OBELISK_SIDE_ID_TO_EP_HEXES,
"precompleted_puzzles": [int(h, 16) for h in self.player_logic.EXCLUDED_LOCATIONS],
"entity_to_name": static_witness_logic.ENTITY_ID_TO_NAME,
"panel_hunt_required_absolute": self.panel_hunt_required_count
}

def determine_sufficient_progression(self) -> None:
Expand Down Expand Up @@ -151,6 +155,13 @@ def generate_early(self) -> None:
if self.options.shuffle_lasers == "local":
self.options.local_items.value |= self.item_name_groups["Lasers"]

if self.options.victory_condition == "panel_hunt":
total_panels = self.options.panel_hunt_total
required_percentage = self.options.panel_hunt_required_percentage
self.panel_hunt_required_count = round(total_panels * required_percentage / 100)
else:
self.panel_hunt_required_count = 0

def create_regions(self) -> None:
self.player_regions.create_regions(self, self.player_logic)

Expand All @@ -169,7 +180,7 @@ def create_regions(self) -> None:

for event_location in self.player_locations.EVENT_LOCATION_TABLE:
item_obj = self.create_item(
self.player_logic.EVENT_ITEM_PAIRS[event_location]
self.player_logic.EVENT_ITEM_PAIRS[event_location][0]
)
location_obj = self.get_location(event_location)
location_obj.place_locked_item(item_obj)
Expand All @@ -192,7 +203,7 @@ def create_regions(self) -> None:
]
if early_items:
random_early_item = self.random.choice(early_items)
if self.options.puzzle_randomization == "sigma_expert":
if self.options.puzzle_randomization == "sigma_expert" or self.options.victory_condition == "panel_hunt":
# In Expert, only tag the item as early, rather than forcing it onto the gate.
self.multiworld.local_early_items[self.player][random_early_item] = 1
else:
Expand Down Expand Up @@ -305,8 +316,8 @@ def create_items(self) -> None:
self.options.local_items.value.add(item_name)

def fill_slot_data(self) -> Dict[str, Any]:
self.log_ids_to_hints: Dict[int, CompactItemData] = {}
self.laser_ids_to_hints: Dict[int, CompactItemData] = {}
self.log_ids_to_hints: Dict[int, CompactHintData] = {}
self.laser_ids_to_hints: Dict[int, CompactHintData] = {}

already_hinted_locations = set()

Expand Down
6 changes: 6 additions & 0 deletions worlds/witness/data/settings/Entity_Hunt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Requirement Changes:
0x03629 - Entity Hunt - True
0x03505 - 0x03629 - True

New Connections:
Tutorial - Outside Tutorial - True
4 changes: 4 additions & 0 deletions worlds/witness/data/static_locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,10 @@
"Mountain Bottom Floor Discard",
}

GENERAL_LOCATION_HEXES = {
static_witness_logic.ENTITIES_BY_NAME[entity_name]["entity_hex"] for entity_name in GENERAL_LOCATIONS
}

OBELISK_SIDES = {
"Desert Obelisk Side 1",
"Desert Obelisk Side 2",
Expand Down
23 changes: 18 additions & 5 deletions worlds/witness/data/static_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def read_logic_file(self, lines: List[str]) -> None:
"region": None,
"id": None,
"entityType": location_id,
"locationType": None,
"area": current_area,
}

Expand All @@ -127,19 +128,30 @@ def read_logic_file(self, lines: List[str]) -> None:
"Laser Hedges",
"Laser Pressure Plates",
}
is_vault_or_video = "Vault" in entity_name or "Video" in entity_name

if "Discard" in entity_name:
entity_type = "Panel"
location_type = "Discard"
elif is_vault_or_video or entity_name == "Tutorial Gate Close":
elif "Vault" in entity_name:
entity_type = "Panel"
location_type = "Vault"
elif entity_name in laser_names:
location_type = "Laser"
entity_type = "Laser"
location_type = None
elif "Obelisk Side" in entity_name:
entity_type = "Obelisk Side"
location_type = "Obelisk Side"
elif "Obelisk" in entity_name:
entity_type = "Obelisk"
location_type = None
elif "EP" in entity_name:
entity_type = "EP"
location_type = "EP"
elif entity_hex.startswith("0xFF"):
entity_type = "Event"
location_type = None
else:
entity_type = "Panel"
location_type = "General"

required_items = parse_lambda(required_item_lambda)
Expand All @@ -152,7 +164,7 @@ def read_logic_file(self, lines: List[str]) -> None:
"items": required_items
}

if location_type == "Obelisk Side":
if entity_type == "Obelisk Side":
eps = set(next(iter(required_panels)))
eps -= {"Theater to Tunnels"}

Expand All @@ -167,7 +179,8 @@ def read_logic_file(self, lines: List[str]) -> None:
"entity_hex": entity_hex,
"region": current_region,
"id": int(location_id),
"entityType": location_type,
"entityType": entity_type,
"locationType": location_type,
"area": current_area,
}

Expand Down
4 changes: 4 additions & 0 deletions worlds/witness/data/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ def get_elevators_come_to_you() -> List[str]:
return get_adjustment_file("settings/Door_Shuffle/Elevators_Come_To_You.txt")


def get_entity_hunt() -> List[str]:
return get_adjustment_file("settings/Entity_Hunt.txt")


def get_sigma_normal_logic() -> List[str]:
return get_adjustment_file("WitnessLogic.txt")

Expand Down
Loading
Loading