|
Post by vilhazarog on Apr 21, 2006 14:38:23 GMT -5
Can any of you veterans quantify such things as "initiative"? Can you look at a game at any point and point to who is winning, and exactly by how much?
If such a method could be determined, I could probably write an ok AI for playing this game.... any thoughts?
|
|
taliesin
Ronin Warlock
Grand Master
Posts: 156
|
Post by taliesin on Apr 23, 2006 7:59:17 GMT -5
My first thought is that writing an AI for Warlocks is significantly more work than reimplementing the game from scratch. (I too have a bit of AI in my background). You're implementing all the spells and the unusual spell interactions in exactly the same way, and then you've got to add your state-space search, evaluation function and heuristics on top. So if you've got a lot of time on your hands, feel free...
Initiative is a bit fuzzy, and different players may interpret different positions differently. It basically refers to one player facing greater risks in the upcoming spellflow. It's not something you'd use in an AI. Why not? Because it refers to your evaluation of the current situation and the probabilities of you securing a genuine advantage such as a monster, damage, a Permanency or an Invis; the things that would be handled in the computer by state-space search are handled by pattern-matching in humans.
The biggest problem in implementing such an AI, apart from the Simple Matter Of Programming, would be to get the probability handling right. If 95% of the possibilities off a certain branch are in your favour, you can bet your opponent will go for the possibilities in the other 5%. And yet if you always play the safest possible move, you will be vulnerable to someone who takes small risks to secure small advantages - i.e. most top ladder players - and vulnerable to almost everyone who plays you long enough to predict what you'll do.
Taliesin
|
|
|
Post by vilhazarog on Apr 24, 2006 14:19:44 GMT -5
Well, I wondered if you could not cheat a bit and create an AI that played alright without doing a complete "state-space" search and relying mostly on heuristics. I'd actually written a long post on this but erased it after because I figured it wasn't very interesting. And yes, I figured you'd have to throw a small amount of randomness in there or else people could make outrageous moves knowing full well that it's perfectly safe because the AI always does X in that situation.
|
|
|
Post by Slartucker on Apr 24, 2006 15:23:12 GMT -5
Short answer: It's not that simple.
|
|
|
Post by vilhazarog on Apr 24, 2006 16:42:03 GMT -5
Actually, the short answer is "no."
|
|
taliesin
Ronin Warlock
Grand Master
Posts: 156
|
Post by taliesin on Apr 24, 2006 17:49:57 GMT -5
Well, I wondered if you could not cheat a bit and create an AI that played alright without doing a complete "state-space" search and relying mostly on heuristics. If you find yourself wondering things like this, then I'd steer clear of thinking of implementing game AIs full stop, to be honest, until you understand a lot more about the field. Computers are hideously bad at pattern-matching, and translating the way humans match the patterns into heuristics will lead to vast numbers of heuristics and a very fragile system. This is true of pretty much every turn-based strategy game ever. If the computer is required to think ahead, state-space search is your friend. Heuristics in turn-based strategy game AI exist solely so that you can trim the state-space search for efficiency.
|
|
|
Post by ExDeath on Jul 15, 2007 0:09:16 GMT -5
Old topic, but I found it interesting. I believe that even though a chess AI does far more work in calculating all the possibilities, a Warlocks AI would actually be HARDER to develop. This is because a computer cannot correctly identify the advantage gained from invis, or guess whether you're going to use that PSD on a monster or a person, etc. Chess has very well-defined mathematical values, and paths to victory that may be hard to discover but can easily be computed...this is the same reason computer AI is good at things like tennis (simple method of victory) but bad at things like poker because they only understand how to play, not how to win.
|
|
|
Post by nawglan on Aug 22, 2007 10:04:11 GMT -5
I'm not convinced that this is an impossible problem for an AI to solve. I've been tossing around what would I consider the inputs for a neural net to be and came up with the following list.
This is for a 2 player match. I shudder to think all the factors going into a melee match.
1) 6 move history player A (LH and RH each 6 moves) 2) 6 move history player B 3) health A 4) health B 5) # monsters A (possibly as a packed decimal array, each byte represents a different monster type) 6) # monsters B 7) Total Heath Monsters A (again, possibly as a packed decimal array...) 8) Total Health Monsters B 9) Total incoming dmg from monsters to A 10) Total incoming dmg from monsters to B
Outputs 1) LH 2) RH 3) Target LH 4) Target RH 6) Monster Targets (probably an array)
Thoughts? Where am I missing it? Should I consider leaving monsters out totally for now?
|
|
Derfel
Ronin Warlock
Did I Do That?
Troublemaker
Posts: 283
|
Post by Derfel on Aug 22, 2007 12:44:41 GMT -5
Wouldn't you also need to have some recognition of "potential" damage incoming? Say, from a storm or such?
For example, say the AI has a "PWP" set up, and the human player had "SWW". The AI has 5 health left, and the human player has 6. How would the AI know to either block the storm with a "WPP" or to continue through to "WPFD" or even "PWPFS..."?
|
|
|
Post by nawglan on Aug 22, 2007 13:04:05 GMT -5
My thought was any potential dmg coming from the spellflow of the opponent would be calculated and not needed as an initial input into the network. It could be included, but is it really necessary? Also, looking at monsters again, should the input value be actual or potential dmg coming from monsters? Can it be derived also? Probably. So, again, shouldn't be in the input list.
That leaves us with: 1) 6 move history player A (LH and RH each 6 moves) 2) 6 move history player B 3) health A 4) health B 5) # monsters A (possibly an array, each element represents a different monster type) 6) # monsters B 7) Total Heath Monsters A (again, possibly an array...) 8) Total Health Monsters B 9) Somehow represent the targets of the opponent's monsters.
|
|
Derfel
Ronin Warlock
Did I Do That?
Troublemaker
Posts: 283
|
Post by Derfel on Aug 22, 2007 14:50:42 GMT -5
You know, I could probably write an Waving Hands AI in about 3 days. Mind you, it would lose every match...
|
|
|
Post by nawglan on Aug 22, 2007 15:00:23 GMT -5
I'm still tossing around a layered approach. One that utilizes a couple of neural nets to help make a decision. I'm not so sure that a unified approach using a single network will be effective. Feel free to attempt it Derfel. I'd be willing to help out providing it's in a language I know (or can read...) If you decide to use COBOL, you are on your own. Sorry. 8)
|
|
Derfel
Ronin Warlock
Did I Do That?
Troublemaker
Posts: 283
|
Post by Derfel on Aug 22, 2007 15:10:26 GMT -5
I was actually kidding. I have a minor in Computer Sciences, which allows me to teach high school computer courses, but not much else. When I said I could write an AI in 3 days, I was suggesting that it would just make random gestures, and hope for the best. Mind you, compared to some of the new players I've played today...
|
|
|
Post by nawglan on Aug 22, 2007 16:14:16 GMT -5
Oh... i already have a program that does that... it's in perl. sourceforge.net/projects/warlocksbot. It sucks as a player, but it does do some rudimentary checking of the opponent's possibilities.
|
|
Derfel
Ronin Warlock
Did I Do That?
Troublemaker
Posts: 283
|
Post by Derfel on Aug 22, 2007 19:39:28 GMT -5
That's a good start.
From the limited AI work I did, it tends to be a "building" sort of project. If you can get it to recognize some things, chances are it will continue to recognize those things even when you add more complexities.
|
|