Why F.E.A.R.’s AI is still the best in first-person shooters
I've been using Orkin's Goal-Oriented-Action-Planning (GOAP) in my own game development.
Let me tell you an amusing story of how an AI agent outsmarted me, the developer.So I had set up a test scenario, with an agent that could travel, buy stuff at shops, use axes, cut trees, and so forth. When I ran this test, I had set a goal of procuring timber.What I expected the agent to do:1. Go to shop2. Buy axe3. Go to forest4. Cut tree5. Drop axe6. Pickup timber.So I ran my GOAP test, and saw what the agent came up with:1. Go to forest...When I saw that step 1, I was disappointed, because the agent clearly should not be going to the forest when he has no axe yet.But then, as a proud parent of my AI, I saw what the agent had actually planned:1. Go to forest2. Pick up firewood3. Go to store4. Sell firewood5. Buy axe6. Go to forest7. Cut tree8. Drop axe9. Pickup timberHooray! I simply forget to give my agent money. But GOAP made him smart enough on how to get some money on his own.I had of course equipped the agent with 'sell' action, and I had placed firewood in the forest, which I promptly had forgotten about when writing a test scenario.I was so proud of that smart little agent!Cool stuff, that GOAP!