summary refs log tree commit diff stats
path: root/WitnessRandomizer/WitnessRandomizer.cpp
diff options
context:
space:
mode:
authorjbzdarkid <jbzdarkid@gmail.com>2018-10-24 22:13:56 -0700
committerjbzdarkid <jbzdarkid@gmail.com>2018-10-24 22:13:56 -0700
commita96cea16828973b92c465fb84de2554779f07101 (patch)
treeca10bab4bed674c935ce497ad56751247c8fc34f /WitnessRandomizer/WitnessRandomizer.cpp
parent69a8f903ef70845894ff07e0805d9cc60597cc7c (diff)
downloadwitness-tutorializer-a96cea16828973b92c465fb84de2554779f07101.tar.gz
witness-tutorializer-a96cea16828973b92c465fb84de2554779f07101.tar.bz2
witness-tutorializer-a96cea16828973b92c465fb84de2554779f07101.zip
Lots of progress, lots of ideas.
Diffstat (limited to 'WitnessRandomizer/WitnessRandomizer.cpp')
-rw-r--r--WitnessRandomizer/WitnessRandomizer.cpp54
1 files changed, 22 insertions, 32 deletions
diff --git a/WitnessRandomizer/WitnessRandomizer.cpp b/WitnessRandomizer/WitnessRandomizer.cpp index 79fb721..2a06ee2 100644 --- a/WitnessRandomizer/WitnessRandomizer.cpp +++ b/WitnessRandomizer/WitnessRandomizer.cpp
@@ -1,15 +1,14 @@
1/* 1/*
2 * BUGS:
3 * Bunker has physical panel objects which I can't move :(
4 * Shipwreck vault does not copy well
5 * FEATURES: 2 * FEATURES:
6 * SWAP_TARGETS should still require the full panel sequence (and have ways to prevent softlocks?) 3 * SWAP_TARGETS should still require the full panel sequence (and have ways to prevent softlocks?)
4 ** Jungle(?), Bunker, Monastery, Challenge(!), Shadows
7 * Randomize audio logs 5 * Randomize audio logs
8 * List of panels which can be valid "Burn" (aka desert) substitutes: Prevent (or limit) panel counting
9 * List of panels which split left/right (for left/right controls) 6 * List of panels which split left/right (for left/right controls)
10 * List of panels which split up/down (for up/down controls) 7 * List of panels which split up/down (for up/down controls)
11 * Swap sounds in jungle (along with panels) -- maybe impossible 8 * Swap sounds in jungle (along with panels) -- maybe impossible
12 * Make orange 7 (all of oranges?) hard. Like big = hard. 9 * Make orange 7 (all of oranges?) hard. Like big = hard.
10 * Kill panel slowdown in tutorial
11 * Fix desert elevator (laser rando) / Add keep?
13 * TRY: 12 * TRY:
14 * Swap treehouse pivots 13 * Swap treehouse pivots
15*/ 14*/
@@ -27,25 +26,21 @@ int main(int argc, char** argv)
27 srand(atoi(argv[1])); // Seed with RNG from command line 26 srand(atoi(argv[1])); // Seed with RNG from command line
28 } 27 }
29 28
30 // randomizer.Randomize(bunkerPanels, SWAP_LINES | SWAP_STYLE); 29 //*
31 /*
32 randomizer.Randomize(lasers, SWAP_TARGETS); 30 randomizer.Randomize(lasers, SWAP_TARGETS);
33 randomizer.Randomize(tutorialPanels, SWAP_TARGETS);
34 randomizer.Randomize(monasteryPanels, SWAP_TARGETS);
35 randomizer.Randomize(shadowsPanels, SWAP_TARGETS);
36 31
37 randomizer.Randomize(desertPanels, SWAP_LINES);
38 randomizer.Randomize(treehousePanels, SWAP_LINES);
39
40 std::vector<int> squarePanels;
41 for (auto panelSet : {outsideTutorialPanels, symmetryPanels, quarryPanels, keepPanels, townPanels, bunkerPanels, swampPanels, mountainPanels, utmPanels}) {
42 squarePanels.insert(squarePanels.end(), panelSet.begin(), panelSet.end());
43 }
44 randomizer.Randomize(squarePanels, SWAP_LINES | SWAP_STYLE); 32 randomizer.Randomize(squarePanels, SWAP_LINES | SWAP_STYLE);
33 randomizer.Randomize(burnablePanels, SWAP_LINES | SWAP_STYLE);
34
35
36 // randomizer.Randomize(monasteryPanels, SWAP_TARGETS);
37 // randomizer.Randomize(shadowsPanels, SWAP_TARGETS);
38 // randomizer.Randomize(bunkerPanels, SWAP_TARGETS);
39
40 // randomizer.Randomize(junglePanels, SWAP_LINES | SWAP_STYLE);
41 // randomizer.Randomize(mountainMultipanel, SWAP_LINES | SWAP_STYLE);
42 // randomizer.Randomize(pillars, SWAP_LINES | SWAP_STYLE | SWAP_BACK_DISTANCE);
45 43
46 randomizer.Randomize(junglePanels, SWAP_LINES | SWAP_STYLE);
47 randomizer.Randomize(mountainMultipanel, SWAP_LINES | SWAP_STYLE);
48 randomizer.Randomize(pillars, SWAP_LINES | SWAP_STYLE | SWAP_BACK_DISTANCE);
49 /*/ 44 /*/
50 int BOATH_3_1 = 0x21B5; 45 int BOATH_3_1 = 0x21B5;
51 int MILL_L_1 = 0xE0C; 46 int MILL_L_1 = 0xE0C;
@@ -65,14 +60,6 @@ int main(int argc, char** argv)
65 int DESERT_L_2 = 0x006E3; 60 int DESERT_L_2 = 0x006E3;
66 int TOWN_S_1 = 0x28AC7; 61 int TOWN_S_1 = 0x28AC7;
67 62
68 std::vector<int> squarePanels;
69 for (auto panelSet : {outsideTutorialPanels, symmetryPanels, quarryPanels, keepPanels, townPanels, bunkerPanels, swampPanels, mountainPanels, utmPanels, treehousePanels}) {
70 squarePanels.insert(squarePanels.end(), panelSet.begin(), panelSet.end());
71 }
72 for (int panel : squarePanels) {
73 randomizer.SwapPanels(DESERT_L_2, panel, SWAP_LINES | SWAP_STYLE);
74 }
75
76 63
77 //randomizer.SwapPanels(PILLAR_L_1, PILLAR_C_L, SWAP_LINES | SWAP_STYLE | SWAP_BACK_DISTANCE); 64 //randomizer.SwapPanels(PILLAR_L_1, PILLAR_C_L, SWAP_LINES | SWAP_STYLE | SWAP_BACK_DISTANCE);
78 //randomizer.SwapPanelData(PILLAR_L_1, PILLAR_C_L, 0x200, 0x50); 65 //randomizer.SwapPanelData(PILLAR_L_1, PILLAR_C_L, 0x200, 0x50);
@@ -89,10 +76,13 @@ WitnessRandomizer::WitnessRandomizer() : _memory("witness64_d3d11.exe")
89 _memory.WriteData<float>({0x5B28C0, 0x18, 0x18076*8, 0x2A8}, {0.0f, 0.0f}); 76 _memory.WriteData<float>({0x5B28C0, 0x18, 0x18076*8, 0x2A8}, {0.0f, 0.0f});
90 // Change desert floating target to desert flood final 77 // Change desert floating target to desert flood final
91 _memory.WriteData<int>({0x5B28C0, 0x18, 0x17ECA*8, 0x2BC}, {0x18077}); 78 _memory.WriteData<int>({0x5B28C0, 0x18, 0x17ECA*8, 0x2BC}, {0x18077});
79 // Distance-gate shadows laser to prevent sniping through the bars
80 _memory.WriteData<float>({0x5B28C0, 0x18, 0x19650*8, 0x3C0}, {2.0f});
81
92 // Explicitly set back-off distance for the challenge entry & final 2 pillars 82 // Explicitly set back-off distance for the challenge entry & final 2 pillars
93 _memory.WriteData<float>({0x5B28C0, 0x18, 0x9DD5*8, 0x22C}, {2.5f}); 83// _memory.WriteData<float>({0x5B28C0, 0x18, 0x9DD5*8, 0x22C}, {2.5f});
94 _memory.WriteData<float>({0x5B28C0, 0x18, 0x1C31A*8, 0x22C}, {3.0f}); 84// _memory.WriteData<float>({0x5B28C0, 0x18, 0x1C31A*8, 0x22C}, {3.0f});
95 _memory.WriteData<float>({0x5B28C0, 0x18, 0x1C319*8, 0x22C}, {3.0f}); 85// _memory.WriteData<float>({0x5B28C0, 0x18, 0x1C319*8, 0x22C}, {3.0f});
96} 86}
97 87
98void WitnessRandomizer::Randomize(std::vector<int> panels, int flags) { 88void WitnessRandomizer::Randomize(std::vector<int> panels, int flags) {
@@ -196,8 +186,8 @@ void WitnessRandomizer::SwapPanelData(int panel1, int panel2, int finalOffset, i
196 std::vector<int> panel2Offset = {0x5B28C0, 0x18, panel2*8, finalOffset}; 186 std::vector<int> panel2Offset = {0x5B28C0, 0x18, panel2*8, finalOffset};
197 187
198 std::vector<byte> panel1Data = _memory.ReadData<byte>(panel1Offset, dataSize); 188 std::vector<byte> panel1Data = _memory.ReadData<byte>(panel1Offset, dataSize);
199 //std::vector<byte> panel2Data = _memory.ReadData<byte>(panel2Offset, dataSize); 189 std::vector<byte> panel2Data = _memory.ReadData<byte>(panel2Offset, dataSize);
200 190
201 _memory.WriteData<byte>(panel2Offset, panel1Data); 191 _memory.WriteData<byte>(panel2Offset, panel1Data);
202 //_memory.WriteData<byte>(panel1Offset, panel2Data); 192 _memory.WriteData<byte>(panel1Offset, panel2Data);
203} 193}