Fix map extraction

master
Louis Pearson 2022-08-10 21:12:17 -06:00
parent aa539339b9
commit 05328945e6
4 changed files with 450 additions and 40 deletions

View File

@ -10,7 +10,7 @@
}, },
"jsonVersion": "1.1.3", "jsonVersion": "1.1.3",
"appBuildId": 458364, "appBuildId": 458364,
"nextUid": 161, "nextUid": 162,
"identifierStyle": "Capitalize", "identifierStyle": "Capitalize",
"worldLayout": "GridVania", "worldLayout": "GridVania",
"worldGridWidth": 160, "worldGridWidth": 160,
@ -2463,6 +2463,30 @@
"active": true, "active": true,
"isOptional": false, "isOptional": false,
"rules": [ "rules": [
{
"uid": 161,
"active": true,
"size": 3,
"tileIds": [127],
"chance": 1,
"breakOnMatch": true,
"pattern": [0,1,0,1,1,1,0,1,0],
"flipX": false,
"flipY": false,
"xModulo": 1,
"yModulo": 1,
"xOffset": 0,
"yOffset": 0,
"checker": "None",
"tileMode": "Single",
"pivotX": 0,
"pivotY": 0,
"outOfBoundsValue": 1,
"perlinActive": false,
"perlinSeed": 67351,
"perlinScale": 0.2,
"perlinOctaves": 2
},
{ {
"uid": 23, "uid": 23,
"active": true, "active": true,
@ -3498,6 +3522,84 @@
{ "px": [40,112], "src": [72,56], "f": 0, "t": 121, "d": [14,285] }, { "px": [40,112], "src": [72,56], "f": 0, "t": 121, "d": [14,285] },
{ "px": [96,72], "src": [16,56], "f": 0, "t": 114, "d": [20,192] }, { "px": [96,72], "src": [16,56], "f": 0, "t": 114, "d": [20,192] },
{ "px": [48,120], "src": [16,56], "f": 0, "t": 114, "d": [20,306] }, { "px": [48,120], "src": [16,56], "f": 0, "t": 114, "d": [20,306] },
{ "px": [0,0], "src": [120,56], "f": 0, "t": 127, "d": [161,0] },
{ "px": [8,0], "src": [120,56], "f": 0, "t": 127, "d": [161,1] },
{ "px": [16,0], "src": [120,56], "f": 0, "t": 127, "d": [161,2] },
{ "px": [24,0], "src": [120,56], "f": 0, "t": 127, "d": [161,3] },
{ "px": [32,0], "src": [120,56], "f": 0, "t": 127, "d": [161,4] },
{ "px": [40,0], "src": [120,56], "f": 0, "t": 127, "d": [161,5] },
{ "px": [48,0], "src": [120,56], "f": 0, "t": 127, "d": [161,6] },
{ "px": [56,0], "src": [120,56], "f": 0, "t": 127, "d": [161,7] },
{ "px": [64,0], "src": [120,56], "f": 0, "t": 127, "d": [161,8] },
{ "px": [72,0], "src": [120,56], "f": 0, "t": 127, "d": [161,9] },
{ "px": [80,0], "src": [120,56], "f": 0, "t": 127, "d": [161,10] },
{ "px": [88,0], "src": [120,56], "f": 0, "t": 127, "d": [161,11] },
{ "px": [96,0], "src": [120,56], "f": 0, "t": 127, "d": [161,12] },
{ "px": [104,0], "src": [120,56], "f": 0, "t": 127, "d": [161,13] },
{ "px": [112,0], "src": [120,56], "f": 0, "t": 127, "d": [161,14] },
{ "px": [120,0], "src": [120,56], "f": 0, "t": 127, "d": [161,15] },
{ "px": [128,0], "src": [120,56], "f": 0, "t": 127, "d": [161,16] },
{ "px": [136,0], "src": [120,56], "f": 0, "t": 127, "d": [161,17] },
{ "px": [144,0], "src": [120,56], "f": 0, "t": 127, "d": [161,18] },
{ "px": [152,0], "src": [120,56], "f": 0, "t": 127, "d": [161,19] },
{ "px": [0,8], "src": [120,56], "f": 0, "t": 127, "d": [161,20] },
{ "px": [8,8], "src": [120,56], "f": 0, "t": 127, "d": [161,21] },
{ "px": [16,8], "src": [120,56], "f": 0, "t": 127, "d": [161,22] },
{ "px": [24,8], "src": [120,56], "f": 0, "t": 127, "d": [161,23] },
{ "px": [32,8], "src": [120,56], "f": 0, "t": 127, "d": [161,24] },
{ "px": [40,8], "src": [120,56], "f": 0, "t": 127, "d": [161,25] },
{ "px": [48,8], "src": [120,56], "f": 0, "t": 127, "d": [161,26] },
{ "px": [56,8], "src": [120,56], "f": 0, "t": 127, "d": [161,27] },
{ "px": [64,8], "src": [120,56], "f": 0, "t": 127, "d": [161,28] },
{ "px": [72,8], "src": [120,56], "f": 0, "t": 127, "d": [161,29] },
{ "px": [80,8], "src": [120,56], "f": 0, "t": 127, "d": [161,30] },
{ "px": [88,8], "src": [120,56], "f": 0, "t": 127, "d": [161,31] },
{ "px": [96,8], "src": [120,56], "f": 0, "t": 127, "d": [161,32] },
{ "px": [104,8], "src": [120,56], "f": 0, "t": 127, "d": [161,33] },
{ "px": [112,8], "src": [120,56], "f": 0, "t": 127, "d": [161,34] },
{ "px": [120,8], "src": [120,56], "f": 0, "t": 127, "d": [161,35] },
{ "px": [128,8], "src": [120,56], "f": 0, "t": 127, "d": [161,36] },
{ "px": [136,8], "src": [120,56], "f": 0, "t": 127, "d": [161,37] },
{ "px": [144,8], "src": [120,56], "f": 0, "t": 127, "d": [161,38] },
{ "px": [152,8], "src": [120,56], "f": 0, "t": 127, "d": [161,39] },
{ "px": [0,16], "src": [120,56], "f": 0, "t": 127, "d": [161,40] },
{ "px": [48,48], "src": [120,56], "f": 0, "t": 127, "d": [161,126] },
{ "px": [88,48], "src": [120,56], "f": 0, "t": 127, "d": [161,131] },
{ "px": [96,48], "src": [120,56], "f": 0, "t": 127, "d": [161,132] },
{ "px": [136,48], "src": [120,56], "f": 0, "t": 127, "d": [161,137] },
{ "px": [144,48], "src": [120,56], "f": 0, "t": 127, "d": [161,138] },
{ "px": [152,48], "src": [120,56], "f": 0, "t": 127, "d": [161,139] },
{ "px": [144,56], "src": [120,56], "f": 0, "t": 127, "d": [161,158] },
{ "px": [152,56], "src": [120,56], "f": 0, "t": 127, "d": [161,159] },
{ "px": [144,64], "src": [120,56], "f": 0, "t": 127, "d": [161,178] },
{ "px": [152,64], "src": [120,56], "f": 0, "t": 127, "d": [161,179] },
{ "px": [144,72], "src": [120,56], "f": 0, "t": 127, "d": [161,198] },
{ "px": [152,72], "src": [120,56], "f": 0, "t": 127, "d": [161,199] },
{ "px": [144,80], "src": [120,56], "f": 0, "t": 127, "d": [161,218] },
{ "px": [152,80], "src": [120,56], "f": 0, "t": 127, "d": [161,219] },
{ "px": [144,88], "src": [120,56], "f": 0, "t": 127, "d": [161,238] },
{ "px": [152,88], "src": [120,56], "f": 0, "t": 127, "d": [161,239] },
{ "px": [0,96], "src": [120,56], "f": 0, "t": 127, "d": [161,240] },
{ "px": [144,96], "src": [120,56], "f": 0, "t": 127, "d": [161,258] },
{ "px": [152,96], "src": [120,56], "f": 0, "t": 127, "d": [161,259] },
{ "px": [0,104], "src": [120,56], "f": 0, "t": 127, "d": [161,260] },
{ "px": [8,104], "src": [120,56], "f": 0, "t": 127, "d": [161,261] },
{ "px": [40,104], "src": [120,56], "f": 0, "t": 127, "d": [161,265] },
{ "px": [80,104], "src": [120,56], "f": 0, "t": 127, "d": [161,270] },
{ "px": [88,104], "src": [120,56], "f": 0, "t": 127, "d": [161,271] },
{ "px": [144,104], "src": [120,56], "f": 0, "t": 127, "d": [161,278] },
{ "px": [152,104], "src": [120,56], "f": 0, "t": 127, "d": [161,279] },
{ "px": [0,112], "src": [120,56], "f": 0, "t": 127, "d": [161,280] },
{ "px": [88,112], "src": [120,56], "f": 0, "t": 127, "d": [161,291] },
{ "px": [144,112], "src": [120,56], "f": 0, "t": 127, "d": [161,298] },
{ "px": [152,112], "src": [120,56], "f": 0, "t": 127, "d": [161,299] },
{ "px": [0,120], "src": [120,56], "f": 0, "t": 127, "d": [161,300] },
{ "px": [88,120], "src": [120,56], "f": 0, "t": 127, "d": [161,311] },
{ "px": [144,120], "src": [120,56], "f": 0, "t": 127, "d": [161,318] },
{ "px": [152,120], "src": [120,56], "f": 0, "t": 127, "d": [161,319] },
{ "px": [0,128], "src": [120,56], "f": 0, "t": 127, "d": [161,320] },
{ "px": [88,128], "src": [120,56], "f": 0, "t": 127, "d": [161,331] },
{ "px": [152,128], "src": [120,56], "f": 0, "t": 127, "d": [161,339] },
{ "px": [136,144], "src": [0,56], "f": 0, "t": 112, "d": [85,377] }, { "px": [136,144], "src": [0,56], "f": 0, "t": 112, "d": [85,377] },
{ "px": [144,144], "src": [8,56], "f": 0, "t": 113, "d": [90,378] }, { "px": [144,144], "src": [8,56], "f": 0, "t": 113, "d": [90,378] },
{ "px": [144,136], "src": [64,56], "f": 0, "t": 120, "d": [91,358] }, { "px": [144,136], "src": [64,56], "f": 0, "t": 120, "d": [91,358] },
@ -3925,6 +4027,62 @@
{ "px": [40,48], "src": [32,56], "f": 0, "t": 116, "d": [22,125] }, { "px": [40,48], "src": [32,56], "f": 0, "t": 116, "d": [22,125] },
{ "px": [112,8], "src": [8,56], "f": 0, "t": 113, "d": [23,34] }, { "px": [112,8], "src": [8,56], "f": 0, "t": 113, "d": [23,34] },
{ "px": [112,56], "src": [8,56], "f": 0, "t": 113, "d": [23,154] }, { "px": [112,56], "src": [8,56], "f": 0, "t": 113, "d": [23,154] },
{ "px": [0,0], "src": [120,56], "f": 0, "t": 127, "d": [161,0] },
{ "px": [8,0], "src": [120,56], "f": 0, "t": 127, "d": [161,1] },
{ "px": [16,0], "src": [120,56], "f": 0, "t": 127, "d": [161,2] },
{ "px": [24,0], "src": [120,56], "f": 0, "t": 127, "d": [161,3] },
{ "px": [32,0], "src": [120,56], "f": 0, "t": 127, "d": [161,4] },
{ "px": [40,0], "src": [120,56], "f": 0, "t": 127, "d": [161,5] },
{ "px": [48,0], "src": [120,56], "f": 0, "t": 127, "d": [161,6] },
{ "px": [56,0], "src": [120,56], "f": 0, "t": 127, "d": [161,7] },
{ "px": [112,0], "src": [120,56], "f": 0, "t": 127, "d": [161,14] },
{ "px": [152,0], "src": [120,56], "f": 0, "t": 127, "d": [161,19] },
{ "px": [0,8], "src": [120,56], "f": 0, "t": 127, "d": [161,20] },
{ "px": [8,8], "src": [120,56], "f": 0, "t": 127, "d": [161,21] },
{ "px": [16,8], "src": [120,56], "f": 0, "t": 127, "d": [161,22] },
{ "px": [24,8], "src": [120,56], "f": 0, "t": 127, "d": [161,23] },
{ "px": [32,8], "src": [120,56], "f": 0, "t": 127, "d": [161,24] },
{ "px": [40,8], "src": [120,56], "f": 0, "t": 127, "d": [161,25] },
{ "px": [48,8], "src": [120,56], "f": 0, "t": 127, "d": [161,26] },
{ "px": [56,8], "src": [120,56], "f": 0, "t": 127, "d": [161,27] },
{ "px": [40,16], "src": [120,56], "f": 0, "t": 127, "d": [161,45] },
{ "px": [48,16], "src": [120,56], "f": 0, "t": 127, "d": [161,46] },
{ "px": [56,16], "src": [120,56], "f": 0, "t": 127, "d": [161,47] },
{ "px": [48,24], "src": [120,56], "f": 0, "t": 127, "d": [161,66] },
{ "px": [56,24], "src": [120,56], "f": 0, "t": 127, "d": [161,67] },
{ "px": [64,24], "src": [120,56], "f": 0, "t": 127, "d": [161,68] },
{ "px": [48,32], "src": [120,56], "f": 0, "t": 127, "d": [161,86] },
{ "px": [56,32], "src": [120,56], "f": 0, "t": 127, "d": [161,87] },
{ "px": [64,32], "src": [120,56], "f": 0, "t": 127, "d": [161,88] },
{ "px": [72,32], "src": [120,56], "f": 0, "t": 127, "d": [161,89] },
{ "px": [80,32], "src": [120,56], "f": 0, "t": 127, "d": [161,90] },
{ "px": [88,32], "src": [120,56], "f": 0, "t": 127, "d": [161,91] },
{ "px": [96,32], "src": [120,56], "f": 0, "t": 127, "d": [161,92] },
{ "px": [104,32], "src": [120,56], "f": 0, "t": 127, "d": [161,93] },
{ "px": [152,72], "src": [120,56], "f": 0, "t": 127, "d": [161,199] },
{ "px": [0,80], "src": [120,56], "f": 0, "t": 127, "d": [161,200] },
{ "px": [136,80], "src": [120,56], "f": 0, "t": 127, "d": [161,217] },
{ "px": [144,80], "src": [120,56], "f": 0, "t": 127, "d": [161,218] },
{ "px": [152,80], "src": [120,56], "f": 0, "t": 127, "d": [161,219] },
{ "px": [112,88], "src": [120,56], "f": 0, "t": 127, "d": [161,234] },
{ "px": [120,88], "src": [120,56], "f": 0, "t": 127, "d": [161,235] },
{ "px": [128,88], "src": [120,56], "f": 0, "t": 127, "d": [161,236] },
{ "px": [136,88], "src": [120,56], "f": 0, "t": 127, "d": [161,237] },
{ "px": [144,88], "src": [120,56], "f": 0, "t": 127, "d": [161,238] },
{ "px": [152,88], "src": [120,56], "f": 0, "t": 127, "d": [161,239] },
{ "px": [112,96], "src": [120,56], "f": 0, "t": 127, "d": [161,254] },
{ "px": [120,96], "src": [120,56], "f": 0, "t": 127, "d": [161,255] },
{ "px": [128,96], "src": [120,56], "f": 0, "t": 127, "d": [161,256] },
{ "px": [136,96], "src": [120,56], "f": 0, "t": 127, "d": [161,257] },
{ "px": [144,96], "src": [120,56], "f": 0, "t": 127, "d": [161,258] },
{ "px": [152,96], "src": [120,56], "f": 0, "t": 127, "d": [161,259] },
{ "px": [112,104], "src": [120,56], "f": 0, "t": 127, "d": [161,274] },
{ "px": [120,104], "src": [120,56], "f": 0, "t": 127, "d": [161,275] },
{ "px": [128,104], "src": [120,56], "f": 0, "t": 127, "d": [161,276] },
{ "px": [136,104], "src": [120,56], "f": 0, "t": 127, "d": [161,277] },
{ "px": [144,104], "src": [120,56], "f": 0, "t": 127, "d": [161,278] },
{ "px": [152,104], "src": [120,56], "f": 0, "t": 127, "d": [161,279] },
{ "px": [0,128], "src": [120,56], "f": 0, "t": 127, "d": [161,320] },
{ "px": [0,144], "src": [0,56], "f": 0, "t": 112, "d": [85,360] }, { "px": [0,144], "src": [0,56], "f": 0, "t": 112, "d": [85,360] },
{ "px": [24,144], "src": [0,56], "f": 0, "t": 112, "d": [85,363] }, { "px": [24,144], "src": [0,56], "f": 0, "t": 112, "d": [85,363] },
{ "px": [136,40], "src": [8,16], "f": 0, "t": 33, "d": [125,117] }, { "px": [136,40], "src": [8,16], "f": 0, "t": 33, "d": [125,117] },
@ -4421,6 +4579,126 @@
{ "px": [8,136], "src": [16,56], "f": 0, "t": 114, "d": [20,341] }, { "px": [8,136], "src": [16,56], "f": 0, "t": 114, "d": [20,341] },
{ "px": [56,32], "src": [8,56], "f": 0, "t": 113, "d": [23,87] }, { "px": [56,32], "src": [8,56], "f": 0, "t": 113, "d": [23,87] },
{ "px": [88,120], "src": [8,56], "f": 0, "t": 113, "d": [23,311] }, { "px": [88,120], "src": [8,56], "f": 0, "t": 113, "d": [23,311] },
{ "px": [0,0], "src": [120,56], "f": 0, "t": 127, "d": [161,0] },
{ "px": [8,0], "src": [120,56], "f": 0, "t": 127, "d": [161,1] },
{ "px": [16,0], "src": [120,56], "f": 0, "t": 127, "d": [161,2] },
{ "px": [152,0], "src": [120,56], "f": 0, "t": 127, "d": [161,19] },
{ "px": [0,8], "src": [120,56], "f": 0, "t": 127, "d": [161,20] },
{ "px": [8,8], "src": [120,56], "f": 0, "t": 127, "d": [161,21] },
{ "px": [0,16], "src": [120,56], "f": 0, "t": 127, "d": [161,40] },
{ "px": [8,16], "src": [120,56], "f": 0, "t": 127, "d": [161,41] },
{ "px": [0,24], "src": [120,56], "f": 0, "t": 127, "d": [161,60] },
{ "px": [8,24], "src": [120,56], "f": 0, "t": 127, "d": [161,61] },
{ "px": [152,24], "src": [120,56], "f": 0, "t": 127, "d": [161,79] },
{ "px": [0,32], "src": [120,56], "f": 0, "t": 127, "d": [161,80] },
{ "px": [8,32], "src": [120,56], "f": 0, "t": 127, "d": [161,81] },
{ "px": [80,32], "src": [120,56], "f": 0, "t": 127, "d": [161,90] },
{ "px": [88,32], "src": [120,56], "f": 0, "t": 127, "d": [161,91] },
{ "px": [96,32], "src": [120,56], "f": 0, "t": 127, "d": [161,92] },
{ "px": [104,32], "src": [120,56], "f": 0, "t": 127, "d": [161,93] },
{ "px": [112,32], "src": [120,56], "f": 0, "t": 127, "d": [161,94] },
{ "px": [120,32], "src": [120,56], "f": 0, "t": 127, "d": [161,95] },
{ "px": [128,32], "src": [120,56], "f": 0, "t": 127, "d": [161,96] },
{ "px": [136,32], "src": [120,56], "f": 0, "t": 127, "d": [161,97] },
{ "px": [144,32], "src": [120,56], "f": 0, "t": 127, "d": [161,98] },
{ "px": [152,32], "src": [120,56], "f": 0, "t": 127, "d": [161,99] },
{ "px": [0,40], "src": [120,56], "f": 0, "t": 127, "d": [161,100] },
{ "px": [8,40], "src": [120,56], "f": 0, "t": 127, "d": [161,101] },
{ "px": [80,40], "src": [120,56], "f": 0, "t": 127, "d": [161,110] },
{ "px": [88,40], "src": [120,56], "f": 0, "t": 127, "d": [161,111] },
{ "px": [96,40], "src": [120,56], "f": 0, "t": 127, "d": [161,112] },
{ "px": [104,40], "src": [120,56], "f": 0, "t": 127, "d": [161,113] },
{ "px": [112,40], "src": [120,56], "f": 0, "t": 127, "d": [161,114] },
{ "px": [120,40], "src": [120,56], "f": 0, "t": 127, "d": [161,115] },
{ "px": [128,40], "src": [120,56], "f": 0, "t": 127, "d": [161,116] },
{ "px": [136,40], "src": [120,56], "f": 0, "t": 127, "d": [161,117] },
{ "px": [144,40], "src": [120,56], "f": 0, "t": 127, "d": [161,118] },
{ "px": [152,40], "src": [120,56], "f": 0, "t": 127, "d": [161,119] },
{ "px": [0,48], "src": [120,56], "f": 0, "t": 127, "d": [161,120] },
{ "px": [8,48], "src": [120,56], "f": 0, "t": 127, "d": [161,121] },
{ "px": [72,48], "src": [120,56], "f": 0, "t": 127, "d": [161,129] },
{ "px": [80,48], "src": [120,56], "f": 0, "t": 127, "d": [161,130] },
{ "px": [88,48], "src": [120,56], "f": 0, "t": 127, "d": [161,131] },
{ "px": [96,48], "src": [120,56], "f": 0, "t": 127, "d": [161,132] },
{ "px": [104,48], "src": [120,56], "f": 0, "t": 127, "d": [161,133] },
{ "px": [112,48], "src": [120,56], "f": 0, "t": 127, "d": [161,134] },
{ "px": [120,48], "src": [120,56], "f": 0, "t": 127, "d": [161,135] },
{ "px": [128,48], "src": [120,56], "f": 0, "t": 127, "d": [161,136] },
{ "px": [136,48], "src": [120,56], "f": 0, "t": 127, "d": [161,137] },
{ "px": [144,48], "src": [120,56], "f": 0, "t": 127, "d": [161,138] },
{ "px": [152,48], "src": [120,56], "f": 0, "t": 127, "d": [161,139] },
{ "px": [0,56], "src": [120,56], "f": 0, "t": 127, "d": [161,140] },
{ "px": [8,56], "src": [120,56], "f": 0, "t": 127, "d": [161,141] },
{ "px": [152,56], "src": [120,56], "f": 0, "t": 127, "d": [161,159] },
{ "px": [0,64], "src": [120,56], "f": 0, "t": 127, "d": [161,160] },
{ "px": [8,64], "src": [120,56], "f": 0, "t": 127, "d": [161,161] },
{ "px": [0,72], "src": [120,56], "f": 0, "t": 127, "d": [161,180] },
{ "px": [8,72], "src": [120,56], "f": 0, "t": 127, "d": [161,181] },
{ "px": [0,80], "src": [120,56], "f": 0, "t": 127, "d": [161,200] },
{ "px": [8,80], "src": [120,56], "f": 0, "t": 127, "d": [161,201] },
{ "px": [152,80], "src": [120,56], "f": 0, "t": 127, "d": [161,219] },
{ "px": [0,88], "src": [120,56], "f": 0, "t": 127, "d": [161,220] },
{ "px": [8,88], "src": [120,56], "f": 0, "t": 127, "d": [161,221] },
{ "px": [144,88], "src": [120,56], "f": 0, "t": 127, "d": [161,238] },
{ "px": [152,88], "src": [120,56], "f": 0, "t": 127, "d": [161,239] },
{ "px": [0,96], "src": [120,56], "f": 0, "t": 127, "d": [161,240] },
{ "px": [8,96], "src": [120,56], "f": 0, "t": 127, "d": [161,241] },
{ "px": [144,96], "src": [120,56], "f": 0, "t": 127, "d": [161,258] },
{ "px": [152,96], "src": [120,56], "f": 0, "t": 127, "d": [161,259] },
{ "px": [0,104], "src": [120,56], "f": 0, "t": 127, "d": [161,260] },
{ "px": [8,104], "src": [120,56], "f": 0, "t": 127, "d": [161,261] },
{ "px": [16,104], "src": [120,56], "f": 0, "t": 127, "d": [161,262] },
{ "px": [144,104], "src": [120,56], "f": 0, "t": 127, "d": [161,278] },
{ "px": [152,104], "src": [120,56], "f": 0, "t": 127, "d": [161,279] },
{ "px": [144,112], "src": [120,56], "f": 0, "t": 127, "d": [161,298] },
{ "px": [152,112], "src": [120,56], "f": 0, "t": 127, "d": [161,299] },
{ "px": [136,120], "src": [120,56], "f": 0, "t": 127, "d": [161,317] },
{ "px": [144,120], "src": [120,56], "f": 0, "t": 127, "d": [161,318] },
{ "px": [152,120], "src": [120,56], "f": 0, "t": 127, "d": [161,319] },
{ "px": [120,128], "src": [120,56], "f": 0, "t": 127, "d": [161,335] },
{ "px": [128,128], "src": [120,56], "f": 0, "t": 127, "d": [161,336] },
{ "px": [136,128], "src": [120,56], "f": 0, "t": 127, "d": [161,337] },
{ "px": [144,128], "src": [120,56], "f": 0, "t": 127, "d": [161,338] },
{ "px": [152,128], "src": [120,56], "f": 0, "t": 127, "d": [161,339] },
{ "px": [112,136], "src": [120,56], "f": 0, "t": 127, "d": [161,354] },
{ "px": [120,136], "src": [120,56], "f": 0, "t": 127, "d": [161,355] },
{ "px": [128,136], "src": [120,56], "f": 0, "t": 127, "d": [161,356] },
{ "px": [136,136], "src": [120,56], "f": 0, "t": 127, "d": [161,357] },
{ "px": [144,136], "src": [120,56], "f": 0, "t": 127, "d": [161,358] },
{ "px": [152,136], "src": [120,56], "f": 0, "t": 127, "d": [161,359] },
{ "px": [32,144], "src": [120,56], "f": 0, "t": 127, "d": [161,364] },
{ "px": [40,144], "src": [120,56], "f": 0, "t": 127, "d": [161,365] },
{ "px": [48,144], "src": [120,56], "f": 0, "t": 127, "d": [161,366] },
{ "px": [56,144], "src": [120,56], "f": 0, "t": 127, "d": [161,367] },
{ "px": [64,144], "src": [120,56], "f": 0, "t": 127, "d": [161,368] },
{ "px": [72,144], "src": [120,56], "f": 0, "t": 127, "d": [161,369] },
{ "px": [80,144], "src": [120,56], "f": 0, "t": 127, "d": [161,370] },
{ "px": [88,144], "src": [120,56], "f": 0, "t": 127, "d": [161,371] },
{ "px": [96,144], "src": [120,56], "f": 0, "t": 127, "d": [161,372] },
{ "px": [104,144], "src": [120,56], "f": 0, "t": 127, "d": [161,373] },
{ "px": [112,144], "src": [120,56], "f": 0, "t": 127, "d": [161,374] },
{ "px": [120,144], "src": [120,56], "f": 0, "t": 127, "d": [161,375] },
{ "px": [128,144], "src": [120,56], "f": 0, "t": 127, "d": [161,376] },
{ "px": [136,144], "src": [120,56], "f": 0, "t": 127, "d": [161,377] },
{ "px": [144,144], "src": [120,56], "f": 0, "t": 127, "d": [161,378] },
{ "px": [152,144], "src": [120,56], "f": 0, "t": 127, "d": [161,379] },
{ "px": [24,152], "src": [120,56], "f": 0, "t": 127, "d": [161,383] },
{ "px": [32,152], "src": [120,56], "f": 0, "t": 127, "d": [161,384] },
{ "px": [40,152], "src": [120,56], "f": 0, "t": 127, "d": [161,385] },
{ "px": [48,152], "src": [120,56], "f": 0, "t": 127, "d": [161,386] },
{ "px": [56,152], "src": [120,56], "f": 0, "t": 127, "d": [161,387] },
{ "px": [64,152], "src": [120,56], "f": 0, "t": 127, "d": [161,388] },
{ "px": [72,152], "src": [120,56], "f": 0, "t": 127, "d": [161,389] },
{ "px": [80,152], "src": [120,56], "f": 0, "t": 127, "d": [161,390] },
{ "px": [88,152], "src": [120,56], "f": 0, "t": 127, "d": [161,391] },
{ "px": [96,152], "src": [120,56], "f": 0, "t": 127, "d": [161,392] },
{ "px": [104,152], "src": [120,56], "f": 0, "t": 127, "d": [161,393] },
{ "px": [112,152], "src": [120,56], "f": 0, "t": 127, "d": [161,394] },
{ "px": [120,152], "src": [120,56], "f": 0, "t": 127, "d": [161,395] },
{ "px": [128,152], "src": [120,56], "f": 0, "t": 127, "d": [161,396] },
{ "px": [136,152], "src": [120,56], "f": 0, "t": 127, "d": [161,397] },
{ "px": [144,152], "src": [120,56], "f": 0, "t": 127, "d": [161,398] },
{ "px": [152,152], "src": [120,56], "f": 0, "t": 127, "d": [161,399] },
{ "px": [40,56], "src": [8,16], "f": 0, "t": 33, "d": [125,145] }, { "px": [40,56], "src": [8,16], "f": 0, "t": 33, "d": [125,145] },
{ "px": [40,88], "src": [8,16], "f": 0, "t": 33, "d": [125,225] }, { "px": [40,88], "src": [8,16], "f": 0, "t": 33, "d": [125,225] },
{ "px": [32,40], "src": [24,16], "f": 0, "t": 35, "d": [126,104] }, { "px": [32,40], "src": [24,16], "f": 0, "t": 35, "d": [126,104] },
@ -4630,6 +4908,9 @@
{ "px": [64,152], "src": [80,56], "f": 0, "t": 122, "d": [9,388] }, { "px": [64,152], "src": [80,56], "f": 0, "t": 122, "d": [9,388] },
{ "px": [152,120], "src": [40,56], "f": 0, "t": 117, "d": [11,319] }, { "px": [152,120], "src": [40,56], "f": 0, "t": 117, "d": [11,319] },
{ "px": [96,152], "src": [96,56], "f": 0, "t": 124, "d": [12,392] }, { "px": [96,152], "src": [96,56], "f": 0, "t": 124, "d": [12,392] },
{ "px": [0,0], "src": [120,56], "f": 0, "t": 127, "d": [161,0] },
{ "px": [152,0], "src": [120,56], "f": 0, "t": 127, "d": [161,19] },
{ "px": [0,152], "src": [120,56], "f": 0, "t": 127, "d": [161,380] },
{ "px": [80,152], "src": [24,16], "f": 0, "t": 35, "d": [126,390] }, { "px": [80,152], "src": [24,16], "f": 0, "t": 35, "d": [126,390] },
{ "px": [72,152], "src": [16,16], "f": 0, "t": 34, "d": [127,389] } { "px": [72,152], "src": [16,16], "f": 0, "t": 34, "d": [127,389] }
], ],
@ -4949,7 +5230,7 @@
3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,0,0,0,0,1,1,1,1, 3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,0,0,0,0,1,1,1,1,
1,1,1,3,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0, 1,1,1,3,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0,
1,0,0,0,1,1,1,1,3,3,3,1,1,1,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0, 1,0,0,0,1,1,1,1,3,3,3,1,1,1,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
], ],
"autoLayerTiles": [ "autoLayerTiles": [
@ -4974,13 +5255,6 @@
{ "px": [136,96], "src": [112,56], "f": 0, "t": 126, "d": [5,257] }, { "px": [136,96], "src": [112,56], "f": 0, "t": 126, "d": [5,257] },
{ "px": [144,96], "src": [112,56], "f": 0, "t": 126, "d": [5,258] }, { "px": [144,96], "src": [112,56], "f": 0, "t": 126, "d": [5,258] },
{ "px": [120,112], "src": [112,56], "f": 0, "t": 126, "d": [5,295] }, { "px": [120,112], "src": [112,56], "f": 0, "t": 126, "d": [5,295] },
{ "px": [0,144], "src": [112,56], "f": 0, "t": 126, "d": [5,360] },
{ "px": [8,144], "src": [112,56], "f": 0, "t": 126, "d": [5,361] },
{ "px": [16,144], "src": [112,56], "f": 0, "t": 126, "d": [5,362] },
{ "px": [24,144], "src": [112,56], "f": 0, "t": 126, "d": [5,363] },
{ "px": [32,144], "src": [112,56], "f": 0, "t": 126, "d": [5,364] },
{ "px": [40,144], "src": [112,56], "f": 0, "t": 126, "d": [5,365] },
{ "px": [48,144], "src": [112,56], "f": 0, "t": 126, "d": [5,366] },
{ "px": [56,144], "src": [112,56], "f": 0, "t": 126, "d": [5,367] }, { "px": [56,144], "src": [112,56], "f": 0, "t": 126, "d": [5,367] },
{ "px": [64,144], "src": [112,56], "f": 0, "t": 126, "d": [5,368] }, { "px": [64,144], "src": [112,56], "f": 0, "t": 126, "d": [5,368] },
{ "px": [72,144], "src": [112,56], "f": 0, "t": 126, "d": [5,369] }, { "px": [72,144], "src": [112,56], "f": 0, "t": 126, "d": [5,369] },
@ -4993,6 +5267,12 @@
{ "px": [128,144], "src": [112,56], "f": 0, "t": 126, "d": [5,376] }, { "px": [128,144], "src": [112,56], "f": 0, "t": 126, "d": [5,376] },
{ "px": [136,144], "src": [112,56], "f": 0, "t": 126, "d": [5,377] }, { "px": [136,144], "src": [112,56], "f": 0, "t": 126, "d": [5,377] },
{ "px": [144,144], "src": [112,56], "f": 0, "t": 126, "d": [5,378] }, { "px": [144,144], "src": [112,56], "f": 0, "t": 126, "d": [5,378] },
{ "px": [0,152], "src": [112,56], "f": 0, "t": 126, "d": [5,380] },
{ "px": [8,152], "src": [112,56], "f": 0, "t": 126, "d": [5,381] },
{ "px": [16,152], "src": [112,56], "f": 0, "t": 126, "d": [5,382] },
{ "px": [24,152], "src": [112,56], "f": 0, "t": 126, "d": [5,383] },
{ "px": [32,152], "src": [112,56], "f": 0, "t": 126, "d": [5,384] },
{ "px": [40,152], "src": [112,56], "f": 0, "t": 126, "d": [5,385] },
{ "px": [16,8], "src": [88,56], "f": 0, "t": 123, "d": [6,22] }, { "px": [16,8], "src": [88,56], "f": 0, "t": 123, "d": [6,22] },
{ "px": [16,16], "src": [88,56], "f": 0, "t": 123, "d": [6,42] }, { "px": [16,16], "src": [88,56], "f": 0, "t": 123, "d": [6,42] },
{ "px": [16,24], "src": [88,56], "f": 0, "t": 123, "d": [6,62] }, { "px": [16,24], "src": [88,56], "f": 0, "t": 123, "d": [6,62] },
@ -5064,6 +5344,7 @@
{ "px": [48,112], "src": [40,56], "f": 0, "t": 117, "d": [11,286] }, { "px": [48,112], "src": [40,56], "f": 0, "t": 117, "d": [11,286] },
{ "px": [48,48], "src": [96,56], "f": 0, "t": 124, "d": [12,126] }, { "px": [48,48], "src": [96,56], "f": 0, "t": 124, "d": [12,126] },
{ "px": [48,96], "src": [96,56], "f": 0, "t": 124, "d": [12,246] }, { "px": [48,96], "src": [96,56], "f": 0, "t": 124, "d": [12,246] },
{ "px": [48,144], "src": [96,56], "f": 0, "t": 124, "d": [12,366] },
{ "px": [56,24], "src": [48,56], "f": 0, "t": 118, "d": [13,67] }, { "px": [56,24], "src": [48,56], "f": 0, "t": 118, "d": [13,67] },
{ "px": [64,24], "src": [48,56], "f": 0, "t": 118, "d": [13,68] }, { "px": [64,24], "src": [48,56], "f": 0, "t": 118, "d": [13,68] },
{ "px": [72,24], "src": [48,56], "f": 0, "t": 118, "d": [13,69] }, { "px": [72,24], "src": [48,56], "f": 0, "t": 118, "d": [13,69] },
@ -5082,6 +5363,110 @@
{ "px": [48,128], "src": [32,56], "f": 0, "t": 116, "d": [22,326] }, { "px": [48,128], "src": [32,56], "f": 0, "t": 116, "d": [22,326] },
{ "px": [56,8], "src": [8,56], "f": 0, "t": 113, "d": [23,27] }, { "px": [56,8], "src": [8,56], "f": 0, "t": 113, "d": [23,27] },
{ "px": [120,128], "src": [8,56], "f": 0, "t": 113, "d": [23,335] }, { "px": [120,128], "src": [8,56], "f": 0, "t": 113, "d": [23,335] },
{ "px": [0,0], "src": [120,56], "f": 0, "t": 127, "d": [161,0] },
{ "px": [8,0], "src": [120,56], "f": 0, "t": 127, "d": [161,1] },
{ "px": [16,0], "src": [120,56], "f": 0, "t": 127, "d": [161,2] },
{ "px": [56,0], "src": [120,56], "f": 0, "t": 127, "d": [161,7] },
{ "px": [80,0], "src": [120,56], "f": 0, "t": 127, "d": [161,10] },
{ "px": [88,0], "src": [120,56], "f": 0, "t": 127, "d": [161,11] },
{ "px": [96,0], "src": [120,56], "f": 0, "t": 127, "d": [161,12] },
{ "px": [104,0], "src": [120,56], "f": 0, "t": 127, "d": [161,13] },
{ "px": [112,0], "src": [120,56], "f": 0, "t": 127, "d": [161,14] },
{ "px": [120,0], "src": [120,56], "f": 0, "t": 127, "d": [161,15] },
{ "px": [128,0], "src": [120,56], "f": 0, "t": 127, "d": [161,16] },
{ "px": [136,0], "src": [120,56], "f": 0, "t": 127, "d": [161,17] },
{ "px": [144,0], "src": [120,56], "f": 0, "t": 127, "d": [161,18] },
{ "px": [152,0], "src": [120,56], "f": 0, "t": 127, "d": [161,19] },
{ "px": [0,8], "src": [120,56], "f": 0, "t": 127, "d": [161,20] },
{ "px": [8,8], "src": [120,56], "f": 0, "t": 127, "d": [161,21] },
{ "px": [88,8], "src": [120,56], "f": 0, "t": 127, "d": [161,31] },
{ "px": [96,8], "src": [120,56], "f": 0, "t": 127, "d": [161,32] },
{ "px": [104,8], "src": [120,56], "f": 0, "t": 127, "d": [161,33] },
{ "px": [112,8], "src": [120,56], "f": 0, "t": 127, "d": [161,34] },
{ "px": [120,8], "src": [120,56], "f": 0, "t": 127, "d": [161,35] },
{ "px": [128,8], "src": [120,56], "f": 0, "t": 127, "d": [161,36] },
{ "px": [136,8], "src": [120,56], "f": 0, "t": 127, "d": [161,37] },
{ "px": [144,8], "src": [120,56], "f": 0, "t": 127, "d": [161,38] },
{ "px": [152,8], "src": [120,56], "f": 0, "t": 127, "d": [161,39] },
{ "px": [0,16], "src": [120,56], "f": 0, "t": 127, "d": [161,40] },
{ "px": [8,16], "src": [120,56], "f": 0, "t": 127, "d": [161,41] },
{ "px": [88,16], "src": [120,56], "f": 0, "t": 127, "d": [161,51] },
{ "px": [96,16], "src": [120,56], "f": 0, "t": 127, "d": [161,52] },
{ "px": [104,16], "src": [120,56], "f": 0, "t": 127, "d": [161,53] },
{ "px": [112,16], "src": [120,56], "f": 0, "t": 127, "d": [161,54] },
{ "px": [120,16], "src": [120,56], "f": 0, "t": 127, "d": [161,55] },
{ "px": [128,16], "src": [120,56], "f": 0, "t": 127, "d": [161,56] },
{ "px": [136,16], "src": [120,56], "f": 0, "t": 127, "d": [161,57] },
{ "px": [144,16], "src": [120,56], "f": 0, "t": 127, "d": [161,58] },
{ "px": [152,16], "src": [120,56], "f": 0, "t": 127, "d": [161,59] },
{ "px": [0,24], "src": [120,56], "f": 0, "t": 127, "d": [161,60] },
{ "px": [8,24], "src": [120,56], "f": 0, "t": 127, "d": [161,61] },
{ "px": [152,24], "src": [120,56], "f": 0, "t": 127, "d": [161,79] },
{ "px": [0,32], "src": [120,56], "f": 0, "t": 127, "d": [161,80] },
{ "px": [8,32], "src": [120,56], "f": 0, "t": 127, "d": [161,81] },
{ "px": [0,40], "src": [120,56], "f": 0, "t": 127, "d": [161,100] },
{ "px": [8,40], "src": [120,56], "f": 0, "t": 127, "d": [161,101] },
{ "px": [0,48], "src": [120,56], "f": 0, "t": 127, "d": [161,120] },
{ "px": [8,48], "src": [120,56], "f": 0, "t": 127, "d": [161,121] },
{ "px": [152,48], "src": [120,56], "f": 0, "t": 127, "d": [161,139] },
{ "px": [0,56], "src": [120,56], "f": 0, "t": 127, "d": [161,140] },
{ "px": [8,56], "src": [120,56], "f": 0, "t": 127, "d": [161,141] },
{ "px": [56,56], "src": [120,56], "f": 0, "t": 127, "d": [161,147] },
{ "px": [64,56], "src": [120,56], "f": 0, "t": 127, "d": [161,148] },
{ "px": [72,56], "src": [120,56], "f": 0, "t": 127, "d": [161,149] },
{ "px": [80,56], "src": [120,56], "f": 0, "t": 127, "d": [161,150] },
{ "px": [88,56], "src": [120,56], "f": 0, "t": 127, "d": [161,151] },
{ "px": [96,56], "src": [120,56], "f": 0, "t": 127, "d": [161,152] },
{ "px": [104,56], "src": [120,56], "f": 0, "t": 127, "d": [161,153] },
{ "px": [112,56], "src": [120,56], "f": 0, "t": 127, "d": [161,154] },
{ "px": [120,56], "src": [120,56], "f": 0, "t": 127, "d": [161,155] },
{ "px": [128,56], "src": [120,56], "f": 0, "t": 127, "d": [161,156] },
{ "px": [136,56], "src": [120,56], "f": 0, "t": 127, "d": [161,157] },
{ "px": [144,56], "src": [120,56], "f": 0, "t": 127, "d": [161,158] },
{ "px": [152,56], "src": [120,56], "f": 0, "t": 127, "d": [161,159] },
{ "px": [0,64], "src": [120,56], "f": 0, "t": 127, "d": [161,160] },
{ "px": [8,64], "src": [120,56], "f": 0, "t": 127, "d": [161,161] },
{ "px": [152,64], "src": [120,56], "f": 0, "t": 127, "d": [161,179] },
{ "px": [0,72], "src": [120,56], "f": 0, "t": 127, "d": [161,180] },
{ "px": [8,72], "src": [120,56], "f": 0, "t": 127, "d": [161,181] },
{ "px": [0,80], "src": [120,56], "f": 0, "t": 127, "d": [161,200] },
{ "px": [8,80], "src": [120,56], "f": 0, "t": 127, "d": [161,201] },
{ "px": [0,88], "src": [120,56], "f": 0, "t": 127, "d": [161,220] },
{ "px": [8,88], "src": [120,56], "f": 0, "t": 127, "d": [161,221] },
{ "px": [0,96], "src": [120,56], "f": 0, "t": 127, "d": [161,240] },
{ "px": [8,96], "src": [120,56], "f": 0, "t": 127, "d": [161,241] },
{ "px": [152,96], "src": [120,56], "f": 0, "t": 127, "d": [161,259] },
{ "px": [0,104], "src": [120,56], "f": 0, "t": 127, "d": [161,260] },
{ "px": [8,104], "src": [120,56], "f": 0, "t": 127, "d": [161,261] },
{ "px": [56,104], "src": [120,56], "f": 0, "t": 127, "d": [161,267] },
{ "px": [64,104], "src": [120,56], "f": 0, "t": 127, "d": [161,268] },
{ "px": [72,104], "src": [120,56], "f": 0, "t": 127, "d": [161,269] },
{ "px": [80,104], "src": [120,56], "f": 0, "t": 127, "d": [161,270] },
{ "px": [136,104], "src": [120,56], "f": 0, "t": 127, "d": [161,277] },
{ "px": [144,104], "src": [120,56], "f": 0, "t": 127, "d": [161,278] },
{ "px": [152,104], "src": [120,56], "f": 0, "t": 127, "d": [161,279] },
{ "px": [0,112], "src": [120,56], "f": 0, "t": 127, "d": [161,280] },
{ "px": [8,112], "src": [120,56], "f": 0, "t": 127, "d": [161,281] },
{ "px": [72,112], "src": [120,56], "f": 0, "t": 127, "d": [161,289] },
{ "px": [152,112], "src": [120,56], "f": 0, "t": 127, "d": [161,299] },
{ "px": [0,120], "src": [120,56], "f": 0, "t": 127, "d": [161,300] },
{ "px": [8,120], "src": [120,56], "f": 0, "t": 127, "d": [161,301] },
{ "px": [152,144], "src": [120,56], "f": 0, "t": 127, "d": [161,379] },
{ "px": [48,152], "src": [120,56], "f": 0, "t": 127, "d": [161,386] },
{ "px": [56,152], "src": [120,56], "f": 0, "t": 127, "d": [161,387] },
{ "px": [64,152], "src": [120,56], "f": 0, "t": 127, "d": [161,388] },
{ "px": [72,152], "src": [120,56], "f": 0, "t": 127, "d": [161,389] },
{ "px": [80,152], "src": [120,56], "f": 0, "t": 127, "d": [161,390] },
{ "px": [88,152], "src": [120,56], "f": 0, "t": 127, "d": [161,391] },
{ "px": [96,152], "src": [120,56], "f": 0, "t": 127, "d": [161,392] },
{ "px": [104,152], "src": [120,56], "f": 0, "t": 127, "d": [161,393] },
{ "px": [112,152], "src": [120,56], "f": 0, "t": 127, "d": [161,394] },
{ "px": [120,152], "src": [120,56], "f": 0, "t": 127, "d": [161,395] },
{ "px": [128,152], "src": [120,56], "f": 0, "t": 127, "d": [161,396] },
{ "px": [136,152], "src": [120,56], "f": 0, "t": 127, "d": [161,397] },
{ "px": [144,152], "src": [120,56], "f": 0, "t": 127, "d": [161,398] },
{ "px": [152,152], "src": [120,56], "f": 0, "t": 127, "d": [161,399] },
{ "px": [40,144], "src": [8,16], "f": 0, "t": 33, "d": [125,365] },
{ "px": [24,64], "src": [24,16], "f": 0, "t": 35, "d": [126,163] }, { "px": [24,64], "src": [24,16], "f": 0, "t": 35, "d": [126,163] },
{ "px": [24,80], "src": [24,16], "f": 0, "t": 35, "d": [126,203] }, { "px": [24,80], "src": [24,16], "f": 0, "t": 35, "d": [126,203] },
{ "px": [24,112], "src": [24,16], "f": 0, "t": 35, "d": [126,283] }, { "px": [24,112], "src": [24,16], "f": 0, "t": 35, "d": [126,283] },

View File

@ -21,10 +21,6 @@ pub const Options = struct {
db: world.Database, db: world.Database,
}; };
fn is_solid(tile: u7) bool {
return tile != 0 and tile != 1;
}
/// Extracts a compressed level into the map and circuit buffers /// Extracts a compressed level into the map and circuit buffers
pub fn extractLevel(opt: Options) !void { pub fn extractLevel(opt: Options) !void {
w4.tracef("extract begin"); w4.tracef("extract begin");
@ -56,7 +52,14 @@ pub fn extractLevel(opt: Options) !void {
for (tiles) |data, i| { for (tiles) |data, i| {
switch (data) { switch (data) {
.tile => |tile| { .tile => |tile| {
auto_map[i] = .Empty; w4.tracef("[extract tile] [%d] %d", i, tile);
const is_solid = world.Tiles.is_solid(tile);
const is_oneway = world.Tiles.is_solid(tile);
auto_map[i] = solid_type: {
if (is_solid) break :solid_type .Solid;
if (is_oneway) break :solid_type .Oneway;
break :solid_type .Empty;
};
map.tiles[i] = tile; map.tiles[i] = tile;
circuit_map[i] = .None; circuit_map[i] = .None;
}, },
@ -79,6 +82,7 @@ pub fn extractLevel(opt: Options) !void {
const y = @divTrunc(i, width); const y = @divTrunc(i, width);
const stride = width; const stride = width;
w4.tracef("[extract] %d (%d, %d)", @enumToInt(auto_map[i]), x, y);
if (auto_map[i] == .Empty) { if (auto_map[i] == .Empty) {
autotiles[i] = null; autotiles[i] = null;
continue; continue;
@ -125,14 +129,20 @@ pub fn extractLevel(opt: Options) !void {
for (autotiles) |autotile_opt, i| { for (autotiles) |autotile_opt, i| {
if (autotile_opt) |autotile| { if (autotile_opt) |autotile| {
const tile = tileset.find(autotile); const tile = switch (auto_map[i]) {
.Solid => tileset.find(autotile),
.Oneway => world.Tiles.OneWayMiddle,
.Empty => 0,
};
map.tiles[i] = tile; map.tiles[i] = tile;
} }
} }
var autocircuit = try alloc.alloc(?AutoTile, size);
defer alloc.free(autocircuit);
w4.tracef("autotile circuit"); w4.tracef("autotile circuit");
// Auto generate circuit // Auto generate circuit
// Re-use autotiles to save memory
{ {
var i: usize = 0; var i: usize = 0;
while (i < size) : (i += 1) { while (i < size) : (i += 1) {
@ -154,7 +164,7 @@ pub fn extractLevel(opt: Options) !void {
} }
if (circuit_map[i] == .None) { if (circuit_map[i] == .None) {
autotiles[i] = null; autocircuit[i] = null;
continue; continue;
} }
@ -170,28 +180,28 @@ pub fn extractLevel(opt: Options) !void {
// Check horizontal neighbors // Check horizontal neighbors
if (x == 0) { if (x == 0) {
west = out_of_bounds; west = out_of_bounds;
east = circuit_map[i + 1] != .None; east = circuit_map[i + 1] != .None and circuit_map[i + 1] != .Conduit_Vertical;
} else if (x == width - 1) { } else if (x == width - 1) {
west = circuit_map[i - 1] != .None; west = circuit_map[i - 1] != .None and circuit_map[i - 1] != .Conduit_Vertical;
east = out_of_bounds; east = out_of_bounds;
} else { } else {
west = circuit_map[i - 1] != .None; west = circuit_map[i - 1] != .None and circuit_map[i - 1] != .Conduit_Vertical;
east = circuit_map[i + 1] != .None; east = circuit_map[i + 1] != .None and circuit_map[i + 1] != .Conduit_Vertical;
} }
// Check vertical neighbours // Check vertical neighbours
if (y == 0) { if (y == 0) {
north = out_of_bounds; north = out_of_bounds;
south = circuit_map[i + stride] != .None; south = circuit_map[i + stride] != .None and circuit_map[i + stride] != .Conduit_Horizontal;
} else if (y == height - 1) { } else if (y == height - 1) {
north = circuit_map[i - stride] != .None; north = circuit_map[i - stride] != .None and circuit_map[i - stride] != .Conduit_Horizontal;
south = out_of_bounds; south = out_of_bounds;
} else { } else {
north = circuit_map[i - stride] != .None; north = circuit_map[i - stride] != .None and circuit_map[i - stride] != .Conduit_Horizontal;
south = circuit_map[i + stride] != .None; south = circuit_map[i + stride] != .None and circuit_map[i + stride] != .Conduit_Horizontal;
} }
autotiles[i] = AutoTile{ autocircuit[i] = AutoTile{
.North = north, .North = north,
.South = south, .South = south,
.West = west, .West = west,
@ -200,15 +210,15 @@ pub fn extractLevel(opt: Options) !void {
} }
} }
for (autotiles) |autotile_opt, i| { for (autocircuit) |autotile_opt, i| {
if (autotile_opt) |autotile| { if (autotile_opt) |autotile| {
const tile = switch (circuit_map[i]) { const tile = switch (circuit_map[i]) {
.Conduit, .Conduit,
.Conduit_Vertical,
.Conduit_Horizontal,
.Source, .Source,
.Join, .Join,
=> opt.conduit.find(autotile), => opt.conduit.find(autotile),
.Conduit_Vertical => opt.conduit.find(.{ .North = true, .South = true, .West = false, .East = false }),
.Conduit_Horizontal => opt.conduit.find(.{ .North = false, .South = false, .West = true, .East = true }),
.Switch_On => opt.switch_on.find(autotile), .Switch_On => opt.switch_on.find(autotile),
.Switch_Off => opt.switch_off.find(autotile), .Switch_Off => opt.switch_off.find(autotile),
.Plug, .Socket => opt.plug.find(autotile), .Plug, .Socket => opt.plug.find(autotile),

View File

@ -133,25 +133,30 @@ pub const TileData = union(enum) {
return null; return null;
} }
const isTileBitMask = 0b1000_0000;
const tileBitMask = 0b0111_1111;
const solidBitMask = 0b0000_0011;
const circuitBitMask = 0b0111_1100;
pub fn toByte(data: TileData) u8 { pub fn toByte(data: TileData) u8 {
switch (data) { switch (data) {
.tile => |int| return 0b1000_0000 | @intCast(u8, int), .tile => |int| return 0b1000_0000 | @intCast(u8, int),
.flags => |flags| { .flags => |flags| {
const solid = @enumToInt(flags.solid); const solid = @enumToInt(flags.solid);
const circuit = @enumToInt(flags.circuit); const circuit = @enumToInt(flags.circuit);
return 0b0111_1111 & ((@intCast(u7, solid)) | (@intCast(u7, circuit) << 2)); return ((@intCast(u8, solid) & solidBitMask) | ((@intCast(u8, circuit) << 2) & circuitBitMask));
}, },
} }
} }
pub fn fromByte(byte: u8) TileData { pub fn fromByte(byte: u8) TileData {
const is_tile = (0b1000_0000 & byte) > 0; const is_tile = (isTileBitMask & byte) > 0;
if (is_tile) { if (is_tile) {
const tile = @intCast(u7, (0b0000_0011 & byte)); const tile = @intCast(u7, (tileBitMask & byte));
return TileData{ .tile = tile }; return TileData{ .tile = tile };
} else { } else {
const solid = (0b0000_0011 & byte); const solid = @intCast(u2, (solidBitMask & byte));
const circuit = @intCast(u5, (0b0111_1100 & byte) >> 2); const circuit = @intCast(u5, (circuitBitMask & byte) >> 2);
return TileData{ .flags = .{ return TileData{ .flags = .{
.solid = @intToEnum(SolidType, solid), .solid = @intToEnum(SolidType, solid),
.circuit = @intToEnum(CircuitType, circuit), .circuit = @intToEnum(CircuitType, circuit),

View File

@ -71,6 +71,16 @@ fn make(step: *std.build.Step) !void {
.wires = &wires, .wires = &wires,
}); });
for (parsed_level.tiles.?) |tile, i| {
if (tile == .tile) {
std.log.warn("{:0>2}: {}", .{ i, tile.tile });
} else if (tile == .flags) {
std.log.warn("{:0>2}: {s} {s}", .{ i, @tagName(tile.flags.solid), @tagName(tile.flags.circuit) });
} else {
std.log.warn("{:0>2}: {}", .{ i, tile });
}
}
try levels.append(parsed_level); try levels.append(parsed_level);
} }
defer for (levels.items) |level| { defer for (levels.items) |level| {
@ -272,14 +282,16 @@ fn parseLevel(opt: struct {
const tiles = parsed_level.tiles.?; const tiles = parsed_level.tiles.?;
for (tiles) |_, i| {
tiles[i] = world.TileData{ .tile = 0 };
}
// Add unchanged tile data // Add unchanged tile data
for (collision.autoLayerTiles) |autotile| { for (collision.autoLayerTiles) |autotile| {
const x = @divExact(autotile.px[0], collision.__gridSize); const x = @divExact(autotile.px[0], collision.__gridSize);
const y = @divExact(autotile.px[1], collision.__gridSize); const y = @divExact(autotile.px[1], collision.__gridSize);
const i = @intCast(usize, x + y * width); const i = @intCast(usize, x + y * width);
const sx = @divExact(autotile.src[0], collision.__gridSize); const t = autotile.t;
const sy = @divExact(autotile.src[1], collision.__gridSize);
const t = sx + sy * 16;
tiles[i] = world.TileData{ .tile = @intCast(u7, t) }; tiles[i] = world.TileData{ .tile = @intCast(u7, t) };
} }
@ -293,10 +305,8 @@ fn parseLevel(opt: struct {
0 => .Empty, 0 => .Empty,
1 => .Solid, 1 => .Solid,
3 => .Oneway, 3 => .Oneway,
else => return error.DebrisAndCircuitOverlapped, else => continue,
}; };
if (cir == .Socket)
std.log.warn("[parseLevel] {}: {}", .{ i, cir });
tiles[i] = world.TileData{ .flags = .{ tiles[i] = world.TileData{ .flags = .{
.solid = solid, .solid = solid,
.circuit = cir, .circuit = cir,