🧠Enemy AI

A look at

Rival Traveler

AI Breakdown

Check for injury

If their Pikamoon’s health is below 20%, they make a series of checks. First of all, do they still have healing items? (Rival Travelers typically have d3-1 healing items, with a minimum of 0). If no, then the Check for injury step concludes. Next, the Rival Traveler calculates to see if they’ll use the healing item on their Pikamoon.

The calculation depends on two factors:

  • If the player Pikamoon is WEAK to the Rival Traveler’s Pikamoon, or if their Pikamoon is WEAK to the player’s Pikamoon, they will have a 100% chance to use the healing item.

  • Otherwise, it depends on the number of Pikamoon remaining in the party (100% chance if it's their last Pikamoon, 80% if they have two Pikamoon, 60% if they have three, 40% if they have four, and 20% if they have five).

Check to swap

If the Traveler didn’t use a healing item, then they’ll proceed to calculate their next course of action. First of all, the Traveler checks to see if they should switch out their Pikamoon. If the Traveler is on their last Pikamoon, they skip to Choosing a Move.

A Traveler will only switch out their Pikamoon a maximum of TWO (2) times per battle. If they have hit this limit, then they will move on to the next step.

If their active Pikamoon is WEAK to the player’s Pikamoon (either because the player Pikamoon has a SUPER-EFFECTIVE typing, or because the player Pikamoon has previously used a SUPER-EFFECTIVE move), and if they have a NON-WEAK Pikamoon in their party, then they’ll have a 20% chance of switching their Pikamoon out.

  • If they decide to switch, they will prioritize switching to a Pikamoon that has SUPER-EFFECTIVE moves and is RESISTANT to the player Pikamoon’s type:

    • Else, they will switch to a Pikamoon that is RESISTANT to the player Pikamoon’s type.

    • Else, they will switch to a Pikamoon that has SUPER-EFFECTIVE moves against the player’s Pikamoon.

    • Else, they will switch to a random Pikamoon that isn’t WEAK to the player’s Pikamoon.

  • If there is a Pikamoon in their party who is SUPER-EFFECTIVE against the player’s Pikamoon, then they’ll have a 10% chance of switching their Pikamoon out.

    • If they decide to switch, they will prioritize switching to a Pikamoon that has SUPER-EFFECTIVE moves and is RESISTANT to the player Pikamoon’s type.

    • Else, they will switch to a Pikamoon that has SUPER-EFFECTIVE moves against the player’s Pikamoon.

Choose a move

If the Traveler doesn’t decide to switch Pikamoon, then they’ll choose a move.

  • If the Traveler sees a killing move (a move that is guaranteed to do enough damage to knock out the player’s Pikamoon), it will ALWAYS use it.

    • If several moves meet this criterion, the Traveler will randomly select between them.

  • If the Traveler does not see a killing move but does see a move that is super-effective against the player’s Pikamoon, it will have a 50% chance to use it.

    • If several moves meet this criterion, then after the initial 50% check, the Traveler will randomly select one of those moves.

  • If the Traveler does not see a killing move or roll to use a super-effective move, they will randomly choose a non-super-effective move to use.

Counterpick

If the Traveler’s Pikamoon is knocked unconscious, and the Traveler still has Pikamoon remaining, it will send out a new one based on the following criteria:

  • Firstly, if they only have one remaining Pikamoon, they will send that one out.

  • If they have more than one Pikamoon, they perform the following checks:

    • If they have a Pikamoon that is SUPER-EFFECTIVE against the player’s Pikamoon and RESISTANT to the player Pikamoon’s type, they will send that one.

    • Else, they will switch to ta Pikamoon that is SUPER-EFFECTIVE against the player’s Pikamoon.

    • Else, they will switch to a Pikamoon that is RESISTANT to the player Pikamoon’s type.

    • Else, they will switch to a random Pikamoon that has REGULAR-DAMAGING moves against the player’s Pikamoon.

    • Else, they will switch to a random Pikamoon that isn’t WEAK to the player’s Pikamoon.

    • Else, they will switch to a random Pikamoon.

Wild Pikamoon

Wild Pikamoon battles are different from Traveler battles for a number of reasons:

  • Wild Pikamoon CAN’T use items.

  • Wild Pikamoon fight alone, so once defeated another Pikamoon won’t take their place.

  • Wild Pikamoon battles don’t award money.

  • Wild Pikamoon CAN be captured.

  • Wild Pikamoon CAN attempt to flee if injured.

Don’t underestimate them, however. Wild Pikamoon are powerful creatures who have survived the harshness of Dreva for many years. They welcome the opportunity to journey with mighty Travelers, but only if you can prove yourself to them.

AI Breakdown

Check if Pikamoon flees

If a successful injury check was made on the previous turn, then the Pikamoon flees at the start of the turn. Battle ends.

Check for injury

If the Wild Pikamoon’s health is below 20%, they make a check to see if they attempt to flee. A d12+x is rolled, where x is equal to the number of times this check has been made (to rephrase, the longer the battle goes on, the higher the chance the Pikamoon will try and flee)

  • If the result is â‰Ĩ 10, the Pikamoon will flee on the next turn. A message is displayed to the player: [SPECIESNAME] is going to run!

  • If the result is < 9, nothing happens and the Pikamoon will select a move as normal.

Select move

The Wild Pikamoon chooses a move, based on the following criteria:

  • If the Wild Pikamoon sees a killing move (a move that is guaranteed to do enough damage to knock out the player’s Pikamoon), it will ALWAYS use it.

    • If several moves meet this criterion, the Wild Pikamoon will select between them.

  • If the Wild Pikamoon does not see a killing move but does see a move that is super-effective against the player’s Pikamoon, it will have a 50% chance to use it.

    • If several moves meet this criterion, then after the initial 50% check, the Pikamoon will randomly select one of those moves.

  • If the Wild Pikamoon does not see a killing move and either fails the 50% check to use a super-effective move or does not have a super-effective move, they will randomly choose a non-super-effective move to use.

Bosses

Powerful Travelers, Guardians, and even the Divines themselves are all beings the player can hope to confront over the course of their journey. These will be fine-tuned over the creation of the project to ensure each boss battle feels tense, epic, and unique.

Last updated