10-16-2017, 01:07 AM | #11 | |
Join Date: Oct 2017
|
How to get a better AI
Quote:
OK, let's say you have a great evaluation function. The AI is pretty good at looking at all of its available positrons and picking the best one. Now add a layer (known as a "ply" in chess programming). Look at every possible response, evaluate them all, and choose your move so as to avoid the really good counter moves. Then look at all of your possible responses to each of those countermoves. This is known an "Min-max" and there are a lot of webpages on it. For most games a two-ply lookahead happens so fast that you don't notice the delay. But as you add plies the computing time explodes, and in chess you have to prune some branches of the tree in order to get a longer lookahead. For example a move that loses a queen usually doesn't need to be explored as deeply as a move that gains a pawn. Then there is the classic trade-off: do I have a simpler evaluation function so as to get more lookahead in a reasonable amount of time? That's what IBM's Deep Blue did. Or do I sacrifice lookahead in order to spend more time evaluating each position? These are all pretty advanced chess programming topics, but in the case of Ogre I think a simple brute-force lookahead with limited plies and no pruning, using the best evaluation function you can write, would improve the AI noticeably. The first few plies make a big difference in how smart the AI seems to be. As for levels of AI difficulty, don't fall into the trap of simply reducing the lookahead. That makes the AI easier to beat, but it often feels like you are playing an idiot machine, Instead, spend some time figuring out how to make it play well sometimes while sometimes making the kind of blunder a human might make. Something like in chess not noticing that a knight is under attack -- a mistake even the dumbest programs never make. |
|
10-16-2017, 07:03 AM | #12 | |
Join Date: Oct 2005
|
Re: Moving Stacks?
Quote:
For example, one theme in Ogre is the difficulty of changing your goals after you've committed to them. "Pick mostly GEVs, get rid of the main battery, then go after treads to preserve your GEVs." vs "Pick mostly HVYs, and take the ogre apart to preserve your HVYs." Every decision you make commits you further. I think a playbook approach fits Ogre particularly well - to some degree imitating that catalog of opening moves. Look-ahead minimax makes some sense just before and during contact, to pick just which option to take. However, look-ahead should be confined to following the overall strategy. One way to add levels in a playbook is to include better strategies and tactics at higher levels. The introductory AI sets up its GEVs too far forward. The diabolical AI knows the inverted V of HVYs and the 4 howitzer defense. A more dynamic option is to add "rookie mistakes" to the playbook to rebalance the game part-way through. The AI could take a game from a near-certain win to 4:3 odds with a mistake that gives up a tank. (At some point you switch to a mercy kill to wrap up the gaim. That's in the entertainment spectrum of AI. DARPA didn't ask for that.) One advantage of having the video game is that the AI can harvest results from many players and get a good idea of the odds from each move. The AI included in the game now - to my mind at least - seems to make a lot of rookie mistakes. |
|
10-16-2017, 01:48 PM | #13 | |
Join Date: Oct 2017
|
Re: Moving Stacks?
Quote:
|
|
10-16-2017, 02:08 PM | #14 | |
Ogre Line Editor
Join Date: Sep 2006
Location: Plainfield, IL
|
Re: Moving Stacks?
Quote:
A not-quite-AI issue, too... The UI stuck me in a swamp when there was no reason for it; it picked a path through the swamp over a path through clear terrain. I'm not sure what drives the logic for selecting a driving path, but it failed miserably on that one.
__________________
GranitePenguin Ogre Line Editor |
|
Thread Tools | |
Display Modes | |
|
|