# TODO # daedalus/roof -> icarus connections { from { port { map: "the_entry" room: "Gallery Return" name: "GALLERY" } } to { port { map: "the_gallery" room: "Main Area" name: "ENTRY" } } } connections { from { port { map: "the_entry" room: "Four Rooms Entrance" name: "FOUR" } } to { port { map: "four_rooms" room: "Synonyms Room" name: "ENTRY" } } } connections { from { port { map: "the_entry" room: "Least Blue Last" name: "DARKROOM" } } to { port { map: "the_darkroom" room: "First Room" name: "ENTRY" } } } connections { from { port { map: "the_darkroom" room: "Second Room" name: "ENTRY" } } to { port { map: "the_entry" room: "Least Blue Last" name: "DARKROOM" } } oneway: true } connections { from { port { map: "the_darkroom" room: "Third Room" name: "ENTRY" } } to { port { map: "the_entry" room: "Least Blue Last" name: "DARKROOM" } } oneway: true } connections { from { painting { map: "the_between" room: "Control Center Side" name: "EYE" } } to { room { map: "the_entry" name: "Eye Room" } } oneway: true } connections { from { painting { map: "the_gallery" room: "Main Area" name: "ENTRY" } } to { room { map: "the_entry" name: "Eye Room" } } oneway: true } connections { from { painting { map: "the_bearer" room: "Butterfly Room" name: "BUTTERFLY" } } to { room { map: "the_butterfly" name: "Main Area" } } oneway: true } connections { from { port { map: "the_colorful" room: "Cyan Hallway" name: "DARKROOM" } } to { port { map: "the_darkroom" room: "Cyan Hallway" name: "COLORFUL" } } } connections { from { port { map: "the_congruent" room: "Main Area" name: "DARKROOM" } } to { port { map: "the_darkroom" room: "Congruent Entrance" name: "CONGRUENT" } } } connections { from { port { map: "the_digital" room: "Main Area" name: "ENTRY3" } } to { port { map: "the_entry" room: "Digital Entrance" name: "DIGITAL" } } } connections { from { port { map: "the_digital" room: "Main Area" name: "ENTRY2" } } to { port { map: "the_entry" room: "Digital Entrance" name: "DIGITAL" } } oneway: true } connections { from { port { map: "the_digital" room: "Main Area" name: "ENTRY1" } } to { port { map: "the_entry" room: "Digital Entrance" name: "DIGITAL" } } oneway: true } connections { from { port { map: "the_digital" room: "Gallery Maze" name: "GALLERY" } } to { port { map: "the_gallery" room: "Main Area" name: "ENTRY" } } oneway: true } connections { from { port { map: "the_darkroom" room: "Double Sided Entrance" name: "DOUBLESIDED" } } to { port { map: "the_double_sided" room: "Start" name: "DARKROOM" } } } connections { from { painting { map: "the_gallery" room: "Main Area" name: "EXTRAVAGANT" } } to { painting { map: "the_extravagant" room: "Y Minus First Floor" name: "GALLERY" } } } connections { from { port { map: "the_extravagant" room: "Engine Room" name: "GALLERY" } } to { room { map: "the_gallery" name: "Main Area" } } oneway: true } connections { from { painting { map: "the_gallery" room: "Main Area" name: "BETWEEN" } } to { room { map: "the_between" name: "Main Area" } } oneway: true } connections { from { painting { map: "the_gallery" room: "Main Area" name: "BUTTERFLY" } } to { port { map: "the_butterfly" room: "Main Area" 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 { painting { map: "the_gallery" room: "Main Area" name: "DARKROOM" } } to { room { map: "the_darkroom" name: "First Room" } } oneway: true } connections { from { painting { map: "the_gallery" room: "Main Area" name: "COLORFUL" } } to { room { map: "the_colorful" name: "White Room" } } oneway: true } connections { from { painting { map: "the_gallery" room: "Main Area" name: "ANCIENT" } } to { room { map: "the_ancient" name: "Outside" } } oneway: true } connections { from { room { map: "the_ancient" name: "Outside" } } to { room { map: "the_graveyard" name: "Outside" } } oneway: true } connections { from { painting { map: "the_gallery" room: "Main Area" name: "GRAVEYARD" } } to { room { map: "the_graveyard" name: "Outside" } } oneway: true } connections { from { port { map: "the_great" room: "Main Area" name: "DIGITAL" } } to { room { map: "the_digital" name: "Main Area" } } oneway: true } connections { from { port { map: "the_entry" room: "Entry Exit" name: "GREAT" } } to { port { map: "the_great" room: "Main Area" name: "ENTRY" } } } connections { from { port { map: "the_great" room: "Salmon Room" name: "BETWEEN" } } to { port { map: "the_between" room: "Main Area" name: "GREAT" } } } connections { from { painting { map: "the_great" room: "West Side" name: "EXTRAVAGANT" } } to { painting { map: "the_extravagant" room: "Y Minus First Floor" name: "GALLERY" } } oneway: true } connections { from { port { map: "the_great" room: "Colorful Entrance" name: "COLORFUL" } } to { port { map: "the_colorful" room: "White Room" name: "GREAT" } } } connections { from { room { map: "the_great" name: "North Landscape" } } to { room { map: "the_graveyard" name: "Outside" } } oneway: true } connections { from { port { map: "the_hive" room: "Main Area" name: "GREAT" } } to { port { map: "the_great" room: "Hive Entrance" name: "HIVE" } } } connections { from { port { map: "the_great" room: "West Side" name: "IMPRESSIVE" } } to { port { map: "the_impressive" room: "Lobby" name: "GREAT" } } } connections { from { port { map: "the_impressive" room: "Side Area" name: "FOURROOMS" } } to { port { map: "four_rooms" room: "Intensify Room" name: "IMPRESSIVE" } } } connections { from { port { map: "the_great" room: "North Landscape" name: "INVISIBLE" } } to { port { map: "the_invisible" room: "Entrance" name: "ENTRY" } } door { map: "the_great" name: "Invisible Entrance" } oneway: true } connections { from { port { map: "the_invisible" room: "Entrance" name: "ENTRY" } } to { room { map: "the_entry" name: "Starting Room" } } oneway: true } connections { from { port { map: "the_invisible" room: "Maze" name: "ENTRY" } } to { room { map: "the_entry" name: "Starting Room" } } oneway: true } connections { from { port { map: "the_great" room: "Jubilant Entrance" name: "JUBILANT" } } to { port { map: "the_jubilant" room: "Main Area" name: "GREAT" } } } connections { from { port { map: "the_great" room: "Main Area" name: "KEEN" } } to { port { map: "the_keen" room: "Main Area" name: "GREAT" } } } connections { from { port { map: "the_entry" room: "Liberated Entrance" name: "BLUE" } } to { port { map: "the_liberated" room: "Puzzle Room" name: "ENTRY" } } } connections { from { port { map: "the_great" room: "Main Area" name: "LINEAR" } } to { port { map: "the_linear" room: "Room" name: "GREAT" } } } connections { from { port { map: "the_entry" room: "Eye Room" name: "LIONIZED" } } to { port { map: "the_lionized" room: "Puzzle Room" name: "ENTRY" } } } connections { from { port { map: "the_entry" room: "Literate Entrance" name: "BROWN" } } to { port { map: "the_literate" room: "Puzzle Room" name: "ENTRY" } } } connections { from { port { map: "the_between" room: "Control Center Side" name: "LIVELY" } } to { port { map: "the_lively" room: "Puzzle Room" name: "BETWEEN" } } } connections { from { port { map: "the_great" room: "Main Area" name: "ORB" } } to { port { map: "the_orb" room: "Main Area" name: "GREAT" } } } connections { from { port { map: "the_orb" room: "B Room" name: "MID" } } to { port { map: "the_great" room: "Main Area" name: "ORB" } } oneway: true } connections { from { port { map: "the_orb" room: "B Room" name: "FINAL" } } to { port { map: "the_great" room: "Main Area" name: "ORB" } } oneway: true } connections { from { port { map: "four_rooms" room: "Time Room" name: "OWL" } } to { port { map: "the_owl" room: "Connected Area" name: "FOURROOMS" } } } connections { from { painting { map: "the_gallery" room: "Main Area" name: "OWL" } } to { port { map: "the_owl" room: "R2C2 Bottom" name: "GALLERY" } } oneway: true } connections { from { port { map: "the_owl" room: "R2C2 Bottom" name: "GALLERY" } } to { room { map: "the_gallery" name: "Main Area" } } oneway: true } connections { from { port { map: "the_entry" room: "Parthenon Return" name: "PARTHENON" } } to { port { map: "the_parthenon" room: "Main Area" name: "ENTRY" } } } connections { from { painting { map: "the_gallery" room: "Main Area" name: "PARTHENON" } } to { port { map: "the_parthenon" room: "Main Area" name: "GALLERY" } } } connections { from { painting { map: "the_entry" room: "Right Eye" name: "PSYCHIC" } } to { room { map: "the_partial" name: "Obverse Side" } } oneway: true } # Two one-way connections because the CLUE panel only needs to be solved to # go from The Great to The Partial. connections { from { port { map: "the_great" room: "West Side" name: "PARTIAL" } } to { port { map: "the_partial" room: "Obverse Side" name: "GREAT" } } oneway: true } connections { from { port { map: "the_partial" room: "Obverse Side" name: "GREAT" } } to { port { map: "the_great" room: "West Side" name: "PARTIAL" } } oneway: true bypass_target_door: true } connections { from { port { map: "the_between" room: "Plaza Entrance" name: "PLAZA" } } to { port { map: "the_plaza" room: "Main Area" name: "BETWEEN" } } } connections { from { port { map: "the_impressive" room: "Green Eye" name: "PLAZA" } } to { port { map: "the_plaza" room: "Main Area" name: "IMPRESSIVE" } } } connections { from { port { map: "the_plaza" room: "Repetitive Entrance" name: "REPETITIVE" } } to { port { map: "the_repetitive" room: "Plaza Connector" name: "PLAZA" } } } connections { from { port { map: "the_entry" room: "Repetitive Entrance" name: "REPETITIVE" } } to { port { map: "the_repetitive" room: "Entry Connector" name: "ENTRY" } } } connections { from { port { map: "the_entry" room: "Lime Room" name: "REVITALIZED" } } to { port { map: "the_revitalized" room: "Bye Room" name: "PARTHENON" } } oneway: true } connections { from { port { map: "the_parthenon" room: "Main Area" name: "REVITALIZED" } } to { port { map: "the_revitalized" room: "Bye Room" name: "PARTHENON" } } } connections { from { panel { map: "the_revitalized" room: "Return Room" name: "RETURN" } } to { room { map: "the_entry" name: "Starting Room" } } oneway: true } connections { from { port { map: "the_entry" room: "Shop Entrance" name: "SHOP" } } to { port { map: "the_shop" room: "Main Area" name: "ENTRY" } } } connections { from { port { map: "the_plaza" room: "Sirenic Entrance" name: "SIRENIC" } } to { port { map: "the_sirenic" room: "Start" name: "PLAZA" } } } connections { from { painting { map: "the_stormy" room: "X2 Room" name: "PARTHENON" } } to { room { map: "the_parthenon" name: "Main Area" } } oneway: true } connections { from { port { map: "the_colorful" room: "Cyan Hallway" name: "STURDY" } } to { port { map: "the_sturdy" room: "Main Area" name: "COLORFUL" } } } connections { from { port { map: "the_owl" room: "Magenta Hallway" name: "STURDY" } } to { port { map: "the_sturdy" room: "Main Area" name: "OWL" } } } connections { from { painting { map: "the_gallery" room: "Main Area" name: "SUNTEMPLE" } } to { room { map: "the_sun_temple" name: "Entrance" } } oneway: true } connections { from { port { map: "the_unyielding" room: "Bearer Entrance" name: "BEARER" } } to { port { map: "the_bearer" room: "Entry" name: "UNYIELDING" } } } connections { from { port { map: "the_digital" room: "Unyielding Entrance" name: "UNYIELDING" } } to { port { map: "the_unyielding" room: "Digital Entrance" name: "DIGITAL" } } } connections { from { painting { map: "the_gallery" room: "Main Area" name: "UNYIELDING" } } to { room { map: "the_unyielding" name: "Digital Entrance" } } oneway: true } connections { from { port { map: "the_unyielding" room: "Nuanced Entrance" name: "NUANCED" } } to { port { map: "the_nuanced" room: "Main Room" name: "UNYIELDING" } } } connections { from { port { map: "the_plaza" room: "Main Area" name: "UNYIELDING" } } to { port { map: "the_unyielding" room: "Plaza Entrance" name: "PLAZA" } } } connections { from { port { map: "daedalus" room: "Outside Hedges" name: "REVITALIZED" } } to { port { map: "the_revitalized" room: "Bye Room" name: "PARTHENON" } } oneway: true } connections { from { panel { map: "daedalus" room: "Rainbow End" name: "POT" } } to { room { map: "the_gold" name: "The Whole Thing" } } oneway: true } connections { from { room { map: "daedalus" name: "Roof" } } to { room { map: "the_graveyard" name: "Outside" } } oneway: true roof_access: true } connections { from { painting { map: "the_gallery" room: "Daedalus Extension" name: "PYRAMID" } } to { room { map: "daedalus" name: "Outside Pyramid" } } oneway: true } connections { from { painting { map: "the_gallery" room: "Daedalus Extension" name: "TOWER" } } to { room { map: "daedalus" name: "Outside Hedges" } } oneway: true } connections { from { painting { map: "the_gallery" room: "Daedalus Extension" name: "GATE" } } to { room { map: "daedalus" name: "Z2 Room" } } oneway: true } connections { from { painting { map: "the_gallery" room: "Daedalus Extension" name: "PUMPKIN" } } to { room { map: "daedalus" name: "Green Color Door" } } oneway: true } connections { from { painting { map: "the_gallery" room: "Daedalus Extension" name: "HOUSE" } } to { room { map: "daedalus" name: "Outside House" } } oneway: true } connections { from { painting { map: "the_gallery" room: "Daedalus Extension" name: "SNAKE" } } to { room { map: "daedalus" name: "Outside Snake Room" } } oneway: true } connections { from { port { map: "the_entry" room: "White Hallway To Daedalus" name: "DAEDALUS" } } to { port { map: "daedalus" room: "White Hallway From Entry" name: "ENTRY" } } } connections { from { port { map: "the_entry" room: "Daedalus Entrance" name: "DAEDALUS" } } to { port { map: "daedalus" room: "Entry Shortcut" name: "ENTRY" } } } connections { from { port { map: "the_entry" room: "Composite Room Entrance" name: "COMPOSITE" } } to { port { map: "daedalus" room: "Composite Room S" name: "ENTRY" } } } connections { from { port { map: "four_rooms" room: "Examples Room" name: "DAEDALUS" } } to { port { map: "daedalus" room: "Yellow Color Door" name: "FOURROOMS" } } } connections { from { port { map: "the_bearer" room: "Back Area" name: "DAEDALUS" } } to { port { map: "daedalus" room: "Rain Side" name: "BEARER" } } } connections { from { painting { map: "the_gallery" room: "Main Area" name: "RAINBOW" } } to { painting { map: "daedalus" room: "Rainbow Start" name: "RAINBOW" } } oneway: true } connections { from { painting { map: "the_gallery" room: "Main Area" name: "CASTLE" } } to { room { map: "daedalus" name: "Castle" } } oneway: true } connections { from { port { map: "the_great" room: "Purple Room" name: "DAEDALUS" } } to { port { map: "daedalus" room: "Purple Hallway From Great" name: "GREAT" } } } connections { from { port { map: "the_great" room: "Daedalus Entrance" name: "DAEDALUS" } } to { port { map: "daedalus" room: "Starting Room" name: "GREAT" } } oneway: true } connections { from { port { map: "daedalus" room: "Starting Room" name: "GREAT" } } to { port { map: "the_great" room: "Daedalus Entrance" name: "DAEDALUS" } } oneway: true bypass_target_door: true } connections { from { port { map: "the_hive" room: "Main Area" name: "DAED1" } } to { port { map: "daedalus" room: "Moat" name: "HIVE" } } } connections { from { port { map: "the_hive" room: "Main Area" name: "DAED2" } } to { port { map: "daedalus" room: "Moat" name: "HIVE" } } oneway: true } connections { from { port { map: "the_hive" room: "Main Area" name: "DAED3" } } to { port { map: "daedalus" room: "Moat" name: "HIVE" } } oneway: true } connections { from { port { map: "the_quiet" room: "Main Area" name: "DAEDALUS" } } to { port { map: "daedalus" room: "Quiet Entrance" name: "QUIET" } } } connections { from { painting { map: "the_sturdy" room: "S2 Area" name: "RAINBOW" } } to { painting { map: "daedalus" room: "Rainbow Start" name: "RAINBOW" } } oneway: true } connections { from { port { map: "the_sweet" room: "Main Area" name: "EXIT1" } } to { port { map: "daedalus" room: "Sweet Foyer" name: "SWEET1" } } } connections { from { port { map: "the_sweet" room: "Main Area" name: "EXIT2" } } to { port { map: "daedalus" room: "Sweet Foyer" name: "SWEET2" } } } connections { from { painting { map: "daedalus" room: "Gallery Entrance" name: "GALLERY" } } to { painting { map: "the_gallery" room: "Daedalus Extension" name: "EYE" } } oneway: true } connections { from { port { map: "the_entry" room: "Rabbit Hole" name: "HOLE" } } to { room { map: "daedalus" name: "Wonderland" } } oneway: true } connections { from { port { map: "the_plaza" room: "Symbolic Entrance" name: "SYMBOLIC" } } to { port { map: "the_symbolic" room: "White Room" name: "PLAZA" } } } connections { from { port { map: "the_great" room: "Talented Entrance" name: "TALENTED" } } to { port { map: "the_talented" room: "Main Area" name: "GREAT" } } } connections { from { panel { map: "daedalus" room: "Wisdom Panel" name: "INTELLIGENCE" } } to { room { map: "the_tenacious" name: "Wisdom Room" } } oneway: true } connections { from { painting { map: "daedalus" room: "South Castle Area" name: "TRIANGLE" } } to { room { map: "the_tenacious" name: "Color Room" } } oneway: true } connections { from { port { map: "daedalus" room: "Hedges Tower" name: "TENACIOUS" } } to { room { map: "the_tenacious" name: "Tower Room" } } oneway: true } connections { from { port { map: "the_great" room: "Back Area" name: "THREEDOORS" } } to { port { map: "the_three_doors" room: "First Second Room" name: "GREAT" } } } connections { from { painting { map: "the_gallery" room: "Main Area" name: "TOWER" } } to { room { map: "the_tower" name: "First Floor" } } oneway: true } connections { # Two one-way connections because the door only blocks one direction. from { port { map: "the_great" room: "Back Area" name: "TOWER" } } to { port { map: "the_tower" room: "First Floor" name: "GREAT" } } oneway: true } connections { from { port { map: "the_tower" room: "First Floor" name: "GREAT" } } to { port { map: "the_great" room: "Back Area" name: "TOWER" } } oneway: true bypass_target_door: true } connections { from { port { map: "the_bearer" room: "Tree Entrance" name: "TREE" } } to { port { map: "the_tree" room: "Bearer Entrance" name: "BEARER" } } } connections { from { port { map: "the_digital" room: "Tree Area" name: "TREE" } } to { port { map: "the_tree" room: "Main Area" name: "DIGITAL" } } } connections { from { painting { map: "the_gallery" room: "Main Area" name: "TREE" } } to { room { map: "the_tree" name: "Main Area" } } oneway: true } connections { from { port { map: "the_great" room: "Back Area" name: "TREE" } } to { port { map: "the_tree" room: "Main Area" name: "GREAT" } } } connections { from { port { map: "daedalus" room: "Tree Entrance" name: "TREE" } } to { port { map: "the_tree" room: "Main Area" name: "DAEDALUS" } } } connections { from { port { map: "the_great" room: "Back Area" name: "UNKEMPT" } } to { port { map: "the_unkempt" room: "Main Area" name: "GREAT" } } } connections { # Two one-way connections because the door only blocks one direction. from { port { map: "the_unkempt" room: "Main Area" name: "SUNTEMPLE" } } to { port { map: "the_sun_temple" room: "Entrance" name: "UNKEMPT" } } oneway: true } connections { from { port { map: "the_sun_temple" room: "Entrance" name: "UNKEMPT" } } to { port { map: "the_unkempt" room: "Main Area" name: "SUNTEMPLE" } } oneway: true bypass_target_door: true } connections { from { port { map: "the_unkempt" room: "Daedalus Entrance" name: "DAEDALUS" } } to { port { map: "daedalus" room: "Unkempt Entrance" name: "UNKEMPT" } } } connections { from { port { map: "the_unkempt" room: "Main Area" name: "TREE" } } to { port { map: "the_tree" room: "Main Area" name: "UNKEMPT" } } } connections { from { painting { map: "the_entry" room: "Link Area" name: "PYRAMID" } } to { room { map: "the_wise" name: "Entry" } } oneway: true } connections { from { painting { map: "the_gallery" room: "Main Area" name: "WISE" } } to { room { map: "the_wise" name: "Entry" } } oneway: true } connections { from { painting { map: "the_liberated" room: "Painting Room" name: "PYRAMID" } } to { room { map: "the_wise" name: "Entry" } } oneway: true } connections { from { painting { map: "the_literate" room: "Painting Room" name: "PYRAMID" } } to { room { map: "the_wise" name: "Entry" } } oneway: true } connections { from { painting { map: "the_wise" room: "Entry" name: "TRIANGLE" } } to { room { map: "the_gallery" name: "Main Area" } } oneway: true } connections { from { room { map: "the_wondrous" name: "Huge" } } to { room { map: "the_door" name: "Main Area" } } door { map: "the_wondrous" name: "Big Door" } oneway: true } connections { from { painting { map: "the_gallery" room: "Main Area" name: "WONDROUS" } } to { room { map: "the_wondrous" name: "Huge" } } oneway: true } connections { from { port { map: "daedalus" room: "Wonderland" name: "WONDROUS" } } to { port { map: "the_wondrous" room: "Entry" name: "DAEDALUS" } } } connections { from { panel { map: "the_entry" room: "Starting Room" name: "HI" answer: "thewords" } } to { room { map: "the_words" name: "Main Area" } } oneway: true } connections { from { port { map: "the_words" room: "Main Area" name: "ENTRY" } } to { room { map: "the_entry" name: "Starting Room" } } oneway: true } connections { from { painting { map: "the_gallery" room: "Main Area" name: "WORDS" } } to { room { map: "the_words" name: "Main Area" } } oneway: true } connections { from { room { map: "control_center" name: "Main Area" } } to { room { map: "the_relentless" name: "Turn Room" } } door { map: "control_center" name: "Relentless Turn Door" } } connections { from { room { map: "control_center" name: "Main Area" } } to { room { map: "the_relentless" name: "Shop Room" } } door { map: "control_center" name: "Relentless Shop Door" } } connections { from { room { map: "control_center" name: "Main Area" } } to { room { map: "the_relentless" name: "Left Room" } } door { map: "control_center" name: "Relentless Left Door" } } connections { from { port { map: "control_center" room: "Ancient Entrance" name: "ANCIENT" } } to { room { map: "the_ancient" name: "Outside" } } oneway: true } connections { from { port { map: "the_between" room: "Control Center Side" name: "CC" } } to { port { map: "control_center" room: "Between Entrance" name: "BETWEEN" } } } connections { from { painting { map: "the_gallery" room: "Main Area" name: "CC" } } to { room { map: "control_center" name: "Desert Room" } } oneway: true } connections { from { port { map: "the_great" room: "West Side" name: "CC" } } to { port { map: "control_center" room: "Entry" name: "GREAT" } } } connections { from { port { map: "the_hinterlands" room: "Main Area" name: "LEFT" } } to { port { map: "control_center" room: "Main Area" name: "LEFT" } } } connections { from { port { map: "the_hinterlands" room: "Main Area" name: "RIGHT" } } to { port { map: "control_center" room: "Main Area" name: "RIGHT" } } } connections { from { port { map: "the_partial" room: "Control Center Entrance" name: "CC" } } to { port { map: "control_center" room: "Partial Entrance" name: "PARTIAL" } } } connections { from { port { map: "the_perceptive" room: "Main Area" name: "CC" } } to { port { map: "control_center" room: "Perceptive Entrance" name: "PERCEPTIVE" } } } connections { from { port { map: "the_repetitive" room: "Main Room" name: "CC" } } to { port { map: "control_center" room: "Repetitive Entrance" name: "REPETITIVE" } } } connections { from { room { map: "the_shop" name: "Main Area" } } to { room { map: "control_center" name: "Shop Entrance" } } door { map: "the_shop" name: "N Entered" } oneway: true } connections { from { room { map: "control_center" name: "Shop Entrance" } } to { room { map: "the_shop" name: "Main Area" } } oneway: true } connections { from { panel { map: "the_unyielding" room: "Central Connected Area" name: "BACK" } } to { panel { map: "control_center" room: "Unyielding Entrance" name: "FORTH" } } } connections { from { port { map: "the_tenacious" room: "Control Center Entrance" name: "CC" } } to { port { map: "control_center" room: "Tenacious Entrance" name: "TENACIOUS" } } } connections { from { port { map: "the_unkempt" room: "Control Center Entrance" name: "CC" } } to { port { map: "control_center" room: "Unkempt Entrance" name: "UNKEMPT" } } } connections { from { panel { map: "control_center" room: "Stormy Entrance" name: "TURN" } } to { room { map: "the_stormy" name: "Center" } } oneway: true } connections { from { port { map: "the_entry" room: "X Area" name: "CC" } } to { port { map: "control_center" room: "Entry Entrance" name: "ENTRY" } } } 44:50 -0700 committer jbzdarkid <jbzdarkid@gmail.com> 2018-10-28 15:44:50 -0700 Fix treehouse pivots, jungle + monastery randomization, add final pillars randomization' href='/witness-tutorializer/commit/Source/Randomizer.cpp?h=tutorial-v0.4.0&id=d99313f4e4fdf5103c5f149e2d54dbf6e4fcc3f2'>d99313f ^
223f724 ^
d99313f ^
133975b ^



d99313f ^
ecc14a3 ^
d99313f ^
133975b ^







d99313f ^
ecc14a3 ^
d99313f ^

ecc14a3 ^
d99313f ^
133975b ^
92084d0 ^
133975b ^







3f16a3e ^

d99313f ^

2270169 ^
d99313f ^
133975b ^














3f16a3e ^

d99313f ^
0e6b61f ^
133975b ^


0e6b61f ^


ac83733 ^

133975b ^
4edd6ab ^

d99313f ^
133975b ^



3f16a3e ^

d99313f ^
133975b ^









d99313f ^
3f16a3e ^
d99313f ^
133975b ^










d99313f ^
3f16a3e ^
d99313f ^
4edd6ab ^
4edd6ab ^
d99313f ^
133975b ^





















38475fd ^


133975b ^



5f99f9e ^


133975b ^



1cad987 ^


133975b ^
1cad987 ^



133975b ^










1cad987 ^


133975b ^










































































1cad987 ^


133975b ^














1cad987 ^


133975b ^







1cad987 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
  






























































                                                                                                           


                                        
                                                  



                                                                                



                                                                    
 
        

                                                                                                                               


                                                 
            
                                      
                                                                
                                                                
                                                                          

                                                                                                         
                                          
                                              
  
                
                       
                                
                   
                   

                  
                                                                       




                                                                        
 
 


                                                                                  













                                                                             

                                                            
                                               
                                       

                                                       

                                                                                
 
                                                                      

                                    












                                       
                            
 
 
                                





                                                                        

 
                                    



                                                                                             



                                



                                                                             


                  
                                      




                                                                        
 
 
                                      



                                                         
 
 
                                    







                                                                
 
 

                                    
 
                                       
                                                                           
                                       







                                                                               

 

                                  
 
                                     














                                                                                        

 
                                  
                                            


                                                         


                                                                         

                                                        
                                          

 
                                       



                                                                            

 
                                    









                                                                         
 
 
                                    










                                                                                                     
 
 
                                   
 
 
                                      





















                                                                                  


                                       



                                                                                                                     


                                       



                                                         


                                                                 
                                                           



                                                                                                          










                                                                                                                              


                                                                










































































                                                                                                                                               


                                                                                                                           














                                                                                                            


                                                                                               







                                                                                        
 
/*
Things to do for V2:
- Better interface design. It's way too simplistic, take (some) notes from talos.
  - Seed: [   ] (Randomize)
  ?? Challenge

  - [] Prevent speedrun snipes // Shadows, Swamp, Town, Quarry stairs
  - [] Speed up various autoscrollers // Swamp platforms, Desert/Mountain elevators, Desert rotating panels

  (Additional required panels)
  - [] Desert 8
  - [] Pond 5
  - [] Both keep halves
  - [] Town lattice requires stars door // and stars door will be randomized

  (Debug version only)
  - [] Noclip
  - [] Noclip speed


- Really randomize panels. Sorted by ROI
  - Random with style
    - Tutorial
    - Mountain 1 orange, green, blue, purple
    - Mountain 2 multipanel
    - Mountain 3 pillars
    - Laser areas (Glass Factory, Symmetry, Quarry, Treehouse, Swamp, Keep pressure plates, Town 25 dots)
    - (low) Discarded panels
    - (low) Tutorials // Dots, Stones, Swamp

  - Keep Hedges become like hedges 4, intersection between path and panel
  - Keep Pressure plates: Random with style

  - No idea how to randomize:
    - Symmetry transparent
    - Desert
    - Shadows
    - Town (lattice, RGB area, snipes, triple)
    - Monastery
    - Jungle
    - Bunker
    - UTM
    - Mountain 2 rainbow
    - Challenge

- Any RNG rerolls should be based on previous seed so that everyone can go to next seed easily

- Stability. Duh. I need to clearly define the ownership between the randomizer and the game.

- Challenge should have some way to 'reroll every run'
- Challenge should not turn off after time limit?
- Challenge triangles should not turn off




*/






/*
 * Try to wire up both keep halves
 * Wire up both halves of symmetry laser
 * Turn off floating panel in desert
 * Try randomizing default-on for pitches & bunker


 * Speed up *everything* ? Or maybe we'll just stop using this setting entirely.

 * Add setting for "Don't reset the challenge seed on new challenge"
 * Don't rerandomize anything outside of challenge on re-click
 * Change re-randomization prevention?


 * BUGS:
 * Shipwreck vault is solved reversed? -> Not reversed, just "half", you can normally solve orange. Seems to need pattern name.
 * Tutorial sounds don't always play -> Unsure. Not controlled by pattern name.
 * Rainbow seems to be not copying background?
 ** Rainbow 1 <-> Green 3 (the poly one) worked
 ** Rainbow 2 <-> Treehouse Right Orange 1 didn't
 * FEATURES:
 * Start the game if it isn't running?
 * Randomize audio logs -- Hard, seem to be unloaded some times?
 * Swap sounds in jungle (along with panels) -- maybe impossible
 * Make orange 7 (all of oranges?) hard. Like big = hard. (See: HARD_MODE)
 * Try turning on first half of wire in shadows once tutorial is done
 * It might be possible to remove the texture on top of rainbow 5 (so that any panel can be placed there)
 * 20 challenges with 20 consecutive seeds
 * Random *rotation* of desert laser redirect?
*/
#include "pch.h"
#include "Randomizer.h"
#include "ChallengeRandomizer.h"
#include "Panels.h"
#include "Random.h"

template <class T>
int find(const std::vector<T> &data, T search, size_t startIndex = 0) {
    for (size_t i=startIndex ; i<data.size(); i++) {
        if (data[i] == search) return static_cast<int>(i);
    }
    std::cout << "Couldn't find " << search << " in data!" << std::endl;
    throw std::exception("Couldn't find value in data!");
}

Randomizer::Randomizer(const std::shared_ptr<Memory>& memory) : _memory(memory) {}

void Randomizer::Randomize() {
    // reveal_exit_hall - Prevent actually ending the game (EEE)
    _memory->AddSigScan({0x45, 0x8B, 0xF7, 0x48, 0x8B, 0x4D}, [&](int index){
        _memory->WriteData<byte>({index + 0x15}, {0xEB}); // jz -> jmp
    });

    // begin_endgame_1 - Prevent actually ending the game (Wonkavator)
    _memory->AddSigScan({0x83, 0x7C, 0x01, 0xD0, 0x04}, [&](int index){
        if (GLOBALS == 0x5B28C0) { // Version differences.
            index += 0x75;
        } else if (GLOBALS == 0x62D0A0) {
            index += 0x86;
        }
        _memory->WriteData<byte>({index}, {0xEB}); // jz -> jmp
    });
    // Sig scans will be run during challenge randomization.

    // Seed challenge first for future-proofing
    MEMORY_CATCH(RandomizeChallenge());

    // Content swaps -- must happen before squarePanels
    MEMORY_CATCH(Randomize(upDownPanels, SWAP::LINES | SWAP::COLORS));
    MEMORY_CATCH(Randomize(leftForwardRightPanels, SWAP::LINES | SWAP::COLORS));

    MEMORY_CATCH(Randomize(squarePanels, SWAP::LINES | SWAP::COLORS));

    // Individual area modifications
    MEMORY_CATCH(RandomizeTutorial());
    MEMORY_CATCH(RandomizeDesert());
    MEMORY_CATCH(RandomizeQuarry());
    MEMORY_CATCH(RandomizeTreehouse());
    MEMORY_CATCH(RandomizeKeep());
    MEMORY_CATCH(RandomizeShadows());
    MEMORY_CATCH(RandomizeMonastery());
    MEMORY_CATCH(RandomizeBunker());
    MEMORY_CATCH(RandomizeJungle());
    MEMORY_CATCH(RandomizeSwamp());
    MEMORY_CATCH(RandomizeMountain());
    MEMORY_CATCH(RandomizeTown());
    MEMORY_CATCH(RandomizeSymmetry());
    // RandomizeAudioLogs();
}

void Randomizer::AdjustSpeed() {
    // Desert Surface Final Control
    _memory->WriteEntityData<float>(0x09F95, OPEN_RATE, {0.04f}); // 4x
    // Swamp Sliding Bridge
    _memory->WriteEntityData<float>(0x0061A, OPEN_RATE, {0.1f}); // 4x
    // Mountain 2 Elevator
    _memory->WriteEntityData<float>(0x09EEC, OPEN_RATE, {0.075f}); // 3x
}

void Randomizer::RandomizeLasers() {
    Randomize(lasers, SWAP::TARGETS);
    // Read the target of keep front laser, and write it to keep back laser.
    std::vector<int> keepFrontLaserTarget = _memory->ReadEntityData<int>(0x0360E, TARGET, 1);
    _memory->WriteEntityData<int>(0x03317, TARGET, keepFrontLaserTarget);
}

void Randomizer::PreventSnipes()
{
    // Distance-gate swamp snipe 1 to prevent RNG swamp snipe
    _memory->WriteEntityData<float>(0x17C05, MAX_BROADCAST_DISTANCE, {15.0});
    // Distance-gate shadows laser to prevent sniping through the bars
    _memory->WriteEntityData<float>(0x19650, MAX_BROADCAST_DISTANCE, {2.5});
}

// Private methods
void Randomizer::RandomizeTutorial() {
    // Disable tutorial cursor speed modifications (not working?)
    _memory->WriteEntityData<float>(0x00295, CURSOR_SPEED_SCALE, {1.0});
    _memory->WriteEntityData<float>(0x0C373, CURSOR_SPEED_SCALE, {1.0});
    _memory->WriteEntityData<float>(0x00293, CURSOR_SPEED_SCALE, {1.0});
    _memory->WriteEntityData<float>(0x002C2, CURSOR_SPEED_SCALE, {1.0});
}

void Randomizer::RandomizeSymmetry() {
    std::vector<int> randomOrder(transparent.size(), 0);
    std::iota(randomOrder.begin(), randomOrder.end(), 0);
    RandomizeRange(randomOrder, SWAP::NONE, 1, 5);
    ReassignTargets(transparent, randomOrder);
}

void Randomizer::RandomizeDesert() {
    Randomize(desertPanels, SWAP::LINES);

    // Turn off desert surface 8
    _memory->WriteEntityData<float>(0x09F94, POWER, {0.0, 0.0});
    // Turn off desert flood final
    _memory->WriteEntityData<float>(0x18076, POWER, {0.0, 0.0});
    // Change desert floating target to desert flood final
    _memory->WriteEntityData<int>(0x17ECA, TARGET, {0x18077});
}

void Randomizer::RandomizeQuarry() {
}

void Randomizer::RandomizeTreehouse() {
    // Ensure that whatever pivot panels we have are flagged as "pivotable"
    // @Bug: Can return {}, be careful!
    int panelFlags = _memory->ReadEntityData<int>(0x17DD1, STYLE_FLAGS, 1)[0];
    _memory->WriteEntityData<int>(0x17DD1, STYLE_FLAGS, {panelFlags | 0x8000});
    panelFlags = _memory->ReadEntityData<int>(0x17CE3, STYLE_FLAGS, 1)[0];
    _memory->WriteEntityData<int>(0x17CE3, STYLE_FLAGS, {panelFlags | 0x8000});
    panelFlags = _memory->ReadEntityData<int>(0x17DB7, STYLE_FLAGS, 1)[0];
    _memory->WriteEntityData<int>(0x17DB7, STYLE_FLAGS, {panelFlags | 0x8000});
    panelFlags = _memory->ReadEntityData<int>(0x17E52, STYLE_FLAGS, 1)[0];
    _memory->WriteEntityData<int>(0x17E52, STYLE_FLAGS, {panelFlags | 0x8000});
}

void Randomizer::RandomizeKeep() {
}

void Randomizer::RandomizeShadows() {
    // Change the shadows tutorial cable to only activate avoid
    _memory->WriteEntityData<int>(0x319A8, CABLE_TARGET_2, {0});
    // Change shadows avoid 8 to power shadows follow
    _memory->WriteEntityData<int>(0x1972F, TARGET, {0x1C34C});

    std::vector<int> randomOrder(shadowsPanels.size(), 0);
    std::iota(randomOrder.begin(), randomOrder.end(), 0);
    RandomizeRange(randomOrder, SWAP::NONE, 0, 8); // Tutorial
    RandomizeRange(randomOrder, SWAP::NONE, 8, 16); // Avoid
    RandomizeRange(randomOrder, SWAP::NONE, 16, 21); // Follow
    ReassignTargets(shadowsPanels, randomOrder);
    // Turn off original starting panel
    _memory->WriteEntityData<float>(shadowsPanels[0], POWER, {0.0f, 0.0f});
    // Turn on new starting panel
    _memory->WriteEntityData<float>(shadowsPanels[randomOrder[0]], POWER, {1.0f, 1.0f});
}

void Randomizer::RandomizeTown() {
    // @Hack...? To open the gate at the end
    std::vector<int> randomOrder(orchard.size() + 1, 0);
    std::iota(randomOrder.begin(), randomOrder.end(), 0);
    RandomizeRange(randomOrder, SWAP::NONE, 1, 5);
    // Ensure that we open the gate before the final puzzle (by swapping)
    int panel3Index = find(randomOrder, 3);
    int panel4Index = find(randomOrder, 4);
    randomOrder[std::min(panel3Index, panel4Index)] = 3;
    randomOrder[std::max(panel3Index, panel4Index)] = 4;
    ReassignTargets(orchard, randomOrder);
}

void Randomizer::RandomizeMonastery() {
    std::vector<int> randomOrder(monasteryPanels.size(), 0);
    std::iota(randomOrder.begin(), randomOrder.end(), 0);
    RandomizeRange(randomOrder, SWAP::NONE, 3, 9); // Outer 2 & 3, Inner 1-4
    ReassignTargets(monasteryPanels, randomOrder);
}

void Randomizer::RandomizeBunker() {
    std::vector<int> randomOrder(bunkerPanels.size(), 0);
    std::iota(randomOrder.begin(), randomOrder.end(), 0);
    // Randomize Tutorial 2-Advanced Tutorial 4 + Glass 1
    // Tutorial 1 cannot be randomized, since no other panel can start on
    // Glass 1 will become door + glass 1, due to the targetting system
    RandomizeRange(randomOrder, SWAP::NONE, 1, 10);
    // Randomize Glass 1-3 into everything after the door/glass 1
    const size_t glass1Index = find(randomOrder, 9);
    RandomizeRange(randomOrder, SWAP::NONE, glass1Index + 1, 12);
    ReassignTargets(bunkerPanels, randomOrder);
}

void Randomizer::RandomizeJungle() {
    std::vector<int> randomOrder(junglePanels.size(), 0);
    std::iota(randomOrder.begin(), randomOrder.end(), 0);
    // Waves 1 cannot be randomized, since no other panel can start on
    RandomizeRange(randomOrder, SWAP::NONE, 1, 7); // Waves 2-7
    RandomizeRange(randomOrder, SWAP::NONE, 8, 13); // Pitches 1-6
    ReassignTargets(junglePanels, randomOrder);

    // Fix the wall's target to point back to the cable, and the cable to point to the pitches panel.
    // auto wallTarget = _memory->ReadPanelData<int>(junglePanels[7], TARGET, 1);
    // _memory->WritePanelData<int>(junglePanels[7], TARGET, {0x3C113});
    // _memory->WritePanelData<int>(0x3C112, CABLE_TARGET_1, wallTarget);
}

void Randomizer::RandomizeSwamp() {
}

void Randomizer::RandomizeMountain() {
    // Randomize multipanel
    Randomize(mountainMultipanel, SWAP::LINES | SWAP::COLORS);

    // Randomize final pillars order
    std::vector<int> targets = {pillars[0] + 1};
    for (const int pillar : pillars) {
        int target = _memory->ReadEntityData<int>(pillar, TARGET, 1)[0];
        targets.push_back(target);
    }
    targets[5] = pillars[5] + 1;

    std::vector<int> randomOrder(pillars.size(), 0);
    std::iota(randomOrder.begin(), randomOrder.end(), 0);
    RandomizeRange(randomOrder, SWAP::NONE, 0, 4); // Left Pillars 1-4
    RandomizeRange(randomOrder, SWAP::NONE, 5, 9); // Right Pillars 1-4
    ReassignTargets(pillars, randomOrder, targets);
    // Turn off original starting panels
    _memory->WriteEntityData<float>(pillars[0], POWER, {0.0f, 0.0f});
    _memory->WriteEntityData<float>(pillars[5], POWER, {0.0f, 0.0f});
    // Turn on new starting panels
    _memory->WriteEntityData<float>(pillars[randomOrder[0]], POWER, {1.0f, 1.0f});
    _memory->WriteEntityData<float>(pillars[randomOrder[5]], POWER, {1.0f, 1.0f});
}

void Randomizer::RandomizeChallenge() {
    ChallengeRandomizer cr(_memory, Random::RandInt(1, 0x7FFFFFFF)); // 0 will trigger an "RNG not initialized" block
    for (int panel : challengePanels) {
        _memory->WriteEntityData<int>(panel, POWER_OFF_ON_FAIL, {0});
    }
}

void Randomizer::RandomizeAudioLogs() {
    std::vector<int> randomOrder(audiologs.size(), 0);
    std::iota(randomOrder.begin(), randomOrder.end(), 0);
    Randomize(randomOrder, SWAP::NONE);
    ReassignNames(audiologs, randomOrder);
}

void Randomizer::Randomize(std::vector<int>& panels, int flags) {
    return RandomizeRange(panels, flags, 0, panels.size());
}

// Range is [start, end)
void Randomizer::RandomizeRange(std::vector<int> &panels, int flags, size_t startIndex, size_t endIndex) {
    if (panels.size() == 0) return;
    if (startIndex >= endIndex) return;
    if (endIndex >= panels.size()) endIndex = static_cast<int>(panels.size());
    for (size_t i = endIndex-1; i > startIndex; i--) {
        const int target = Random::RandInt(static_cast<int>(startIndex), static_cast<int>(i));
        if (i != target) {
            // std::cout << "Swapping panels " << std::hex << panels[i] << " and " << std::hex << panels[target] << std::endl;
            SwapPanels(panels[i], panels[target], flags);
            std::swap(panels[i], panels[target]); // Panel indices in the array
        }
    }
}

void Randomizer::SwapPanels(int panel1, int panel2, int flags) {
    std::map<int, int> offsets;

    if (flags & SWAP::TARGETS) {
        offsets[TARGET] = sizeof(int);
    }
    if (flags & SWAP::AUDIO_NAMES) {
        offsets[AUDIO_LOG_NAME] = sizeof(void*);
    }
    if (flags & SWAP::COLORS) {
        offsets[PATH_COLOR] = 16;
        offsets[REFLECTION_PATH_COLOR] = 16;
        offsets[DOT_COLOR] = 16;
        offsets[ACTIVE_COLOR] = 16;
        offsets[BACKGROUND_REGION_COLOR] = 12; // Not copying alpha to preserve transparency.
        offsets[SUCCESS_COLOR_A] = 16;
        offsets[SUCCESS_COLOR_B] = 16;
        offsets[STROBE_COLOR_A] = 16;
        offsets[STROBE_COLOR_B] = 16;
        offsets[ERROR_COLOR] = 16;
        offsets[PATTERN_POINT_COLOR] = 16;
        offsets[PATTERN_POINT_COLOR_A] = 16;
        offsets[PATTERN_POINT_COLOR_B] = 16;
        offsets[SYMBOL_A] = 16;
        offsets[SYMBOL_B] = 16;
        offsets[SYMBOL_C] = 16;
        offsets[SYMBOL_D] = 16;
        offsets[SYMBOL_E] = 16;
        offsets[PUSH_SYMBOL_COLORS] = sizeof(int);
        offsets[OUTER_BACKGROUND] = 16;
        offsets[OUTER_BACKGROUND_MODE] = sizeof(int);
        // These two control the "burn intensity", but I can't swap out burn marks in new ver, so they should probably stay tied to each frame.
        // offsets[SPECULAR_ADD] = sizeof(float);
        // offsets[SPECULAR_POWER] = sizeof(int);
        offsets[NUM_COLORED_REGIONS] = sizeof(int);
        offsets[COLORED_REGIONS] = sizeof(void*);
    }
    if (flags & SWAP::LINES) {
        offsets[TRACED_EDGES] = 16;
        offsets[AUDIO_PREFIX] = sizeof(void*);
//        offsets[IS_CYLINDER] = sizeof(int);
//        offsets[CYLINDER_Z0] = sizeof(float);
//        offsets[CYLINDER_Z1] = sizeof(float);
//        offsets[CYLINDER_RADIUS] = sizeof(float);
        offsets[PATH_WIDTH_SCALE] = sizeof(float);
        offsets[STARTPOINT_SCALE] = sizeof(float);
        offsets[NUM_DOTS] = sizeof(int);
        offsets[NUM_CONNECTIONS] = sizeof(int);
        offsets[DOT_POSITIONS] = sizeof(void*);
        offsets[DOT_FLAGS] = sizeof(void*);
        offsets[DOT_CONNECTION_A] = sizeof(void*);
        offsets[DOT_CONNECTION_B] = sizeof(void*);
        offsets[DECORATIONS] = sizeof(void*);
        offsets[DECORATION_FLAGS] = sizeof(void*);
        offsets[DECORATION_COLORS] = sizeof(void*);
        offsets[NUM_DECORATIONS] = sizeof(int);
        offsets[REFLECTION_DATA] = sizeof(void*);
        offsets[GRID_SIZE_X] = sizeof(int);
        offsets[GRID_SIZE_Y] = sizeof(int);
        offsets[STYLE_FLAGS] = sizeof(int);
        offsets[SEQUENCE_LEN] = sizeof(int);
        offsets[SEQUENCE] = sizeof(void*);
        offsets[DOT_SEQUENCE_LEN] = sizeof(int);
        offsets[DOT_SEQUENCE] = sizeof(void*);
        offsets[DOT_SEQUENCE_LEN_REFLECTION] = sizeof(int);
        offsets[DOT_SEQUENCE_REFLECTION] = sizeof(void*);
        offsets[PANEL_TARGET] = sizeof(void*);
        offsets[SPECULAR_TEXTURE] = sizeof(void*);
    }

    for (auto const& [offset, size] : offsets) {
        std::vector<byte> panel1data = _memory->ReadEntityData<byte>(panel1, offset, size);
        std::vector<byte> panel2data = _memory->ReadEntityData<byte>(panel2, offset, size);
        _memory->WriteEntityData<byte>(panel2, offset, panel1data);
        _memory->WriteEntityData<byte>(panel1, offset, panel2data);
    }
}

void Randomizer::ReassignTargets(const std::vector<int>& panels, const std::vector<int>& order, std::vector<int> targets) {
    if (targets.empty()) {
        // This list is offset by 1, so the target of the Nth panel is in position N (aka the N+1th element)
        // The first panel may not have a wire to power it, so we use the panel ID itself.
        targets = {panels[0] + 1};
        for (const int panel : panels) {
            int target = _memory->ReadEntityData<int>(panel, TARGET, 1)[0];
            targets.push_back(target);
        }
    }

    for (size_t i=0; i<order.size() - 1; i++) {
        // Set the target of order[i] to order[i+1], using the "real" target as determined above.
        const int panelTarget = targets[order[i+1]];
        _memory->WriteEntityData<int>(panels[order[i]], TARGET, {panelTarget});
    }
}

void Randomizer::ReassignNames(const std::vector<int>& panels, const std::vector<int>& order) {
    std::vector<int64_t> names;
    for (const int panel : panels) {
        names.push_back(_memory->ReadEntityData<int64_t>(panel, AUDIO_LOG_NAME, 1)[0]);
    }

    for (int i=0; i<panels.size(); i++) {
        _memory->WriteEntityData<int64_t>(panels[i], AUDIO_LOG_NAME, {names[order[i]]});
    }
}