• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] Searching for an AI for Essentials v18.1

  • 107
    Posts
    4
    Years
    • Seen Apr 27, 2023
    Hey,
    No, as far as I know, there is no one working on AI, which is a shame. You've basically found the state of the art of Essential's AI XD
    Pokémon Reborn's AI was a good start but there has been no commits on the GitHub for like 16 months.
    It's just too tedious to code. I remember that Reborn'sAI was a bit different from that from Essentials, but I know that Essential's AI is very "subjective", in the sense that the evaluation of moves is weird. Sometimes a good move gets a score of 90, sometimes it's 100, sometimes it's a +30 or a repeated +10 for some reason.
     
    Last edited:
    Hey,
    No, as far as I know, there is no one working on AI, which is a shame. You've basically found the state of the art of Essential's AI XD
    Pokémon Reborn's AI was a good start but there has been no commits on the GitHub for like 16 months.
    It's just too tedious to code. I remember that Reborn'sAI was a bit different from that from Essentials, but I know that Essential's AI is very "subjective", in the sense that the evaluation of moves is weird. Sometimes a good move gets a score of 90, sometimes it's 100, sometimes it's a +30 or a repeated +10 for some reason.

    And is there any way to improve it even if it is tiring?
    I would happen to help this!
    I saw that every move has that Score. How are these values selected?
    With a north maybe I'll improve it and even post it here!
     
    And is there any way to improve it even if it is tiring?
    I would happen to help this!

    You can do anything with programming. So yes, one can improve it. But they would need time.

    I saw that every move has that Score. How are these values selected?
    Arbitrarily. I said "subjective", but the word I was looking for is "arbitrary".

    With a north maybe I'll improve it and even post it here!
    :)
     
    I'm pretty sure I saw that Marin is working on an updated Essentials AI, but its for v20 I believe, and I have no idea what state of completion it is in, or if he even plans on releasing it.

    There's a reason that after all these years, no one has really bothered to work on the AI. Because it sucks. It's difficult, tedious, and despite all your efforts the AI is always gonna be...AI. It's still gonna act stupid in many situations. For many people, it's just not worth the hassle or time investment. TBH, I would probably avoid using most AI "improvement" scripts you find, anyway. No offense to the creators, but nearly all of them are plagued with bugs or compatibility errors with other scripts that end up just causing more headaches.
     
    I'm pretty sure I saw that Marin is working on an updated Essentials AI, but its for v20 I believe, and I have no idea what state of completion it is in, or if he even plans on releasing it.

    There's a reason that after all these years, no one has really bothered to work on the AI. Because it sucks. It's difficult, tedious, and despite all your efforts the AI is always gonna be...AI. It's still gonna act stupid in many situations. For many people, it's just not worth the hassle or time investment. TBH, I would probably avoid using most AI "improvement" scripts you find, anyway. No offense to the creators, but nearly all of them are plagued with bugs or compatibility errors with other scripts that end up just causing more headaches.

    I also feel that most amateur programmers don't have a clue on how an AI should be coded. In particular, most amateur programmers haven't studied AI, decision theory and operational research.

    I don't know what Marin does, but from a theoretical point of view, the "clean" way to code an AI for Pokémon would be:
    • Make several classes that represent the field, the Pokémons in battle, and the Pokémons in the team.
      These will only be "simulated" copies of the corresponding entities, just a representation of the current state of the battle. Thus, these classes should only list the active effects, the remaining HPs, and so on. Just numerical values that represent a state.
      NB: Maybe we don't need another class, and the existing classes are enough?
    • We must have an evaluation function (a "score") for each state. For example, an enemy having Leech Seed on their Pokémon is better than not, thus it should be represented in the form of a score. The state without Leech Seed on an enemy should have a lower score than the state with Leech Seed. And so on.
    • For each decision (each move to use, each POkémon to replace, each item to use), apply the effect of the move / switch / item on the simulated state. Make a copy of it for each possible choice, and store the resulting states.
    • Evaluate the resulting states, and rank them. Then the best choice is the one with highest score.
    • If you want the AI to be less predictable, introduce some randomness in the scores.
    • If you want the AI to have different levels of skill, restrict the set of choices they can make, or maybe shuffle the scores. (A bad player can be the one who doesn't see all choices, or who doesn't evaluate correctly which one is the best choice)
    • If you want the AI to be unbeatable, instead of simulating and evaluating of turn, simulate and evaluate several turns in a row.

    If I'm not mistaken, this is how AIs in chess or Go work.
     
    Back
    Top