From 1d81570d217e7827ad089f07272bfa668a172c3d Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Thu, 23 Oct 2025 12:28:39 -0400 Subject: Allow validator to ignore custom nodes --- data/maps/the_advanced/metadata.txtpb | 2 ++ data/maps/the_entry/metadata.txtpb | 3 +++ data/maps/the_sturdy/metadata.txtpb | 3 +++ proto/human.proto | 13 +++++++++++-- tools/validator/human_processor.cpp | 4 ++++ 5 files changed, 23 insertions(+), 2 deletions(-) diff --git a/data/maps/the_advanced/metadata.txtpb b/data/maps/the_advanced/metadata.txtpb index 578fe72..cee10b6 100644 --- a/data/maps/the_advanced/metadata.txtpb +++ b/data/maps/the_advanced/metadata.txtpb @@ -1,2 +1,4 @@ display_name: "The Advanced" type: GIFT_MAP +# The map's mastery is created at runtime. +custom_nodes: "Components/Collectables/collectable" diff --git a/data/maps/the_entry/metadata.txtpb b/data/maps/the_entry/metadata.txtpb index 0eeb29a..9536831 100644 --- a/data/maps/the_entry/metadata.txtpb +++ b/data/maps/the_entry/metadata.txtpb @@ -11,3 +11,6 @@ excluded_nodes: "Panels/Back Left/backleft_4_proxied_1" excluded_nodes: "Panels/Back Left/backleft_4_proxied_2" # This is a proxy related to the first panel and it doesn't seem useful. excluded_nodes: "Panels/Entry/entry_proxied_fake" +# The gift map entrance is created by the mod. +custom_nodes: "Components/GiftMapEntrance/IcelyPanel" +custom_nodes: "Components/GiftMapEntrance/Panel" diff --git a/data/maps/the_sturdy/metadata.txtpb b/data/maps/the_sturdy/metadata.txtpb index 9f42137..624f765 100644 --- a/data/maps/the_sturdy/metadata.txtpb +++ b/data/maps/the_sturdy/metadata.txtpb @@ -4,3 +4,6 @@ display_name: "The Sturdy" # I don't know why there's a second copy of the rainbow. #excluded_nodes: "Components/Doors/Rainbow/Hinge/rainbow" #excluded_nodes: "Components/Doors/Rainbow/Hinge/rainbowMirrored" +# The validator doesn't know that this node exists because it is part of a +# sub-scene. +custom_nodes: "Components/Doors/Rainbow2/Hinge/rainbow" diff --git a/proto/human.proto b/proto/human.proto index 41fce45..df33a5e 100644 --- a/proto/human.proto +++ b/proto/human.proto @@ -221,9 +221,18 @@ message HumanRoom { message HumanMap { optional string display_name = 1; - repeated string excluded_nodes = 2; - optional PortIdentifier worldport_entrance = 3; optional MapType type = 4; + + optional PortIdentifier worldport_entrance = 3; + + // These two fields are used by the validator and nothing else. excluded_nodes + // are objects in the tscn that are intentionally not mentioned in the txtpb. + // custom_nodes are the reverse of that; objects that are mentioned in the + // txtpb but not present in the tscn. These are generally created dynamically + // by the game mod, but may also be used for places where the validator is + // just wrong about the contents of the map file. + repeated string excluded_nodes = 2; + repeated string custom_nodes = 5; } message HumanProgressive { diff --git a/tools/validator/human_processor.cpp b/tools/validator/human_processor.cpp index de80db0..5a1c095 100644 --- a/tools/validator/human_processor.cpp +++ b/tools/validator/human_processor.cpp @@ -78,6 +78,10 @@ class HumanProcessor { map_info.game_nodes[path].uses++; } + for (const std::string& path : metadata.custom_nodes()) { + map_info.game_nodes[path].defined = true; + } + if (metadata.has_worldport_entrance()) { auto port_identifier = GetCompletePortIdentifier( metadata.worldport_entrance(), current_map_name, std::nullopt); -- cgit 1.4.1