-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathparseMapInfo.js
252 lines (251 loc) · 11.7 KB
/
parseMapInfo.js
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
s=`Developer Endless load screen 0x006 0x006 0x006
Developer 2005 Prototype Intro Cutscene Waka Lake 0x007 0x007 0x007
Developer Item Test Map - Items 0x00-0x7F 0x010 0x010 0x010
Developer Item Test Map - Items 0x80-0xFF 0x011 0x011 0x011
Developer Brush Interaction Test Map 1 - Large Animals 0x020 0x020 0x020
Developer Brush Interaction Test Map 2 - Small Animals 0x021 0x021 0x021
Developer Brush Interaction Test Map 3 - Wheel Enemies 0x030 0x030 0x030
Developer Brush Interaction Test Map 4 - Bull Enemies 0x031 0x031 0x031
Developer Brush Interaction Test Map 5 - Empty 0x032 0x032 0x032
Developer Brush Interaction Test Map 6 - Empty 0x033 0x033 0x033
Developer Brush Interaction Test Map 7 - Blue Cylinder 0x034 0x034 0x034
Developer Collision and Movement Test Map 0x0FF 0x0FF 0x0FF
Normal Kamiki Village - Game Start 0x100 0x100 0x100
Normal Cave of Nagi 0x101 0x101 0x101
Normal Kamiki Village 0x102 0x102 0x102
Normal Hana Valley 0x103 0x103 0x103
Dungeon Tsuta Ruins 0x104 0x104 0x104
Normal City Checkpoint 0x105 0x105 0x105
Dungeon Tsuta Ruins - Spider Queen Arena 0x106 0x106 0x106
Dungeon Gale Shrine 0x107 0x107 0x107
Normal Kusa Village 0x108 0x108 0x108
Normal Sasa Sanctuary 0x109 0x109 0x109
Subarea Agata Forest - Madame Fawn's House 0x10A 0x10A 0x10A
Minigame Digging Minigame 0x10B 0x10B 0x10B
Minigame Onigiri Dojo Lesson Room 0x10C 0x10C 0x10C
Dungeon Gale Shrine - Crimson Helm Arena 0x10D 0x10D 0x10D
Normal Calcified Cavern 0x10E 0x10E 0x10E
Dungeon Moon Cave - Interior 0x110 0x110 0x110
Dungeon Moon Cave - Staircase and Orochi Arena 0x111 0x111 0x111
Normal Kamiki Village - After fighting Tei 0x112 0x112 0x112
Subarea Ryoshima Coast - Bandit Spider Arena 0x113 0x113 0x113
Subarea Taka Pass - Stray Bead #26 Cave 0x114 0x114 0x114
Subarea Kamui - Cherry Bomb 3 Cave 0x115 0x115 0x115
Subarea N. Ryoshima Coast - Power Slash 2 Cave 0x116 0x116 0x116
Subarea N. Ryoshima Coast - Cherry Bomb 2 Cave 0x117 0x117 0x117
Subarea Kamui (Ezofuji) - Power Slash 3 Cave 0x118 0x118 0x118
Subarea Kamui - Blockhead Grande Cave 0x119 0x119 0x119
Subarea N. Ryoshima Coast - Bandit Spider Arena 0x11A 0x11A 0x11A
Subarea Kamui - Bandit Spider Arena 0x11B 0x11B 0x11B
Subarea Dragon Palace - Stray Bead #70 Cave 0x11C 0x11C 0x11C
Subarea N. Ryoshima Coast - Stray Bead #63 Cave 0x11D 0x11D 0x11D
Developer New Game Intro Cutscene Map 0x120 0x120 0x120
Developer Beta Kamiki 0x121 0x121 0x121
Normal River of the Heavens 0x122 0x122 0x122
Normal Sei-an City (Aristocratic Qtr.) 0x200 0x200 0x200
Normal Sei-an City (Commoners' Qtr.) 0x201 0x201 0x201
Subarea Sei-an City (Aristocratic Qtr.) - Himiko's Palace 0x202 0x202 0x202
Normal Dragon Palace 0x203 0x203 0x203
Normal Inside the Dragon 0x204 0x204 0x204
Normal Sunken Ship 0x205 0x205 0x205
Normal Imperial Palace - Ammy Size 0x206 0x206 0x206
Dungeon Imperial Palace - Issun Size 0x207 0x207 0x207
Dungeon Oni Island - Lower Interior 0x208 0x208 0x208
Dungeon Oni Island - Ninetales Arena 0x209 0x209 0x209
Dungeon Catcall Tower 0x20A 0x20A 0x20A
Dungeon Imperial Palace - Blight Arena 0x20B 0x20B 0x20B
Subarea Sei-an City (Commoners' Qtr.) - Kimono Shop 0x20C 0x20C 0x20C
Normal, Dungeon Oni Island - Exterior 0x20D 0x20D 0x20D
Dungeon Oni Island - Upper Interior 0x20E 0x20E 0x20E
Dungeon Oni Island - Sidescroller 0x20F 0x20F 0x20F
Normal Wep'keer 0x301 0x301 0x301
Normal Kamiki Village - 100 years ago 0x302 0x302 0x302
Dungeon Wawku Shrine 0x303 0x303 0x303
Dungeon Wawku Shrine - Nechku Arena 0x304 0x304 0x304
Normal Ponc'tan 0x305 0x305 0x305
Normal Moon Cave - 100 years ago 0x306 0x306 0x306
Normal Ark of Yamato 0x307 0x307 0x307
Normal Ark of Yamato - Spider Queen Arena 0x308 0x308 0x308
Normal Ark of Yamato - Orochi Arena 0x309 0x309 0x309
Normal Ark of Yamato - Blight Arena 0x30A 0x30A 0x30A
Normal Ark of Yamato - Ninetales Arena 0x30B 0x30B 0x30B
Normal Ark of Yamato - Crimson Helm Arena 0x30C 0x30C 0x30C
Subarea Ponc'tan - Mrs. Seal's House 0x30D 0x30D 0x30D
Subarea Yoshpet 0x310 0x310 0x310
Subarea Inner Yoshpet 0x311 0x311 0x311
Normal Ark of Yamato - Yami Arena 0x312 0x312 0x312
Normal Wep'keer Square 0x313 0x313 0x313
Dungeon Wawku Shrine - Lechku & Nechku Arena 0x314 0x314 0x314
Menu Return to Title Screen 0xC00 0xC00 0xC00
Menu Presents from Issun 0xC02 0xC02 0xC02
Developer Beta Shinshu 0xD00 0xD00 0xD00
Developer Beta Hana 0xD01 0xD01 0xD01
Developer Beta Tsuta 0xD02 0xD02 0xD02
Developer Beta Agata 0xD03 0xD03 0xD03
Developer Beta Ryoshima 0xD04 0xD04 0xD04
Developer Beta Kamui 0xD05 0xD05 0xD05
Developer Beta Taka 0xD06 0xD06 0xD06
Developer Title Screen Demo Cutscene Village 0xD07 0xD07 0xD07
Fishing Fishing with Benkei on Sei-an Bridge 0xE00 0xE00 0xE00
Fishing Fishing with Benkei next to Himiko's Palace 0xE01 0xE01 0xE01
Fishing Fishing with Kokari in Agata 0xE02 0xE02 0xE02
Fishing Fishing with Kokari in Kamui 0xE03 0xE03 0xE03
Fishing Fishing with Fisherman in NRyo 0xE04 0xE04 0xE04
Normal Shinshu Field - Cursed 0xF01 0xF01 0xF01
Normal Shinshu Field - Healed 0xF02 0xF02 0xF02
Normal Agata Forest - Cursed 0xF03 0xF03 0xF03
Normal Agata Forest - Healed 0xF04 0xF04 0xF04
Normal Moon Cave Entrance 0xF06 0xF06 0xF06
Normal Taka Pass - Cursed 0xF07 0xF07 0xF07
Normal Taka Pass - Healed 0xF08 0xF08 0xF08
Normal Ryoshima Coast - Cursed 0xF09 0xF09 0xF09
Normal Ryoshima Coast - Healed 0xF0A 0xF0A 0xF0A
Normal N. Ryoshima Coast 0xF0C 0xF0C 0xF0C
Normal Kamui - Cursed 0xF11 0xF11 0xF11
Normal Kamui - Healed 0xF12 0xF12 0xF12
Normal Kamui (Ezofuji) 0xF13 0xF13 0xF13
Normal Shinshu Field - 100 years ago 0xF20 0xF20 0xF20
Normal Moon Cave Entrance - 100 years ago 0xF21 0xF21 0xF21`
l = s.split('\n')
out = Object.create(null)
for (const line of l) {
const [category, name, xid] = line.split('\t');
const idn = parseInt(xid, 16);
out[idn] = {name, category};
}
ms = `Game Start Kamiki Village 0x100 1 0 5000 200 200
Cave of Nagi 0x101 2 1300 -8500 127 100
Kamiki Village 0x102 2 1500 500 150 110
Hana Valley 0x103 2 -1300 -3000 110 90
Tsuta Ruins 0x104
City Checkpoint Bridge up 0x105 2 -2400 -1000 100 70
City Checkpoint Bridge lowered 0x105 2 -2400 -1000 100 70
Tsuta Ruins Spider Queen Arena 0x106
Gale Shrine 0x107
Kusa Village Ground level 0x108 2 -1700 2000 120 100
Kusa Village Lower level 0x108 2 -1700 2000 120 100
Kusa Village Upper level 0x108 2 -1700 2000 120 100
Sasa Sanctuary 0x109 2 1000 -3500 120 100
Madame Fawn's 0x10A 2 -1000 5500 120 90
Sasa Sanctuary - Mr. Bamboo Digging 0x10B
Onigiri Dojo Lesson Room (4 Winds?) 0x10C
Crimson Helm Arena 0x10D
Calcified Cavern 0x10E 1 800 3200 127 90
Moon Cave Interior 0x110
Moon Cave Staircase and Orochi Arena 0x111
Kamiki Village (Healed, Bloomed) 0x112 2 1500 500 150 100
Ryo Bandit Spider Arena 0x113 3 500 3500 90 80
Taka Stray Bead #26 Cave 0x114 2 -4500 4000 100 80
Kamui CB3 Cave 0x115 2 -500 -4100 100 80
NRyo PS2 Cave 0x116 6 1200 -5500 120 90
NRyo CB2 Cave 0x117 6 1200 -5500 120 90
Ezofuji PS3 Cave 0x118 2 500 -1500 120 100
Kamui Blockhead Grande Cave 0x119 2 -500 -4100 100 80
NRyo Bandit Spider Arena 0x11A 6 1200 -5500 120 90
Kamui Bandit Spider Arena 0x11B 2 -500 -4100 100 80
Dragon Palace Stray Bead #70 Cave 0x11C 1 200 -700 200 150
NRyo Stray Bead #63 Cave 0x11D 2 1500 -3500 100 80
<Infinite Loading Screen, doesn't crash> 0x120
<Weird beta Kamiki?> 0x121
River of the Heavens 0x122 2 0 -2500 130 100
Sei'an Aristocratic Quarter Bridge connected 0x200 2 0 -1800 100 90
Sei'an Aristocratic Quarter Bridge separated 0x200 2 0 -1800 100 90
Sei'an Commoners' Quarter 0x201 1 0 -500 120 100
Himiko's Palace 0x202 2 0 -1800 100 90
Dragon Palace 0x203 1 200 -700 200 150
Inside the Dragon 0x204 2 0 -2500 120 100
Sunken Ship 0x205 1 0 -1200 100 100
Imperial Palace Courtyard 0x206 1 0 -500 200 150
Imperial Palace Interior 0x207
Oni Island Lower Interior 0x208
Oni Island Ninetales Arena 0x209
Catcall Tower 0x20A 1 0 0 180 150
Imperial Palace Blight Arena 0x20B
Sei'an Commoners' Quarter Kimono Shop 0x20C 1 0 -500 120 100
Oni Island Exterior 0x20D 2 0 3500 120 120
Oni Island Upper Interior 0x20E
Oni Island Sidescroller 0x20F
Wep'keer Gate closed 0x301 1 789 -1693 90 75
Wep'keer Gate open 0x301 1 789 -1693 90 75
100YITP Kamiki 0x302 2 1500 500 120 100
Wawku Shrine 0x303
Wawku Shrine Nechku Arena 0x304
Ponc'tan 0x305 1 -100 1400 100 80
100YITP Moon Cave Staircase + Orochi Arena 0x306 2 0 1500 120 100
Ark of Yamato 0x307 2 0 800 120 100
Ark Spider Queen Arena 0x308 1 -1000 -9000 150 150
Ark Orochi Arena 0x309 1 0 0 150 120
Ark Blight Arena 0x30A 1 0 0 127 200
Ark Ninetales Arena 0x30B 1 0 0 127 100
Ark Crimson Helm Arena 0x30C 1 -4500 -1300 127 100
Ponc'tan Mrs. Seal's House 0x30D 1 -100 1400 100 80
Yoshpet Forest 0x310 2 -500 -4100 100 80
Inner Yoshpet 0x311 2 -500 -4100 100 80
Yami Arena 0x312 1 0 0 127 100
Wep'keer Square 0x313 1 -500 1200 127 100
Wawku Shrine Lechku & Nechku Arena 0x314
<Return to Title Screen> 0xC00
<Presents from Issun> 0xC02
<Weird Beta Shinshu?> 0xD00
<Weird Beta Hana?> 0xD01
<Weird Beta Tsuta?> 0xD02
<Weird Beta Agata?> 0xD03
<Weird Beta Ryo?> 0xD04
<Weird Beta Kamui?> 0xD05
<Weird Beta Taka?> 0xD06
<Beta Map used for Title Screen CS> 0xD07
Fishing with Benkei on Sei-an Bridge 0xE00
Fishing with Benkei next to Himiko's Palace 0xE01
Fishing with Kokari in Agata 0xE02
Fishing with Kokari in Kamui 0xE03
Fishing with Fisherman in NRyo 0xE04
Cursed Shinshu Field 0xF01 2 1000 -1000 90 80
Healed Shinshu Field 0xF02 2 1000 -1000 90 80
Cursed Agata Forest Lower level 0xF03 2 -1000 5500 120 90
Cursed Agata Forest Upper level 0xF03 2 -1000 5500 120 90
Healed Agata Forest Lower level 0xF04 2 -1000 5500 120 90
Healed Agata Forest Upper level 0xF04 2 -1000 5500 120 90
Moon Cave Entrance 0xF06 1 1600 7900 100 80
Cursed Taka Pass 0xF07 2 -4500 4000 100 80
Healed Taka Pass 0xF08 2 -4500 4000 100 80
Cursed Ryoshima Coast 0xF09 3 500 3500 100 80
Healed Ryoshima Coast 0xF0A 3 500 3500 90 80
North Ryoshima Coast (NRyo) Inner 0xF0C 2 1500 -3500 100 80
North Ryoshima Coast (NRyo) Inner with Whirlpool 0xF0C 2 1500 -3500 100 80
North Ryoshima Coast (NRyo) Inner with Oni Island 0xF0C 2 1500 -3500 100 80
North Ryoshima Coast (NRyo) Inner with Otohime Bridge 0xF0C 2 1500 -3500 100 80
North Ryoshima Coast (NRyo) Outer 0xF0C 6 1200 -5500 120 90
North Ryoshima Coast (NRyo) Outer with Whirlpool 0xF0C 6 1200 -5500 120 90
North Ryoshima Coast (NRyo) Outer with Oni Island 0xF0C 6 1200 -5500 120 90
North Ryoshima Coast (NRyo) Outer with Otohime Bridge and Oni Island 0xF0C 6 1200 -5500 120 90
Cursed Kamui 0xF11 2 -500 -4100 100 80
Healed Kamui 0xF12 2 -500 -4100 100 80
Kamui (Ezofuji) Laochi Lake frozen 0xF13 2 500 -1500 120 100
Kamui (Ezofuji) Laochi Lake thawed 0xF13 2 500 -1500 120 100
100YITP Shinshu Field 0xF20 2 800 -300 120 100
100YITP Moon Cave Entrance 0xF21 1 1600 7900 100 80
Stage - Eastern Nippon
Stage - Western Nippon
Stage - Kamui
All - Eastern Nippon
All - Eastern and Western Nippon
All - Eastern and Western Nippon and Kamui `
lms = ms.split('\n')
for (const mapl of lms) {
// debugger;
const [name, layer, xid, scale, centerX, centerZ] = mapl.split('\t');
const center = [centerX, centerZ].map(parseFloat);
if ([scale].includes('')) continue
const idn = parseInt(xid.substr(2), 16);
const entry = out[idn]
if (entry.center && (entry.center[0] != center[0] || entry.center[1] != center[1])) {
console.warn(`Entry already has center [${entry.center}], overwritten with center [${[centerX, centerZ]}]`);
}
Object.assign(entry, {scale: parseInt(scale), center});
if (layer === '') continue;
if (!('layers' in entry)) entry.layers = [];
entry.layers.push(layer);
}
preJson = JSON.stringify(out, null, 2);
finalJson = preJson.replaceAll(/\[([^\]]+)\]/g, (_,m)=>`[${m.split(",").map(s=>s.trim()).join(', ')}]`);
copy(finalJson)