Giter Club home page Giter Club logo

Comments (2)

pmariglia avatar pmariglia commented on August 23, 2024 1

Definitely not a bug.

I think it's safe to say that using the minimax algorithm, a search depth of 2 is the most you're going to get when using this bot unless you have an insane supercomputer - the engine is just too slow. The exponential growth hurts much more than you may realize.

Just to give an idea of the amount of operations required for each search depth. Let's assume 4 moves and 5 switches per player, 9 decisions total. This means 81 "transpositions" to calculate (alpha-beta pruning exists and reduces this - but lets just use this as an example) Let's also assume each transposition takes 0.0001s to calculate each.

Search Depth Number of Transpositions Total Time (seconds)
1 81^1 = 81 81 * 0.0001 = 0.0081
2 81^2 = 6561 6561 * 0.0001 = 0.6561
3 81^3 = 531441 531441 * 0.0001 = 53.1441

As for this:

If not, perhaps the bot could detect when the timer is close to running out and reduce search depth at that point?

To use minimax properly, the entire calculation from 2 -> 3 needs to be done. So it could calculate for up to say ~10 seconds, but it wouldn't have enough information to make a better decision that if it just stopped at search depth=2. A monte-carlo-tree-search style algorithm would benefit from calculating in this way.

Regardless, I have good reason to believe that adding an additional search depth would not seriously improve the performance of the minimax bot. I ran the minimax bots head-to-head, one searching to a depth of 2, the other searching to a depth of 3 for about 500 gen8randombattle games. It took a very long time, and in the end they were roughly equal in the number of wins.

I think to make a better Pokemon bot, a different algorithm entirely must be used.

from showdown.

rahidz avatar rahidz commented on August 23, 2024

Ah, makes sense. Was thinking 9 instead of 81, but of course the bot has to consider both your and your opponent's move. Thank you for the information :)

from showdown.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.