Be a Supporter!

Numbers in AI Decisions

  • 211 Views
  • 1 Reply
New Topic Respond to this Topic
MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Member
Level 16
Game Developer
Numbers in AI Decisions 2012-07-17 19:00:17 Reply

At the moment in my turn-based RPG, I'm working with the AI finding the best or seemingly best move (movement + attack) to make. I have a few influence maps for movement decisions based on various factors, and per tile it checks it's various attacks to see what does the most damage * accuracy or most healing, etc. Then it adds the movement score with the attack score and finds the max of that. One problem that I'm having is that the attack score far outweighs the movement score. The influence maps are the results of normalized numbers (resulting in values from -1 to 2, though it could be -1 to 1 if I would normalize again), while the attack score could be in the hundreds. Also, some units have stat buffs/debuffs and status effects; how could I work that into a number to compare to simply attacking instead?

I'm also thinking about working towards having the AI look down the list of units whose turns are coming up, and making some decisions based on that. Any suggestions on how that should work, I guess besides testing every possible scenario between the two? For instance, a guy who does a lot of damage on my team is up next; how can I help him score a kill?

Sandremss128
Sandremss128
  • Member since: Aug. 22, 2009
  • Offline.
Forum Stats
Supporter
Level 11
Programmer
Response to Numbers in AI Decisions 2012-07-18 00:53:34 Reply

You could try to make min-max sort of algorithm that looks at how the moves affect future possibilities, as opposed to a greedy algorithm that makes the best possible move for 1 turn.
Depending on your engine you could simply try all valid combinations, or make a list of moves that should more often be considered.