|
@@ -230,6 +230,42 @@ if __name__ == '__main__':
|
|
# 在文件转为bin
|
|
# 在文件转为bin
|
|
converJosnToProto(folder_path, base_name[0],1)
|
|
converJosnToProto(folder_path, base_name[0],1)
|
|
mergeLeveldata3()
|
|
mergeLeveldata3()
|
|
|
|
+
|
|
|
|
+ # 生成一些关卡的体验参数模板,在关卡实例中对应这个里面来
|
|
|
|
+ with open("./loadable/paramTemplates.csv", 'w+') as f:
|
|
|
|
+ fieldnames = ["name","tilevar","topN","matchRInTopN","maxUmZ","umMatchRs"]
|
|
|
|
+ writer = csv.DictWriter(f, fieldnames=fieldnames)
|
|
|
|
+ writer.writeheader()
|
|
|
|
+ templates = {}
|
|
|
|
+ # 容易:首层即有明显和高的匹配率,每一层的为匹配率也比较高
|
|
|
|
+ writer.writerow({"name":"easy",
|
|
|
|
+ "tilevar":"4",
|
|
|
|
+ "topN":"1",
|
|
|
|
+ "matchRInTopN":"40",
|
|
|
|
+ "maxUmZ":"3",
|
|
|
|
+ "umMatchRs":"30"})
|
|
|
|
+ # 普通:首层的匹配率一般,到第二层的匹配率较高,后面的匹配率一般
|
|
|
|
+ writer.writerow({"name":"normal",
|
|
|
|
+ "tilevar":"4",
|
|
|
|
+ "topN":"1",
|
|
|
|
+ "matchRInTopN":"20",
|
|
|
|
+ "maxUmZ":"3",
|
|
|
|
+ "umMatchRs":"40|20|20|20|20"})
|
|
|
|
+ # 普通.前难后易:首部2层的匹配率一般,但是后面的匹配率高
|
|
|
|
+ writer.writerow({"name":"normal.hard_easy",
|
|
|
|
+ "tilevar":"4",
|
|
|
|
+ "topN":"2",
|
|
|
|
+ "matchRInTopN":"50",
|
|
|
|
+ "maxUmZ":"3",
|
|
|
|
+ "umMatchRs":"40|40|40|40|40"})
|
|
|
|
+ # 难:前两层的匹配率较高,后面的匹配率一般,同时tile的分布极端一点
|
|
|
|
+ writer.writerow({"name":"hard",
|
|
|
|
+ "tilevar":"3",
|
|
|
|
+ "topN":"2",
|
|
|
|
+ "matchRInTopN":"30",
|
|
|
|
+ "maxUmZ":"4",
|
|
|
|
+ "umMatchRs":"20|20|20|20|20"})
|
|
|
|
+
|
|
|
|
|
|
# 将关卡id和模板的对应关系输出到文件
|
|
# 将关卡id和模板的对应关系输出到文件
|
|
lv_stat = {}
|
|
lv_stat = {}
|
|
@@ -261,20 +297,15 @@ if __name__ == '__main__':
|
|
d["dda_type"] = lv_stat[lvid]["dda_type"]
|
|
d["dda_type"] = lv_stat[lvid]["dda_type"]
|
|
d["dda_para"] = lv_stat[lvid]["dda_para"]
|
|
d["dda_para"] = lv_stat[lvid]["dda_para"]
|
|
writer.writerow(d)
|
|
writer.writerow(d)
|
|
- # 模版的信息
|
|
|
|
|
|
+
|
|
|
|
+ # 实例模版的信息
|
|
|
|
+ hdr4try = "(tileCnt|seed|param_template)"
|
|
with open("./loadable/levelInstInfo.csv", 'w+') as f:
|
|
with open("./loadable/levelInstInfo.csv", 'w+') as f:
|
|
all_insts = set()
|
|
all_insts = set()
|
|
- fieldnames = ["lvinst","template",
|
|
|
|
- "try1(tileA|tileB|tileVar|indexTop3|indexPlusByZ|seed)",
|
|
|
|
- "try2(tileA|tileB|tileVar|indexTop3|indexPlusByZ|seed)",
|
|
|
|
- "try3(tileA|tileB|tileVar|indexTop3|indexPlusByZ|seed)",
|
|
|
|
- "try4(tileA|tileB|tileVar|indexTop3|indexPlusByZ|seed)",
|
|
|
|
- "try5(tileA|tileB|tileVar|indexTop3|indexPlusByZ|seed)",
|
|
|
|
- "try6(tileA|tileB|tileVar|indexTop3|indexPlusByZ|seed)",
|
|
|
|
- "try7(tileA|tileB|tileVar|indexTop3|indexPlusByZ|seed)",
|
|
|
|
- "try8(tileA|tileB|tileVar|indexTop3|indexPlusByZ|seed)",
|
|
|
|
- "try9(tileA|tileB|tileVar|indexTop3|indexPlusByZ|seed)",
|
|
|
|
- "try10(tileA|tileB|tileVar|indexTop3|indexPlusByZ|seed)"]
|
|
|
|
|
|
+ fieldnames = ["lvinst","template"]
|
|
|
|
+ for tried in range(1,11):
|
|
|
|
+ k = "try" + str(tried)+hdr4try
|
|
|
|
+ fieldnames.append(k)
|
|
writer = csv.DictWriter(f, fieldnames=fieldnames)
|
|
writer = csv.DictWriter(f, fieldnames=fieldnames)
|
|
writer.writeheader()
|
|
writer.writeheader()
|
|
for lvid in sorted(lv_stat.keys(), key=lambda x:int(x)):
|
|
for lvid in sorted(lv_stat.keys(), key=lambda x:int(x)):
|
|
@@ -283,17 +314,10 @@ if __name__ == '__main__':
|
|
all_insts.add(inst_id)
|
|
all_insts.add(inst_id)
|
|
else:
|
|
else:
|
|
continue
|
|
continue
|
|
- d = {"lvinst":"", "template":"",
|
|
|
|
- "try1(tileA|tileB|tileVar|indexTop3|indexPlusByZ|seed)":"",
|
|
|
|
- "try2(tileA|tileB|tileVar|indexTop3|indexPlusByZ|seed)":"",
|
|
|
|
- "try3(tileA|tileB|tileVar|indexTop3|indexPlusByZ|seed)":"",
|
|
|
|
- "try4(tileA|tileB|tileVar|indexTop3|indexPlusByZ|seed)":"",
|
|
|
|
- "try5(tileA|tileB|tileVar|indexTop3|indexPlusByZ|seed)":"",
|
|
|
|
- "try6(tileA|tileB|tileVar|indexTop3|indexPlusByZ|seed)":"",
|
|
|
|
- "try7(tileA|tileB|tileVar|indexTop3|indexPlusByZ|seed)":"",
|
|
|
|
- "try8(tileA|tileB|tileVar|indexTop3|indexPlusByZ|seed)":"",
|
|
|
|
- "try9(tileA|tileB|tileVar|indexTop3|indexPlusByZ|seed)":"",
|
|
|
|
- "try10(tileA|tileB|tileVar|indexTop3|indexPlusByZ|seed)":""}
|
|
|
|
|
|
+ d = {"lvinst":"", "template":""}
|
|
|
|
+ for tried in range(1,11):
|
|
|
|
+ k = "try" + str(tried)+hdr4try
|
|
|
|
+ d[k] = ""
|
|
d["lvinst"] = lv_stat[lvid]["关卡 id"]
|
|
d["lvinst"] = lv_stat[lvid]["关卡 id"]
|
|
d["template"] = lv_stat[lvid]["模板 id"]
|
|
d["template"] = lv_stat[lvid]["模板 id"]
|
|
seeds = []
|
|
seeds = []
|
|
@@ -308,17 +332,18 @@ if __name__ == '__main__':
|
|
tileA = try1.split('|')[0]
|
|
tileA = try1.split('|')[0]
|
|
tileB = try1.split('|')[3]
|
|
tileB = try1.split('|')[3]
|
|
tileCnt = tileA if int(tileA) > int(tileB) else tileB
|
|
tileCnt = tileA if int(tileA) > int(tileB) else tileB
|
|
- ps=[tileCnt,"0","0","100","100"]
|
|
|
|
|
|
+ # 默认都是normal的体验模式
|
|
|
|
+ ps=[tileCnt,]
|
|
if tried <= len(seeds):
|
|
if tried <= len(seeds):
|
|
ps.append(seeds[tried-1])
|
|
ps.append(seeds[tried-1])
|
|
else:
|
|
else:
|
|
ps.append("100")
|
|
ps.append("100")
|
|
- d["try" + str(tried)+"(tileA|tileB|tileVar|indexTop3|indexPlusByZ|seed)"] = "|".join(ps)
|
|
|
|
|
|
+ ps.append("normal")
|
|
|
|
+ d["try" + str(tried)+hdr4try] = "|".join(ps)
|
|
else:
|
|
else:
|
|
- d["try" + str(tried)+"(tileA|tileB|tileVar|indexTop3|indexPlusByZ|seed)"] = ""
|
|
|
|
|
|
+ d["try" + str(tried)+hdr4try] = ""
|
|
writer.writerow(d)
|
|
writer.writerow(d)
|
|
|
|
|
|
-
|
|
|
|
# 导出关卡id和模板的对应关系,并输出模板的信息
|
|
# 导出关卡id和模板的对应关系,并输出模板的信息
|
|
else:
|
|
else:
|
|
print('ohoh')
|
|
print('ohoh')
|