From 4ccc7e9a2e8250d01b1578e5ca1c28787558f3d8 Mon Sep 17 00:00:00 2001 From: Louis Pearson Date: Wed, 10 Aug 2022 17:17:25 -0600 Subject: [PATCH] Begin adding directed conduit pieces --- assets/maps/wired.ldtk | 1120 +++++++++++++++++++++++++++++----------- deps/zig-ldtk | 2 +- flake.lock | 18 +- src/extract.zig | 30 +- src/world.zig | 87 ++-- tools/LDtkImport.zig | 222 +++++--- 6 files changed, 1065 insertions(+), 414 deletions(-) diff --git a/assets/maps/wired.ldtk b/assets/maps/wired.ldtk index 47694f4..1e40212 100644 --- a/assets/maps/wired.ldtk +++ b/assets/maps/wired.ldtk @@ -10,7 +10,7 @@ }, "jsonVersion": "1.1.3", "appBuildId": 458364, - "nextUid": 136, + "nextUid": 161, "identifierStyle": "Capitalize", "worldLayout": "GridVania", "worldGridWidth": 160, @@ -82,7 +82,9 @@ "excludedTags": [], "intGridValues": [ { "value": 1, "identifier": "Conduit", "color": "#248913" }, - { "value": 8, "identifier": "Outlet", "color": "#248913" }, + { "value": 12, "identifier": "Conduit_Vertical", "color": "#3EEA21" }, + { "value": 13, "identifier": "Conduit_Horizontal", "color": "#135109" }, + { "value": 8, "identifier": "Outlet", "color": "#448B38" }, { "value": 2, "identifier": "Plug", "color": "#EFC41D" }, { "value": 10, "identifier": "Socket", "color": "#7B47B2" }, { "value": 3, "identifier": "Switch_Off", "color": "#452A47" }, @@ -95,6 +97,406 @@ ], "autoTilesetDefUid": 1, "autoRuleGroups": [ + { + "uid": 137, + "name": "Conduit Vertical", + "active": true, + "isOptional": false, + "rules": [ + { + "uid": 155, + "active": true, + "size": 3, + "tileIds": [105], + "chance": 1, + "breakOnMatch": true, + "pattern": [0,0,0,12,1,0,0,0,0], + "flipX": true, + "flipY": false, + "xModulo": 1, + "yModulo": 1, + "xOffset": 0, + "yOffset": 0, + "checker": "None", + "tileMode": "Single", + "pivotX": 0, + "pivotY": 0, + "outOfBoundsValue": null, + "perlinActive": false, + "perlinSeed": 9882249, + "perlinScale": 0.2, + "perlinOctaves": 2 + }, + { + "uid": 152, + "active": true, + "size": 3, + "tileIds": [108], + "chance": 1, + "breakOnMatch": true, + "pattern": [0,-1000001,0,12,1,1000001,0,1000001,0], + "flipX": false, + "flipY": false, + "xModulo": 1, + "yModulo": 1, + "xOffset": 0, + "yOffset": 0, + "checker": "None", + "tileMode": "Single", + "pivotX": 0, + "pivotY": 0, + "outOfBoundsValue": null, + "perlinActive": false, + "perlinSeed": 5536565, + "perlinScale": 0.2, + "perlinOctaves": 2 + }, + { + "uid": 151, + "active": true, + "size": 3, + "tileIds": [106], + "chance": 1, + "breakOnMatch": true, + "pattern": [0,-1000001,0,1000001,1,12,0,1000001,0], + "flipX": false, + "flipY": false, + "xModulo": 1, + "yModulo": 1, + "xOffset": 0, + "yOffset": 0, + "checker": "None", + "tileMode": "Single", + "pivotX": 0, + "pivotY": 0, + "outOfBoundsValue": null, + "perlinActive": false, + "perlinSeed": 9607194, + "perlinScale": 0.2, + "perlinOctaves": 2 + }, + { + "uid": 150, + "active": true, + "size": 3, + "tileIds": [99], + "chance": 1, + "breakOnMatch": true, + "pattern": [0,1000001,0,1000001,1,12,0,-1000001,0], + "flipX": false, + "flipY": false, + "xModulo": 1, + "yModulo": 1, + "xOffset": 0, + "yOffset": 0, + "checker": "None", + "tileMode": "Single", + "pivotX": 0, + "pivotY": 0, + "outOfBoundsValue": null, + "perlinActive": false, + "perlinSeed": 554240, + "perlinScale": 0.2, + "perlinOctaves": 2 + }, + { + "uid": 149, + "active": true, + "size": 3, + "tileIds": [101], + "chance": 1, + "breakOnMatch": true, + "pattern": [0,1000001,0,12,1,1000001,0,-1000001,0], + "flipX": false, + "flipY": false, + "xModulo": 1, + "yModulo": 1, + "xOffset": 0, + "yOffset": 0, + "checker": "None", + "tileMode": "Single", + "pivotX": 0, + "pivotY": 0, + "outOfBoundsValue": null, + "perlinActive": false, + "perlinSeed": 6760405, + "perlinScale": 0.2, + "perlinOctaves": 2 + }, + { + "uid": 145, + "active": true, + "size": 3, + "tileIds": [109], + "chance": 1, + "breakOnMatch": true, + "pattern": [0,1000001,0,12,1,1000001,0,1000001,0], + "flipX": false, + "flipY": false, + "xModulo": 1, + "yModulo": 1, + "xOffset": 0, + "yOffset": 0, + "checker": "None", + "tileMode": "Single", + "pivotX": 0, + "pivotY": 0, + "outOfBoundsValue": null, + "perlinActive": false, + "perlinSeed": 2439642, + "perlinScale": 0.2, + "perlinOctaves": 2 + }, + { + "uid": 147, + "active": true, + "size": 3, + "tileIds": [107], + "chance": 1, + "breakOnMatch": true, + "pattern": [0,1000001,0,1000001,1,12,0,1000001,0], + "flipX": false, + "flipY": false, + "xModulo": 1, + "yModulo": 1, + "xOffset": 0, + "yOffset": 0, + "checker": "None", + "tileMode": "Single", + "pivotX": 0, + "pivotY": 0, + "outOfBoundsValue": null, + "perlinActive": false, + "perlinSeed": 2439642, + "perlinScale": 0.2, + "perlinOctaves": 2 + }, + { + "uid": 139, + "active": true, + "size": 1, + "tileIds": [105], + "chance": 1, + "breakOnMatch": true, + "pattern": [12], + "flipX": false, + "flipY": false, + "xModulo": 1, + "yModulo": 1, + "xOffset": 0, + "yOffset": 0, + "checker": "None", + "tileMode": "Single", + "pivotX": 0, + "pivotY": 0, + "outOfBoundsValue": null, + "perlinActive": false, + "perlinSeed": 9146683, + "perlinScale": 0.2, + "perlinOctaves": 2 + } + ] + }, + { + "uid": 136, + "name": "Conduit Horizontal", + "active": true, + "isOptional": false, + "rules": [ + { + "uid": 153, + "active": true, + "size": 3, + "tileIds": [102], + "chance": 1, + "breakOnMatch": true, + "pattern": [0,0,0,1000001,1,1000001,0,13,0], + "flipX": false, + "flipY": true, + "xModulo": 1, + "yModulo": 1, + "xOffset": 0, + "yOffset": 0, + "checker": "None", + "tileMode": "Single", + "pivotX": 0, + "pivotY": 0, + "outOfBoundsValue": null, + "perlinActive": false, + "perlinSeed": 9015353, + "perlinScale": 0.2, + "perlinOctaves": 2 + }, + { + "uid": 148, + "active": true, + "size": 3, + "tileIds": [103], + "chance": 1, + "breakOnMatch": true, + "pattern": [0,1000001,0,1000001,1,1000001,0,13,0], + "flipX": false, + "flipY": false, + "xModulo": 1, + "yModulo": 1, + "xOffset": 0, + "yOffset": 0, + "checker": "None", + "tileMode": "Single", + "pivotX": 0, + "pivotY": 0, + "outOfBoundsValue": null, + "perlinActive": false, + "perlinSeed": 2439642, + "perlinScale": 0.2, + "perlinOctaves": 2 + }, + { + "uid": 146, + "active": true, + "size": 3, + "tileIds": [110], + "chance": 1, + "breakOnMatch": true, + "pattern": [0,13,0,1000001,1,1000001,0,1000001,0], + "flipX": false, + "flipY": false, + "xModulo": 1, + "yModulo": 1, + "xOffset": 0, + "yOffset": 0, + "checker": "None", + "tileMode": "Single", + "pivotX": 0, + "pivotY": 0, + "outOfBoundsValue": null, + "perlinActive": false, + "perlinSeed": 2439642, + "perlinScale": 0.2, + "perlinOctaves": 2 + }, + { + "uid": 141, + "active": true, + "size": 3, + "tileIds": [99], + "chance": 1, + "breakOnMatch": true, + "pattern": [0,1000001,0,1000001,1,-1000001,0,13,0], + "flipX": false, + "flipY": false, + "xModulo": 1, + "yModulo": 1, + "xOffset": 0, + "yOffset": 0, + "checker": "None", + "tileMode": "Single", + "pivotX": 0, + "pivotY": 0, + "outOfBoundsValue": null, + "perlinActive": false, + "perlinSeed": 835221, + "perlinScale": 0.2, + "perlinOctaves": 2 + }, + { + "uid": 143, + "active": true, + "size": 3, + "tileIds": [101], + "chance": 1, + "breakOnMatch": true, + "pattern": [0,1000001,0,-1000001,1,1000001,0,13,0], + "flipX": false, + "flipY": false, + "xModulo": 1, + "yModulo": 1, + "xOffset": 0, + "yOffset": 0, + "checker": "None", + "tileMode": "Single", + "pivotX": 0, + "pivotY": 0, + "outOfBoundsValue": null, + "perlinActive": false, + "perlinSeed": 835221, + "perlinScale": 0.2, + "perlinOctaves": 2 + }, + { + "uid": 144, + "active": true, + "size": 3, + "tileIds": [106], + "chance": 1, + "breakOnMatch": true, + "pattern": [0,13,0,1000001,1,-1000001,0,1000001,0], + "flipX": false, + "flipY": false, + "xModulo": 1, + "yModulo": 1, + "xOffset": 0, + "yOffset": 0, + "checker": "None", + "tileMode": "Single", + "pivotX": 0, + "pivotY": 0, + "outOfBoundsValue": null, + "perlinActive": false, + "perlinSeed": 835221, + "perlinScale": 0.2, + "perlinOctaves": 2 + }, + { + "uid": 142, + "active": true, + "size": 3, + "tileIds": [108], + "chance": 1, + "breakOnMatch": true, + "pattern": [0,13,0,-1000001,1,1000001,0,1000001,0], + "flipX": false, + "flipY": false, + "xModulo": 1, + "yModulo": 1, + "xOffset": 0, + "yOffset": 0, + "checker": "None", + "tileMode": "Single", + "pivotX": 0, + "pivotY": 0, + "outOfBoundsValue": null, + "perlinActive": false, + "perlinSeed": 835221, + "perlinScale": 0.2, + "perlinOctaves": 2 + }, + { + "uid": 138, + "active": true, + "size": 1, + "tileIds": [102], + "chance": 1, + "breakOnMatch": true, + "pattern": [13], + "flipX": false, + "flipY": false, + "xModulo": 1, + "yModulo": 1, + "xOffset": 0, + "yOffset": 0, + "checker": "None", + "tileMode": "Single", + "pivotX": 0, + "pivotY": 0, + "outOfBoundsValue": null, + "perlinActive": false, + "perlinSeed": 7056291, + "perlinScale": 0.2, + "perlinOctaves": 2 + } + ] + }, { "uid": 81, "name": "Logic", @@ -653,6 +1055,102 @@ "active": true, "isOptional": false, "rules": [ + { + "uid": 157, + "active": true, + "size": 3, + "tileIds": [16], + "chance": 1, + "breakOnMatch": true, + "pattern": [0,1000001,0,0,2,12,0,0,0], + "flipX": true, + "flipY": false, + "xModulo": 1, + "yModulo": 1, + "xOffset": 0, + "yOffset": 0, + "checker": "None", + "tileMode": "Single", + "pivotX": 0, + "pivotY": 0, + "outOfBoundsValue": null, + "perlinActive": false, + "perlinSeed": 7140682, + "perlinScale": 0.2, + "perlinOctaves": 2 + }, + { + "uid": 58, + "active": true, + "size": 3, + "tileIds": [17], + "chance": 1, + "breakOnMatch": true, + "pattern": [0,13,0,1000001,2,0,0,0,0], + "flipX": false, + "flipY": true, + "xModulo": 1, + "yModulo": 1, + "xOffset": 0, + "yOffset": 0, + "checker": "None", + "tileMode": "Single", + "pivotX": 0, + "pivotY": 0, + "outOfBoundsValue": null, + "perlinActive": false, + "perlinSeed": 4621333, + "perlinScale": 0.2, + "perlinOctaves": 2 + }, + { + "uid": 159, + "active": true, + "size": 3, + "tileIds": [18], + "chance": 1, + "breakOnMatch": true, + "pattern": [0,13,0,0,2,1000001,0,0,0], + "flipX": false, + "flipY": true, + "xModulo": 1, + "yModulo": 1, + "xOffset": 0, + "yOffset": 0, + "checker": "None", + "tileMode": "Single", + "pivotX": 0, + "pivotY": 0, + "outOfBoundsValue": null, + "perlinActive": false, + "perlinSeed": 7076749, + "perlinScale": 0.2, + "perlinOctaves": 2 + }, + { + "uid": 56, + "active": true, + "size": 3, + "tileIds": [19], + "chance": 1, + "breakOnMatch": true, + "pattern": [0,0,0,0,2,12,0,1000001,0], + "flipX": true, + "flipY": false, + "xModulo": 1, + "yModulo": 1, + "xOffset": 0, + "yOffset": 0, + "checker": "None", + "tileMode": "Single", + "pivotX": 0, + "pivotY": 0, + "outOfBoundsValue": null, + "perlinActive": false, + "perlinSeed": 8968821, + "perlinScale": 0.2, + "perlinOctaves": 2 + }, { "uid": 57, "active": true, @@ -678,7 +1176,7 @@ "perlinOctaves": 2 }, { - "uid": 58, + "uid": 158, "active": true, "size": 3, "tileIds": [17], @@ -726,7 +1224,7 @@ "perlinOctaves": 2 }, { - "uid": 56, + "uid": 160, "active": true, "size": 3, "tileIds": [19], @@ -2823,7 +3321,7 @@ { "px": [80,136], "src": [72,48], "f": 0, "t": 105, "d": [45,350] }, { "px": [56,80], "src": [8,8], "f": 0, "t": 17, "d": [130,207] }, { "px": [32,112], "src": [0,8], "f": 0, "t": 16, "d": [129,284] }, - { "px": [16,112], "src": [8,8], "f": 0, "t": 17, "d": [58,282] }, + { "px": [16,112], "src": [8,8], "f": 0, "t": 17, "d": [158,282] }, { "px": [80,72], "src": [0,8], "f": 0, "t": 16, "d": [57,190] }, { "px": [96,64], "src": [96,8], "f": 0, "t": 28, "d": [78,172] }, { "px": [48,112], "src": [96,8], "f": 0, "t": 28, "d": [78,286] }, @@ -3759,8 +4257,8 @@ { "px": [24,16], "src": [8,8], "f": 0, "t": 17, "d": [130,43] }, { "px": [56,64], "src": [0,8], "f": 0, "t": 16, "d": [129,167] }, { "px": [144,64], "src": [0,8], "f": 0, "t": 16, "d": [129,178] }, - { "px": [80,16], "src": [24,8], "f": 0, "t": 19, "d": [56,50] }, - { "px": [96,72], "src": [24,8], "f": 0, "t": 19, "d": [56,192] }, + { "px": [80,16], "src": [24,8], "f": 0, "t": 19, "d": [160,50] }, + { "px": [96,72], "src": [24,8], "f": 0, "t": 19, "d": [160,192] }, { "px": [144,8], "src": [16,8], "f": 0, "t": 18, "d": [59,38] }, { "px": [40,128], "src": [96,8], "f": 0, "t": 28, "d": [78,325] }, { "px": [72,128], "src": [96,8], "f": 0, "t": 28, "d": [78,329] }, @@ -4190,7 +4688,7 @@ "entityInstances": [ { "__identifier": "Player", - "__grid": [1,18], + "__grid": [1,17], "__pivot": [0,0], "__tags": [], "__tile": null, @@ -4199,152 +4697,64 @@ "width": 8, "height": 8, "defUid": 31, - "px": [8,144], - "fieldInstances": [] - }, - { - "__identifier": "Trapdoor", - "__grid": [9,3], - "__pivot": [0,0], - "__tags": ["Door"], - "__tile": { "tilesetUid": 1, "x": 24, "y": 0, "w": 8, "h": 8 }, - "__smartColor": "#4B2B8D", - "iid": "6f8a7a40-02f0-11ed-9529-d178c0b9c387", - "width": 8, - "height": 8, - "defUid": 63, - "px": [72,24], - "fieldInstances": [] - }, - { - "__identifier": "Trapdoor", - "__grid": [10,3], - "__pivot": [0,0], - "__tags": ["Door"], - "__tile": { "tilesetUid": 1, "x": 24, "y": 0, "w": 8, "h": 8 }, - "__smartColor": "#4B2B8D", - "iid": "6fca1b50-02f0-11ed-9529-816d5fad9e48", - "width": 8, - "height": 8, - "defUid": 63, - "px": [80,24], - "fieldInstances": [] - }, - { - "__identifier": "Trapdoor", - "__grid": [9,9], - "__pivot": [0,0], - "__tags": ["Door"], - "__tile": { "tilesetUid": 1, "x": 24, "y": 0, "w": 8, "h": 8 }, - "__smartColor": "#4B2B8D", - "iid": "d882bb20-02f0-11ed-9529-a7375a2fc3b7", - "width": 8, - "height": 8, - "defUid": 63, - "px": [72,72], - "fieldInstances": [] - }, - { - "__identifier": "Trapdoor", - "__grid": [10,9], - "__pivot": [0,0], - "__tags": ["Door"], - "__tile": { "tilesetUid": 1, "x": 24, "y": 0, "w": 8, "h": 8 }, - "__smartColor": "#4B2B8D", - "iid": "d8e5e9c0-02f0-11ed-9529-679772105563", - "width": 8, - "height": 8, - "defUid": 63, - "px": [80,72], + "px": [8,136], "fieldInstances": [] }, { "__identifier": "Door", - "__grid": [3,18], + "__grid": [7,2], "__pivot": [0,0], "__tags": ["Door"], "__tile": { "tilesetUid": 1, "x": 16, "y": 0, "w": 8, "h": 8 }, "__smartColor": "#4B2B8D", - "iid": "78ab1c10-02f0-11ed-9529-cbfa20cb5d8f", + "iid": "c89ee550-02f0-11ed-9529-e573049b3454", "width": 8, "height": 8, "defUid": 60, - "px": [24,144], + "px": [56,16], "fieldInstances": [] }, { - "__identifier": "Door", - "__grid": [9,16], + "__identifier": "Coin", + "__grid": [9,2], "__pivot": [0,0], - "__tags": ["Door"], - "__tile": { "tilesetUid": 1, "x": 16, "y": 0, "w": 8, "h": 8 }, - "__smartColor": "#4B2B8D", - "iid": "795fc610-02f0-11ed-9529-b5ee255ca4b7", - "width": 8, - "height": 8, - "defUid": 60, - "px": [72,128], - "fieldInstances": [] - }, - { - "__identifier": "Door", - "__grid": [16,18], - "__pivot": [0,0], - "__tags": ["Door"], - "__tile": { "tilesetUid": 1, "x": 16, "y": 0, "w": 8, "h": 8 }, - "__smartColor": "#4B2B8D", - "iid": "7a0247a0-02f0-11ed-9529-b170ce028c9f", - "width": 8, - "height": 8, - "defUid": 60, - "px": [128,144], - "fieldInstances": [] - }, - { - "__identifier": "Wire", - "__grid": [4,14], - "__pivot": [0.5,0.5], "__tags": [], - "__tile": null, - "__smartColor": "#BC2634", - "iid": "2c33d320-02f0-11ed-9529-c132a85e7d55", + "__tile": { "tilesetUid": 1, "x": 32, "y": 0, "w": 8, "h": 8 }, + "__smartColor": "#E2D547", + "iid": "ced1cf50-02f0-11ed-9529-0fa138bec945", "width": 8, "height": 8, - "defUid": 93, - "px": [36,116], - "fieldInstances": [ - { "__identifier": "Point", "__value": [{ "cx": 8, "cy": 14 }], "__type": "Array", "__tile": null, "defUid": 94, "realEditorValues": [{ - "id": "V_String", - "params": ["8,14"] - }] }, - { "__identifier": "Anchor", "__value": [ true, true ], "__type": "Array", "__tile": null, "defUid": 98, "realEditorValues": [ { - "id": "V_Bool", - "params": [ true ] - }, { - "id": "V_Bool", - "params": [ true ] - } ] } - ] + "defUid": 61, + "px": [72,16], + "fieldInstances": [] }, { - "__identifier": "Wire", - "__grid": [15,14], - "__pivot": [0.5,0.5], + "__identifier": "Coin", + "__grid": [17,17], + "__pivot": [0,0], "__tags": [], - "__tile": null, - "__smartColor": "#BC2634", - "iid": "4afcd630-02f0-11ed-9529-817527ea07c7", + "__tile": { "tilesetUid": 1, "x": 32, "y": 0, "w": 8, "h": 8 }, + "__smartColor": "#E2D547", + "iid": "d0c42970-02f0-11ed-9529-cfd9701a6edd", "width": 8, "height": 8, - "defUid": 93, - "px": [124,116], - "fieldInstances": [ - { "__identifier": "Point", "__value": [{ "cx": 10, "cy": 14 }], "__type": "Array", "__tile": null, "defUid": 94, "realEditorValues": [{ - "id": "V_String", - "params": ["10,14"] - }] }, - { "__identifier": "Anchor", "__value": [ true, true ], "__type": "Array", "__tile": null, "defUid": 98, "realEditorValues": [ null, null ] } - ] + "defUid": 61, + "px": [136,136], + "fieldInstances": [] + }, + { + "__identifier": "Door", + "__grid": [15,17], + "__pivot": [0,0], + "__tags": ["Door"], + "__tile": { "tilesetUid": 1, "x": 16, "y": 0, "w": 8, "h": 8 }, + "__smartColor": "#4B2B8D", + "iid": "d50c3360-02f0-11ed-9529-b553af27cb1a", + "width": 8, + "height": 8, + "defUid": 60, + "px": [120,136], + "fieldInstances": [] } ] }, @@ -4367,41 +4777,143 @@ "visible": true, "optionalRules": [], "intGridCsv": [ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0, - 0,0,0,1,10,0,0,0,2,1,2,0,0,0,0,10,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0, - 0,1,0,0,0,0,0,0,1,0,0,0,10,0,8,0,10,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,1,1,1, - 1,1,0,0,0,0,1,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,1,1,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,1,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,1,6,1,1,1,1,6,1,1, + 1,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,0,0, + 0,10,0,0,0,0,0,10,0,0,0,0,0,2,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, + 0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,6,13,13,13,13,13,1,13,13,13,13,1,0, + 0,0,0,0,1,0,1,0,0,0,0,1,1,6,1,1,1,0,1,0,0,0,0,2,1,0,1,1,0,0,0,10,0,0,0, + 0,10,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,3,0,1,6,1,1, + 1,1,1,0,0,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,2,12,0,10,0,0,0,9, + 0,1,0,0,0,0,1,6,1,0,0,0,12,12,0,12,0,0,0,1,0,1,0,0,0,0,1,0,3,1,1,1,6,1,0, + 12,0,0,0,1,0,1,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0,3,0,1,0, + 0,0,0,0,0,8,0,0,0,1,0,1,13,13,13,13,1,13,1,13,13,13,13,13,13,13,13,13,13,1,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ], "autoLayerTiles": [ - { "px": [72,104], "src": [64,48], "f": 0, "t": 104, "d": [106,269] }, - { "px": [24,112], "src": [96,48], "f": 0, "t": 108, "d": [35,283] }, - { "px": [128,112], "src": [80,48], "f": 0, "t": 106, "d": [36,296] }, - { "px": [88,136], "src": [24,48], "f": 0, "t": 99, "d": [37,351] }, - { "px": [56,136], "src": [40,48], "f": 0, "t": 101, "d": [38,347] }, - { "px": [72,112], "src": [56,48], "f": 0, "t": 103, "d": [42,289] }, - { "px": [72,136], "src": [56,48], "f": 0, "t": 103, "d": [42,349] }, - { "px": [64,136], "src": [48,48], "f": 0, "t": 102, "d": [44,348] }, - { "px": [80,136], "src": [48,48], "f": 0, "t": 102, "d": [44,350] }, - { "px": [24,120], "src": [72,48], "f": 0, "t": 105, "d": [45,303] }, - { "px": [128,120], "src": [72,48], "f": 0, "t": 105, "d": [45,316] }, - { "px": [24,128], "src": [72,48], "f": 0, "t": 105, "d": [45,323] }, - { "px": [128,128], "src": [72,48], "f": 0, "t": 105, "d": [45,336] }, - { "px": [24,136], "src": [72,48], "f": 0, "t": 105, "d": [45,343] }, - { "px": [128,136], "src": [72,48], "f": 0, "t": 105, "d": [45,356] }, - { "px": [56,128], "src": [24,8], "f": 0, "t": 19, "d": [132,327] }, - { "px": [88,128], "src": [24,8], "f": 0, "t": 19, "d": [132,331] }, - { "px": [120,112], "src": [16,8], "f": 0, "t": 18, "d": [131,295] }, - { "px": [32,112], "src": [8,8], "f": 0, "t": 17, "d": [130,284] }, - { "px": [64,112], "src": [16,8], "f": 0, "t": 18, "d": [59,288] }, - { "px": [80,112], "src": [8,8], "f": 0, "t": 17, "d": [58,290] } + { "px": [152,104], "src": [104,48], "f": 0, "t": 109, "d": [112,279] }, + { "px": [8,24], "src": [96,48], "f": 0, "t": 108, "d": [35,61] }, + { "px": [8,64], "src": [96,48], "f": 0, "t": 108, "d": [35,161] }, + { "px": [8,96], "src": [96,48], "f": 0, "t": 108, "d": [35,241] }, + { "px": [48,112], "src": [96,48], "f": 0, "t": 108, "d": [35,286] }, + { "px": [16,8], "src": [80,48], "f": 0, "t": 106, "d": [36,22] }, + { "px": [96,24], "src": [80,48], "f": 0, "t": 106, "d": [36,72] }, + { "px": [16,40], "src": [80,48], "f": 0, "t": 106, "d": [36,102] }, + { "px": [152,40], "src": [80,48], "f": 0, "t": 106, "d": [36,119] }, + { "px": [104,64], "src": [80,48], "f": 0, "t": 106, "d": [36,173] }, + { "px": [16,80], "src": [80,48], "f": 0, "t": 106, "d": [36,202] }, + { "px": [56,96], "src": [80,48], "f": 0, "t": 106, "d": [36,247] }, + { "px": [64,112], "src": [80,48], "f": 0, "t": 106, "d": [36,288] }, + { "px": [104,120], "src": [24,48], "f": 0, "t": 99, "d": [37,313] }, + { "px": [152,144], "src": [24,48], "f": 0, "t": 99, "d": [37,379] }, + { "px": [8,40], "src": [40,48], "f": 0, "t": 101, "d": [38,101] }, + { "px": [8,80], "src": [40,48], "f": 0, "t": 101, "d": [38,201] }, + { "px": [8,144], "src": [40,48], "f": 0, "t": 101, "d": [38,361] }, + { "px": [48,24], "src": [112,48], "f": 0, "t": 110, "d": [41,66] }, + { "px": [64,64], "src": [112,48], "f": 0, "t": 110, "d": [41,168] }, + { "px": [48,144], "src": [56,48], "f": 0, "t": 103, "d": [42,366] }, + { "px": [64,144], "src": [56,48], "f": 0, "t": 103, "d": [42,368] }, + { "px": [152,72], "src": [88,48], "f": 0, "t": 107, "d": [43,199] }, + { "px": [8,8], "src": [48,48], "f": 0, "t": 102, "d": [44,21] }, + { "px": [24,24], "src": [48,48], "f": 0, "t": 102, "d": [44,63] }, + { "px": [32,24], "src": [48,48], "f": 0, "t": 102, "d": [44,64] }, + { "px": [40,24], "src": [48,48], "f": 0, "t": 102, "d": [44,65] }, + { "px": [64,24], "src": [48,48], "f": 0, "t": 102, "d": [44,68] }, + { "px": [72,24], "src": [48,48], "f": 0, "t": 102, "d": [44,69] }, + { "px": [80,24], "src": [48,48], "f": 0, "t": 102, "d": [44,70] }, + { "px": [88,24], "src": [48,48], "f": 0, "t": 102, "d": [44,71] }, + { "px": [24,96], "src": [48,48], "f": 0, "t": 102, "d": [44,243] }, + { "px": [32,96], "src": [48,48], "f": 0, "t": 102, "d": [44,244] }, + { "px": [40,96], "src": [48,48], "f": 0, "t": 102, "d": [44,245] }, + { "px": [48,96], "src": [48,48], "f": 0, "t": 102, "d": [44,246] }, + { "px": [72,120], "src": [48,48], "f": 0, "t": 102, "d": [44,309] }, + { "px": [80,120], "src": [48,48], "f": 0, "t": 102, "d": [44,310] }, + { "px": [88,120], "src": [48,48], "f": 0, "t": 102, "d": [44,311] }, + { "px": [16,16], "src": [72,48], "f": 0, "t": 105, "d": [45,42] }, + { "px": [8,32], "src": [72,48], "f": 0, "t": 105, "d": [45,81] }, + { "px": [48,32], "src": [72,48], "f": 0, "t": 105, "d": [45,86] }, + { "px": [96,32], "src": [72,48], "f": 0, "t": 105, "d": [45,92] }, + { "px": [16,48], "src": [72,48], "f": 0, "t": 105, "d": [45,122] }, + { "px": [152,48], "src": [72,48], "f": 0, "t": 105, "d": [45,139] }, + { "px": [16,56], "src": [72,48], "f": 0, "t": 105, "d": [45,142] }, + { "px": [152,56], "src": [72,48], "f": 0, "t": 105, "d": [45,159] }, + { "px": [152,64], "src": [72,48], "f": 0, "t": 105, "d": [45,179] }, + { "px": [8,72], "src": [72,48], "f": 0, "t": 105, "d": [45,181] }, + { "px": [104,72], "src": [72,48], "f": 0, "t": 105, "d": [45,193] }, + { "px": [104,80], "src": [72,48], "f": 0, "t": 105, "d": [45,213] }, + { "px": [152,80], "src": [72,48], "f": 0, "t": 105, "d": [45,219] }, + { "px": [16,88], "src": [72,48], "f": 0, "t": 105, "d": [45,222] }, + { "px": [104,88], "src": [72,48], "f": 0, "t": 105, "d": [45,233] }, + { "px": [104,96], "src": [72,48], "f": 0, "t": 105, "d": [45,253] }, + { "px": [152,96], "src": [72,48], "f": 0, "t": 105, "d": [45,259] }, + { "px": [8,104], "src": [72,48], "f": 0, "t": 105, "d": [45,261] }, + { "px": [56,104], "src": [72,48], "f": 0, "t": 105, "d": [45,267] }, + { "px": [8,112], "src": [72,48], "f": 0, "t": 105, "d": [45,281] }, + { "px": [152,112], "src": [72,48], "f": 0, "t": 105, "d": [45,299] }, + { "px": [8,120], "src": [72,48], "f": 0, "t": 105, "d": [45,301] }, + { "px": [48,120], "src": [72,48], "f": 0, "t": 105, "d": [45,306] }, + { "px": [152,120], "src": [72,48], "f": 0, "t": 105, "d": [45,319] }, + { "px": [8,128], "src": [72,48], "f": 0, "t": 105, "d": [45,321] }, + { "px": [48,128], "src": [72,48], "f": 0, "t": 105, "d": [45,326] }, + { "px": [64,128], "src": [72,48], "f": 0, "t": 105, "d": [45,328] }, + { "px": [120,128], "src": [72,48], "f": 0, "t": 105, "d": [45,335] }, + { "px": [152,128], "src": [72,48], "f": 0, "t": 105, "d": [45,339] }, + { "px": [8,136], "src": [72,48], "f": 0, "t": 105, "d": [45,341] }, + { "px": [64,136], "src": [72,48], "f": 0, "t": 105, "d": [45,348] }, + { "px": [152,136], "src": [72,48], "f": 0, "t": 105, "d": [45,359] }, + { "px": [120,104], "src": [24,8], "f": 0, "t": 19, "d": [132,275] }, + { "px": [48,40], "src": [0,8], "f": 0, "t": 16, "d": [129,106] }, + { "px": [96,40], "src": [0,8], "f": 0, "t": 16, "d": [129,112] }, + { "px": [48,80], "src": [0,8], "f": 0, "t": 16, "d": [129,206] }, + { "px": [88,80], "src": [0,8], "f": 0, "t": 16, "d": [129,211] }, + { "px": [144,40], "src": [16,8], "f": 0, "t": 18, "d": [59,118] }, + { "px": [144,72], "src": [16,8], "f": 0, "t": 18, "d": [59,198] }, + { "px": [96,104], "src": [24,8], "f": 0, "t": 19, "d": [56,272] }, + { "px": [64,120], "src": [80,8], "f": 0, "t": 26, "d": [53,308] }, + { "px": [152,88], "src": [96,8], "f": 0, "t": 28, "d": [78,239] }, + { "px": [48,136], "src": [96,8], "f": 0, "t": 28, "d": [78,346] }, + { "px": [0,8], "src": [48,48], "f": 0, "t": 102, "d": [68,20] }, + { "px": [16,24], "src": [32,8], "f": 0, "t": 20, "d": [82,62] }, + { "px": [56,24], "src": [32,8], "f": 0, "t": 20, "d": [82,67] }, + { "px": [16,64], "src": [32,8], "f": 0, "t": 20, "d": [82,162] }, + { "px": [64,72], "src": [32,8], "f": 0, "t": 20, "d": [82,188] }, + { "px": [16,96], "src": [32,8], "f": 0, "t": 20, "d": [82,242] }, + { "px": [56,112], "src": [32,8], "f": 0, "t": 20, "d": [82,287] }, + { "px": [96,120], "src": [32,8], "f": 0, "t": 20, "d": [82,312] }, + { "px": [24,64], "src": [48,48], "f": 0, "t": 102, "d": [138,163] }, + { "px": [32,64], "src": [48,48], "f": 0, "t": 102, "d": [138,164] }, + { "px": [40,64], "src": [48,48], "f": 0, "t": 102, "d": [138,165] }, + { "px": [48,64], "src": [48,48], "f": 0, "t": 102, "d": [138,166] }, + { "px": [56,64], "src": [48,48], "f": 0, "t": 102, "d": [138,167] }, + { "px": [72,64], "src": [48,48], "f": 0, "t": 102, "d": [138,169] }, + { "px": [80,64], "src": [48,48], "f": 0, "t": 102, "d": [138,170] }, + { "px": [88,64], "src": [48,48], "f": 0, "t": 102, "d": [138,171] }, + { "px": [96,64], "src": [48,48], "f": 0, "t": 102, "d": [138,172] }, + { "px": [16,144], "src": [48,48], "f": 0, "t": 102, "d": [138,362] }, + { "px": [24,144], "src": [48,48], "f": 0, "t": 102, "d": [138,363] }, + { "px": [32,144], "src": [48,48], "f": 0, "t": 102, "d": [138,364] }, + { "px": [40,144], "src": [48,48], "f": 0, "t": 102, "d": [138,365] }, + { "px": [56,144], "src": [48,48], "f": 0, "t": 102, "d": [138,367] }, + { "px": [72,144], "src": [48,48], "f": 0, "t": 102, "d": [138,369] }, + { "px": [80,144], "src": [48,48], "f": 0, "t": 102, "d": [138,370] }, + { "px": [88,144], "src": [48,48], "f": 0, "t": 102, "d": [138,371] }, + { "px": [96,144], "src": [48,48], "f": 0, "t": 102, "d": [138,372] }, + { "px": [104,144], "src": [48,48], "f": 0, "t": 102, "d": [138,373] }, + { "px": [112,144], "src": [48,48], "f": 0, "t": 102, "d": [138,374] }, + { "px": [120,144], "src": [48,48], "f": 0, "t": 102, "d": [138,375] }, + { "px": [128,144], "src": [48,48], "f": 0, "t": 102, "d": [138,376] }, + { "px": [136,144], "src": [48,48], "f": 0, "t": 102, "d": [138,377] }, + { "px": [144,144], "src": [48,48], "f": 0, "t": 102, "d": [138,378] }, + { "px": [48,72], "src": [96,48], "f": 0, "t": 108, "d": [142,186] }, + { "px": [88,72], "src": [80,48], "f": 0, "t": 106, "d": [144,191] }, + { "px": [56,72], "src": [48,48], "f": 2, "t": 102, "d": [153,187] }, + { "px": [72,72], "src": [48,48], "f": 2, "t": 102, "d": [153,189] }, + { "px": [80,72], "src": [48,48], "f": 2, "t": 102, "d": [153,190] }, + { "px": [104,104], "src": [72,48], "f": 0, "t": 105, "d": [139,273] }, + { "px": [96,112], "src": [72,48], "f": 0, "t": 105, "d": [139,292] }, + { "px": [104,112], "src": [72,48], "f": 0, "t": 105, "d": [139,293] }, + { "px": [120,112], "src": [72,48], "f": 0, "t": 105, "d": [139,295] }, + { "px": [120,120], "src": [72,48], "f": 0, "t": 105, "d": [139,315] } ], "seed": 4888981, "overrideTilesetUid": null, @@ -4427,160 +4939,164 @@ "visible": true, "optionalRules": [], "intGridCsv": [ - 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,0,0,0,0,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0, - 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,3,3,1,0,0,0,1,1,1,1,1,1,1,1,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,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,3,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,0,0,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1, - 1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,1,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0, - 0,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,1,3,3,1,1,1,1, - 1,1,1,1,3,3,1,0,0,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,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,1,1,1,0,0,0,0,1,0,0,1,1,1,1,1, + 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,3,3,3,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,0,0,0,0,0,0,0,1,1,1,1,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,3,3,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,1,1,1,1,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,0,0,0,0,0,0,0,0,0,0,1,1,1,1,3,0,3,0,0,0,0, + 0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,3,3, + 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,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, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 ], "autoLayerTiles": [ - { "px": [24,56], "src": [112,56], "f": 0, "t": 126, "d": [5,143] }, - { "px": [32,56], "src": [112,56], "f": 0, "t": 126, "d": [5,144] }, - { "px": [40,56], "src": [112,56], "f": 0, "t": 126, "d": [5,145] }, - { "px": [48,56], "src": [112,56], "f": 0, "t": 126, "d": [5,146] }, - { "px": [56,56], "src": [112,56], "f": 0, "t": 126, "d": [5,147] }, - { "px": [96,56], "src": [112,56], "f": 0, "t": 126, "d": [5,152] }, - { "px": [104,56], "src": [112,56], "f": 0, "t": 126, "d": [5,153] }, - { "px": [112,56], "src": [112,56], "f": 0, "t": 126, "d": [5,154] }, - { "px": [120,56], "src": [112,56], "f": 0, "t": 126, "d": [5,155] }, - { "px": [128,56], "src": [112,56], "f": 0, "t": 126, "d": [5,156] }, - { "px": [32,88], "src": [112,56], "f": 0, "t": 126, "d": [5,224] }, - { "px": [40,88], "src": [112,56], "f": 0, "t": 126, "d": [5,225] }, - { "px": [48,88], "src": [112,56], "f": 0, "t": 126, "d": [5,226] }, - { "px": [56,88], "src": [112,56], "f": 0, "t": 126, "d": [5,227] }, - { "px": [64,88], "src": [112,56], "f": 0, "t": 126, "d": [5,228] }, - { "px": [72,88], "src": [112,56], "f": 0, "t": 126, "d": [5,229] }, - { "px": [80,88], "src": [112,56], "f": 0, "t": 126, "d": [5,230] }, - { "px": [88,88], "src": [112,56], "f": 0, "t": 126, "d": [5,231] }, - { "px": [96,88], "src": [112,56], "f": 0, "t": 126, "d": [5,232] }, - { "px": [104,88], "src": [112,56], "f": 0, "t": 126, "d": [5,233] }, - { "px": [112,88], "src": [112,56], "f": 0, "t": 126, "d": [5,234] }, - { "px": [120,88], "src": [112,56], "f": 0, "t": 126, "d": [5,235] }, - { "px": [56,136], "src": [112,56], "f": 0, "t": 126, "d": [5,347] }, - { "px": [64,136], "src": [112,56], "f": 0, "t": 126, "d": [5,348] }, - { "px": [72,136], "src": [112,56], "f": 0, "t": 126, "d": [5,349] }, - { "px": [80,136], "src": [112,56], "f": 0, "t": 126, "d": [5,350] }, - { "px": [88,136], "src": [112,56], "f": 0, "t": 126, "d": [5,351] }, - { "px": [96,136], "src": [112,56], "f": 0, "t": 126, "d": [5,352] }, - { "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": [112,152], "src": [112,56], "f": 0, "t": 126, "d": [5,394] }, - { "px": [120,152], "src": [112,56], "f": 0, "t": 126, "d": [5,395] }, - { "px": [128,152], "src": [112,56], "f": 0, "t": 126, "d": [5,396] }, - { "px": [136,152], "src": [112,56], "f": 0, "t": 126, "d": [5,397] }, - { "px": [144,152], "src": [112,56], "f": 0, "t": 126, "d": [5,398] }, - { "px": [56,8], "src": [88,56], "f": 0, "t": 123, "d": [6,27] }, - { "px": [56,16], "src": [88,56], "f": 0, "t": 123, "d": [6,47] }, + { "px": [56,48], "src": [112,56], "f": 0, "t": 126, "d": [5,127] }, + { "px": [64,48], "src": [112,56], "f": 0, "t": 126, "d": [5,128] }, + { "px": [72,48], "src": [112,56], "f": 0, "t": 126, "d": [5,129] }, + { "px": [80,48], "src": [112,56], "f": 0, "t": 126, "d": [5,130] }, + { "px": [88,48], "src": [112,56], "f": 0, "t": 126, "d": [5,131] }, + { "px": [96,48], "src": [112,56], "f": 0, "t": 126, "d": [5,132] }, + { "px": [104,48], "src": [112,56], "f": 0, "t": 126, "d": [5,133] }, + { "px": [112,48], "src": [112,56], "f": 0, "t": 126, "d": [5,134] }, + { "px": [120,48], "src": [112,56], "f": 0, "t": 126, "d": [5,135] }, + { "px": [128,48], "src": [112,56], "f": 0, "t": 126, "d": [5,136] }, + { "px": [136,48], "src": [112,56], "f": 0, "t": 126, "d": [5,137] }, + { "px": [144,48], "src": [112,56], "f": 0, "t": 126, "d": [5,138] }, + { "px": [56,96], "src": [112,56], "f": 0, "t": 126, "d": [5,247] }, + { "px": [64,96], "src": [112,56], "f": 0, "t": 126, "d": [5,248] }, + { "px": [72,96], "src": [112,56], "f": 0, "t": 126, "d": [5,249] }, + { "px": [80,96], "src": [112,56], "f": 0, "t": 126, "d": [5,250] }, + { "px": [88,96], "src": [112,56], "f": 0, "t": 126, "d": [5,251] }, + { "px": [128,96], "src": [112,56], "f": 0, "t": 126, "d": [5,256] }, + { "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": [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": [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": [80,144], "src": [112,56], "f": 0, "t": 126, "d": [5,370] }, + { "px": [88,144], "src": [112,56], "f": 0, "t": 126, "d": [5,371] }, + { "px": [96,144], "src": [112,56], "f": 0, "t": 126, "d": [5,372] }, + { "px": [104,144], "src": [112,56], "f": 0, "t": 126, "d": [5,373] }, + { "px": [112,144], "src": [112,56], "f": 0, "t": 126, "d": [5,374] }, + { "px": [120,144], "src": [112,56], "f": 0, "t": 126, "d": [5,375] }, + { "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": [144,144], "src": [112,56], "f": 0, "t": 126, "d": [5,378] }, + { "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,24], "src": [88,56], "f": 0, "t": 123, "d": [6,62] }, + { "px": [16,32], "src": [88,56], "f": 0, "t": 123, "d": [6,82] }, { "px": [16,40], "src": [88,56], "f": 0, "t": 123, "d": [6,102] }, { "px": [16,48], "src": [88,56], "f": 0, "t": 123, "d": [6,122] }, - { "px": [64,64], "src": [88,56], "f": 0, "t": 123, "d": [6,168] }, - { "px": [0,80], "src": [88,56], "f": 0, "t": 123, "d": [6,200] }, - { "px": [0,88], "src": [88,56], "f": 0, "t": 123, "d": [6,220] }, - { "px": [0,96], "src": [88,56], "f": 0, "t": 123, "d": [6,240] }, - { "px": [128,96], "src": [88,56], "f": 0, "t": 123, "d": [6,256] }, - { "px": [0,104], "src": [88,56], "f": 0, "t": 123, "d": [6,260] }, - { "px": [128,104], "src": [88,56], "f": 0, "t": 123, "d": [6,276] }, - { "px": [0,112], "src": [88,56], "f": 0, "t": 123, "d": [6,280] }, - { "px": [0,120], "src": [88,56], "f": 0, "t": 123, "d": [6,300] }, - { "px": [104,144], "src": [88,56], "f": 0, "t": 123, "d": [6,373] }, + { "px": [16,56], "src": [88,56], "f": 0, "t": 123, "d": [6,142] }, + { "px": [16,64], "src": [88,56], "f": 0, "t": 123, "d": [6,162] }, + { "px": [16,72], "src": [88,56], "f": 0, "t": 123, "d": [6,182] }, + { "px": [16,80], "src": [88,56], "f": 0, "t": 123, "d": [6,202] }, + { "px": [16,88], "src": [88,56], "f": 0, "t": 123, "d": [6,222] }, + { "px": [16,96], "src": [88,56], "f": 0, "t": 123, "d": [6,242] }, + { "px": [16,104], "src": [88,56], "f": 0, "t": 123, "d": [6,262] }, + { "px": [88,104], "src": [88,56], "f": 0, "t": 123, "d": [6,271] }, + { "px": [16,112], "src": [88,56], "f": 0, "t": 123, "d": [6,282] }, + { "px": [16,120], "src": [88,56], "f": 0, "t": 123, "d": [6,302] }, + { "px": [24,0], "src": [56,56], "f": 0, "t": 119, "d": [7,3] }, + { "px": [32,0], "src": [56,56], "f": 0, "t": 119, "d": [7,4] }, + { "px": [40,0], "src": [56,56], "f": 0, "t": 119, "d": [7,5] }, + { "px": [48,0], "src": [56,56], "f": 0, "t": 119, "d": [7,6] }, { "px": [64,0], "src": [56,56], "f": 0, "t": 119, "d": [7,8] }, { "px": [72,0], "src": [56,56], "f": 0, "t": 119, "d": [7,9] }, - { "px": [80,0], "src": [56,56], "f": 0, "t": 119, "d": [7,10] }, - { "px": [88,0], "src": [56,56], "f": 0, "t": 119, "d": [7,11] }, - { "px": [40,24], "src": [56,56], "f": 0, "t": 119, "d": [7,65] }, - { "px": [48,24], "src": [56,56], "f": 0, "t": 119, "d": [7,66] }, - { "px": [56,24], "src": [56,56], "f": 0, "t": 119, "d": [7,67] }, + { "px": [80,24], "src": [56,56], "f": 0, "t": 119, "d": [7,70] }, + { "px": [88,24], "src": [56,56], "f": 0, "t": 119, "d": [7,71] }, { "px": [96,24], "src": [56,56], "f": 0, "t": 119, "d": [7,72] }, { "px": [104,24], "src": [56,56], "f": 0, "t": 119, "d": [7,73] }, { "px": [112,24], "src": [56,56], "f": 0, "t": 119, "d": [7,74] }, - { "px": [24,32], "src": [56,56], "f": 0, "t": 119, "d": [7,83] }, - { "px": [128,32], "src": [56,56], "f": 0, "t": 119, "d": [7,96] }, - { "px": [8,72], "src": [56,56], "f": 0, "t": 119, "d": [7,181] }, - { "px": [16,72], "src": [56,56], "f": 0, "t": 119, "d": [7,182] }, - { "px": [24,72], "src": [56,56], "f": 0, "t": 119, "d": [7,183] }, - { "px": [32,72], "src": [56,56], "f": 0, "t": 119, "d": [7,184] }, - { "px": [40,72], "src": [56,56], "f": 0, "t": 119, "d": [7,185] }, - { "px": [48,72], "src": [56,56], "f": 0, "t": 119, "d": [7,186] }, - { "px": [56,72], "src": [56,56], "f": 0, "t": 119, "d": [7,187] }, - { "px": [96,72], "src": [56,56], "f": 0, "t": 119, "d": [7,192] }, - { "px": [104,72], "src": [56,56], "f": 0, "t": 119, "d": [7,193] }, - { "px": [112,72], "src": [56,56], "f": 0, "t": 119, "d": [7,194] }, - { "px": [120,72], "src": [56,56], "f": 0, "t": 119, "d": [7,195] }, - { "px": [128,72], "src": [56,56], "f": 0, "t": 119, "d": [7,196] }, - { "px": [136,72], "src": [56,56], "f": 0, "t": 119, "d": [7,197] }, - { "px": [144,72], "src": [56,56], "f": 0, "t": 119, "d": [7,198] }, - { "px": [32,104], "src": [56,56], "f": 0, "t": 119, "d": [7,264] }, - { "px": [40,104], "src": [56,56], "f": 0, "t": 119, "d": [7,265] }, - { "px": [48,104], "src": [56,56], "f": 0, "t": 119, "d": [7,266] }, - { "px": [56,104], "src": [56,56], "f": 0, "t": 119, "d": [7,267] }, - { "px": [64,104], "src": [56,56], "f": 0, "t": 119, "d": [7,268] }, - { "px": [80,104], "src": [56,56], "f": 0, "t": 119, "d": [7,270] }, - { "px": [88,104], "src": [56,56], "f": 0, "t": 119, "d": [7,271] }, - { "px": [96,104], "src": [56,56], "f": 0, "t": 119, "d": [7,272] }, - { "px": [104,104], "src": [56,56], "f": 0, "t": 119, "d": [7,273] }, - { "px": [112,104], "src": [56,56], "f": 0, "t": 119, "d": [7,274] }, - { "px": [120,104], "src": [56,56], "f": 0, "t": 119, "d": [7,275] }, - { "px": [96,8], "src": [104,56], "f": 0, "t": 125, "d": [8,32] }, - { "px": [96,16], "src": [104,56], "f": 0, "t": 125, "d": [8,52] }, - { "px": [136,40], "src": [104,56], "f": 0, "t": 125, "d": [8,117] }, - { "px": [136,48], "src": [104,56], "f": 0, "t": 125, "d": [8,137] }, - { "px": [88,64], "src": [104,56], "f": 0, "t": 125, "d": [8,171] }, + { "px": [120,24], "src": [56,56], "f": 0, "t": 119, "d": [7,75] }, + { "px": [128,24], "src": [56,56], "f": 0, "t": 119, "d": [7,76] }, + { "px": [136,24], "src": [56,56], "f": 0, "t": 119, "d": [7,77] }, + { "px": [144,24], "src": [56,56], "f": 0, "t": 119, "d": [7,78] }, + { "px": [56,64], "src": [56,56], "f": 0, "t": 119, "d": [7,167] }, + { "px": [64,64], "src": [56,56], "f": 0, "t": 119, "d": [7,168] }, + { "px": [72,64], "src": [56,56], "f": 0, "t": 119, "d": [7,169] }, + { "px": [80,64], "src": [56,56], "f": 0, "t": 119, "d": [7,170] }, + { "px": [88,64], "src": [56,56], "f": 0, "t": 119, "d": [7,171] }, + { "px": [96,64], "src": [56,56], "f": 0, "t": 119, "d": [7,172] }, + { "px": [104,64], "src": [56,56], "f": 0, "t": 119, "d": [7,173] }, + { "px": [112,64], "src": [56,56], "f": 0, "t": 119, "d": [7,174] }, + { "px": [120,64], "src": [56,56], "f": 0, "t": 119, "d": [7,175] }, + { "px": [128,64], "src": [56,56], "f": 0, "t": 119, "d": [7,176] }, + { "px": [136,64], "src": [56,56], "f": 0, "t": 119, "d": [7,177] }, + { "px": [144,64], "src": [56,56], "f": 0, "t": 119, "d": [7,178] }, + { "px": [56,112], "src": [56,56], "f": 0, "t": 119, "d": [7,287] }, + { "px": [64,112], "src": [56,56], "f": 0, "t": 119, "d": [7,288] }, + { "px": [80,112], "src": [56,56], "f": 0, "t": 119, "d": [7,290] }, + { "px": [88,112], "src": [56,56], "f": 0, "t": 119, "d": [7,291] }, + { "px": [128,112], "src": [56,56], "f": 0, "t": 119, "d": [7,296] }, + { "px": [136,112], "src": [56,56], "f": 0, "t": 119, "d": [7,297] }, + { "px": [144,112], "src": [56,56], "f": 0, "t": 119, "d": [7,298] }, + { "px": [0,128], "src": [56,56], "f": 0, "t": 119, "d": [7,320] }, + { "px": [8,128], "src": [56,56], "f": 0, "t": 119, "d": [7,321] }, + { "px": [80,8], "src": [104,56], "f": 0, "t": 125, "d": [8,30] }, + { "px": [80,16], "src": [104,56], "f": 0, "t": 125, "d": [8,50] }, + { "px": [152,32], "src": [104,56], "f": 0, "t": 125, "d": [8,99] }, + { "px": [152,40], "src": [104,56], "f": 0, "t": 125, "d": [8,119] }, + { "px": [48,56], "src": [104,56], "f": 0, "t": 125, "d": [8,146] }, + { "px": [152,72], "src": [104,56], "f": 0, "t": 125, "d": [8,199] }, { "px": [152,80], "src": [104,56], "f": 0, "t": 125, "d": [8,219] }, { "px": [152,88], "src": [104,56], "f": 0, "t": 125, "d": [8,239] }, - { "px": [24,96], "src": [104,56], "f": 0, "t": 125, "d": [8,243] }, - { "px": [152,96], "src": [104,56], "f": 0, "t": 125, "d": [8,259] }, - { "px": [24,104], "src": [104,56], "f": 0, "t": 125, "d": [8,263] }, - { "px": [152,104], "src": [104,56], "f": 0, "t": 125, "d": [8,279] }, - { "px": [152,112], "src": [104,56], "f": 0, "t": 125, "d": [8,299] }, + { "px": [48,104], "src": [104,56], "f": 0, "t": 125, "d": [8,266] }, + { "px": [128,104], "src": [104,56], "f": 0, "t": 125, "d": [8,276] }, { "px": [152,120], "src": [104,56], "f": 0, "t": 125, "d": [8,319] }, { "px": [152,128], "src": [104,56], "f": 0, "t": 125, "d": [8,339] }, { "px": [152,136], "src": [104,56], "f": 0, "t": 125, "d": [8,359] }, - { "px": [48,144], "src": [104,56], "f": 0, "t": 125, "d": [8,366] }, - { "px": [152,144], "src": [104,56], "f": 0, "t": 125, "d": [8,379] }, - { "px": [64,24], "src": [80,56], "f": 0, "t": 122, "d": [9,68] }, - { "px": [64,56], "src": [80,56], "f": 0, "t": 122, "d": [9,148] }, - { "px": [128,88], "src": [80,56], "f": 0, "t": 122, "d": [9,236] }, - { "px": [104,136], "src": [80,56], "f": 0, "t": 122, "d": [9,353] }, - { "px": [32,32], "src": [24,56], "f": 0, "t": 115, "d": [10,84] }, - { "px": [64,72], "src": [24,56], "f": 0, "t": 115, "d": [10,188] }, - { "px": [0,128], "src": [24,56], "f": 0, "t": 115, "d": [10,320] }, - { "px": [120,32], "src": [40,56], "f": 0, "t": 117, "d": [11,95] }, - { "px": [88,72], "src": [40,56], "f": 0, "t": 117, "d": [11,191] }, - { "px": [88,24], "src": [96,56], "f": 0, "t": 124, "d": [12,71] }, - { "px": [88,56], "src": [96,56], "f": 0, "t": 124, "d": [12,151] }, - { "px": [24,88], "src": [96,56], "f": 0, "t": 124, "d": [12,223] }, - { "px": [48,136], "src": [96,56], "f": 0, "t": 124, "d": [12,346] }, - { "px": [24,112], "src": [72,56], "f": 0, "t": 121, "d": [14,283] }, - { "px": [72,112], "src": [72,56], "f": 0, "t": 121, "d": [14,289] }, - { "px": [128,112], "src": [72,56], "f": 0, "t": 121, "d": [14,296] }, - { "px": [24,120], "src": [72,56], "f": 0, "t": 121, "d": [14,303] }, - { "px": [128,120], "src": [72,56], "f": 0, "t": 121, "d": [14,316] }, - { "px": [24,128], "src": [72,56], "f": 0, "t": 121, "d": [14,323] }, - { "px": [128,128], "src": [72,56], "f": 0, "t": 121, "d": [14,336] }, - { "px": [64,32], "src": [8,56], "f": 0, "t": 113, "d": [23,88] }, - { "px": [88,32], "src": [8,56], "f": 0, "t": 113, "d": [23,91] }, - { "px": [72,120], "src": [8,56], "f": 0, "t": 113, "d": [23,309] }, - { "px": [24,136], "src": [8,56], "f": 0, "t": 113, "d": [23,343] }, - { "px": [128,136], "src": [8,56], "f": 0, "t": 113, "d": [23,356] }, - { "px": [72,32], "src": [16,16], "f": 0, "t": 34, "d": [127,89] }, - { "px": [80,32], "src": [16,16], "f": 0, "t": 34, "d": [127,90] }, - { "px": [72,56], "src": [16,16], "f": 0, "t": 34, "d": [127,149] }, - { "px": [80,56], "src": [16,16], "f": 0, "t": 34, "d": [127,150] }, - { "px": [32,136], "src": [16,16], "f": 0, "t": 34, "d": [127,344] }, - { "px": [40,136], "src": [16,16], "f": 0, "t": 34, "d": [127,345] }, - { "px": [112,136], "src": [16,16], "f": 0, "t": 34, "d": [127,354] }, - { "px": [120,136], "src": [16,16], "f": 0, "t": 34, "d": [127,355] } + { "px": [16,128], "src": [24,56], "f": 0, "t": 115, "d": [10,322] }, + { "px": [72,128], "src": [24,56], "f": 0, "t": 115, "d": [10,329] }, + { "px": [48,64], "src": [40,56], "f": 0, "t": 117, "d": [11,166] }, + { "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,96], "src": [96,56], "f": 0, "t": 124, "d": [12,246] }, + { "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": [72,24], "src": [48,56], "f": 0, "t": 118, "d": [13,69] }, + { "px": [96,96], "src": [48,56], "f": 0, "t": 118, "d": [13,252] }, + { "px": [104,96], "src": [48,56], "f": 0, "t": 118, "d": [13,253] }, + { "px": [112,96], "src": [48,56], "f": 0, "t": 118, "d": [13,254] }, + { "px": [120,96], "src": [48,56], "f": 0, "t": 118, "d": [13,255] }, + { "px": [96,112], "src": [48,56], "f": 0, "t": 118, "d": [13,292] }, + { "px": [104,112], "src": [48,56], "f": 0, "t": 118, "d": [13,293] }, + { "px": [112,112], "src": [48,56], "f": 0, "t": 118, "d": [13,294] }, + { "px": [56,128], "src": [48,56], "f": 0, "t": 118, "d": [13,327] }, + { "px": [64,128], "src": [48,56], "f": 0, "t": 118, "d": [13,328] }, + { "px": [72,120], "src": [72,56], "f": 0, "t": 121, "d": [14,309] }, + { "px": [120,120], "src": [72,56], "f": 0, "t": 121, "d": [14,315] }, + { "px": [48,24], "src": [32,56], "f": 0, "t": 116, "d": [22,66] }, + { "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": [120,128], "src": [8,56], "f": 0, "t": 113, "d": [23,335] }, + { "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,112], "src": [24,16], "f": 0, "t": 35, "d": [126,283] }, + { "px": [24,24], "src": [16,16], "f": 0, "t": 34, "d": [127,63] }, + { "px": [32,24], "src": [16,16], "f": 0, "t": 34, "d": [127,64] }, + { "px": [40,24], "src": [16,16], "f": 0, "t": 34, "d": [127,65] }, + { "px": [24,48], "src": [16,16], "f": 0, "t": 34, "d": [127,123] }, + { "px": [32,48], "src": [16,16], "f": 0, "t": 34, "d": [127,124] }, + { "px": [40,48], "src": [16,16], "f": 0, "t": 34, "d": [127,125] }, + { "px": [24,96], "src": [16,16], "f": 0, "t": 34, "d": [127,243] }, + { "px": [32,96], "src": [16,16], "f": 0, "t": 34, "d": [127,244] }, + { "px": [40,96], "src": [16,16], "f": 0, "t": 34, "d": [127,245] }, + { "px": [24,128], "src": [16,16], "f": 0, "t": 34, "d": [127,323] }, + { "px": [32,128], "src": [16,16], "f": 0, "t": 34, "d": [127,324] }, + { "px": [40,128], "src": [16,16], "f": 0, "t": 34, "d": [127,325] } ], "seed": 1103672, "overrideTilesetUid": null, diff --git a/deps/zig-ldtk b/deps/zig-ldtk index 1c85773..d1ace5b 160000 --- a/deps/zig-ldtk +++ b/deps/zig-ldtk @@ -1 +1 @@ -Subproject commit 1c85773b680b25d690b95e5c88b2e5bfe9ba534a +Subproject commit d1ace5b48eaf1caa3bce44add0d14e4fb2f10061 diff --git a/flake.lock b/flake.lock index e733d0a..cb84ef4 100644 --- a/flake.lock +++ b/flake.lock @@ -32,11 +32,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1660017629, - "narHash": "sha256-Koz6/k7c6hx4qVz/bboxdR2QsBdkxjRWpNmsOWJtXZE=", + "lastModified": 1660137652, + "narHash": "sha256-L92gcG6Ya4bqjJmStl/HTENhc0PR9lmVgTmeVpk13Os=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9f15d6c3a74d2778c6e1af67947c95f100dc6fd2", + "rev": "a7f89ddd6313ef88fc9c6534ac2511ba9da85fdb", "type": "github" }, "original": { @@ -70,11 +70,11 @@ }, "unstable": { "locked": { - "lastModified": 1659981942, - "narHash": "sha256-uCFiP/B/NXOWzhN6TKfMbSxtVMk1bVnCrnJRjCF6RmU=", + "lastModified": 1660071133, + "narHash": "sha256-XX6T9wcvEZIVWY4TO5O1d2MgFyFrF2v4TpCFs7fjdn8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "39d7f929fbcb1446ad7aa7441b04fb30625a4190", + "rev": "36cc29d837e7232e3176e4651e8e117a6f231793", "type": "github" }, "original": { @@ -89,11 +89,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1659919434, - "narHash": "sha256-U6QsM5FbFpEkqPfXwe/QvNdCWwBIXW9A3fhXo3hFps8=", + "lastModified": 1660096418, + "narHash": "sha256-+NewKwnerjOe5e65y0xwlRzoQ6JoKP2EaZLR+72d8wU=", "owner": "arqv", "repo": "zig-overlay", - "rev": "db9604e7fff0a41f06302d61dd4f320c4e23b81e", + "rev": "f7f0dd5bc40290187c70245d11b61c2305e4f114", "type": "github" }, "original": { diff --git a/src/extract.zig b/src/extract.zig index 0613a4d..577a21f 100644 --- a/src/extract.zig +++ b/src/extract.zig @@ -46,7 +46,7 @@ pub fn extractLevel(opt: Options) !void { circuit.map_size = .{ level.width, height }; w4.tracef("%d", @src().line); - var auto_map = try alloc.alloc(bool, size); + var auto_map = try alloc.alloc(world.SolidType, size); defer alloc.free(auto_map); var circuit_map = try alloc.alloc(CircuitType, size); @@ -56,7 +56,7 @@ pub fn extractLevel(opt: Options) !void { for (tiles) |data, i| { switch (data) { .tile => |tile| { - auto_map[i] = false; + auto_map[i] = .Empty; map.tiles[i] = tile; circuit_map[i] = .None; }, @@ -79,7 +79,7 @@ pub fn extractLevel(opt: Options) !void { const y = @divTrunc(i, width); const stride = width; - if (!auto_map[i]) { + if (auto_map[i] == .Empty) { autotiles[i] = null; continue; } @@ -93,25 +93,25 @@ pub fn extractLevel(opt: Options) !void { // Check horizontal neighbors if (x == 0) { west = out_of_bounds; - east = auto_map[i + 1]; + east = auto_map[i + 1] == .Solid; } else if (x == width - 1) { - west = auto_map[i - 1]; + west = auto_map[i - 1] == .Solid; east = out_of_bounds; } else { - west = auto_map[i - 1]; - east = auto_map[i + 1]; + west = auto_map[i - 1] == .Solid; + east = auto_map[i + 1] == .Solid; } // Check vertical neighbours if (y == 0) { north = out_of_bounds; - south = auto_map[i + stride]; + south = auto_map[i + stride] == .Solid; } else if (y == height - 1) { - north = auto_map[i - stride]; + north = auto_map[i - stride] == .Solid; south = out_of_bounds; } else { - north = auto_map[i - stride]; - south = auto_map[i + stride]; + north = auto_map[i - stride] == .Solid; + south = auto_map[i + stride] == .Solid; } autotiles[i] = AutoTile{ @@ -203,12 +203,18 @@ pub fn extractLevel(opt: Options) !void { for (autotiles) |autotile_opt, i| { if (autotile_opt) |autotile| { const tile = switch (circuit_map[i]) { - .Conduit, .Source, .Join => opt.conduit.find(autotile), + .Conduit, + .Conduit_Vertical, + .Conduit_Horizontal, + .Source, + .Join, + => opt.conduit.find(autotile), .Switch_On => opt.switch_on.find(autotile), .Switch_Off => opt.switch_off.find(autotile), .Plug, .Socket => opt.plug.find(autotile), .And => world.Tiles.LogicAnd, .Xor => world.Tiles.LogicXor, + .Diode => world.Tiles.LogicDiode, .None, .Outlet => 0, }; circuit.map[i] = tile; diff --git a/src/world.zig b/src/world.zig index e687e3d..08a2ba5 100644 --- a/src/world.zig +++ b/src/world.zig @@ -2,22 +2,6 @@ const std = @import("std"); -/// The CircuitType of a tile modifies how the tile responds to -/// electricity -pub const CircuitType = enum(u4) { - None = 0, - Conduit = 1, - Plug = 2, - Switch_Off = 3, - Switch_On = 4, - Join = 5, - And = 6, - Xor = 7, - Outlet = 8, - Source = 9, - Socket = 10, -}; - /// This lists the most important tiles so I don't have to keep rewriting things pub const Tiles = struct { // Switches @@ -50,9 +34,10 @@ pub const Tiles = struct { pub const LogicAnd = 20; pub const LogicNot = 21; pub const LogicXor = 22; + pub const LogicDiode = 23; pub fn is_logic(tile: u8) bool { - return tile >= 21 and tile <= 24; + return tile >= LogicAnd and tile <= LogicDiode; } pub const ConduitCross = 96; @@ -109,29 +94,52 @@ pub const Tiles = struct { }, 2); }; +pub const SolidType = enum(u2) { + Empty = 0, + Solid = 1, + Oneway = 2, +}; + +/// The CircuitType of a tile modifies how the tile responds to +/// electricity +pub const CircuitType = enum(u5) { + None = 0, + Conduit = 1, + Plug = 2, + Switch_Off = 3, + Switch_On = 4, + Join = 5, + And = 6, + Xor = 7, + Outlet = 8, + Source = 9, + Socket = 10, + Diode = 11, + Conduit_Vertical = 12, + Conduit_Horizontal = 13, +}; + pub const TileData = union(enum) { tile: u7, flags: struct { - solid: bool, + solid: SolidType, circuit: CircuitType, }, pub fn getCircuit(data: TileData) ?CircuitType { - switch (data) { - .tile => |_| return null, - .flags => |flags| { - if (flags.circuit == .None) return null; - return flags.circuit; - }, + if (data == .flags) { + return data.flags.circuit; } + return null; } pub fn toByte(data: TileData) u8 { switch (data) { .tile => |int| return 0b1000_0000 | @intCast(u8, int), .flags => |flags| { + const solid = @enumToInt(flags.solid); const circuit = @enumToInt(flags.circuit); - return (@intCast(u7, @boolToInt(flags.solid))) | (@intCast(u7, circuit) << 1); + return 0b0111_1111 & ((@intCast(u7, solid)) | (@intCast(u7, circuit) << 2)); }, } } @@ -139,13 +147,13 @@ pub const TileData = union(enum) { pub fn fromByte(byte: u8) TileData { const is_tile = (0b1000_0000 & byte) > 0; if (is_tile) { - const tile = @intCast(u7, (0b0111_1111 & byte)); + const tile = @intCast(u7, (0b0000_0011 & byte)); return TileData{ .tile = tile }; } else { - const is_solid = (0b0000_0001 & byte) > 0; - const circuit = @intCast(u4, (0b0001_1110 & byte) >> 1); + const solid = (0b0000_0011 & byte); + const circuit = @intCast(u5, (0b0111_1100 & byte) >> 2); return TileData{ .flags = .{ - .solid = is_solid, + .solid = @intToEnum(SolidType, solid), .circuit = @intToEnum(CircuitType, circuit), } }; } @@ -257,12 +265,12 @@ pub const Level = struct { size: u16, tiles: ?[]TileData, - pub fn init(x: u8, y: u8, width: u16, buf: []TileData) Level { + pub fn init(x: i8, y: i8, width: u16, buf: []TileData) Level { return Level{ .world_x = x, .world_y = y, .width = width, - .size = buf.len, + .size = @intCast(u16, buf.len), .tiles = buf, }; } @@ -310,9 +318,11 @@ pub const Level = struct { pub fn getTile(level: Level, globalc: Coord) ?TileData { const tiles = level.tiles orelse return null; const worldc = globalc.toLevelTopLeft(); + const se = worldc.add(.{ 20, 20 }); + if (!globalc.within(worldc, se)) return null; const x = globalc.val[0] - worldc.val[0]; const y = globalc.val[1] - worldc.val[1]; - const w = @intCast(i16, level.width); + const w = @intCast(i32, level.width); const i = @intCast(usize, x + y * w); return tiles[i]; } @@ -817,25 +827,30 @@ pub const Database = struct { if (visited[i]) return db.circuit_info[i].energized; visited[i] = true; const node = db.circuit_info[i]; + const w4 = @import("wasm4.zig"); switch (node.kind) { .And => |And| { + w4.tracef("[updateCircuitFragment] %d And %d %d", i, And[0], And[1]); const input1 = db.updateCircuitFragment(And[0], visited); const input2 = db.updateCircuitFragment(And[1], visited); db.circuit_info[i].energized = (input1 and input2); }, .Xor => |Xor| { + w4.tracef("[updateCircuitFragment] %d Xor", i); const input1 = db.updateCircuitFragment(Xor[0], visited); const input2 = db.updateCircuitFragment(Xor[1], visited); db.circuit_info[i].energized = (input1 and !input2) or (input2 and !input1); }, .Source => db.circuit_info[i].energized = true, .Conduit => |Conduit| { + w4.tracef("[updateCircuitFragment] %d Conduit", i); const input1 = db.updateCircuitFragment(Conduit[0], visited); const input2 = db.updateCircuitFragment(Conduit[1], visited); db.circuit_info[i].energized = (input1 or input2); }, // TODO: Sockets may come before the plug they are connected to .Socket => |socket_opt| { + w4.tracef("[updateCircuitFragment] %d Socket", i); if (socket_opt) |input| { db.circuit_info[i].energized = db.updateCircuitFragment(input, visited); } else { @@ -843,12 +858,15 @@ pub const Database = struct { } }, .Plug => |Plug| { + w4.tracef("[updateCircuitFragment] %d Plug", i); db.circuit_info[i].energized = db.updateCircuitFragment(Plug, visited); }, .Switch => |_Switch| { + w4.tracef("[updateCircuitFragment] %d Switch %d", i, _Switch.source); db.circuit_info[i].energized = db.updateCircuitFragment(_Switch.source, visited); }, .SwitchOutlet => |_Switch| { + w4.tracef("[updateCircuitFragment] %d Switch Outlet", i); const is_energized = db.updateCircuitFragment(_Switch.source, visited); const _switch = db.circuit_info[_Switch.source].kind.Switch; const _outlet = db.circuit_info[i].kind.SwitchOutlet; @@ -858,12 +876,15 @@ pub const Database = struct { db.circuit_info[i].energized = _outlet.which == _switch.state; }, .Join => |Join| { + w4.tracef("[updateCircuitFragment] %d Join", i); db.circuit_info[i].energized = db.updateCircuitFragment(Join, visited); }, .Outlet => |Outlet| { + w4.tracef("[updateCircuitFragment] %d Outlet", i); db.circuit_info[i].energized = db.updateCircuitFragment(Outlet, visited); }, } + w4.tracef("[updateCircuitFragment] %d end", i); return db.circuit_info[i].energized; } @@ -872,6 +893,8 @@ pub const Database = struct { defer alloc.free(visited); std.mem.set(bool, visited, false); var i: usize = db.circuit_info.len - 1; + const w4 = @import("wasm4.zig"); + w4.tracef("[updateCircuit] circuit info len %d", db.circuit_info.len); while (i > 0) : (i -|= 1) { _ = db.updateCircuitFragment(i, visited); if (i == 0) break; diff --git a/tools/LDtkImport.zig b/tools/LDtkImport.zig index 3bab744..43e8430 100644 --- a/tools/LDtkImport.zig +++ b/tools/LDtkImport.zig @@ -152,8 +152,8 @@ fn parseLevel(opt: struct { const layers = level.layerInstances orelse return error.NoLayers; - const world_x: i8 = @intCast(i8, @divExact(level.worldX, (ldtk.worldGridWidth orelse 160))); - const world_y: i8 = @intCast(i8, @divExact(level.worldY, (ldtk.worldGridHeight orelse 160))); + const world_x: i8 = @intCast(i8, @divFloor(level.worldX, (ldtk.worldGridWidth orelse 160))); + const world_y: i8 = @intCast(i8, @divFloor(level.worldY, (ldtk.worldGridHeight orelse 160))); var circuit_layer: ?LDtk.LayerInstance = null; var collision_layer: ?LDtk.LayerInstance = null; @@ -285,14 +285,22 @@ fn parseLevel(opt: struct { // Add circuit tiles for (circuit.intGridCsv) |cir64, i| { - const cir = @intCast(u4, cir64); + const cir = @intToEnum(world.CircuitType, @intCast(u5, cir64)); const col = collision.intGridCsv[i]; - if (col == 0 or col == 1) { - tiles[i] = world.TileData{ .flags = .{ - .solid = col == 1, - .circuit = @intToEnum(world.CircuitType, cir), - } }; - } + if (cir != .None and col == 2) return error.DebrisAndCircuitOverlapped; + if (cir == .None) continue; + const solid: world.SolidType = switch (col) { + 0 => .Empty, + 1 => .Solid, + 3 => .Oneway, + else => return error.DebrisAndCircuitOverlapped, + }; + if (cir == .Socket) + std.log.warn("[parseLevel] {}: {}", .{ i, cir }); + tiles[i] = world.TileData{ .flags = .{ + .solid = solid, + .circuit = cir, + } }; } return parsed_level; @@ -313,22 +321,15 @@ pub fn buildCircuit(alloc: std.mem.Allocator, levels: []world.Level) !std.ArrayL var sources = Queue{}; var sockets = Queue{}; - var level_hashmap = std.AutoHashMap(u16, world.Level).init(alloc); - defer level_hashmap.deinit(); - for (levels) |level| { - const id: u16 = @bitCast(u8, level.world_x) | @intCast(u16, @bitCast(u8, level.world_y)) << 8; - // So we can quickly find levels - try level_hashmap.put(id, level); - // Use a global coordinate system for our algorithm const global_x = @intCast(i16, level.world_x) * 20; const global_y = @intCast(i16, level.world_y) * 20; for (level.tiles orelse continue) |tileData, i| { const x = global_x + @intCast(i16, @mod(i, level.width)); const y = global_y + @intCast(i16, @divTrunc(i, level.width)); - const coordinate = try alloc.create(Node); - coordinate.* = .{ .data = .{ + const search_item = try alloc.create(Node); + search_item.* = .{ .data = .{ .last_node = @intCast(world.NodeID, nodes.items.len), .coord = Coord.init(.{ x, y }), } }; @@ -340,12 +341,11 @@ pub fn buildCircuit(alloc: std.mem.Allocator, levels: []world.Level) !std.ArrayL switch (flags.circuit) { .Source => { try nodes.append(.{ .kind = .Source, .coord = Coord.init(.{ x, y }) }); - sources.append(coordinate); + sources.append(search_item); }, .Socket => { - // try nodes.append(.{ .kind = .{ .Plug = null } }); - coordinate.data.last_node = std.math.maxInt(world.NodeID); - sockets.append(coordinate); + search_item.data.last_node = std.math.maxInt(world.NodeID); + sockets.append(search_item); }, else => { // Do nothing @@ -367,24 +367,22 @@ pub fn buildCircuit(alloc: std.mem.Allocator, levels: []world.Level) !std.ArrayL while (run < 2) : (run += 1) { if (run == 0) bfs_queue.concatByMoving(&sources); if (run == 1) bfs_queue.concatByMoving(&sockets); - // bfs_queue.concatByMoving(&outlets); while (bfs_queue.popFirst()) |node| { // Make sure we clean up the node's memory defer alloc.destroy(node); const coord = node.data.coord; if (visited.contains(coord)) continue; - try visited.put(coord, .{}); - // TODO remove magic numbers + try visited.put(coord, {}); + const worldc = coord.toWorld(); - const id: u16 = @bitCast(u8, worldc[0]) | @intCast(u16, @bitCast(u8, worldc[1])) << 8; - // const level_opt: ?world.Level = level_hashmap.get(.{ world_x, world_y }); - if (level_hashmap.getPtr(id) != null) { - const level = level_hashmap.getPtr(id); + // const level = getLevel(levels, worldc[0], worldc[1]); + if (getLevel(levels, worldc[0], worldc[1])) |level| { const last_node = node.data.last_node; var next_node = last_node; - const tile = level.?.getTile(coord).?; + const tile = level.getTile(coord) orelse continue; + std.log.warn("[buildCircuit] {} [{}] {}", .{ coord, node.data.last_node, tile }); if (tile != .flags) continue; const flags = tile.flags; @@ -397,6 +395,56 @@ pub fn buildCircuit(alloc: std.mem.Allocator, levels: []world.Level) !std.ArrayL // previous nodes to point to the conduit // TODO }, + .Conduit_Horizontal => { + // Skip vertical inputs + const last_coord = node.data.last_coord.?; + const input_dir: Dir = getInputDirection(coord, last_coord); + if (input_dir == .North or input_dir == .South) { + _ = visited.remove(coord); + continue; + } + const left = try alloc.create(Node); + left.* = Node{ .data = .{ + .last_node = last_node, + .coord = coord.add(.{ -1, 0 }), + .last_coord = coord, + } }; + bfs_queue.append(left); + + const right = try alloc.create(Node); + right.* = Node{ .data = .{ + .last_node = last_node, + .coord = coord.add(.{ 1, 0 }), + .last_coord = coord, + } }; + bfs_queue.append(right); + continue; + }, + .Conduit_Vertical => { + // Skip horizontal inputs + const last_coord = node.data.last_coord.?; + const input_dir: Dir = getInputDirection(coord, last_coord); + if (input_dir == .West or input_dir == .East) { + _ = visited.remove(coord); + continue; + } + const up = try alloc.create(Node); + up.* = Node{ .data = .{ + .last_node = last_node, + .coord = coord.add(.{ 0, -1 }), + .last_coord = coord, + } }; + bfs_queue.append(up); + + const down = try alloc.create(Node); + down.* = Node{ .data = .{ + .last_node = last_node, + .coord = coord.add(.{ 0, 1 }), + .last_coord = coord, + } }; + bfs_queue.append(down); + continue; + }, .Socket => { next_node = @intCast(world.NodeID, nodes.items.len); try nodes.append(.{ @@ -423,28 +471,39 @@ pub fn buildCircuit(alloc: std.mem.Allocator, levels: []world.Level) !std.ArrayL .Switch_Off, .Switch_On => { // Identify input side const last_coord = node.data.last_coord.?; - const Dir = enum { North, West, East, South }; - const input_dir: Dir = dir: { - if (last_coord.eq(coord.add(.{ 0, -1 }))) { - break :dir .North; - } else if (last_coord.eq(coord.add(.{ -1, 0 }))) { - break :dir .West; - } else if (last_coord.eq(coord.add(.{ 1, 0 }))) { - break :dir .East; - } else { - break :dir .South; - } - }; + const input_dir: Dir = getInputDirection(coord, last_coord); // Find outlets - const north_opt = level.?.getTile(coord.add(.{ 0, -1 })).?.getCircuit(); - const west_opt = level.?.getTile(coord.add(.{ -1, 0 })).?.getCircuit(); - const east_opt = level.?.getTile(coord.add(.{ 1, 0 })).?.getCircuit(); - const south_opt = level.?.getTile(coord.add(.{ 0, 1 })).?.getCircuit(); + const ncoord = coord.add(.{ 0, -1 }); + const wcoord = coord.add(.{ -1, 0 }); + const ecoord = coord.add(.{ 1, 0 }); + const scoord = coord.add(.{ 0, 1 }); - const north = (north_opt orelse world.CircuitType.None) != .None; - const west = (west_opt orelse world.CircuitType.None) != .None; - const east = (east_opt orelse world.CircuitType.None) != .None; - const south = (south_opt orelse world.CircuitType.None) != .None; + const north_opt = if (level.getTile(ncoord)) |t| t.getCircuit() else @panic("AAAAA"); + const west_opt = if (level.getTile(wcoord)) |t| t.getCircuit() else @panic("AAAAA"); + const east_opt = if (level.getTile(ecoord)) |t| t.getCircuit() else @panic("AAAAA"); + const south_opt = if (level.getTile(scoord)) |t| t.getCircuit() else @panic("AAAAA"); + + const north_tile = north_opt orelse world.CircuitType.None; + const west_tile = west_opt orelse world.CircuitType.None; + const east_tile = east_opt orelse world.CircuitType.None; + const south_tile = south_opt orelse world.CircuitType.None; + + const north = north_tile != .None and north_tile != .Conduit_Horizontal; + const west = west_tile != .None and west_tile != .Conduit_Vertical; + const east = east_tile != .None and east_tile != .Conduit_Vertical; + const south = south_tile != .None and south_tile != .Conduit_Horizontal; + + std.log.warn("[buildCircuit] {}: {} {},\n\t{} {},\n\t{} {},\n\t{} {}", .{ + coord, + north_tile, + ncoord, + west_tile, + wcoord, + east_tile, + ecoord, + south_tile, + scoord, + }); // We don't have four way switches, don't allow them std.debug.assert(west != true or east != true); @@ -480,7 +539,7 @@ pub fn buildCircuit(alloc: std.mem.Allocator, levels: []world.Level) !std.ArrayL // Add switch outlets if (input_dir != .West and west) { const out_node = @intCast(world.NodeID, nodes.items.len); - const new_coord = coord.add(.{-1, 0}); + const new_coord = coord.add(.{ -1, 0 }); try nodes.append(.{ .kind = .{ .SwitchOutlet = .{ .source = next_node, @@ -499,7 +558,7 @@ pub fn buildCircuit(alloc: std.mem.Allocator, levels: []world.Level) !std.ArrayL if (input_dir != .East and east) { const out_node = @intCast(world.NodeID, nodes.items.len); - const new_coord = coord.add(.{1, 0}); + const new_coord = coord.add(.{ 1, 0 }); try nodes.append(.{ .kind = .{ .SwitchOutlet = .{ .source = next_node, @@ -518,7 +577,7 @@ pub fn buildCircuit(alloc: std.mem.Allocator, levels: []world.Level) !std.ArrayL if (input_dir != .South and south) { const out_node = @intCast(world.NodeID, nodes.items.len); - const new_coord = coord.add(.{0, 1}); + const new_coord = coord.add(.{ 0, 1 }); try nodes.append(.{ .kind = .{ .SwitchOutlet = .{ .source = next_node, @@ -537,7 +596,7 @@ pub fn buildCircuit(alloc: std.mem.Allocator, levels: []world.Level) !std.ArrayL if (input_dir != .North and north) { const out_node = @intCast(world.NodeID, nodes.items.len); - const new_coord = coord.add(.{0, -1}); + const new_coord = coord.add(.{ 0, -1 }); try nodes.append(.{ .kind = .{ .SwitchOutlet = .{ .source = next_node, @@ -596,10 +655,34 @@ pub fn buildCircuit(alloc: std.mem.Allocator, levels: []world.Level) !std.ArrayL } } else { _ = visited.remove(coord); - if (side == .O) { + if (side != .O) { // TODO: reverse the path, since the search path // may have come from a plug - return error.OutputToSource; + next_node = @intCast(world.NodeID, nodes.items.len); + try nodes.append(.{ + .kind = .{ .And = .{ last_node, std.math.maxInt(world.NodeID) } }, + .coord = coord, + }); + std.log.warn("{}", .{nodes.items[last_node]}); + switch (nodes.items[last_node].kind) { + .And => |_and| { + if (_and[0] == std.math.maxInt(world.NodeID)) { + nodes.items[last_node].kind.And[0] = next_node; + } else if (_and[1] == std.math.maxInt(world.NodeID)) { + nodes.items[last_node].kind.And[1] = next_node; + } else { + return error.AndGateFilled; + } + }, + .SwitchOutlet => |_switch| { + _ = _switch; + std.log.warn("{}", .{nodes.items[last_node].coord}); + }, + .Socket => |socket| { + _ = socket; + }, + else => return error.Unimplemented, + } } else if (side == .L) { next_node = @intCast(world.NodeID, nodes.items.len); try nodes.append(.{ @@ -625,7 +708,7 @@ pub fn buildCircuit(alloc: std.mem.Allocator, levels: []world.Level) !std.ArrayL } }, .Xor => { - std.log.warn("XOR XOR XOR",.{}); + std.log.warn("XOR XOR XOR", .{}); // TODO: verify Xor gate is properly connected const last_coord = node.data.last_coord.?; const Side = enum { O, L, R }; @@ -679,6 +762,9 @@ pub fn buildCircuit(alloc: std.mem.Allocator, levels: []world.Level) !std.ArrayL continue; } }, + .Diode => { + // TODO + }, .None => continue, } @@ -712,10 +798,30 @@ pub fn buildCircuit(alloc: std.mem.Allocator, levels: []world.Level) !std.ArrayL bfs_queue.append(left); bfs_queue.append(down); bfs_queue.append(up); - } } } return nodes; } + +const Dir = enum { North, West, East, South }; + +fn getInputDirection(coord: world.Coordinate, last_coord: world.Coordinate) Dir { + if (last_coord.eq(coord.add(.{ 0, -1 }))) { + return .North; + } else if (last_coord.eq(coord.add(.{ -1, 0 }))) { + return .West; + } else if (last_coord.eq(coord.add(.{ 1, 0 }))) { + return .East; + } else { + return .South; + } +} + +fn getLevel(levels: []world.Level, x: i8, y: i8) ?world.Level { + for (levels) |level| { + if (level.world_x == x and level.world_y == y) return level; + } + return null; +}