Board rpg ai
Fill that out -- simply on paper -- and your AI is well on its way.
Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play
"Reducing the world to mathematical equations!"
Also, there are so many moves that could be done, and adding in cooldown timings makes it even more difficult. I've read that Chess can have around 319 billion possible ways to do the first 4 moves. I have less squares and pieces, but have removed movement restrictions, added 4 other actions per piece, and added the cooldown time element so I'm guessing I'm sitting close to the 319 billion mark if not over it.
So I was just wondering if there are some preferred techniques that could help me make this AI seem "consistent" and "intelligent" without some feeble attempt at trying to have it do what I would do. There will be many judgement calls that have to be made while playing this game. Many priority changes in real-time as you see what the player is doing to your units.
Edit: You have more squares and less pieces, by the way. And for weighting things and priority changes, have saving units low on health (if it has that RPG element) take priority to save themselves. Or use a combined value -- heuristic is the word for all these values -- that determines whether saving a unit or taking a piece/using an ability is the best option.
If an ability is on cooldown I might not want to rule it out entirely. It might be worth waiting the x seconds in order to do it again but during that wait time the player does something that changes that. It's all real-time and I can move and do abilities on all the units at any time pending cooldowns.
There are 2 units that can heal and I suppose those would be the primary targets, but I can't just have my units all swarm the healer(s). That AI wouldn't be much fun to play over and over again. The hard part about this is that I don't even really know how I would play it exactly right now.
I almost feel like I'd have to play it against people first just to see what kind of strategies would work or develop. Maybe I should get the multiplayer working first so I can play against others before diving into making a crappy AI system.
I guess I just thought there were some techniques and tricks out there to help me get started. Seems brute force is what people are recommending. With basically unlimited amount of moves and actions to do brute force just didn't seem like the way to go about it.
EDIT:
Sorry it's an 8x8 board. I misspoke before. Thanks for the edit tips. There is health to these units so self preservation is probably a good idea to a point of where sacrificing ones self to benefit the whole would be required.So how would you come up with these heuristics?
Don't be daunted by all these "billions of possible moves". You are only making one at a time. Even in chess this is so. The trick is evaluating what your options are for the next possible move. The cooldowns, in this case, actually make it easier because you are taking some of the options off the table.
This is why you need to do step 1... make a list of the things you take into account when you are playing. Seriously... write it down. What are your factors? Damage dealt? Mana? Time? Vulnerability? How important is one compared to the other? How do you evaluate threats to your own pieces? Is it better to kill recklessly or play it safe?
Once you have scores for these you can choose. Evaluate the potential costs and gains of each of your possible moves at that moment. Score them somehow using a system that makes sense to you mentally... e.g. "damage dealt"... and compare your results. If you simply sort the list of potential actions by this figure, you can take the move on the top.
Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play
"Reducing the world to mathematical equations!"
Same with your game. Each unit has options. Each player has to choose which unit to act with at a given point. Is it better to move the knight or the mage? Should I heal or throw a fireball? Like IADaveMark said, figure out what each piece/character can do, figure out cooldowns, figure out movement, figure out damage, decide on a final goal. Use these to determine things. For instance:
If your total current HP / total max HP is less than 50% your units should not make fighting decisions but instead safe movements/defensive actions and healing. If a character is almost able to cast a big spell and is in no immediate danger (enemy distance), only move or position him, then cast when cooldown expires. Decide what types of things each piece values most, decide what goals are valued. Perhaps have a list: Eliminate Enemy, Buff Piece, Heal Piece. Then adjust which is more worth while at a given time (say like with that HP check). If HP hits that halfway mark, then you make Healing more worthwhile. Say you are 75% down. Or an ally in range is below 50%. You raise a piece's heal piece value so it will be the better choice, but still isn't as worthwhile as eliminating a piece (perhaps an enemy is close and can be attacked this time around). Say it gets worse, then healing a piece reaches the top. It's all about deciding what can be done at a given moment then deciding on the best action.
Evaluate the potential costs and gains of each of your possible moves at that moment.[/quote]