Discussion Decomp Hackers: how do you setup your AI?

Started by Meister_anon~Master_o f_None March 30th, 2021 4:16 PM
  • 413 views
  • 3 replies
Seen 7 Hours Ago
Posted 12 Hours Ago
713 posts
141 Days
So I have some big ideas that hopefully I'll be able to see to fruition, but looking at CFRU and they setup their battle ai, got me thinking.

They used a rating based system, and then a bunch of conditional statements if I remember correclty.

For those that mess around with the system decision making, what kind of things do you do?

Do you prefer some type of rating system, do you prefer strict control of conditions?
Or something more loosely defined?
The A-non Team



Trevenant
Lv. 100 @ 306
Points: 70
Challenge: Souls of the Damned
Legendary: TBA

Chandelure
Lv. 100 @ 213
Points: 100
Challenge: N/A
Legendary: Entei

Rapidash
Lv. 100 @ 497
Points: 70
Challenge: N/A
Legendary: Entei

Flareon
Lv. 100 @ 708
Points: 70
Challenge: TBA
Legendary: TBA

Budew
Lv. 100 @ 794
Points: 100
Challenge: TBA
Legendary: TBA

Seen 3 Hours Ago
Posted 2 Weeks Ago
194 posts
1.5 Years
I’ve done a rating system (more of a weighted point-based setup). I also give the AI some knowledge that a human opponent wouldn’t have (like what move you chose), but then I give it a random chance on if it acts on that information or not. The intent is to simulate the AI making a good guess at what you will do since a human can do this around 2/3 of the time.

I do not prefer strict control. At best this can lead to the AI feeling samey and predictable. At worst it makes the game unfun as you throw yourself into a meat grinder of perfect-playing opponents.
Author of Shin Pokemon Red/Blue/Green. A Gen 1 hack focusing on bugfixes, better AI, and QoL/151 enhancements. Come say hello in the sideshow thread.
Seen 1 Day Ago
Posted 1 Day Ago
1,380 posts
7.1 Years
I also give the AI some knowledge that a human opponent wouldn’t have (like what move you chose), but then I give it a random chance on if it acts on that information or not. The intent is to simulate the AI making a good guess at what you will do since a human can do this around 2/3 of the time.
That's very clever! I like it a lot.


Myself, I'm using a rating system too. I work out all the options that are available to the AI, score them, remove the ones that score significantly worse than the best option, and then pick from the remaining ones proportional to their scores (i.e. higher-scoring is picked more often). The difficulty with this approach is dealing with switches, or more specifically, being able to score states in a way that will only rate switches highly if the following turns are advantageous too; it's no good switching into a Pokémon that resists the predicted move only to get blown out by a coverage move on the next turn.

I strongly dislike conditional-based approaches because they're often either too simple and thus exploitable, or so complex that they're almost impossible to extend or maintain. My ratings are produced by a hand-written scoring function applied to simulated results of the AI's options. I like that approach because imo it strikes a nice balance between being able to make decisions dynamically, but still being bound by the sorts of things a human (specifically, me!) would consider. But if I'm not able to get that to perform acceptably I'm going to explore using machine learning to find a scoring function, at the cost of having something that's understandable, and potentially feels quite alien in its approach to playing.
Seen 7 Hours Ago
Posted 12 Hours Ago
713 posts
141 Days
Both very interesting, I didn't even think about how switches would be handled.
it seems like the consesus is to use ratings systems, but like the idea of guessing (with conditional statements/functions) in the same way that a normal player would, based on knowledge of the type weaknesses of their team, and the possible moves of the opponent pokemon.

I haven't gotten deep into this side of things yet, so I don't know if that's best or not, but I like the idea of keeping a natural feel.
The A-non Team



Trevenant
Lv. 100 @ 306
Points: 70
Challenge: Souls of the Damned
Legendary: TBA

Chandelure
Lv. 100 @ 213
Points: 100
Challenge: N/A
Legendary: Entei

Rapidash
Lv. 100 @ 497
Points: 70
Challenge: N/A
Legendary: Entei

Flareon
Lv. 100 @ 708
Points: 70
Challenge: TBA
Legendary: TBA

Budew
Lv. 100 @ 794
Points: 100
Challenge: TBA
Legendary: TBA