From fcfefe57d9d0b9d8eb3e149e68605103a9e6b490 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Thu, 11 Sep 2025 20:08:32 -0400 Subject: [Data] Fixed connection target required door logic bugs --- data/connections.txtpb | 36 ++++++++++++---- data/maps/the_bearer/connections.txtpb | 5 +++ data/maps/the_bearer/rooms/Back Area.txtpb | 6 --- data/maps/the_bearer/rooms/Tree Entrance.txtpb | 6 +++ data/maps/the_darkroom/connections.txtpb | 10 +++++ .../the_darkroom/rooms/Congruent Entrance.txtpb | 7 ++++ .../the_darkroom/rooms/Double Sided Entrance.txtpb | 7 ++++ data/maps/the_darkroom/rooms/First Room.txtpb | 6 --- data/maps/the_darkroom/rooms/Second Room.txtpb | 6 --- data/maps/the_entry/connections.txtpb | 15 +++++++ .../maps/the_entry/rooms/Flipped Second Room.txtpb | 7 ---- .../maps/the_entry/rooms/Four Rooms Entrance.txtpb | 7 ++++ data/maps/the_entry/rooms/Liberated Entrance.txtpb | 6 +++ data/maps/the_entry/rooms/Link Area.txtpb | 12 ------ data/maps/the_entry/rooms/Literate Entrance.txtpb | 6 +++ proto/human.proto | 4 ++ tools/validator/human_processor.cpp | 26 ++++++++++-- tools/validator/structs.h | 3 ++ tools/validator/validator.cpp | 48 ++++++++++++++++++++++ 19 files changed, 174 insertions(+), 49 deletions(-) create mode 100644 data/maps/the_bearer/rooms/Tree Entrance.txtpb create mode 100644 data/maps/the_darkroom/rooms/Congruent Entrance.txtpb create mode 100644 data/maps/the_darkroom/rooms/Double Sided Entrance.txtpb create mode 100644 data/maps/the_entry/rooms/Four Rooms Entrance.txtpb create mode 100644 data/maps/the_entry/rooms/Liberated Entrance.txtpb create mode 100644 data/maps/the_entry/rooms/Literate Entrance.txtpb diff --git a/data/connections.txtpb b/data/connections.txtpb index 93e7faa..35e7ef8 100644 --- a/data/connections.txtpb +++ b/data/connections.txtpb @@ -20,7 +20,7 @@ connections { from { port { map: "the_entry" - room: "Flipped Second Room" + room: "Four Rooms Entrance" name: "FOUR" } } @@ -157,7 +157,7 @@ connections { to { port { map: "the_darkroom" - room: "Second Room" + room: "Congruent Entrance" name: "CONGRUENT" } } @@ -233,7 +233,7 @@ connections { from { port { map: "the_darkroom" - room: "First Room" + room: "Double Sided Entrance" name: "DOUBLESIDED" } } @@ -308,6 +308,23 @@ connections { name: "GALLERY" } } + oneway: true +} +connections { + from { + port { + map: "the_butterfly" + room: "Main Area" + name: "GALLERY" + } + } + to { + room { + map: "the_gallery" + name: "Main Area" + } + } + oneway: true } connections { from { @@ -618,7 +635,7 @@ connections { from { port { map: "the_entry" - room: "Link Area" + room: "Liberated Entrance" name: "BLUE" } } @@ -666,7 +683,7 @@ connections { from { port { map: "the_entry" - room: "Link Area" + room: "Literate Entrance" name: "BROWN" } } @@ -876,6 +893,7 @@ connections { } } oneway: true + bypass_target_door: true } connections { from { @@ -1455,7 +1473,6 @@ connections { name: "GREAT" } } - door { map: "the_great" name: "Daedalus Entrance" } oneway: true } connections { @@ -1474,6 +1491,7 @@ connections { } } oneway: true + bypass_target_door: true } connections { from { @@ -1769,12 +1787,13 @@ connections { } } oneway: true + bypass_target_door: true } connections { from { port { map: "the_bearer" - room: "Back Area" + room: "Tree Entrance" name: "TREE" } } @@ -1851,7 +1870,6 @@ connections { } } connections { - # Two one-way connections because the door only blocks one direction. from { port { map: "the_great" @@ -1868,6 +1886,7 @@ connections { } } connections { + # Two one-way connections because the door only blocks one direction. from { port { map: "the_unkempt" @@ -1900,6 +1919,7 @@ connections { } } oneway: true + bypass_target_door: true } connections { from { diff --git a/data/maps/the_bearer/connections.txtpb b/data/maps/the_bearer/connections.txtpb index 23410f0..ba14d83 100644 --- a/data/maps/the_bearer/connections.txtpb +++ b/data/maps/the_bearer/connections.txtpb @@ -263,3 +263,8 @@ connections { to_room: "Butterfly Room" door { name: "Butterfly Entrance" } } +connections { + from_room: "Back Area" + to_room: "Tree Entrance" + door { name: "Control Center Brown Door" } +} diff --git a/data/maps/the_bearer/rooms/Back Area.txtpb b/data/maps/the_bearer/rooms/Back Area.txtpb index 27e175c..b1860de 100644 --- a/data/maps/the_bearer/rooms/Back Area.txtpb +++ b/data/maps/the_bearer/rooms/Back Area.txtpb @@ -6,12 +6,6 @@ panels { answer: "brown" symbols: EXAMPLE } -ports { - name: "TREE" - path: "Components/Warps/worldport3" - orientation: "north" - required_door { name: "Control Center Brown Door" } -} ports { name: "DAEDALUS" path: "Components/Warps/worldport2" diff --git a/data/maps/the_bearer/rooms/Tree Entrance.txtpb b/data/maps/the_bearer/rooms/Tree Entrance.txtpb new file mode 100644 index 0000000..97a07da --- /dev/null +++ b/data/maps/the_bearer/rooms/Tree Entrance.txtpb @@ -0,0 +1,6 @@ +name: "Tree Entrance" +ports { + name: "TREE" + path: "Components/Warps/worldport3" + orientation: "north" +} diff --git a/data/maps/the_darkroom/connections.txtpb b/data/maps/the_darkroom/connections.txtpb index 87e9b0e..1b7ad05 100644 --- a/data/maps/the_darkroom/connections.txtpb +++ b/data/maps/the_darkroom/connections.txtpb @@ -38,3 +38,13 @@ connections { to_room: "Cyan Hallway" door { name: "Colorful Entrance" } } +connections { + from_room: "Second Room" + to_room: "Congruent Entrance" + door { name: "Congruent Entrance" } +} +connections { + from_room: "First Room" + to_room: "Double Sided Entrance" + door { name: "Double Sided Entrance" } +} diff --git a/data/maps/the_darkroom/rooms/Congruent Entrance.txtpb b/data/maps/the_darkroom/rooms/Congruent Entrance.txtpb new file mode 100644 index 0000000..7ea1286 --- /dev/null +++ b/data/maps/the_darkroom/rooms/Congruent Entrance.txtpb @@ -0,0 +1,7 @@ +name: "Congruent Entrance" +panel_display_name: "Second Room" +ports { + name: "CONGRUENT" + path: "Components/Warps/worldport7" + orientation: "east" +} diff --git a/data/maps/the_darkroom/rooms/Double Sided Entrance.txtpb b/data/maps/the_darkroom/rooms/Double Sided Entrance.txtpb new file mode 100644 index 0000000..9d25108 --- /dev/null +++ b/data/maps/the_darkroom/rooms/Double Sided Entrance.txtpb @@ -0,0 +1,7 @@ +name: "Double Sided Entrance" +panel_display_name: "First Room" +ports { + name: "DOUBLESIDED" + path: "Components/Warps/worldport6" + orientation: "east" +} diff --git a/data/maps/the_darkroom/rooms/First Room.txtpb b/data/maps/the_darkroom/rooms/First Room.txtpb index 4e656bf..c635757 100644 --- a/data/maps/the_darkroom/rooms/First Room.txtpb +++ b/data/maps/the_darkroom/rooms/First Room.txtpb @@ -42,9 +42,3 @@ ports { orientation: "north" required_door { name: "Second Room Entrance" } } -ports { - name: "DOUBLESIDED" - path: "Components/Warps/worldport6" - orientation: "east" - required_door { name: "Double Sided Entrance" } -} diff --git a/data/maps/the_darkroom/rooms/Second Room.txtpb b/data/maps/the_darkroom/rooms/Second Room.txtpb index baeea12..a3964ea 100644 --- a/data/maps/the_darkroom/rooms/Second Room.txtpb +++ b/data/maps/the_darkroom/rooms/Second Room.txtpb @@ -47,9 +47,3 @@ ports { orientation: "north" required_door { name: "Third Room Entrance" } } -ports { - name: "CONGRUENT" - path: "Components/Warps/worldport7" - orientation: "east" - required_door { name: "Congruent Entrance" } -} diff --git a/data/maps/the_entry/connections.txtpb b/data/maps/the_entry/connections.txtpb index a2e325a..9813f85 100644 --- a/data/maps/the_entry/connections.txtpb +++ b/data/maps/the_entry/connections.txtpb @@ -199,3 +199,18 @@ connections { to_room: "White Hallway To Daedalus" door { name: "Control Center White Door" } } +connections { + from_room: "Flipped Second Room" + to_room: "Four Rooms Entrance" + door { name: "Flipped Second Room Right Door" } +} +connections { + from_room: "Link Area" + to_room: "Liberated Entrance" + door { name: "Liberated Entrance" } +} +connections { + from_room: "Link Area" + to_room: "Literate Entrance" + door { name: "Literate Entrance" } +} diff --git a/data/maps/the_entry/rooms/Flipped Second Room.txtpb b/data/maps/the_entry/rooms/Flipped Second Room.txtpb index 5841ca1..0d518bb 100644 --- a/data/maps/the_entry/rooms/Flipped Second Room.txtpb +++ b/data/maps/the_entry/rooms/Flipped Second Room.txtpb @@ -21,10 +21,3 @@ paintings { gravity: Y_PLUS display_name: "Eye Painting" } -ports { - name: "FOUR" - path: "Components/Warps/worldport9" - orientation: "south" - gravity: Y_PLUS - required_door { name: "Flipped Second Room Right Door" } -} \ No newline at end of file diff --git a/data/maps/the_entry/rooms/Four Rooms Entrance.txtpb b/data/maps/the_entry/rooms/Four Rooms Entrance.txtpb new file mode 100644 index 0000000..689d23e --- /dev/null +++ b/data/maps/the_entry/rooms/Four Rooms Entrance.txtpb @@ -0,0 +1,7 @@ +name: "Four Rooms Entrance" +ports { + name: "FOUR" + path: "Components/Warps/worldport9" + orientation: "south" + gravity: Y_PLUS +} diff --git a/data/maps/the_entry/rooms/Liberated Entrance.txtpb b/data/maps/the_entry/rooms/Liberated Entrance.txtpb new file mode 100644 index 0000000..f0176a0 --- /dev/null +++ b/data/maps/the_entry/rooms/Liberated Entrance.txtpb @@ -0,0 +1,6 @@ +name: "Liberated Entrance" +ports { + name: "BLUE" + path: "worldport8" + orientation: "west" +} diff --git a/data/maps/the_entry/rooms/Link Area.txtpb b/data/maps/the_entry/rooms/Link Area.txtpb index 689f57a..5b68279 100644 --- a/data/maps/the_entry/rooms/Link Area.txtpb +++ b/data/maps/the_entry/rooms/Link Area.txtpb @@ -26,15 +26,3 @@ paintings { orientation: "south" display_name: "Center Painting" } -ports { - name: "BLUE" - path: "worldport8" - orientation: "west" - required_door { name: "Liberated Entrance" } -} -ports { - name: "BROWN" - path: "worldport9" - orientation: "east" - required_door { name: "Literate Entrance" } -} \ No newline at end of file diff --git a/data/maps/the_entry/rooms/Literate Entrance.txtpb b/data/maps/the_entry/rooms/Literate Entrance.txtpb new file mode 100644 index 0000000..4ec402f --- /dev/null +++ b/data/maps/the_entry/rooms/Literate Entrance.txtpb @@ -0,0 +1,6 @@ +name: "Literate Entrance" +ports { + name: "BROWN" + path: "worldport9" + orientation: "east" +} diff --git a/proto/human.proto b/proto/human.proto index e5335e7..615ac86 100644 --- a/proto/human.proto +++ b/proto/human.proto @@ -66,6 +66,10 @@ message HumanConnection { // If true, this connection will only be logically allowed if the Daedalus // Roof Access option is enabled. optional bool roof_access = 7; + + // This means that the connection intentionally skips the target object's + // required door. + optional bool bypass_target_door = 8; } message HumanConnections { diff --git a/tools/validator/human_processor.cpp b/tools/validator/human_processor.cpp index 561225e..2c978bf 100644 --- a/tools/validator/human_processor.cpp +++ b/tools/validator/human_processor.cpp @@ -394,7 +394,9 @@ class HumanProcessor { } } else if (human_connection.has_from()) { ProcessSingleConnection(human_connection, human_connection.from(), - current_map_name); + current_map_name, + /*is_target=*/!human_connection.oneway() && + !human_connection.bypass_target_door()); } if (human_connection.has_to_room()) { @@ -410,8 +412,9 @@ class HumanProcessor { std::cout << "A global connection used to_room." << std::endl; } } else if (human_connection.has_to()) { - ProcessSingleConnection(human_connection, human_connection.to(), - current_map_name); + ProcessSingleConnection( + human_connection, human_connection.to(), current_map_name, + /*is_target=*/!human_connection.bypass_target_door()); } if (human_connection.has_door()) { @@ -432,7 +435,7 @@ class HumanProcessor { void ProcessSingleConnection( const HumanConnection& human_connection, const HumanConnection::Endpoint& endpoint, - const std::optional& current_map_name) { + const std::optional& current_map_name, bool is_target) { if (endpoint.has_room()) { auto room_identifier = GetCompleteRoomIdentifier(endpoint.room(), current_map_name); @@ -451,6 +454,11 @@ class HumanProcessor { if (painting_identifier) { PaintingInfo& painting_info = info_.paintings[*painting_identifier]; painting_info.connections_referenced_by.push_back(human_connection); + + if (is_target) { + painting_info.target_connections_referenced_by.push_back( + human_connection); + } } else { // Not sure where else to store this right now. std::cout @@ -463,6 +471,11 @@ class HumanProcessor { if (port_identifier) { PortInfo& port_info = info_.ports[*port_identifier]; port_info.connections_referenced_by.push_back(human_connection); + + if (is_target) { + port_info.target_connections_referenced_by.push_back( + human_connection); + } } else { // Not sure where else to store this right now. std::cout @@ -480,6 +493,11 @@ class HumanProcessor { panel_info.proxies[endpoint.panel().answer()] .connections_referenced_by.push_back(human_connection); } + + if (is_target) { + panel_info.target_connections_referenced_by.push_back( + human_connection); + } } } } diff --git a/tools/validator/structs.h b/tools/validator/structs.h index 17ed33a..d1d45f2 100644 --- a/tools/validator/structs.h +++ b/tools/validator/structs.h @@ -56,12 +56,14 @@ struct PortInfo { std::vector definitions; std::vector connections_referenced_by; + std::vector target_connections_referenced_by; }; struct PaintingInfo { std::vector definitions; std::vector connections_referenced_by; + std::vector target_connections_referenced_by; std::vector doors_referenced_by; }; @@ -79,6 +81,7 @@ struct PanelInfo { std::string map_area_name; std::vector connections_referenced_by; + std::vector target_connections_referenced_by; std::vector doors_referenced_by; std::map proxies; diff --git a/tools/validator/validator.cpp b/tools/validator/validator.cpp index 4149caa..e4c6324 100644 --- a/tools/validator/validator.cpp +++ b/tools/validator/validator.cpp @@ -256,6 +256,22 @@ class Validator { std::cout << "Port " << port_identifier.ShortDebugString() << " was defined multiple times." << std::endl; } + + if (!port_info.target_connections_referenced_by.empty()) { + for (const HumanPort& port : port_info.definitions) { + if (port.has_required_door()) { + std::cout << "Port " << port_identifier.ShortDebugString() + << " has a required door but is the target of a connection:" + << std::endl; + + for (const HumanConnection& connection : + port_info.target_connections_referenced_by) { + std::cout << " CONNECTION " << connection.ShortDebugString() + << std::endl; + } + } + } + } } void ValidatePainting(const PaintingIdentifier& painting_identifier, @@ -279,6 +295,22 @@ class Validator { std::cout << "Painting " << painting_identifier.ShortDebugString() << " was defined multiple times." << std::endl; } + + if (!painting_info.target_connections_referenced_by.empty()) { + for (const HumanPainting& painting : painting_info.definitions) { + if (painting.has_required_door()) { + std::cout << "Painting " << painting_identifier.ShortDebugString() + << " has a required door but is the target of a connection:" + << std::endl; + + for (const HumanConnection& connection : + painting_info.target_connections_referenced_by) { + std::cout << " CONNECTION " << connection.ShortDebugString() + << std::endl; + } + } + } + } } void ValidatePanel(const PanelIdentifier& panel_identifier, @@ -340,6 +372,22 @@ class Validator { std::cout << "Panel " << panel_identifier.ShortDebugString() << " is missing an AP ID." << std::endl; } + + if (!panel_info.target_connections_referenced_by.empty()) { + for (const HumanPanel& panel : panel_info.definitions) { + if (panel.has_required_door()) { + std::cout << "Panel " << panel_identifier.ShortDebugString() + << " has a required door but is the target of a connection:" + << std::endl; + + for (const HumanConnection& connection : + panel_info.target_connections_referenced_by) { + std::cout << " CONNECTION " << connection.ShortDebugString() + << std::endl; + } + } + } + } } void ValidateKeyholder(const KeyholderIdentifier& keyholder_identifier, -- cgit 1.4.1