<story><title>Why F.E.A.R.’s AI is still the best in first-person shooters</title><url>https://www.rockpapershotgun.com/2017/04/03/why-fears-ai-is-still-the-best-in-first-person-shooters/</url></story><parent_chain><item><author>stolk</author><text>I&amp;#x27;ve been using Orkin&amp;#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.&lt;p&gt;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.&lt;p&gt;What I expected the agent to do:&lt;p&gt;1. Go to shop&lt;p&gt;2. Buy axe&lt;p&gt;3. Go to forest&lt;p&gt;4. Cut tree&lt;p&gt;5. Drop axe&lt;p&gt;6. Pickup timber.&lt;p&gt;So I ran my GOAP test, and saw what the agent came up with:&lt;p&gt;1. Go to forest.&lt;p&gt;..&lt;p&gt;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.&lt;p&gt;But then, as a proud parent of my AI, I saw what the agent had actually planned:&lt;p&gt;1. Go to forest&lt;p&gt;2. Pick up firewood&lt;p&gt;3. Go to store&lt;p&gt;4. Sell firewood&lt;p&gt;5. Buy axe&lt;p&gt;6. Go to forest&lt;p&gt;7. Cut tree&lt;p&gt;8. Drop axe&lt;p&gt;9. Pickup timber&lt;p&gt;Hooray! I simply forget to give my agent money. But GOAP made him smart enough on how to get some money on his own.&lt;p&gt;I had of course equipped the agent with &amp;#x27;sell&amp;#x27; action, and I had placed firewood in the forest, which I promptly had forgotten about when writing a test scenario.&lt;p&gt;I was so proud of that smart little agent!&lt;p&gt;Cool stuff, that GOAP!</text></item></parent_chain><comment><author>edejong</author><text>Sounds very familiar. I once made a planning AI for the xlockmore &amp;#x2F; xscreensaver Pacman. It was never included since it would require too much CPU on low-end machines. Nevertheless, it took me quite some time to debug a strange behavior while writing it. The planning system would plan around 50 steps ahead, minimizing the risk of being eaten by a ghost while maximizing the number of dots eaten. Strangely enough, it would continually decide to go towards the ghosts, instead of evading them. Every time I saw this happening, I decided to stop the game and debug my code. Looking through it for the umphth time, I became weary-eyed and let the simulation run for a bit longer. Awe-struck, I saw what Pacman was planning all along: have the ghosts closely follow behind him. This would minimize the probability of being fenced in by the four ghosts.&lt;p&gt;And this reminds me, I wrote that code 12 years ago, and I still want to incorporate it (with a switch) into the xscreensaver code, but never came to it...</text></comment>
<story><title>Why F.E.A.R.’s AI is still the best in first-person shooters</title><url>https://www.rockpapershotgun.com/2017/04/03/why-fears-ai-is-still-the-best-in-first-person-shooters/</url></story><parent_chain><item><author>stolk</author><text>I&amp;#x27;ve been using Orkin&amp;#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.&lt;p&gt;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.&lt;p&gt;What I expected the agent to do:&lt;p&gt;1. Go to shop&lt;p&gt;2. Buy axe&lt;p&gt;3. Go to forest&lt;p&gt;4. Cut tree&lt;p&gt;5. Drop axe&lt;p&gt;6. Pickup timber.&lt;p&gt;So I ran my GOAP test, and saw what the agent came up with:&lt;p&gt;1. Go to forest.&lt;p&gt;..&lt;p&gt;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.&lt;p&gt;But then, as a proud parent of my AI, I saw what the agent had actually planned:&lt;p&gt;1. Go to forest&lt;p&gt;2. Pick up firewood&lt;p&gt;3. Go to store&lt;p&gt;4. Sell firewood&lt;p&gt;5. Buy axe&lt;p&gt;6. Go to forest&lt;p&gt;7. Cut tree&lt;p&gt;8. Drop axe&lt;p&gt;9. Pickup timber&lt;p&gt;Hooray! I simply forget to give my agent money. But GOAP made him smart enough on how to get some money on his own.&lt;p&gt;I had of course equipped the agent with &amp;#x27;sell&amp;#x27; action, and I had placed firewood in the forest, which I promptly had forgotten about when writing a test scenario.&lt;p&gt;I was so proud of that smart little agent!&lt;p&gt;Cool stuff, that GOAP!</text></item></parent_chain><comment><author>seanwilson</author><text>I love examples like these but where lack of real world or common sense knowledge gives funny results.&lt;p&gt;I tried writing a text adventure game generator once that would combine puzzle templates you gave it like &amp;quot;object X you need is in a tree and you need a climbable thing Y to get it&amp;quot; and &amp;quot;object X is in a vending machine and you need a coin to get it&amp;quot; to create basic chains of puzzles. Without more constraints it would do silly things like create a vending machine containing ladders, vending machines in trees, vending machines containing other vending machines and trees, and vending machines that gave you a coin for a coin.</text></comment>