about summary refs log tree commit diff stats
path: root/data/maps/daedalus/rooms/Blue Hallway Cut Side.txtpb
Commit message (Collapse)AuthorAgeFilesLines
* Changed how door location names are formattedStar Rauchenberger2025-08-301-1/+1
| | | | | | | | | | | | | | | | | | STANDARD type doors with at most four panels in the same map area and no other trigger objects will have their location names generated from the names of the panels used to open the door, similar to Lingo 1. Other door types will use the door's name. In either case, the name can be overridden using the new location_name field. Rooms can also set a panel_display_name field, which will be used in location names for doors, and is used to group panels into areas. Panels themselves can set display names, which differentiates their locations from other panels in the same area. Many maps were updated for this, but note that the_symbolic and the_unyielding have validator failures because of duplicate panel names. This won't matter until panelsanity is implemented.
* Added daedalusStar Rauchenberger2025-08-241-0/+16
18-10-23 22:12:38 -0700 committer jbzdarkid <jbzdarkid@gmail.com> 2018-10-23 22:12:38 -0700 move panels to new file, additional filtering, additional swapping.' href='/witness-tutorializer/commit/WitnessRandomizer/WitnessRandomizer.cpp?h=tutorial-v0.1.0&id=922dbb03a50a54f3e5ae9efaec3b4759cd701c3e'>922dbb0 ^
4edd6ab ^
3f16a3e ^
922dbb0 ^

c39e705 ^


3f16a3e ^

2c9afc0 ^
922dbb0 ^
3f16a3e ^

4edd6ab ^
1f20774 ^
4edd6ab ^

d99313f ^
1f20774 ^
d99313f ^
4edd6ab ^
1f20774 ^

4edd6ab ^
3f16a3e ^
d99313f ^
3f16a3e ^
ecc14a3 ^
d99313f ^




















223f724 ^
d99313f ^






223f724 ^
d99313f ^

ecc14a3 ^
d99313f ^

ecc14a3 ^
d99313f ^






ecc14a3 ^
d99313f ^

ecc14a3 ^
d99313f ^





3f16a3e ^

d99313f ^

2270169 ^
d99313f ^
a96cea1 ^
d99313f ^
4edd6ab ^
d99313f ^
4edd6ab ^
d99313f ^
8020f95 ^
d99313f ^









3f16a3e ^

d99313f ^
4edd6ab ^

d99313f ^




3f16a3e ^

d99313f ^











3f16a3e ^
d99313f ^









3f16a3e ^
d99313f ^


4edd6ab ^
4edd6ab ^
d99313f ^


4edd6ab ^
d99313f ^



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
  
                                                                                                                         
        
                                                                        

                                                      
            
                                                                                                  
                 
                       

                                                                


                                                             

                   
                       
                   

                   
                  
                 

                  
                                                                       
                                                        
                                                                  
         

                                                                            
 
 
                            
 
                                                           




















                                                                       
 






                                                                        
 

                                      
 

                                                             
 






                                                                
 

                                    
 





                                                                               

 

                                  
 
                                     
                                                                          
                                                                            
                                                                   
                                                                
                                                         
                                                              
 









                                                                                        

 
                                  

 




                                                                                     

 











                                                                             
 









                                                                          
 


                                                                             
 
 


                                                        
 



                                                                                             
/*
 * TODO: Split out main() logic into another file, and move into separate functions for easier testing. Then write tests.
 * BUGS:
 * Shipwreck vault fails, possibly because of dot_reflection? Sometimes?
 * Some panels are impossible casually: (idc, I think)
 ** Town Stars, Invisible dots
 * FEATURES:
 * SWAP_TARGETS should still require the full panel sequence (and have ways to prevent softlocks?)
 ** Do: Challenge
 * Randomize audio logs
 * Swap sounds in jungle (along with panels) -- maybe impossible
 * Make orange 7 (all of oranges?) hard. Like big = hard.
 * Start the game if it isn't running?
 * UI for the randomizer :(
 * Increase odds of mountain oranges garbage on other panels?
*/
#include "Memory.h"
#include "Randomizer.h"
#include "Panels.h"
#include <string>
#include <iostream>
#include <numeric>
#include <chrono>

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;
	exit(-1);
}

void Randomizer::Randomize()
{
	// Content swaps -- must happen before squarePanels
	_core.Randomize(tallUpDownPanels, SWAP_LINES|SWAP_LINES);
	_core.Randomize(upDownPanels, SWAP_LINES|SWAP_LINES);
	_core.Randomize(leftForwardRightPanels, SWAP_LINES|SWAP_LINES);

	_core.Randomize(squarePanels, SWAP_LINES|SWAP_LINES);

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

void Randomizer::RandomizeTutorial() {
	// Disable tutorial cursor speed modifications (not working?)
	_core.WritePanelData<float>(0x00295, CURSOR_SPEED_SCALE, {1.0});
	_core.WritePanelData<float>(0x0C373, CURSOR_SPEED_SCALE, {1.0});
	_core.WritePanelData<float>(0x00293, CURSOR_SPEED_SCALE, {1.0});
	_core.WritePanelData<float>(0x002C2, CURSOR_SPEED_SCALE, {1.0});
}

void Randomizer::RandomizeSymmetry() {
}

void Randomizer::RandomizeDesert() {
	_core.Randomize(desertPanels, SWAP_LINES|SWAP_LINES);

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

void Randomizer::RandomizeQuarry() {
}

void Randomizer::RandomizeTreehouse() {
	// Ensure that whatever pivot panels we have are flagged as "pivotable"
	_core.WritePanelData<int>(0x17DD1, STYLE_FLAGS, {0x8000});
	_core.WritePanelData<int>(0x17CE3, STYLE_FLAGS, {0x8000});
	_core.WritePanelData<int>(0x17DB7, STYLE_FLAGS, {0x8000});
	_core.WritePanelData<int>(0x17E52, STYLE_FLAGS, {0x8000});
}

void Randomizer::RandomizeKeep() {
}

void Randomizer::RandomizeShadows() {
	// Distance-gate shadows laser to prevent sniping through the bars
	_core.WritePanelData<float>(0x19650, MAX_BROADCAST_DISTANCE, {2.5});
	// Change the shadows tutorial cable to only activate avoid
	_core.WritePanelData<int>(0x319A8, CABLE_TARGET_2, {0});
	// Change shadows avoid 8 to power shadows follow
	_core.WritePanelData<int>(0x1972F, TARGET, {0x1C34C});

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

void Randomizer::RandomizeTown() {
}

void Randomizer::RandomizeMonastery() {
	std::vector<int> randomOrder(monasteryPanels.size(), 0);
	std::iota(randomOrder.begin(), randomOrder.end(), 0);
	_core.RandomizeRange(randomOrder, SWAP_NONE, 3, 9); // Outer 2 & 3, Inner 1-4
	_core.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
	_core.RandomizeRange(randomOrder, SWAP_NONE, 1, 10);
	// Randomize Glass 1-3 into everything after the door/glass 1
	const size_t glass1Index = find(randomOrder, 9);
	_core.RandomizeRange(randomOrder, SWAP_NONE, glass1Index + 1, 12);
	_core.ReassignTargets(bunkerPanels, randomOrder);
}

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

void Randomizer::RandomizeSwamp() {
	// Distance-gate swamp snipe 1 to prevent RNG swamp snipe
	_core.WritePanelData<float>(0x17C05, MAX_BROADCAST_DISTANCE, {15.0});
}

void Randomizer::RandomizeMountain() {
	_core.Randomize(lasers, SWAP_TARGETS);
	_core.Randomize(pillars, SWAP_LINES|SWAP_LINES);

	// Read the target of keep front laser, and write it to keep back laser.
	std::vector<int> keepFrontLaserTarget = _core.ReadPanelData<int>(0x0360E, TARGET, 1);
	_core.WritePanelData<int>(0x03317, TARGET, keepFrontLaserTarget);
}