From 1951d0bbcabb83717fc64a8f76c23abf3847cc21 Mon Sep 17 00:00:00 2001 From: Ulysse Cura Date: Thu, 20 Aug 2026 01:08:02 +0200 Subject: [PATCH] Documented changing map format and tiled export tool updated. --- assets/asset_builder/README.md | 46 ++-- assets/maps/dungeon_entry.map | 184 ++++++------- assets/maps/dungeon_entry.tmx | 1 - assets/maps/dungeon_room_1.map | 114 +++----- assets/maps/dungeon_room_1.tmx | 36 +-- .../tiled-extensions/json_export_tool.mjs | 258 ++++++++++++------ 6 files changed, 333 insertions(+), 306 deletions(-) diff --git a/assets/asset_builder/README.md b/assets/asset_builder/README.md index b8d76f7..23672d8 100644 --- a/assets/asset_builder/README.md +++ b/assets/asset_builder/README.md @@ -44,26 +44,26 @@ Convert from json to custom format. ### Maps asset data structure -| Description | Length | -| :-------------------------- | :------------------------------------------------ | -| Map width | unsigned int (32 bits) | -| Map height | unsigned int (32 bits) | -| Map background layer 1 data | depend on map size, tile short (16 bits) | -| Map background layer 2 data | depend on map size, tile short (16 bits) | -| Map background layer 3 data | depend on map size, tile short (16 bits) | -| Map foreground layer data | depend on map size, tile short (16 bits) | -| Map hitboxes data | depend on map size, tile unsigned char (8 bits) | -| Entities number | unsigned int (32 bits) | -| ... | | -| Entity ID | unsigned int (32 bits) | -| Entity components number | unsigned int (32 bits) | -| ... | | -| Component type | int (32 bits) | -| ... | | -| Component attributes | depend on attribute type | -| int | int (32 bits) | -| float | float (32 bits) | -| bool | bool (8 bits) | -| str | const char [] (variable length, ends with '\00') | -| ... | | -| ... | | +| Description | Length | +| :-------------------------- | :---------------------------------------------------- | +| Map width | unsigned short (16 bits) | +| Map height | unsigned short (16 bits) | +| Map background layers nb | unsigned char (8 bits) | +| Map background layers data | depends map size and layer count, tile short (16 bits)| +| Map foreground layer data | depend on map size, tile short (16 bits) | +| Tileset asset name | const char [] (variable length, ends with '\00') | +| Map hitboxes data | depend on map size, tile unsigned char (8 bits) | +| Entities number | unsigned short (16 bits) | +| ... | | +| Entity ID | unsigned int (32 bits) | +| Entity components number | unsigned short (16 bits) | +| ... | | +| Component type | unsigned int (32 bits) | +| ... | | +| Component attributes | depend on attribute type | +| int | unsigned int (32 bits) | +| float | float (32 bits) | +| bool | _Bool (8 bits) | +| str | const char [] (variable length, ends with '\00') | +| ... | | +| ... | | diff --git a/assets/maps/dungeon_entry.map b/assets/maps/dungeon_entry.map index d8d66a9..25b78e8 100644 --- a/assets/maps/dungeon_entry.map +++ b/assets/maps/dungeon_entry.map @@ -2,85 +2,87 @@ "MapWidth": 32, "MapHeight": 24, - "BackgroundLayer1": [ - 734, 733, 734, 734, 734, 732, 732, 733, 738, 707, 986, 987, 988, 648, 649, 650, 651, 652, 733, 732, 2069, 2070, 2071, 2072, 733, 734, 734, 734, 733, 1774, 1775, 1776, - 986, 987, 988, 734, 733, 734, 1432, 734, 733, 734, 1035, 1036, 1037, 697, 698, 699, 700, 701, 734, 2163, 2118, 2119, 2120, 2121, 732, 546, 733, 732, 943, 944, 945, 733, - 1035, 1036, 1037, 615, 1717, 732, 1481, 733, 732, 1083, 1084, 1085, 1086, 746, 747, 748, 749, 750, 733, 2166, 2167, 2168, 2169, 2170, 594, 595, 596, 991, 992, 993, 994, 995, - 732, 1085, 1086, 664, 733, 734, 1530, 1531, 732, 733, 733, 734, 734, 795, 796, 797, 798, 733, 1378, 2215, 2216, 2217, 2218, 2219, 643, 644, 645, 1040, 1041, 1042, 1043, 1044, - 733, 733, 733, 732, 714, 1578, 1579, 1580, 732, 733, 734, 733, 734, 734, 734, 846, 733, 734, 1427, 1428, 2265, 2266, 2267, 1497, 692, 693, 694, 1089, 1090, 1091, 1092, 1093, - 732, 734, 732, 733, 732, 1627, 1628, 1629, 733, 733, 733, 734, 734, 732, 732, 1287, 734, 734, 1476, 1477, 2314, 2315, 734, 1546, 732, 742, 743, 1138, 1139, 1140, 1141, 1142, - 733, 732, 732, 732, 734, 1676, 1677, 1678, 734, 732, 733, 734, 733, 85, 35, 85, 85, 36, 36, 733, 1283, 733, 733, 733, 732, 733, 734, 1187, 1188, 1189, 1190, 1191, - 1923, 732, 733, 733, 732, 1725, 1726, 1727, 1728, 734, 33, 231, 230, 231, 230, 230, 230, 231, 230, 230, 34, 732, 733, 1644, 733, 733, 734, 734, 732, 734, 733, 733, - 1972, 732, 908, 734, 732, 1774, 1775, 1776, 732, 33, 130, 131, 180, 180, 229, 720, 721, 229, 131, 131, 129, 230, 34, 732, 734, 733, 734, 733, 733, 734, 732, 734, - 2021, 2022, 733, 733, 959, 732, 1823, 546, 33, 130, 228, 180, 229, 229, 229, 769, 770, 180, 229, 180, 227, 229, 129, 34, 734, 732, 1721, 733, 734, 734, 732, 733, - 2070, 2071, 732, 733, 1008, 732, 594, 595, 596, 228, 280, 278, 278, 278, 278, 818, 819, 278, 278, 278, 276, 180, 227, 229, 733, 734, 1770, 1771, 733, 733, 734, 732, - 2119, 2120, 733, 733, 734, 733, 643, 644, 645, 280, 279, 732, 733, 732, 732, 734, 732, 732, 732, 733, 277, 278, 276, 180, 734, 734, 1819, 1820, 733, 734, 734, 732, - 2168, 2169, 734, 732, 733, 734, 692, 693, 694, 279, 733, 733, 734, 734, 734, 734, 734, 733, 733, 734, 733, 733, 277, 734, 732, 733, 733, 1869, 885, 733, 734, 732, - 2217, 2218, 2219, 734, 733, 732, 733, 742, 734, 734, 732, 733, 732, 734, 733, 733, 732, 733, 734, 732, 732, 734, 732, 732, 732, 732, 732, 733, 934, 733, 734, 733, - 2266, 2267, 733, 943, 944, 945, 732, 733, 734, 734, 732, 733, 732, 732, 734, 734, 733, 732, 734, 733, 732, 733, 732, 732, 734, 733, 546, 982, 983, 732, 1432, 733, - 733, 733, 991, 992, 993, 994, 995, 733, 733, 85, 734, 734, 734, 732, 732, 732, 732, 732, 734, 733, 734, 734, 733, 733, 732, 594, 595, 596, 732, 734, 1481, 732, - 734, 734, 1040, 1041, 1042, 1043, 1044, 732, 733, 732, 733, 734, 733, 734, 734, 734, 732, 734, 734, 734, 734, 733, 732, 732, 733, 643, 644, 645, 733, 733, 1530, 1531, - 733, 733, 1089, 1090, 1091, 1092, 1093, 733, 733, 733, 733, 733, 732, 734, 35, 35, 36, 734, 734, 733, 732, 733, 734, 732, 734, 692, 693, 694, 734, 732, 1579, 1580, - 734, 732, 1138, 1139, 1140, 1141, 1142, 732, 733, 734, 733, 732, 732, 734, 85, 36, 85, 732, 734, 734, 732, 733, 732, 733, 885, 741, 742, 733, 732, 1627, 1628, 1629, - 732, 732, 1187, 1188, 1189, 1190, 734, 733, 733, 732, 733, 732, 733, 35, 35, 85, 35, 732, 732, 732, 733, 734, 734, 734, 934, 733, 732, 732, 732, 1676, 1677, 1678, - 733, 734, 733, 734, 1238, 1721, 734, 732, 732, 734, 732, 732, 732, 36, 85, 85, 36, 732, 734, 734, 733, 732, 734, 733, 983, 732, 732, 732, 732, 1725, 1726, 1727, - 733, 732, 733, 733, 1287, 1770, 1771, 733, 733, 733, 734, 732, 734, 85, 85, 35, 85, 732, 734, 732, 733, 732, 734, 733, 733, 732, 732, 734, 733, 1774, 1775, 1776, - 734, 732, 734, 734, 734, 1819, 1820, 734, 733, 732, 732, 732, 734, 35, 35, 36, 35, 36, 732, 732, 734, 733, 732, 734, 734, 734, 732, 732, 734, 734, 733, 732, - 732, 733, 733, 733, 733, 732, 732, 733, 732, 734, 733, 732, 734, 732, 85, 35, 36, 35, 734, 733, 733, 732, 734, 733, 734, 732, 733, 734, 732, 733, 733, 734 + "BackgroundLayers": [ + [ + 734, 733, 734, 734, 734, 732, 732, 733, 738, 707, 986, 987, 988, 648, 649, 650, 651, 652, 733, 732, 2069, 2070, 2071, 2072, 733, 734, 734, 734, 733, 1774, 1775, 1776, + 986, 987, 988, 734, 733, 734, 1432, 734, 733, 734, 1035, 1036, 1037, 697, 698, 699, 700, 701, 734, 2163, 2118, 2119, 2120, 2121, 732, 546, 733, 732, 943, 944, 945, 733, + 1035, 1036, 1037, 615, 1717, 732, 1481, 733, 732, 1083, 1084, 1085, 1086, 746, 747, 748, 749, 750, 733, 2166, 2167, 2168, 2169, 2170, 594, 595, 596, 991, 992, 993, 994, 995, + 732, 1085, 1086, 664, 733, 734, 1530, 1531, 732, 733, 733, 734, 734, 795, 796, 797, 798, 733, 1378, 2215, 2216, 2217, 2218, 2219, 643, 644, 645, 1040, 1041, 1042, 1043, 1044, + 733, 733, 733, 732, 714, 1578, 1579, 1580, 732, 733, 734, 733, 734, 734, 734, 846, 733, 734, 1427, 1428, 2265, 2266, 2267, 1497, 692, 693, 694, 1089, 1090, 1091, 1092, 1093, + 732, 734, 732, 733, 732, 1627, 1628, 1629, 733, 733, 733, 734, 734, 732, 732, 1287, 734, 734, 1476, 1477, 2314, 2315, 734, 1546, 732, 742, 743, 1138, 1139, 1140, 1141, 1142, + 733, 732, 732, 732, 734, 1676, 1677, 1678, 734, 732, 733, 734, 733, 85, 35, 85, 85, 36, 36, 733, 1283, 733, 733, 733, 732, 733, 734, 1187, 1188, 1189, 1190, 1191, + 1923, 732, 733, 733, 732, 1725, 1726, 1727, 1728, 734, 33, 231, 230, 231, 230, 230, 230, 231, 230, 230, 34, 732, 733, 1644, 733, 733, 734, 734, 732, 734, 733, 733, + 1972, 732, 908, 734, 732, 1774, 1775, 1776, 732, 33, 130, 131, 180, 180, 229, 720, 721, 229, 131, 131, 129, 230, 34, 732, 734, 733, 734, 733, 733, 734, 732, 734, + 2021, 2022, 733, 733, 959, 732, 1823, 546, 33, 130, 228, 180, 229, 229, 229, 769, 770, 180, 229, 180, 227, 229, 129, 34, 734, 732, 1721, 733, 734, 734, 732, 733, + 2070, 2071, 732, 733, 1008, 732, 594, 595, 596, 228, 280, 278, 278, 278, 278, 818, 819, 278, 278, 278, 276, 180, 227, 229, 733, 734, 1770, 1771, 733, 733, 734, 732, + 2119, 2120, 733, 733, 734, 733, 643, 644, 645, 280, 279, 732, 733, 732, 732, 734, 732, 732, 732, 733, 277, 278, 276, 180, 734, 734, 1819, 1820, 733, 734, 734, 732, + 2168, 2169, 734, 732, 733, 734, 692, 693, 694, 279, 733, 733, 734, 734, 734, 734, 734, 733, 733, 734, 733, 733, 277, 734, 732, 733, 733, 1869, 885, 733, 734, 732, + 2217, 2218, 2219, 734, 733, 732, 733, 742, 734, 734, 732, 733, 732, 734, 733, 733, 732, 733, 734, 732, 732, 734, 732, 732, 732, 732, 732, 733, 934, 733, 734, 733, + 2266, 2267, 733, 943, 944, 945, 732, 733, 734, 734, 732, 733, 732, 732, 734, 734, 733, 732, 734, 733, 732, 733, 732, 732, 734, 733, 546, 982, 983, 732, 1432, 733, + 733, 733, 991, 992, 993, 994, 995, 733, 733, 85, 734, 734, 734, 732, 732, 732, 732, 732, 734, 733, 734, 734, 733, 733, 732, 594, 595, 596, 732, 734, 1481, 732, + 734, 734, 1040, 1041, 1042, 1043, 1044, 732, 733, 732, 733, 734, 733, 734, 734, 734, 732, 734, 734, 734, 734, 733, 732, 732, 733, 643, 644, 645, 733, 733, 1530, 1531, + 733, 733, 1089, 1090, 1091, 1092, 1093, 733, 733, 733, 733, 733, 732, 734, 35, 35, 36, 734, 734, 733, 732, 733, 734, 732, 734, 692, 693, 694, 734, 732, 1579, 1580, + 734, 732, 1138, 1139, 1140, 1141, 1142, 732, 733, 734, 733, 732, 732, 734, 85, 36, 85, 732, 734, 734, 732, 733, 732, 733, 885, 741, 742, 733, 732, 1627, 1628, 1629, + 732, 732, 1187, 1188, 1189, 1190, 734, 733, 733, 732, 733, 732, 733, 35, 35, 85, 35, 732, 732, 732, 733, 734, 734, 734, 934, 733, 732, 732, 732, 1676, 1677, 1678, + 733, 734, 733, 734, 1238, 1721, 734, 732, 732, 734, 732, 732, 732, 36, 85, 85, 36, 732, 734, 734, 733, 732, 734, 733, 983, 732, 732, 732, 732, 1725, 1726, 1727, + 733, 732, 733, 733, 1287, 1770, 1771, 733, 733, 733, 734, 732, 734, 85, 85, 35, 85, 732, 734, 732, 733, 732, 734, 733, 733, 732, 732, 734, 733, 1774, 1775, 1776, + 734, 732, 734, 734, 734, 1819, 1820, 734, 733, 732, 732, 732, 734, 35, 35, 36, 35, 36, 732, 732, 734, 733, 732, 734, 734, 734, 732, 732, 734, 734, 733, 732, + 732, 733, 733, 733, 733, 732, 732, 733, 732, 734, 733, 732, 734, 732, 85, 35, 36, 35, 734, 733, 733, 732, 734, 733, 734, 732, 733, 734, 732, 733, 733, 734 + ], + [ + 937, 938, 939, 940, 1127, 1128, 1621, 737, 706, 0, 708, 0, 647, 0, 2412, 0, 0, 2414, 2113, 2114, 1298, 1299, 1300, 1301, 496, 497, 1052, 1053, 1773, 895, 896, 0, + 0, 0, 565, 989, 1176, 1177, 0, 786, 787, 1034, 757, 758, 696, 0, 0, 0, 2412, 0, 702, 2117, 1347, 1348, 1349, 544, 545, 1352, 1101, 1102, 0, 0, 0, 1825, + 0, 613, 614, 0, 616, 1718, 618, 1482, 1081, 805, 806, 807, 745, 2411, 0, 0, 0, 2413, 751, 1330, 1396, 1397, 1398, 593, 1400, 1401, 990, 0, 0, 0, 0, 0, + 1084, 662, 663, 0, 1766, 1767, 0, 0, 1479, 854, 855, 1134, 792, 0, 0, 0, 2413, 799, 0, 1379, 1380, 1446, 1447, 642, 1449, 1450, 1039, 0, 0, 0, 0, 0, + 1133, 1134, 712, 713, 0, 715, 716, 0, 1528, 903, 1182, 1183, 1184, 1047, 1048, 0, 2373, 2352, 0, 0, 1429, 1495, 1496, 0, 1498, 1499, 1088, 0, 0, 0, 0, 0, + 1182, 1183, 1184, 762, 763, 764, 765, 0, 951, 1382, 953, 954, 0, 1285, 1286, 0, 1288, 0, 0, 1233, 1478, 1235, 2230, 0, 741, 1548, 1137, 0, 0, 0, 0, 0, + 539, 809, 810, 811, 1675, 813, 814, 0, 1679, 1001, 520, 2454, 1912, 307, 359, 359, 359, 359, 308, 1526, 1592, 2278, 2279, 1595, 790, 791, 1186, 1575, 0, 0, 0, 0, + 0, 858, 859, 860, 1724, 862, 863, 0, 0, 1442, 307, 359, 359, 355, 0, 0, 0, 0, 354, 359, 308, 1642, 543, 784, 1182, 1183, 1184, 1236, 1479, 1238, 1239, 1240, + 0, 907, 0, 909, 1773, 911, 912, 497, 709, 307, 355, 0, 0, 0, 0, 0, 0, 0, 0, 0, 354, 359, 308, 1693, 834, 1382, 1672, 1285, 1528, 1287, 1288, 0, + 0, 956, 957, 958, 0, 1823, 961, 0, 307, 355, 0, 1491, 1492, 1493, 0, 0, 0, 0, 450, 451, 2059, 0, 354, 308, 883, 1720, 0, 1334, 1335, 1336, 1337, 1149, + 0, 914, 1006, 1007, 0, 1009, 0, 0, 0, 0, 0, 1540, 1541, 1542, 0, 0, 0, 0, 499, 500, 1961, 2009, 0, 132, 508, 1769, 0, 0, 2276, 1196, 1197, 1198, + 962, 963, 1055, 1622, 1057, 1058, 0, 0, 0, 0, 1230, 0, 0, 1618, 0, 0, 0, 2352, 0, 0, 0, 490, 0, 132, 557, 1818, 0, 835, 1821, 1245, 1246, 1247, + 1011, 1012, 2170, 1643, 1644, 1645, 0, 0, 0, 0, 2401, 1681, 1682, 0, 0, 0, 0, 0, 1622, 793, 0, 539, 0, 132, 606, 1867, 1868, 933, 0, 1294, 1295, 1296, + 0, 1061, 893, 1692, 1693, 740, 1381, 0, 84, 793, 0, 0, 506, 0, 0, 0, 0, 0, 0, 0, 0, 2504, 31, 83, 850, 656, 497, 933, 0, 1343, 1344, 1345, + 0, 941, 2268, 0, 0, 0, 1430, 791, 82, 181, 32, 1573, 0, 2450, 505, 0, 0, 0, 1000, 0, 0, 31, 83, 2114, 2115, 545, 0, 547, 0, 984, 0, 1394, + 2315, 2316, 0, 1161, 0, 0, 0, 1183, 1184, 356, 82, 32, 0, 0, 0, 0, 0, 0, 0, 31, 181, 83, 0, 2163, 2164, 0, 0, 0, 1032, 1033, 0, 1443, + 1207, 1039, 1209, 1210, 0, 0, 0, 2278, 705, 2363, 2362, 82, 181, 182, 182, 181, 181, 181, 181, 83, 2512, 793, 2211, 2179, 2180, 0, 0, 0, 1081, 1529, 0, 0, + 1589, 1590, 1258, 1259, 1260, 1574, 1575, 0, 0, 0, 793, 2366, 2471, 2472, 307, 359, 308, 2422, 2423, 0, 705, 2509, 1182, 1183, 2229, 837, 0, 0, 695, 1578, 0, 0, + 1638, 1639, 1307, 1308, 1309, 1623, 1624, 0, 0, 0, 0, 2401, 0, 0, 310, 0, 358, 2471, 2472, 0, 0, 2513, 0, 2277, 0, 886, 0, 743, 744, 0, 0, 0, + 1687, 1688, 1356, 1357, 1671, 1672, 1191, 0, 0, 471, 0, 0, 0, 307, 355, 0, 358, 0, 0, 0, 0, 849, 0, 0, 0, 790, 791, 792, 1675, 0, 0, 0, + 1231, 1232, 1236, 1237, 1720, 1408, 2181, 2182, 0, 2463, 0, 0, 0, 310, 0, 305, 357, 0, 1181, 0, 0, 0, 0, 490, 0, 1182, 1183, 707, 1724, 0, 0, 0, + 1280, 1281, 1454, 1286, 1769, 0, 0, 2231, 2461, 0, 1279, 754, 0, 310, 0, 354, 308, 0, 0, 0, 0, 2412, 2415, 539, 1032, 1033, 932, 756, 1773, 0, 0, 0, + 1329, 1330, 1334, 1335, 1336, 0, 0, 2280, 1181, 0, 2462, 0, 0, 356, 306, 0, 354, 308, 0, 0, 2597, 2413, 892, 0, 1081, 980, 981, 805, 806, 1823, 1824, 1825, + 1378, 1379, 1552, 1553, 2324, 2325, 2326, 2327, 0, 0, 843, 0, 0, 1000, 356, 306, 0, 358, 0, 793, 0, 0, 2414, 1080, 0, 1029, 1030, 854, 855, 856, 0, 0 + ], + [ + 0, 0, 0, 0, 1619, 1620, 1383, 1384, 0, 0, 0, 0, 2415, 0, 0, 0, 0, 0, 653, 2068, 0, 0, 0, 0, 1302, 1303, 498, 893, 894, 0, 0, 0, + 0, 0, 0, 566, 1668, 1669, 0, 1433, 755, 756, 0, 0, 0, 0, 0, 0, 0, 0, 1280, 2117, 0, 0, 0, 1350, 1351, 0, 547, 942, 0, 0, 0, 946, + 0, 0, 0, 0, 0, 1480, 0, 0, 804, 0, 0, 0, 0, 0, 0, 0, 0, 1328, 1329, 0, 0, 0, 0, 1399, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 665, 1529, 0, 0, 853, 0, 0, 856, 1193, 0, 0, 0, 0, 1377, 0, 0, 1445, 0, 0, 1448, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 711, 0, 0, 0, 0, 0, 0, 902, 2323, 2324, 2325, 2326, 2327, 845, 0, 847, 848, 0, 0, 1494, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 490, 760, 761, 0, 0, 0, 0, 0, 1630, 952, 2373, 2374, 2375, 2376, 0, 0, 0, 1475, 0, 0, 1234, 1544, 2316, 0, 1547, 0, 0, 0, 0, 0, 0, 0, + 1874, 1875, 0, 0, 812, 0, 0, 0, 0, 1680, 1002, 1003, 0, 1334, 1335, 1336, 1337, 1524, 1525, 1282, 1592, 1284, 494, 735, 1596, 0, 1574, 0, 0, 0, 0, 0, + 0, 1924, 0, 0, 861, 0, 0, 0, 0, 661, 1443, 1863, 0, 0, 0, 0, 0, 0, 0, 1331, 1332, 1333, 1643, 0, 785, 0, 1623, 1624, 1237, 0, 1050, 1051, + 0, 1973, 1974, 0, 910, 0, 496, 0, 1777, 710, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1131, 1692, 833, 0, 1671, 0, 2177, 1286, 1098, 1099, 1100, + 0, 0, 2023, 867, 0, 960, 545, 0, 547, 548, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 882, 459, 460, 0, 2226, 2227, 1147, 1148, 0, + 0, 0, 2072, 916, 0, 593, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2412, 0, 0, 0, 358, 1919, 509, 0, 0, 1772, 0, 0, 0, + 0, 0, 2121, 1594, 966, 642, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 358, 1968, 558, 0, 0, 836, 837, 0, 0, + 0, 0, 1013, 1014, 1015, 691, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 358, 2017, 607, 0, 0, 0, 886, 0, 0, + 0, 0, 1062, 894, 895, 736, 741, 0, 310, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 305, 357, 2066, 496, 0, 498, 0, 935, 1383, 1384, + 1109, 1110, 942, 1112, 1113, 1114, 790, 0, 356, 306, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 305, 357, 0, 544, 0, 0, 0, 548, 1431, 0, 1433, + 1158, 990, 1160, 0, 1162, 1163, 1164, 2228, 0, 2366, 309, 306, 0, 0, 0, 0, 0, 0, 0, 305, 309, 357, 0, 0, 593, 0, 0, 0, 597, 1480, 0, 1482, + 0, 1208, 0, 0, 1211, 1212, 0, 0, 0, 0, 0, 356, 309, 309, 309, 309, 309, 309, 309, 357, 0, 0, 0, 2212, 642, 0, 0, 0, 646, 0, 0, 0, + 1256, 1088, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2404, 2405, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2228, 691, 0, 0, 0, 1577, 0, 0, 0, + 0, 1137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2601, 2602, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1626, 0, 0, 0, + 0, 1186, 0, 0, 1358, 1359, 1673, 0, 0, 0, 0, 0, 0, 0, 2503, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 935, 657, 658, 659, 0, 0, 0, + 0, 1404, 1405, 1406, 1407, 0, 1240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 706, 0, 708, 0, 0, 0, + 1452, 1453, 0, 1455, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2504, 0, 0, 0, 0, 0, 0, 0, 0, 931, 755, 0, 757, 758, 0, 0, + 1501, 1502, 1503, 1504, 1818, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 804, 0, 0, 807, 0, 0, + 0, 0, 1380, 0, 494, 1868, 1869, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 853, 0, 0, 0, 0, 0 + ] ], - "BackgroundLayer2": [ - 937, 938, 939, 940, 1127, 1128, 1621, 737, 706, 0, 708, 0, 647, 0, 2412, 0, 0, 2414, 2113, 2114, 1298, 1299, 1300, 1301, 496, 497, 1052, 1053, 1773, 895, 896, 0, - 0, 0, 565, 989, 1176, 1177, 0, 786, 787, 1034, 757, 758, 696, 0, 0, 0, 2412, 0, 702, 2117, 1347, 1348, 1349, 544, 545, 1352, 1101, 1102, 0, 0, 0, 1825, - 0, 613, 614, 0, 616, 1718, 618, 1482, 1081, 805, 806, 807, 745, 2411, 0, 0, 0, 2413, 751, 1330, 1396, 1397, 1398, 593, 1400, 1401, 990, 0, 0, 0, 0, 0, - 1084, 662, 663, 0, 1766, 1767, 0, 0, 1479, 854, 855, 1134, 792, 0, 0, 0, 2413, 799, 0, 1379, 1380, 1446, 1447, 642, 1449, 1450, 1039, 0, 0, 0, 0, 0, - 1133, 1134, 712, 713, 0, 715, 716, 0, 1528, 903, 1182, 1183, 1184, 1047, 1048, 0, 2373, 2352, 0, 0, 1429, 1495, 1496, 0, 1498, 1499, 1088, 0, 0, 0, 0, 0, - 1182, 1183, 1184, 762, 763, 764, 765, 0, 951, 1382, 953, 954, 0, 1285, 1286, 0, 1288, 0, 0, 1233, 1478, 1235, 2230, 0, 741, 1548, 1137, 0, 0, 0, 0, 0, - 539, 809, 810, 811, 1675, 813, 814, 0, 1679, 1001, 520, 2454, 1912, 307, 359, 359, 359, 359, 308, 1526, 1592, 2278, 2279, 1595, 790, 791, 1186, 1575, 0, 0, 0, 0, - 0, 858, 859, 860, 1724, 862, 863, 0, 0, 1442, 307, 359, 359, 355, 0, 0, 0, 0, 354, 359, 308, 1642, 543, 784, 1182, 1183, 1184, 1236, 1479, 1238, 1239, 1240, - 0, 907, 0, 909, 1773, 911, 912, 497, 709, 307, 355, 0, 0, 0, 0, 0, 0, 0, 0, 0, 354, 359, 308, 1693, 834, 1382, 1672, 1285, 1528, 1287, 1288, 0, - 0, 956, 957, 958, 0, 1823, 961, 0, 307, 355, 0, 1491, 1492, 1493, 0, 0, 0, 0, 450, 451, 2059, 0, 354, 308, 883, 1720, 0, 1334, 1335, 1336, 1337, 1149, - 0, 914, 1006, 1007, 0, 1009, 0, 0, 0, 0, 0, 1540, 1541, 1542, 0, 0, 0, 0, 499, 500, 1961, 2009, 0, 132, 508, 1769, 0, 0, 2276, 1196, 1197, 1198, - 962, 963, 1055, 1622, 1057, 1058, 0, 0, 0, 0, 1230, 0, 0, 1618, 0, 0, 0, 2352, 0, 0, 0, 490, 0, 132, 557, 1818, 0, 835, 1821, 1245, 1246, 1247, - 1011, 1012, 2170, 1643, 1644, 1645, 0, 0, 0, 0, 2401, 1681, 1682, 0, 0, 0, 0, 0, 1622, 793, 0, 539, 0, 132, 606, 1867, 1868, 933, 0, 1294, 1295, 1296, - 0, 1061, 893, 1692, 1693, 740, 1381, 0, 84, 793, 0, 0, 506, 0, 0, 0, 0, 0, 0, 0, 0, 2504, 31, 83, 850, 656, 497, 933, 0, 1343, 1344, 1345, - 0, 941, 2268, 0, 0, 0, 1430, 791, 82, 181, 32, 1573, 0, 2450, 505, 0, 0, 0, 1000, 0, 0, 31, 83, 2114, 2115, 545, 0, 547, 0, 984, 0, 1394, - 2315, 2316, 0, 1161, 0, 0, 0, 1183, 1184, 356, 82, 32, 0, 0, 0, 0, 0, 0, 0, 31, 181, 83, 0, 2163, 2164, 0, 0, 0, 1032, 1033, 0, 1443, - 1207, 1039, 1209, 1210, 0, 0, 0, 2278, 705, 2363, 2362, 82, 181, 182, 182, 181, 181, 181, 181, 83, 2512, 793, 2211, 2179, 2180, 0, 0, 0, 1081, 1529, 0, 0, - 1589, 1590, 1258, 1259, 1260, 1574, 1575, 0, 0, 0, 793, 2366, 2471, 2472, 307, 359, 308, 2422, 2423, 0, 705, 2509, 1182, 1183, 2229, 837, 0, 0, 695, 1578, 0, 0, - 1638, 1639, 1307, 1308, 1309, 1623, 1624, 0, 0, 0, 0, 2401, 0, 0, 310, 0, 358, 2471, 2472, 0, 0, 2513, 0, 2277, 0, 886, 0, 743, 744, 0, 0, 0, - 1687, 1688, 1356, 1357, 1671, 1672, 1191, 0, 0, 471, 0, 0, 0, 307, 355, 0, 358, 0, 0, 0, 0, 849, 0, 0, 0, 790, 791, 792, 1675, 0, 0, 0, - 1231, 1232, 1236, 1237, 1720, 1408, 2181, 2182, 0, 2463, 0, 0, 0, 310, 0, 305, 357, 0, 1181, 0, 0, 0, 0, 490, 0, 1182, 1183, 707, 1724, 0, 0, 0, - 1280, 1281, 1454, 1286, 1769, 0, 0, 2231, 2461, 0, 1279, 754, 0, 310, 0, 354, 308, 0, 0, 0, 0, 2412, 2415, 539, 1032, 1033, 932, 756, 1773, 0, 0, 0, - 1329, 1330, 1334, 1335, 1336, 0, 0, 2280, 1181, 0, 2462, 0, 0, 356, 306, 0, 354, 308, 0, 0, 2597, 2413, 892, 0, 1081, 980, 981, 805, 806, 1823, 1824, 1825, - 1378, 1379, 1552, 1553, 2324, 2325, 2326, 2327, 0, 0, 843, 0, 0, 1000, 356, 306, 0, 358, 0, 793, 0, 0, 2414, 1080, 0, 1029, 1030, 854, 855, 856, 0, 0 - ], - "BackgroundLayer3": [ - 0, 0, 0, 0, 1619, 1620, 1383, 1384, 0, 0, 0, 0, 2415, 0, 0, 0, 0, 0, 653, 2068, 0, 0, 0, 0, 1302, 1303, 498, 893, 894, 0, 0, 0, - 0, 0, 0, 566, 1668, 1669, 0, 1433, 755, 756, 0, 0, 0, 0, 0, 0, 0, 0, 1280, 2117, 0, 0, 0, 1350, 1351, 0, 547, 942, 0, 0, 0, 946, - 0, 0, 0, 0, 0, 1480, 0, 0, 804, 0, 0, 0, 0, 0, 0, 0, 0, 1328, 1329, 0, 0, 0, 0, 1399, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 665, 1529, 0, 0, 853, 0, 0, 856, 1193, 0, 0, 0, 0, 1377, 0, 0, 1445, 0, 0, 1448, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 711, 0, 0, 0, 0, 0, 0, 902, 2323, 2324, 2325, 2326, 2327, 845, 0, 847, 848, 0, 0, 1494, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 490, 760, 761, 0, 0, 0, 0, 0, 1630, 952, 2373, 2374, 2375, 2376, 0, 0, 0, 1475, 0, 0, 1234, 1544, 2316, 0, 1547, 0, 0, 0, 0, 0, 0, 0, - 1874, 1875, 0, 0, 812, 0, 0, 0, 0, 1680, 1002, 1003, 0, 1334, 1335, 1336, 1337, 1524, 1525, 1282, 1592, 1284, 494, 735, 1596, 0, 1574, 0, 0, 0, 0, 0, - 0, 1924, 0, 0, 861, 0, 0, 0, 0, 661, 1443, 1863, 0, 0, 0, 0, 0, 0, 0, 1331, 1332, 1333, 1643, 0, 785, 0, 1623, 1624, 1237, 0, 1050, 1051, - 0, 1973, 1974, 0, 910, 0, 496, 0, 1777, 710, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1131, 1692, 833, 0, 1671, 0, 2177, 1286, 1098, 1099, 1100, - 0, 0, 2023, 867, 0, 960, 545, 0, 547, 548, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 882, 459, 460, 0, 2226, 2227, 1147, 1148, 0, - 0, 0, 2072, 916, 0, 593, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2412, 0, 0, 0, 358, 1919, 509, 0, 0, 1772, 0, 0, 0, - 0, 0, 2121, 1594, 966, 642, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 358, 1968, 558, 0, 0, 836, 837, 0, 0, - 0, 0, 1013, 1014, 1015, 691, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 358, 2017, 607, 0, 0, 0, 886, 0, 0, - 0, 0, 1062, 894, 895, 736, 741, 0, 310, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 305, 357, 2066, 496, 0, 498, 0, 935, 1383, 1384, - 1109, 1110, 942, 1112, 1113, 1114, 790, 0, 356, 306, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 305, 357, 0, 544, 0, 0, 0, 548, 1431, 0, 1433, - 1158, 990, 1160, 0, 1162, 1163, 1164, 2228, 0, 2366, 309, 306, 0, 0, 0, 0, 0, 0, 0, 305, 309, 357, 0, 0, 593, 0, 0, 0, 597, 1480, 0, 1482, - 0, 1208, 0, 0, 1211, 1212, 0, 0, 0, 0, 0, 356, 309, 309, 309, 309, 309, 309, 309, 357, 0, 0, 0, 2212, 642, 0, 0, 0, 646, 0, 0, 0, - 1256, 1088, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2404, 2405, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2228, 691, 0, 0, 0, 1577, 0, 0, 0, - 0, 1137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2601, 2602, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1626, 0, 0, 0, - 0, 1186, 0, 0, 1358, 1359, 1673, 0, 0, 0, 0, 0, 0, 0, 2503, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 935, 657, 658, 659, 0, 0, 0, - 0, 1404, 1405, 1406, 1407, 0, 1240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 984, 706, 0, 708, 0, 0, 0, - 1452, 1453, 0, 1455, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2504, 0, 0, 0, 0, 0, 0, 0, 0, 931, 755, 0, 757, 758, 0, 0, - 1501, 1502, 1503, 1504, 1818, 0, 0, 0, 0, 0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git a/assets/maps/dungeon_entry.tmx b/assets/maps/dungeon_entry.tmx index 39cecd4..3ab3c14 100644 --- a/assets/maps/dungeon_entry.tmx +++ b/assets/maps/dungeon_entry.tmx @@ -30,5 +30,4 @@ eJwL52JgCB/Fo3gUj+IhhiOhmB52RWDBxMhRy25S5anpBnL9Rg03kGsGLfw/EHaTmg5oZTeutECrND+KR/Eopj0GAGrPIzU= - diff --git a/assets/maps/dungeon_room_1.map b/assets/maps/dungeon_room_1.map index 556f293..249ac77 100644 --- a/assets/maps/dungeon_room_1.map +++ b/assets/maps/dungeon_room_1.map @@ -2,63 +2,47 @@ "MapWidth": 14, "MapHeight": 16, - "BackgroundLayer1": [ - 13, 157, 157, 157, 157, 157, 245, 247, 157, 157, 157, 157, 157, 14, - 108, 1, 2, 2, 2, 2, 245, 247, 2, 2, 2, 2, 3, 156, - 108, 50, 51, 51, 51, 51, 245, 247, 51, 51, 51, 51, 52, 156, - 108, 196, 197, 197, 197, 197, 151, 150, 197, 197, 197, 197, 198, 156, - 108, 245, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 156, - 108, 245, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 156, - 108, 245, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 156, - 108, 245, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 156, - 108, 245, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 156, - 108, 245, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 156, - 108, 245, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 156, - 108, 245, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 156, - 108, 245, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 156, - 108, 245, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 156, - 108, 294, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 296, 156, - 62, 107, 107, 107, 107, 107, 69, 70, 107, 107, 107, 107, 107, 63 + "BackgroundLayers": [ + [ + 13, 157, 157, 157, 157, 157, 245, 247, 157, 157, 157, 157, 157, 14, + 108, 1, 2, 2, 2, 2, 245, 247, 2, 2, 2, 2, 3, 156, + 108, 50, 51, 51, 51, 51, 245, 247, 51, 51, 51, 51, 52, 156, + 108, 196, 197, 197, 197, 197, 151, 150, 197, 197, 197, 197, 198, 156, + 108, 245, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 156, + 108, 245, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 156, + 108, 245, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 156, + 108, 245, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 156, + 108, 245, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 156, + 108, 245, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 156, + 108, 245, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 156, + 108, 245, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 156, + 108, 245, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 156, + 108, 245, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 156, + 108, 294, 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, 296, 156, + 62, 107, 107, 107, 107, 107, 0, 0, 107, 107, 107, 107, 107, 63 + ], + [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 71, 72, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 120, 121, 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,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..eee9afc 100644 --- a/assets/maps/dungeon_room_1.tmx +++ b/assets/maps/dungeon_room_1.tmx @@ -1,11 +1,11 @@ - + - + - + 14,158,158,158,158,158,246,248,158,158,158,158,158,15, 109,2,3,3,3,3,246,248,3,3,3,3,4,157, @@ -22,13 +22,13 @@ 109,246,247,247,247,247,247,247,247,247,247,247,248,157, 109,246,247,247,247,247,247,247,247,247,247,247,248,157, 109,295,296,296,296,296,296,296,296,296,296,296,297,157, -63,108,108,108,108,108,70,71,108,108,108,108,108,64 +63,108,108,108,108,108,1,1,108,108,108,108,108,64 - + 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,72,73,1,1,1,1,1,1, 1,1,1,1,1,1,121,122,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, @@ -43,32 +43,12 @@ 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,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, -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,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, -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,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,23,24,1,1,1,1,1,1, -1,1,1,1,1,1,72,73,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,1,1,1,1,1,1,1,1,1,1,1,1,1, @@ -82,7 +62,7 @@ 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,21,22,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,70,71,1,1,1,1,1,1 diff --git a/assets/maps/tiled-extensions/json_export_tool.mjs b/assets/maps/tiled-extensions/json_export_tool.mjs index 8e80d81..9dae510 100644 --- a/assets/maps/tiled-extensions/json_export_tool.mjs +++ b/assets/maps/tiled-extensions/json_export_tool.mjs @@ -5,37 +5,30 @@ function stringifyFloat(floatNumber) return String(floatNumber); } - -function writeTileLayer(tileLayer, file) +function writeLayerContent(output_file, layer) { - file.writeLine(" \"" + tileLayer.name + "\": ["); - - for(let cell_y = 0; cell_y < tileLayer.height; ++cell_y) + for(let cell_y = 0; cell_y < layer.height; ++cell_y) { - file.write(" "); + output_file.write(" "); - for(let cell_x = 0; cell_x < tileLayer.width; ++cell_x) + for(let cell_x = 0; cell_x < layer.width; ++cell_x) { - file.write(" " + tileLayer.cellAt(cell_x, cell_y).tileId) - if(cell_x < tileLayer.width - 1 || cell_y < tileLayer.height - 1) - file.write(","); + output_file.file.write(" " + layer.cellAt(cell_x, cell_y).tileId) + if(cell_x < layer.width - 1 || cell_y < layer.height - 1) + output_file.file.write(","); } - file.writeLine(""); + output_file.file.writeLine(""); } - - file.writeLine(" ],"); } -function writeEntities(objectLayer, file) +function writeEntities(output_file, entitieslayer) { - file.writeLine(" \"Entities\": ["); - let entities = []; - for(let i = 0; i < objectLayer.objectCount; i++) + for(let i = 0; i < entitieslayer.objectCount; i++) { - let entity = objectLayer.objectAt(i); + let entity = entitieslayer.objectAt(i); if(entity.name) { @@ -54,46 +47,51 @@ function writeEntities(objectLayer, file) { let entity = entities[i]; - file.writeLine(" {"); - file.writeLine(" \"ID\":" + entity.name + ","); - file.writeLine(" \"Components\": ["); + output_file.writeLine("{"); + + output_file.indent_add(2); + output_file.writeLine("\"ID\":" + entity.name + ","); + output_file.writeLine("\"Components\": ["); let components = entity.properties()["components"]; let nb_components = Object.keys(components).length; + output_file.indent_add(2); + for(let j = 0; j < nb_components; j++) { let component = components[j]; let component_type = component[0]; - file.writeLine(" {"); + output_file.writeLine("{"); - file.write(" \"Type\": \"" + component_type + "\""); + output_file.indent_add(2); + output_file.write("\"Type\": \"" + component_type + "\""); if(component.length > 1) { - file.writeLine(","); - file.writeLine(" \"Attributes\": ["); + output_file.file.writeLine(","); + output_file.writeLine("\"Attributes\": ["); } // Write atributes, speciale cases need speciale treatment. if(component_type == "TRANSFORM_COMPONENT") { - file.writeLine(","); - file.writeLine(" \"Attributes\": ["); - file.writeLine(" " + stringifyFloat(entity.x) + ","); - file.writeLine(" " + stringifyFloat(entity.y) + ","); - file.writeLine(" " + stringifyFloat(entity.width) + ","); - file.writeLine(" " + stringifyFloat(entity.height)); - file.writeLine(" ]"); + output_file.file.writeLine(","); + output_file.writeLine("\"Attributes\": ["); + output_file.writeLine(" " + stringifyFloat(entity.x) + ","); + output_file.writeLine(" " + stringifyFloat(entity.y) + ","); + output_file.writeLine(" " + stringifyFloat(entity.width) + ","); + output_file.writeLine(" " + stringifyFloat(entity.height)); + output_file.writeLine("]"); } else if(component_type == "HITBOX_COMPONENT") { let hitbox; - for(let k = 0; k < objectLayer.objectCount; k++) + for(let k = 0; k < entitieslayer.objectCount; k++) { - hitbox = objectLayer.objectAt(k); + hitbox = entitieslayer.objectAt(k); if(hitbox.id === component[1].id) break; } @@ -103,18 +101,18 @@ function writeEntities(objectLayer, file) let width = hitbox.width / entity.width; let height = hitbox.height / entity.height; - file.writeLine(" " + stringifyFloat(x) + ","); - file.writeLine(" " + stringifyFloat(y) + ","); - file.writeLine(" " + stringifyFloat(width) + ","); - file.writeLine(" " + stringifyFloat(height)); + output_file.writeLine(" " + stringifyFloat(x) + ","); + output_file.writeLine(" " + stringifyFloat(y) + ","); + output_file.writeLine(" " + stringifyFloat(width) + ","); + output_file.writeLine(" " + stringifyFloat(height)); } else if(component_type == "INTERACT_COMPONENT") { let interact_box; - for(let k = 0; k < objectLayer.objectCount; k++) + for(let k = 0; k < entitieslayer.objectCount; k++) { - interact_box = objectLayer.objectAt(k); + interact_box = entitieslayer.objectAt(k); if(interact_box.id === component[1].id) break; } @@ -124,37 +122,37 @@ function writeEntities(objectLayer, file) let width = interact_box.width / entity.width; let height = interact_box.height / entity.height; - file.writeLine(" " + stringifyFloat(x) + ","); - file.writeLine(" " + stringifyFloat(y) + ","); - file.writeLine(" " + stringifyFloat(width) + ","); - file.writeLine(" " + stringifyFloat(height) + ","); + output_file.writeLine(" " + stringifyFloat(x) + ","); + output_file.writeLine(" " + stringifyFloat(y) + ","); + output_file.writeLine(" " + stringifyFloat(width) + ","); + output_file.writeLine(" " + stringifyFloat(height) + ","); - file.writeLine(" " + component[2] + ","); - file.writeLine(" " + component[3] + ","); - file.writeLine(" " + component[4]); + output_file.writeLine(" " + component[2] + ","); + output_file.writeLine(" " + component[3] + ","); + output_file.writeLine(" " + component[4]); } else if(component_type == "SPRITE_COMPONENT") { - file.writeLine(" \"" + component[1] + "\""); + output_file.writeLine(" \"" + component[1] + "\""); } else if(component_type == "ANIMATION_SYSTEM") { - file.writeLine(" " + component[1] + ","); - file.writeLine(" " + component[2] + ","); - file.writeLine(" " + stringifyFloat(component[3]) + ","); - file.writeLine(" " + component[4] + ","); - file.writeLine(" " + component[5] + ","); - file.writeLine(" " + component[6]); + output_file.writeLine(" " + component[1] + ","); + output_file.writeLine(" " + component[2] + ","); + output_file.writeLine(" " + stringifyFloat(component[3]) + ","); + output_file.writeLine(" " + component[4] + ","); + output_file.writeLine(" " + component[5] + ","); + output_file.writeLine(" " + component[6]); } else if(component_type == "LEVER_COMPONENT") { - file.writeLine(" " + component[1] + ","); - file.writeLine(" " + component[2]); + output_file.writeLine(" " + component[1] + ","); + output_file.writeLine(" " + component[2]); } else if(component_type == "DOOR_COMPONENT") { - file.writeLine(" " + component[1] + ","); - file.writeLine(" " + component[2]); + output_file.writeLine(" " + component[1] + ","); + output_file.writeLine(" " + component[2]); } else { @@ -162,23 +160,27 @@ function writeEntities(objectLayer, file) } if(component.length > 1) - file.writeLine(" ]"); + output_file.writeLine("]"); + + output_file.indent_remove(2); if(j == nb_components - 1) - file.writeLine(" }"); + output_file.writeLine("}"); else - file.writeLine(" },"); + output_file.writeLine("},"); } - file.writeLine(" ]"); + output_file.indent_remove(2); + + output_file.writeLine("]"); + + output_file.indent_remove(2); if(i == entities.length - 1) - file.writeLine(" }"); + output_file.writeLine("}"); else - file.writeLine(" },"); + output_file.writeLine("},"); } - - file.writeLine(" ]"); } var customMapFormat = { @@ -187,12 +189,44 @@ var customMapFormat = { write: function(map, fileName) { - let file = new TextFile(fileName, TextFile.WriteOnly); + let output_file = { + file: new TextFile(fileName, TextFile.WriteOnly), + indent: "", + indent_add: function(nb) + { + this.indent += " ".repeat(nb); + }, + indent_remove: function(nb) + { + this.indent = this.indent.substring(0, this.indent.length - nb); + }, - file.writeLine("{"); - file.writeLine(" \"MapWidth\": " + map.width + ","); - file.writeLine(" \"MapHeight\": " + map.height + ","); - file.writeLine(""); + write: function(content) + { + this.file.write(this.indent); + this.file.write(content); + }, + writeLine: function(content) + { + this.file.write(this.indent); + this.file.writeLine(content); + }, + commit: function() + { + this.file.commit(); + } + }; + + output_file.file.writeLine("{"); + output_file.indent_add(2); + output_file.writeLine("\"MapWidth\": " + map.width + ","); + output_file.writeLine("\"MapHeight\": " + map.height + ","); + output_file.file.writeLine(""); + + let backgroundlayers = []; + let foregroundlayer = null; + let hitboxes = null; + let entitieslayer = null; for(let i = 0; i < map.layerCount; i++) { @@ -200,17 +234,89 @@ var customMapFormat = { if(layer.isTileLayer) { - writeTileLayer(layer, file); + if(layer.name.startsWith("Background")) + { + backgroundlayers.push(layer); + } + else if(layer.name.startsWith("Foreground")) + { + foregroundlayer = layer; + } + else if(layer.name == "Hitboxes") + { + hitboxes = layer; + } + else + { + throw new Error("Invalid layer name for a tile layer : " + layer.name); + } } else if(layer.isObjectLayer) { - writeEntities(layer, file); + if(layer.name == "Entities") + { + if(entitieslayer) + throw new Error("There cannot be multiple entity layers."); + + entitieslayer = layer; + } + else + { + throw new Error("Invalid layer name for an object layer : " + layer.name); + } } } - file.write("}"); - file.commit(); - }, + if(backgroundlayers.length == 0) + { + throw new Error("At least one background layer is needed."); + } + + if(foregroundlayer == null) + { + throw new Error("A foreground layer is needed."); + } + + backgroundlayers.sort((a, b) => { + if(Number(a.name[a.name.length - 1]) > Number(b.name[b.name.length - 1])) + return 1; + + return -1; + }); + + output_file.writeLine("\"BackgroundLayers\": ["); + output_file.indent_add(2); + for(let i = 0; i < backgroundlayers.length; i++) + { + const layer = backgroundlayers[i]; + + output_file.writeLine("["); + + writeLayerContent(output_file, layer); + + if(i == backgroundlayers.length - 1) + output_file.writeLine("]"); + else + output_file.writeLine("],"); + }; + output_file.indent_remove(2); + output_file.writeLine("],"); + + output_file.writeLine("\"ForegroundLayer\": ["); + writeLayerContent(output_file, foregroundlayer); + output_file.writeLine("],"); + + output_file.writeLine("\"Entities\": ["); + output_file.indent_add(2); + if(entitieslayer) + writeEntities(output_file, entitieslayer); + output_file.indent_remove(2); + output_file.writeLine("]"); + + output_file.indent_remove(2); + output_file.write("}"); + output_file.commit(); + } } tiled.registerMapFormat("custom", customMapFormat)