From 753c86087c4076f1c1f6eed3c8f162a8863c9bca Mon Sep 17 00:00:00 2001 From: APN-Pucky Date: Fri, 25 Sep 2020 23:46:26 +0200 Subject: [PATCH] Fix too high max_braw_score interfeering with anneal scaling --- SimpleTUOLiveSim-x86.exe | Bin 724992 -> 724992 bytes SimpleTUOLiveSim.exe | Bin 1113600 -> 1114112 bytes sim.cpp | 18 +++++++++++------- tyrant.cpp | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/SimpleTUOLiveSim-x86.exe b/SimpleTUOLiveSim-x86.exe index f11e362c2ac8fe5ba7bb36c9b19d87599da613f6..3318410aadceb07a722099a78f7e0d1a46c2fbeb 100644 GIT binary patch delta 316 zcmZozpwqBGXF~}ilgy0CjZEH?4>HbYlxa?6YENWh1Y!`)48$xz%nHP8K+F!r96-#u zJ&}nkxIA~gJp;oN76veoXyj%v0J30w44fI8+#eRcIRH oQsG;i?v!7lprfD~l3HA1sJgxDBi9_!?HcUdH#nv{@No+O0D1CDQvd(} delta 322 zcmZozpwqBGXF~}ilg^CEjZEH?4>HbY)M-v+YENWh1Y!`)48$xz%nHP8K+F!r96-#u zJ&}nkxIA~SJp;oN76vfTXyj%v0J32G2q0esiJybUZ$RTuLF2Cg^8YX*%v-Wuv5IR- z!FJnwTo)L(H@@M@Vv+GLD9OyttV&H$a7j(hwo=lJHj33zPy#ci|NFqDtcXuVELTB+ m@$|DFxTF+~fx7T2oqpgWm+1D1AGz8^nH*iVOR#g_-~a%MIa2!o diff --git a/SimpleTUOLiveSim.exe b/SimpleTUOLiveSim.exe index 403f29a06120bfd31bc458ce2d2a19e55b6c1a1e..cec315cb871db8e858f65ddc3480b005639416f7 100644 GIT binary patch delta 700 zcmZqp2J>p1Z;1(C6Fw${mC~08TR^!07n-W dPd|4k6+vfyJ-sbNv#;JAO@PjPe?RJ42mn|SxD)^Y delta 242 zcmZo@aB2ACyup!?@xo*$#ww;4(>L#9Ok(7EF`WSj1Q{4+G;1-pYcVqdF%uAj*epQI z3dC$c%nrmHK+FlmTtLhX#5_RE3&eat%)ecWS)eN|x5}P@;Ry@KOdvf$kih^%L-`^T z1sOz;_!?+@8#I0Z8b1Zd|HFtdFJZf4mViqEhf+~uUP^wh()LBS1j=L>9k)w-7m#5G E08s=oPyhe` diff --git a/sim.cpp b/sim.cpp index 432e8050..58ec92b6 100644 --- a/sim.cpp +++ b/sim.cpp @@ -3167,7 +3167,7 @@ int evaluate_skill(Field* fd,const Card* c , SkillSpec* ss) { // TODO optimize this int tvalue = ss->x; - + if(ss->card_id != 0)tvalue += 1*evaluate_card(fd,card_by_id_safe(fd->cards,ss->card_id)); tvalue += 10*(ss->id==Skill::flurry); tvalue += 10*(ss->id==Skill::jam); @@ -3242,8 +3242,8 @@ int evaluate_skill(Field* fd,const Card* c , SkillSpec* ss) int evaluate_card(Field* fd,const Card* cs) { int value = 0; - value += cs->m_health; - value += 2*cs->m_attack; + value += cs->m_health; + value += 2*cs->m_attack; for( auto ss : cs->m_skills) { value += evaluate_skill(fd,cs,&ss); } @@ -3254,8 +3254,8 @@ int evaluate_card(Field* fd,const Card* cs) int evaluate_cardstatus(Field* fd,CardStatus* cs) { int value = 0; - value += cs->m_hp; - value += 2*cs->attack_power(); + value += cs->m_hp; + value += 2*cs->attack_power(); value += cs->protected_value(); for( auto ss : cs->m_card->m_skills) { value += evaluate_skill(fd,cs->m_card,&ss); @@ -3354,14 +3354,18 @@ Results evaluate_sim_result(Field* fd, bool single_turn_both) { unsigned enemy_brawl_score = evaluate_brawl_score(fd, 1); unsigned max_score = max_possible_score[(size_t)OptimizationMode::brawl_defense]; - return {0, 0, 1, (points_score_type)(max_score - enemy_brawl_score)}; + if(enemy_brawl_score> max_score) + std::cerr << "WARNING: enemy_brawl_score > max_possible_brawl_score" << std::endl; + return {0, 0, 1, (points_score_type)safe_minus(max_score , enemy_brawl_score)}; } case OptimizationMode::war: return {0,0,1, (points_score_type) 20}; case OptimizationMode::war_defense: { unsigned enemy_war_score = evaluate_war_score(fd, 1); unsigned max_score = max_possible_score[(size_t)OptimizationMode::war_defense]; - return {0, 0, 1, (points_score_type)(max_score - enemy_war_score)}; + if(enemy_war_score> max_score) + std::cerr << "WARNING: enemy_war_score > max_possible_war_score" << std::endl; + return {0, 0, 1, (points_score_type)safe_minus(max_score , enemy_war_score)}; } #ifndef NQUEST case OptimizationMode::quest: return {0, 0, 1, (points_score_type)(fd->quest.must_win ? 0 : quest_score)}; diff --git a/tyrant.cpp b/tyrant.cpp index ed0a271b..84df0e58 100644 --- a/tyrant.cpp +++ b/tyrant.cpp @@ -67,7 +67,7 @@ unsigned min_possible_score[]{0, 0, 0, 20, 20, 5, 5, 5, 0 , 0 #endif }; -unsigned max_possible_score[]{100, 100, 100, 208, 208, 100000, 100000, 100, 100 +unsigned max_possible_score[]{100, 100, 100, 208, 208, 100, 100, 100, 100 #ifndef NQUEST , 100 #endif