Re: Computer version of Risk
- Posted by Michael Packard <lgp at EXO.COM> Jul 02, 1997
- 812 views
On Wed, 2 Jul 1997, Anders Eurenius wrote: > > All AI programming is centered around 2 concepts: > > 1) What does the computer player know > > 2) What does he do about what he knows > > Ooh.. That's a very simplistic view... yup. AI programming isn't a whoodoo voodo thing only guru's can do. It's just making your computer opponents aware of the game and their options, and giving them some way of choosing their options. > > If you ask 5 risk players how to play, you'll get at least 6 "optimal" > > strategies. > ----------8<---------- > strategy stuff deleted > -------->8------------ > > > The "best" way to create computer AI is to make the game playable by human > > players, then play about 20 games with human players and have the computer > > keep track of every move of every player. You then can "teach" the > > computer to play like you do. > > And who says you're so good? (Don't take it personally, but I'm not > convinced) It doesn't matter if you're good or not. You know the game, you know the rules, you give your alter ego a goal and a strategy, then watch him play and advise him when he does something stupid. It's really easy to teach a computer player to play better than you do. You won't always follow your agenda to your best interest, you'll sometimes miss an opportunity, you'll sometimes get desperate and do something stupid. The computer is more disciplined. You give it your decision priority list and it will follow it until it wins or loses. > ----------8<---------- > more stuff deleted > -------->8------------ > > The normal aproach to board-game AI's is the one (normally) used for chess: > > Max-Min algorithm > ================= > > Make a function to give each board-situation a value (score if you like). > > 1. Make a tree of all possible moves (except suicidal ones), and > evaluate them (the resulting board), and cut away the most stupid > moves. (lowest score) In chess you do this dynamically after the opening moves. I designed a nifty chess program for Interplay that analyzed your moves, as well as for the computer or modem opponent and warned you if you or they did something stupid. It told you why the opponent was doing what he did and what advantage or disadvantage the move gave him. <snip> > It's only in real-time games or games with *enormous* branching that really > require something as obscure and intagible as "tactics and strategy". > For Risk, I'd write the valuation function to valuate for any player, > since *each* player is trying to *max* his own score. (If there were > trying to *minimize* *your* score, like chess AI's, they'd all gang up > on you! ) Strategy is ALWAYS important. Even in Chess, you have agendas, you have a basic strategy. A game situation is dynamic, sometimes the table generated "optimal" move isn't the "right" move for your character this time. Sometimes you let the queen do her thing while you move your pieces around. The whole point in doing computer AI for something like RISK is to give multiple opponents multiple personalitiess, multiple game play agendas and options. You need to give them some room to work around the rules they play by. If they always do what you expect, the game isn't fun, you always win or you always lose. The various "players" may or may not try to maximize their score all of the time. They may choose to kick your wimpy butt out of their area of influence because you annoy them rather than do a move into africa that will give them more points. My AI's would taunt you at that point =) Another example. In StarTrek: Judgment Rites, when you were in space combat against the Klingons, their basic strategy was to turn their ships toward you and shoot at you no matter where you were. Their AI was simple "kill the target. Stay out of their sites, cloak if possible." They were pretty easy to destroy: get one in your sites and do whatever it did and keep firing. If you faced 2 or three of them, as long as you kept one in your sights and fired, the others would have to keep turning and moving to try and hit you. If you kept moving, they couldn't target you easily and you could blow up the ships one by one if you were good. In StarFleet Academy, the Kilngon AI is slightly different. When you face multiple klingons, they have multple attack strategies that they use when necessary. They form up together moving away from you, when you pursue, one or more breaks formation and peels off away, around, behind your ship then blasts the bejeebers out of you, then they regroup and depending on your damage\ability to fight, they do something else. They like to disable you then gang up on you for the kill. They also learn your tactics as you face them in combat and can anticipate your moves. As you play they get harder to defeat because they KNOW you better. One way is hard and repetitive once you get the hang of it, the other is manical and constantly challenging. The more varied your AI the more interesting your game. > Hope it helps... I'll try to get some work in on the tree.e... > > (Hey! Here's another use for trees!) I build landscapes with nice trees. =) Michael Packard Lord Generic Productions lgp at exo.com http://exo.com/~lgp A Crash Course in Game Design and Production http://exo.com/~lgp/euphoria