Saturday, December 29, 2012
Summary
Another family Christmas gathering today, this time with no Wifi, sadly. Nonetheless, managed to get a fair amount done on high-level AI. I finished implementing all of the basic concepts that power the high-level AI, and have started testing it with great success! I've implemented a basic reasoning algorithm that allows the AI to think about how to achieve its goals, and take action to do so.
As a very basic test, I changed the tactical interface to use high-level AI commands rather than low-level. Whereas the old interface sent commands directly to the AI (when you clicked attack, it told the AI "attack this target"), the new interface simply gives the AI goals to achieve, but does not tell them what to do. This is really a much more elegant approach, as it affords the AI a lot of creativity in determining how they want to carry out their task. Now, when you click "attack," you are basically telling the AI "I would like for that target to be destroyed." The difference is subtle, but has very heavy implications. Notice that the second form of the order says
nothing about what the AI should do. It's not a command, really, it's more of a wish. So in order to translate the "command" into an action, the AI actually must use the high-level reasoning system, and think about how it will achieve the player's desires.
The end result? The exact same thing as before
When I tell the AI to attack a target, it attacks the target. Woo! Nonetheless, there's a lot more happening now, and, in the future, we will see very cool consequences because of this. Now, the AI is actually saying "hmm, ok, the player wants that target to be destroyed. How can I make that happen? Well, to destroy something, you can try attacking it...I wonder, what would happen if I attacked that thing? Oh, well, I might destroy it, and that would be good, because the player wants that...ok, yeah, I'll do that! *attacks target*" For now, it's that simple. But in the future, the AI will have a notion of difficulty, so that it will be able to judge how good of a chance it has at destroying a certain target. If you tell it to attack something that it has no chance of defeating, it's probably going to try to come up with a different plan than direct attack, because it recognizes that doing so will most likely
not result in the goal you wanted it to achieve, and, moreover, will probably result in death.
I also implemented a system for allowing the AI to query and request the help of nearby friendlies. This is pretty cool, because it will allow the AI to be intelligent about attacks. If you tell a fighter to attack a capital ship that it has no chance of defeating, it may request the help of nearby friendlies for the duration of the engagement to improve the odds of success.
Overall, I really couldn't be more excited about AI in LT
Hour Tally
Coding: 4.60
Internet: 1.54
Testing: 0.73
Total Logged Time: 6.86