Selaa lähdekoodia

开发:使用与tiled的转换脚本

xlxin 1 vuosi sitten
vanhempi
commit
7d09872565
3 muutettua tiedostoa jossa 1251 lisäystä ja 0 poistoa
  1. BIN
      TileManor/loadable/levels.bin
  2. 1038 0
      TileManor/loadable/levelsIndex.bin
  3. 213 0
      TileManor/scripts/conv_lvs.py

BIN
TileManor/loadable/levels.bin


+ 1038 - 0
TileManor/loadable/levelsIndex.bin

@@ -0,0 +1,1038 @@
+
+
+tf_nt1107_môÜ6ü
+
+tf_nt1112_mÈ7ü
+
+tf_nt1193_m¬œô
+
+tf_nt1188_mâ×ü
+
+
tf_zm0018v2_m¶‹ì
+
+tf_n1040plus1_mšš.õ
+
+tf_zm0037plus_mꋯ
+
+tf_n4037plus_mЉœ
+
+
+tf_n6168_mÆ÷à
+
+
+tf_n6404_mќ
+
+tf_zm0058plus1_mú¥È
+
+tf_nt1113_mÑç”
+
+tf_nt1108_mÝä”
+
+tf_nt1194_må—À
+
+tf_nt1189_mÏ‹¨
+
+tf_n2118plus1_m�˜1„
+
+
+tf_n6174_mòД
+
+
+tf_n6169_m•ÂØ
+
+tf_zm0101plus_mܸ5œ
+
+tf_zm0051plus_mü¾À
+
+tf_zm0046plus_mÕí%Ø
+
+tf_n2041plus1_m°ò
˜
+
+tf_n2093plus_m­õ)ô
+
+tf_n2004plus1_mÛ…9Ì
+
+tf_n4051plus_m�ë&ð
+
+tf_nt1064_mˆú/œ
+
+tf_nt1109_m–”Œ
+
+tf_nt1114_mØ“Œ
+
+tf_n1003plus_mð™7Œ
+
+tf_nt1195_m²»ü
+
+
+tf_n6180_mœû1Ø
+
+
+tf_n6406_mᄤ
+
+
+tf_n6411_mÝ£*ô
+
+tf_nt1115_m�
+
+tf_nt1120_míÝ'„
+
+tf_nt1196_m…ÅŒ
+
+tf_zm0105plus_m¹çŒ
+
+tf_zm0110plus_mºÐ¼
+
+tf_zm0055plus_mý�+¼
+
+tf_n2097plus_mòªŒ
+
+tf_zm0011plus1_mÿùÐ
+
+tf_n2022v2_mêØà
+
+
+tf_n6176_möü€
+
+
+tf_n6181_mñÐ(è
+
+
+tf_n6412_mìÄ6œ
+
+tf_n2050plus_m™í+à	
+
+tf_n2009v2plus1_mô«ˆ
+
+tf_nt1121_m¸Á2Œ
+
+tf_nt1116_mú§„
+
+tf_nt1066_mò˜-à
+
+tf_nt1197_m”bì
+
+tf_tempnm1101_mȃä
+
+tf_zm0064plus_mš¦œ
+
+tf_zm0109plus_mæã”
+
+tf_zm0114plus_mýø&Ø
+
+
+tf_n6051_m¢«�
+
+
+tf_n6182_mû¼8œ
+
+
+tf_n6177_mþ¶¨
+
+
+tf_n6413_mÀ�$œ
+
+tf_n1016plus_mÑŽ(¤
+
+tf_nt1117_möŽ„
+
+tf_nt1072_mÊç”
+
+tf_nt1067_m¬¹#œ
+
+tf_nt1122_mýš'Œ
+
+tf_nt1198_mÕþ'ü
+
+tf_n2049plus_m¬É/Ô
+
+tf_n2054plus_m¨ª¤
+
+
+tf_n6052_mÁ³Ä
+
+
+tf_n6178_m—¤Ä
+
+
+tf_n6183_mÁ¬&”
+
+
+tf_n6409_mä�2œ
+
+
+tf_n6414_mÄâ.Ø
+
+tf_n2002plus_m£¿”
+
+tf_zm0023plus1_m¬‡µ
+
+tf_nt1123_m¯Ô7¨
+
+tf_nt1118_mœ±0„
+
+tf_nt1073_mæñà
+
+tf_zm0068plus_m†áà
+
+tf_zm0123plus_m¾Õ	Ü
+
+tf_nt1199_m¼�3°
+
+tf_n1025plus_m×þ …
+
+tf_n2120plus1_m·¯„
+
+tf_zm0016plus_mœ•#Ð
+
+tf_n2063plus_mô�2À
+
+
+tf_n6179_m°†1à
+
+
+tf_n6234_m™åÐ
+
+
+tf_n6229_mÛ¼Ð
+
+tf_nt1074_m�ۜ
+
+tf_nt1069_m«Ðà
+
+tf_nt1124_mûùŒ
+
+tf_nt1119_mÁÉ”
+
+tf_n2006plus_m”«1Ð
+
+tf_n6137plus_mü¤
+
+
+tf_n6054_mÒÑœ
+
+
+tf_n6240_m�¸'¤
+
+tf_zm0030plus_m£ð8¸
+
+tf_zm0025plus_m½–* 
+
+tf_nt1125_màÛ1Œ
+
+tf_nt1080_m�Î1Ð
+
+tf_nt1130_m†úŒ
+
+tf_n2117plus_m÷ëÄ
+
+tf_zm0035plus1_m’ˆ	ô
+
+
+tf_n6241_müð3”
+
+tf_n2017v2plus4_m…—ª
+
+
+tf_n6417_mè²"œ
+
+tf_n6151plus_mÌü5à
+
+tf_nt1076_m¥§œ
+
+tf_nt1131_m÷�¸
+
+tf_nt1081_mƒ—”
+
+tf_nt1126_m·ß ô
+
+tf_n1038plus_mЗø
+
+tf_zm0029plus_m�„4¸
+
+tf_n2081plus_m•ƒ ²
+
+tf_n1024plus1_mÁýä
+
+tf_n2047v2_m€ç5¨
+
+tf_nt1077_m¸«à
+
+tf_nt1132_m†Ù
+Œ
+
+tf_nt1082_mÅÿ*¸
+
+tf_nt1127_mÕÎ+„
+
+tf_zm0078v2plus1_mꃅ
+
+tf_zm0095plus_m¢‘À
+
+tf_n2025v2plus4_m·…à
+
+tf_zm0015plus1_mÌü4Œ
+
+tf_n2085plus_mƨ
+ü
+
+tf_nt1133_mÌúÀ
+
+tf_nt1128_m‡Œ
+
+tf_nt1083_mü´!ü
+
+tf_n4043plus_mûø”
+
+tf_n4038plus_m�„,À
+
+tf_zm0026_mÈÅ#ø
+
+tf_n2057plus1_mä¡Î
+
+tf_zm0038v2plus1_mþû¸
+
+tf_n2025plus1_mì¥#À
+
+
+tf_n6058_mŸÚØ
+
+
+tf_n6244_m‡ˆü
+
+tf_zm0099plus_m²´à
+
+tf_n4052plus1_mÍ“,Ð
+
+tf_nt1079_m¤ä3Ø
+
+tf_nt1084_m¨Ô3ü
+
+tf_nt1134_mæø„
+
+tf_nt1129_m¤óÀ
+
+tf_zm0047plus_mÀ¨5œ
+
+tf_zm0102plus_mæóÞ
+
+tf_zm0052plus_måÞ&¨
+
+tf_n2094plus_mÌû.¬
+
+tf_zm0038v2plus_mŒìÀ
+
+tf_n4047plus_mÄ…Œ
+
+
+tf_n6250_mΩ	˜
+
+tf_nt1140_mˆ©4ü
+
+tf_nt1090_m�Ñ
Œ
+
+tf_nt1135_m±�
È
+
+tf_nt1085_m‰©'„
+
+tf_zm0027plus1_mÀá0ô
+
+tf_zm0032plus1_m·ÈŒ
+
+tf_nt2002_mªÛ¼
+
+tf_zm0078v2plus4_mšé¬
+
+tf_zm0051v2plus1_m¢¡”
+
+
+tf_n6251_m‹Üà
+
+
+tf_n6246_m¨Û!”
+
+tf_zm0056plus_möߘ
+
+tf_zm0106plus_mïåŒ
+
+tf_zm0061plus_mÕÖø
+
+tf_n2042plus1_má�&´
+
+tf_n2005plus1_mŸ¢°
+
+tf_nt1086_m�÷7Œ
+
+tf_nt1091_m¶´ô
+
+tf_nt1136_m–“Œ
+
+tf_nt1141_mÑ´*ü
+
+tf_n4056plus_m¹ +´
+
+tf_zm0078v2plus5_m ­õ
+
+tf_n2046plus_m�ʜ
+
+tf_n2051plus_mÓ’”
+
+
+tf_n6121_m¸Ø4œ
+
+
+tf_n6302_mر6”
+
+
+tf_n6252_mæˆÔ
+
+
+tf_n6247_m±¾+¤
+
+tf_n1016plus1_mÆýÒ
+
+tf_nt1142_mðì6„
+
+tf_nt1092_mϲÐ
+
+tf_nt1137_mçíÈ
+
+tf_nt1087_mÕ¾&œ
+
+tf_nt2004_m¦É¼
+
+
+tf_n2090_m´†#è
+
+tf_zm0115plus_mŒÉ4¬
+
+tf_zm0070plus_m’Áà
+
+tf_zm0065plus_mÞö	Ø
+
+tf_zm0078v2plus6_m¤Ë�
+
+tf_n1022plus_m›…8¤
+
+tf_nm0001_mÍÄ*ô
+
+
+tf_n6253_m̹¤
+
+
+tf_n6303_møó$”
+
+tf_nt1138_møÈ5Œ
+
+tf_nt1088_m®Ëü
+
+tf_nt1093_m¾Àü
+
+tf_nt1143_mܰ$È
+
+tf_n2049plus1_mŠÜœ
+
+tf_zm0078v2plus7_mËö…
+
+tf_n2017plus1_mÐß%…
+
+tf_zm0069plus_mŠôà
+
+tf_zm0074plus_mÒ¤-à
+
+
+tf_n6304_m€Ö/Ð
+
+
+tf_n6254_mŠÖ¬
+
+tf_nt1013_mҊ�
+
+tf_nt1144_mìš/Œ
+
+tf_nt1089_mñš„
+
+tf_nt1094_mëì”
+
+tf_nt1139_mÙâ(È
+
+tf_nt2006_møÂ¬
+
+
+tf_n1028plus1_m•‚)„
+
+tf_nt2011_mÖŒ-œ
+
+tf_n2114plus_mé÷ô
+
+
+tf_n6310_m®ó”
+
+
+tf_n6305_m»Á¨
+
+tf_n2007plus_mø¦"ð
+
+tf_zm0019plus1_mÜÕ„
+
+tf_nt1200_mø¨/ü
+
+tf_nt1095_mªÈ	”
+
+tf_nt1150_m
+
+tf_nt1145_m·�È
+
+tf_zm0083plus_m»©8Ô
+
+tf_zm0078plus_mŒä"à
+
+
+tf_n2012_mØ�5Ð
+
+tf_nt2007_m¹¬
+
+
+tf_nt2012_m—”œ
+
+tf_zm0038_müß2¬
+
+
+tf_n6125_mî‰.¬
+
+
+tf_n6256_m¥‹¬
+
+
+tf_n6311_mˆàœ
+
+
+tf_n6306_mºÛ,Ð
+
+tf_nm1002_mˆØ6ì
+
+tf_n2118plus_m¾à¤
+
+tf_nt1096_mèšÀ
+
+tf_nt1151_mä‚ô
+
+tf_nt1146_mŠé-È
+
+tf_nt2013_mˆ¤0”
+
+
+tf_n2013_måË)Ì
+
+tf_nt3011_mþÿ,Ø
+
+tf_n1045plus1_mì’3À
+
+tf_zm0087plus_môúœ
+
+tf_zm0092plus_múô”
+
+
+tf_n6131_mâëœ
+
+
+tf_n6307_mÀÔ#¤
+
+tf_n1039plus_m¦ê°
+
+tf_nt1152_mú�ü
+
+tf_nt1097_mâù
+„
+
+tf_nt1147_m„Æ"„
+
+tf_nt2009_mŒÏ!œ
+
+tf_nt2014_mŒ‡%Ð
+
+tf_n2082plus_m·å”
+
+tf_nt4010_mÇà8à
+
+tf_zm0073v2plus1_m†˜	È
+
+tf_zm0068v2plus1_mã¼ œ
+
+tf_n2051plus1_m¿•8ü
+
+tf_nt1148_mŽ˜
+¸
+
+tf_nt1153_mº˜À
+
+tf_nt1098_m·âü
+
+tf_n1048plus_m워
+
+tf_nt4006_mññ¬
+
+
+tf_zm0039plus_mõ©È
+
+tf_n1013plus3_mŽÖŒ
+
+tf_n2091plus_m’ç
+Ð
+
+tf_nm1010_m–¾ä
+
+tf_n4039plus_m³ò„
+
+tf_nt1099_m¤†0„
+
+tf_nt1154_m‘³À
+
+tf_nt1149_mîÄ
+
+
+tf_n2016_m¨•0à
+
+
+tf_n2021_m±Ýì
+
+tf_n2029plus_mћ�
+
+tf_nt2016_m±Ù)Ø
+
+tf_nt4007_mþÇè
+
+
+
+tf_n6320_m¬Î0”
+
+tf_zm0081v2plus1_m‘ÓÀ
+
+
+tf_n6315_m¦‰¼
+
+tf_zm0016plus1_mü
+
+tf_zm0103plus_mÖúü
+
+tf_nt1160_mìé1°
+
+tf_nt1155_mþ¼ô
+
+tf_n2095plus_mð¡!Œ
+
+tf_zm0053_m»
+È
+
+tf_nt4013_m¹±(”
+
+tf_tempzmm0023_m�¸8ì
+
+tf_n2043plus_m­þ%Ð
+
+
+tf_n6140_m„µ3Ä
+
+
+tf_n6502_mø®Ð
+
+tf_n4053plus1_m�Ùü
+
+tf_nt1156_måôü
+
+tf_nt1161_m÷ê„
+
+tf_tempnm0012_mÀï$¸
+
+tf_n6122plus_míÔð
+
+tf_n1042plus1_mô“"„
+
+tf_nt4009_môû6œ
+
+tf_nt4014_mùö+”
+
+tf_zm0107plus_m�¦,Ø
+
+tf_nm0015_mòÍÀ
+
+
+tf_n6317_m€t€
+
+tf_n1009plus_m��
+
+tf_n2052plus_míÕ¬
+
+tf_nt1157_m %¨
+
+tf_nt1162_mÙÝ+À
+
+tf_zm0033plus1_mäž6ô
+
+tf_zm0028plus1_m»ÿ˜
+
+tf_nt4015_m»œ ”
+
+
+tf_n6323_mÏ© ”
+
+
+tf_n6504_mï–Ø
+
+tf_zm0071plus_mæº	Ä
+
+tf_nt1163_mÿÎ ¸
+
+tf_nt1158_mñ¢(È
+
+tf_n2009plus6_m€ÿ!ô
+
+tf_n1023plus_mÑê*ô
+
+tf_zm0014plus_m¢¢Œ
+
+tf_zm0009plus_m”ù#ä
+
+tf_nt4016_m À0Œ
+
+tf_n2111plus_mñÊ&ô
+
+
+tf_n6319_m¨î2”
+
+tf_nm1015_mâï„
+
+
+tf_n6505_m¶…
+Ø
+
+tf_n1017plus1_mìó"È
+
+tf_n1022plus1_m³Ï.‘
+
+tf_n2004plus_m¯¦¨
+
+tf_nt1164_mÄÏ2¸
+
+tf_nt1159_m€±2¸
+
+tf_n2009plus7_mÆÆ-ô
+
+tf_n6135plus_m·¶Ø
+
+tf_tempnm0020_mæÒ¨
+
+tf_n1032plus_m풬
+
+tf_zm0023plus_m¼î!Ä
+
+tf_n2115plus_mŽñ„
+
+tf_nt1170_mù�
ô
+
+tf_nt1165_m±É'À
+
+tf_n2087plus1_mÙ¹)Œ
+
+tf_n2018plus1_mü¬7¬
+
+tf_n2023plus1_m’¾
þ
+
+tf_n6139plus_mä½1¬
+
+
+tf_n6331_m®´Ð
+
+tf_nt1166_m׿7¸
+
+tf_nt1171_m¶ç°
+
+tf_n1029plus1_mކÐ
+
+tf_zm0051v2plus_mÃܤ
+
+tf_tempnm0017_m‚Ú,¸
+
+tf_n2119plus_mŸÀü
+
+tf_n4032plus_m™•)¤
+
+
+tf_n6015_m¹ˆ¬
+
+tf_nm0025_mñØ'ü
+
+
+tf_n6332_mÈ”
+
+
+tf_n6327_m�«%”
+
+
+tf_n6508_mç¢Ð
+
+tf_nm1018_mõž(ü
+
+tf_tempn1018v2_m†äÜ
+
+tf_zm0025plus1_m¥õð
+
+tf_nt1172_m¯ü¨
+
+tf_n6153plus_mÇ©”
+
+tf_nt1167_mÕˆ'¨
+
+tf_zm0088plus_mõ·,é
+
+tf_tempnm0023_màèì
+
+
+tf_n6016_mðQ¤
+
+
+tf_n6147_mÜ�!”
+
+tf_zm0041plus_mÞË,¤
+
+
+tf_n6333_m˜·Œ
+
+tf_nm1019_m´™2°
+
+
+tf_n6509_m÷¼.¼
+
+tf_n2003plus1_mãÓŒ
+
+tf_n4041plus_m�í¤
+
+tf_nt1168_mâ›À
+
+tf_nt1173_m’„„
+
+tf_zm0081v2plus_m ±Ø
+
+
+tf_n2035_mý‹&ä
+
+
+tf_n6148_mÈ Ø
+
+
+tf_n6334_mòÒ”
+
+
+tf_n6515_m;(¤
+
+tf_nt1169_mÅ÷ô
+
+tf_nt1174_m¯®ô
+
+tf_zm0045plus_m¼ÍÎ
+
+tf_zm0050plus_m’ÅÐ
+
+tf_zm0100plus_m¤¾%´
+
+tf_n2092plus_m¨À7‡
+
+tf_n2087plus_m‰æ)¤
+
+tf_n4050plus_m„¹4ˆ
+
+tf_n4045plus_mØÍ%ø
+
+
+tf_n6018_m¬¤3Ø
+
+
+tf_n6154_mϧ
”
+
+
+tf_n6516_m—Ï8°
+
+tf_n2040plus_m�
+
+tf_nt1180_m„×5ü
+
+tf_n2102plus1_mî­Ð
+
+tf_nt1175_mÞç¨
+
+tf_zm0073_m€‡Ø
+
+tf_zm0054plus_mÿ«ˆ
+
+tf_zm0069v2plus_mâѤ
+
+
+tf_n6155_mªÅà
+
+
+tf_n6160_mÒ÷-œ
+
+tf_n4054plus_mᙤ
+
+tf_n1011plus_m´ó0ü
+
+tf_n1026plus1_m�ü”
+
+tf_nt1100_m‡¸À
+
+tf_n1031plus1_mÇÇœ
+
+tf_tempn1043v2_mœö.°
+
+tf_nt1176_mŒŠä
+
+tf_nt1181_m¡ñ(ô
+
+tf_n2039plus_mÜ”%Œ
+
+
+tf_n6156_m›Óœ
+
+
+tf_n6161_mãØ”
+
+tf_tempn2030_mè§%¨
+
+tf_zm0108plus_m�‹Ø
+
+tf_zm0063plus_mØ›à
+
+tf_zm0113plus_mí²+Ä
+
+tf_zm0058plus_m�­.è
+
+tf_nt1101_mø‰/ô
+
+tf_nt1182_m¬Ž6¸
+
+tf_nt1177_mŠÉ
+ü
+
+tf_zm0069v2plus1_mÁÉ*„
+
+tf_zm0011plus_m¨í5¤
+
+
+tf_n6162_m²´-”
+
+tf_tempn2031_m§ì8ü
+
+tf_nt1102_mˆÕ"„
+
+tf_nt1047_m•¢&¬
+
+
+tf_nt1178_m�‹¨
+
+tf_nt1183_m¨Î$¸
+
+tf_n4049plus1_mñì'ä
+
+tf_n6127plus_màÞ$à
+
+tf_n1038plus1_mÄG¬
+
+
+tf_zm0072plus_mÈÅ3à
+
+tf_zm0122plus_m¶´„
+
+tf_zm0117plus_mðœ„
+
+
+tf_n6158_m½¨)œ
+
+tf_n1019plus_mšä	Ä
+
+tf_zm0020plus_m׎È
+
+tf_nt1103_mºÛ-Ð
+
+tf_nt1179_mÐé/¸
+
+tf_nt1184_mô¸/¸
+
+tf_zm0077_m˜�”
+
+tf_tempn2003v2_m¨ 5˜
+
+
+tf_n6159_mÔé4ø
+
+
+tf_n6209_m½¼Ä
+
+tf_zm0076plus_mí®
¥
+
+tf_zm0081plus_mŬ
+
+tf_n2007plus1_mꇬ
+
+tf_nt1104_mÅÜ*Œ
+
+tf_nt1190_mîãÀ
+
+tf_nt1185_m³ „
+
+
+tf_n6170_m݈”
+
+
+tf_n6165_m¡…*œ
+
+tf_tempn2034_mǘ ô
+
+tf_nt1105_mș4+
+tf_nt1110_m²ÒŒ
+
+tf_nt1191_m¤Íä
+
+tf_nt1186_mŠï,ô
+
+tf_n1026v2plus1_mÛµæ
+
+tf_zm0090plus_m«ð ¬
+
+
+tf_n6035_m†æ„
+
+
+tf_n6166_m�ˆ7à
+
+
+tf_n6171_mÞ˜”
+
+
+tf_n6402_mö­œ
+
+tf_n1015v2easyv1_mÞô˜
+
+tf_nt1111_m…¥Œ
+
+tf_nt1106_m¤¿$„
+
+tf_nt1192_mºÇ°
+
+tf_nt1187_mäç#°
+
+tf_n4028plus_mðÊ 
+
+
+tf_n2049_møÄ!”
+
+
+tf_n2056plus1_m·Ó€
+
+tf_n2023plus_múÁØ
+
+
+tf_n6172_m×µà
+
+
+tf_n6167_møŠ$È

+ 213 - 0
TileManor/scripts/conv_lvs.py

@@ -0,0 +1,213 @@
+# Desc: 将用到的关卡文件压缩成程序使用的protobuf格式
+# Date: 2017-04-18
+import os
+import sys
+import json
+import levelData_pb2
+
+
+def read_json(file_path):
+    with open(file_path, 'r') as file:
+        return json.load(file)
+    
+def write_json(data, file_path):
+    with open(file_path, 'w+') as file:
+        json.dump(data, file, indent=4)
+
+# 将  ../conf/levelInstInfo.csv 里面的每一个实例的模板名加上“tf_”前缀
+def add_prefix_to_inst_name():
+    with open('../conf/levelInstInfo.csv', 'r') as f:
+        hdr_done = False
+        with open('../conf/levelInstInfo_new.csv', 'w+') as f_new:
+            for line in f.readlines():
+                if line.startswith('#'):
+                    f_new.write(line)
+                    continue
+                if not hdr_done:
+                    f_new.write(line)
+                    hdr_done = True
+                    continue
+                line = line.split(',')
+                if line[1].startswith('tf_'):
+                    f_new.write(line)
+                    continue
+                line[1] = 'tf_' + line[1]
+                f_new.write(','.join(line))
+
+# 解析 ../conf/levelInstInfo.csv 文件,得到所有被用到的模板列表
+def parse_level_inst_info():
+    temp_list = set()
+    with open('../conf/levelInstInfo.csv', 'r') as f:
+        # 跳过第一行
+        f.readline()
+        for line in f.readlines():
+            if line.startswith('#'):
+                continue
+            temp_list.add(line.split(',')[1])
+    return temp_list
+
+# 将某个tiled的json文件转换成protobuf格式
+def conver_json_to_proto(tDir, tFileName, outDir):
+    global lvFileInfo, lvInfo
+    jsonFile = os.path.join(tDir, tFileName + '.json')
+
+    with open(jsonFile, 'r') as f:#, encoding='utf-8'
+        jsonData = json.load(f)
+
+    levelData = levelData_pb2.LevelData()
+
+    levelData.tileWidth = jsonData['width']
+    levelData.tileHeight = jsonData['height']
+    cntUndefined = 0
+    tilesByPos = {}
+    maxZ = 0
+    maxX = 0
+    maxY = 0
+    #  首先得到stacked的坐标数据
+    stacked_map = {}
+    for item in jsonData['layers']:
+        name = item['name']
+        if name == 'Marks':
+            data = item['data']
+            for i in range(0, len(data)):
+                if data[i] == 0:
+                    continue
+                x = (int)(i % levelData.tileWidth)
+                y = (int)(i / (int)(levelData.tileWidth))
+                stacked_map[(x, y)] = 0
+
+    # 处理各层的tile数据
+    for item in jsonData['layers']:
+        name = item['name']
+        if not name.startswith('Tile_'):
+            # stacked
+            continue
+        z = int(name[5:])
+        data = item['data']
+        for i in range(0, len(data)):
+            if data[i] == 0:
+                continue
+            tile = levelData.tiles.add()
+            tile.x = (int)(i % levelData.tileWidth)
+            tile.y = (int)(i / (int)(levelData.tileWidth))
+            tile.z = z
+            if (tile.x, tile.y) in stacked_map:
+                stacked_map[(x, y)] += 1
+            tiledata = tile.tileData
+            tiledata.zv = 0
+            tiledata.weight = 0
+            tiledata.id = data[i]
+            if tiledata.id == -10:
+                cntUndefined += 1
+            tiledata.type = 1
+            tiledata.subtype = 0
+            # 一些统计信息
+            tilesByPos[(tile.x, tile.y, tile.z)] = tile
+            if tile.z > maxZ:
+                maxZ = tile.z
+            if tile.x > maxX:
+                maxX = tile.x
+            if tile.y > maxY:
+                maxY = tile.y
+    # 根据上面的布局信息,计算每个tile的几个信息:
+    # 1. 每个tile的视觉层级(不同于上面z的信息,那是一个布局信息,相同的z可能出在不同的视觉层级)
+    # 从maxZ开始,逐层向下计算;对于每一个位置,如果该位置有tile,则计算该tile的视觉层级
+    # 对于每一个tile,如果其上方(从该tile的z+1层,一直到maxZ层)有tile,则其视觉层级为上方tile的视觉层级+1
+    for z in range(0, maxZ+1):
+        z = maxZ - z
+        for x in range(0, maxX+1):
+            for y in range(0, maxY+1):
+                if (x,y,z) in tilesByPos:
+                    tile = tilesByPos[(x, y, z)]
+                    adjs = [(x,y),(x,y+1),(x,y-1),(x+1,y),(x+1,y+1),(x+1,y-1),(x-1,y),(x-1,y-1),(x-1,y+1)]
+                    # 确定视觉层级
+                    zvMax = -1
+                    for zup in range(z+1, maxZ+1):
+                        for adj in adjs:
+                            if (adj[0],adj[1],zup) in tilesByPos:
+                                zv = tilesByPos[adj[0],adj[1],zup].tileData.zv
+                                if zv > zvMax:
+                                    zvMax = zv
+                    tile.tileData.zv = zvMax + 1
+    # 计算权重
+    # 从最底下开始,逐层向上计算
+    # 每个tile的初始权重为4,然后加上其下方压住的tile的权重:如果压了全部,则该加上被压住的tile权重;
+    # 如果压住了一半,则加上被压住的tile权重的一半;如果是压住1/4,则加上被压住的tile权重的1/4
+    for z in range(0, maxZ+1): 
+        for x in range(0, maxX+1):
+            for y in range(0, maxY+1):
+                if (x,y,z) in tilesByPos:
+                    tile = tilesByPos[(x,y,z)]
+                    adjs = [(x,y,1.0),(x,y+1,0.5),(x,y-1,0.5),(x+1,y,0.5),(x+1,y+1,0.25),(x+1,y-1,0.25),(x-1,y,0.5),(x-1,y-1,0.25),(x-1,y+1,0.25)]
+                    weight = 4
+                    for adj in adjs:
+                        # 从临近层往下,在某个位置找到了tile,则该tile被压住了,就不再找了
+                        for zb in range(0, z):
+                            zb = z-1-zb
+                            if (adj[0], adj[1], zb) in tilesByPos:
+                                tileB = tilesByPos[(adj[0], adj[1], zb)]
+                                weight += tileB.tileData.weight * adj[2]
+                                break
+                    tile.tileData.weight = int(weight)
+        pass
+
+    for item in stacked_map:
+        stack_data = levelData.stacks.add()
+        stack_data.x = int(item[0])
+        stack_data.y = int(item[1])
+        stack_data.direction = 0    # 先默认都是0
+    
+    # 数据序列化
+    level_protobuf_data = levelData.SerializeToString()
+    protoFile = os.path.join(outDir, tFileName + '.bin')
+    with open(protoFile, 'w+b') as f:
+        f.write(level_protobuf_data)
+
+def gen_index_and_data(binDir, group = None):
+    lvelsIndex = levelData_pb2.LevelsIndex()
+    if group is not None:
+        protoDataTrunk = os.path.join(binDir, 'levels-' + str(group) + '.bin')
+        protoDataIndex = os.path.join(binDir, 'levelsIndex-' + str(group) + '.bin')
+    else:
+        protoDataTrunk = os.path.join(binDir, 'levels' + '.bin')
+        protoDataIndex = os.path.join(binDir, 'levelsIndex' + '.bin')
+
+    offset = 0
+    for filename in os.listdir(binDir):
+        my_message = levelData_pb2.LevelData()
+        binFile = os.path.splitext(filename)[0] + '.bin'
+        binFile = os.path.join(binDir, binFile)
+        if os.path.exists(binFile) :    
+            # print(binFile)        
+            with open(binFile, "rb") as f:
+                binary_data = f.read()
+                my_message.ParseFromString(binary_data)
+            os.remove(binFile)
+            with open(protoDataTrunk, 'ab') as f:
+                f.write(binary_data)
+            lvelsIndex.LevelsIndex[os.path.splitext(filename)[0]].len = len(binary_data)
+            lvelsIndex.LevelsIndex[os.path.splitext(filename)[0]].offset = offset
+            offset += len(binary_data)
+        
+    level_protobuf_index = lvelsIndex.SerializePartialToString()
+    with open(protoDataIndex, 'w+b') as f:
+        f.write(level_protobuf_index)
+
+# 将所有的模板文件转换成protobuf格式
+def convert_all_templates():
+    temp_list = parse_level_inst_info()
+    for temp_name in temp_list:
+        print(f"Converting template {temp_name}")
+        conver_json_to_proto('../tf_templates', temp_name, '../loadable')
+    gen_index_and_data('../loadable')
+
+
+# 获取当前工作目录
+current_dir = os.getcwd()
+script_dir = os.path.dirname(os.path.abspath(__file__))
+os.chdir(script_dir)
+
+convert_all_templates()
+
+# 恢复当前工作目录
+os.chdir(current_dir)