Skip to content

Commit

Permalink
Botris 8
Browse files Browse the repository at this point in the history
  • Loading branch information
mm304321141 committed Aug 10, 2024
1 parent 955473b commit ba49fd1
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/ai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ extern "C" DECLSPEC_EXPORT char *__cdecl BotrisAI2(int field[], int field_w, int
botris_ai.status()->death = 0;
botris_ai.status()->combo = combo;
botris_ai.status()->attack = 0;
botris_ai.status()->clear = 0;
if (botris_ai.status()->under_attack != upcomeAtt)
{
botris_ai.update();
Expand Down
3 changes: 2 additions & 1 deletion src/ai_zzz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1837,6 +1837,7 @@ namespace ai_zzz
{
Status result = status;
result.value = eval_result.value;
result.clear += eval_result.clear;
int safe = node->row >= 20 ? -1 : env.length > 0 ? get_safe(*eval_result.map, *env.next) : eval_result.map->roof;
if (safe <= 0)
{
Expand Down Expand Up @@ -1912,7 +1913,7 @@ namespace ai_zzz
result.max_attack = std::max(result.attack, result.max_attack);
result.value += ((0.
+ result.max_attack * 64
+ result.attack * 128 * rate
+ result.attack * 128 * rate / std::max<int>(1, result.clear)
+ (result.b2b ? 514 : 0)
+ result.like * 64
) * std::max<double>(0.05, (full_count_ - eval_result.count - result.map_rise * (context_->width() - 1)) / double(full_count_))
Expand Down
1 change: 1 addition & 0 deletions src/ai_zzz.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ namespace ai_zzz
int death;
int combo;
int attack;
int clear;
int under_attack;
int map_rise;
bool b2b;
Expand Down
1 change: 1 addition & 0 deletions src/botris.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ struct test_ai
ai.status()->death = 0;
ai.status()->combo = combo;
ai.status()->attack = 0;
ai.status()->clear = 0;
if (ai.status()->under_attack != upcomeAtt)
{
ai.update();
Expand Down
1 change: 1 addition & 0 deletions src/cmd_tris.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ struct test_ai
ai.status()->death = 0;
ai.status()->combo = combo;
ai.status()->attack = 0;
ai.status()->clear = 0;
if (ai.status()->under_attack != upcomeAtt)
{
ai.update();
Expand Down

0 comments on commit ba49fd1

Please sign in to comment.