AI Gets Smarter (and More Punctual!) with Time Management


Hey Go players!

We've been working under the hood to make our AI opponent a bit more sophisticated in how it "thinks" and, importantly, how it manages its thinking time. Here's a peek at some recent improvements:

1. More Respect for Your Time: AI Time Limits Overhaul

Previously, while you could set a "Time Limit" for the AI, it was more of a guideline for how many calculations (iterations) it would try to do. If you set a high number of calculations on a slower computer or a complex, large board, the AI could sometimes take much longer than the specified time limit.

  • What's New: We've revamped this! Now, when you set the "Time Limit per Evaluation Batch (ms)" in the AI settings, our AI is much better at sticking to it.
  • How it Works (Simplified): The AI looks at all possible first moves. It then uses multiple "mini-AIs" (Web Workers, for those curious) to think about several of these moves at the same time (a "batch"). Each of these mini-AIs now has its own stopwatch. If its allocated time for that batch runs out, it stops thinking about that specific set of moves and gives its best guess so far.
  • What this means for you:
    • The AI's thinking time should now more closely match the time limit you set in the options, leading to a more predictable and responsive experience.
    • If there are many possible moves for the AI (like in the early game), it might still take a bit longer overall because it processes them in these time-limited batches. The total time will be roughly (Time Limit per Batch) * (Number of Batches).
    • This allows the AI to make a more informed decision by considering more options, even if it can't think super deeply about every single one when time is tight.

2. Balancing Brainpower (Iterations) and Speed (Time Limit)

You still have two main knobs to tune the AI's strength:

  • "MCTS Iterations (Total)": Roughly, how many "thoughts" or simulations the AI tries to run in total for its turn. More iterations generally mean stronger play but take more time.
  • "Time Limit per Evaluation Batch (ms)": As described above, how long each group of parallel "mini-AIs" gets to think.
  •   The Interplay: The AI will try to complete its target iterations within the time limit for each batch.
    • If you give it plenty of time, it will likely complete most of its target iterations.
    • If the time limit is strict, it will stop early and use the best information it has up to that point.
    • This gives you more control to find the right balance for your computer and how patient you are!

Why these changes?

Our goal is to provide a challenging AI opponent that also respects your time. These improvements to its "thought process" make the AI's performance more consistent across different game situations and computer speeds, and give advanced users finer control over its behavior.

We're always looking to improve the AI, so let us know what you think of its play!

Happy Pondering (and Playing!)

Files

go.zip Play in browser
11 hours ago

Leave a comment

Log in with itch.io to leave a comment.