Why F.E.A.R.’s AI is still the best in first-person shooters
I&#x27;ve been using Orkin&#x27;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.<p>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.<p>What I expected the agent to do:<p>1. Go to shop<p>2. Buy axe<p>3. Go to forest<p>4. Cut tree<p>5. Drop axe<p>6. Pickup timber.<p>So I ran my GOAP test, and saw what the agent came up with:<p>1. Go to forest.<p>..<p>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.<p>But then, as a proud parent of my AI, I saw what the agent had actually planned:<p>1. Go to forest<p>2. Pick up firewood<p>3. Go to store<p>4. Sell firewood<p>5. Buy axe<p>6. Go to forest<p>7. Cut tree<p>8. Drop axe<p>9. Pickup timber<p>Hooray! I simply forget to give my agent money. But GOAP made him smart enough on how to get some money on his own.<p>I had of course equipped the agent with &#x27;sell&#x27; action, and I had placed firewood in the forest, which I promptly had forgotten about when writing a test scenario.<p>I was so proud of that smart little agent!<p>Cool stuff, that GOAP!