Facing Your F.E.A.R

Building the AI of F.E.A.R.

  • What information do we have of the world? Knowledge that we can encapsulate within a simple encoding, known as a state.
  • What actions does the agent have available to them? How can they transform that state into different circumstances that may ultimately prove more desirable.
  • Lastly, what are the agents goals? By understanding their intent, we can use a search algorithm to find the optimal state transitions (using actions) to reach that goal.
The NPCs in F.E.A.R. are focussed on removing the threat presented by the player.

Thinking Long-Term

NPCs in F.E.A.R. adopt planning techniques to think long-term about what they want to achieve.

G.O.A.P.: Goal Oriented Action Planning

  • Goto — It is assumed that the bot is moving towards a particular physical location. These locations are often nodes that have been denoted to permit some actions to take place when near them.
  • Animate — each character in the game has some basic animations that need to be executed in order for it to maintain some level of emergence with the player. So this state enforces that bots will run animations that have context within the game world. These can be peeking out from cover, opening fire or throwing a grenade.
  • Use Smart Object — as explained in (Orkin, 2005), this is essentially an animation node. The only different is the animation is happening in the context of that node. Examples of this can be jumping over a railing or flipping a table on its side to provide cover.
F.E.A.R. AI is robust, reactive and proactive where necessary.

Planning in G.O.A.P.

Memory Management

Dynamic Goal Assignment

A collection of goals and actions that assigned to a specific NPC type.

Basic and Squad Behaviour

  • Get-To-Cover: ensures all squad members not currently in cover to do so.
  • Advance-Cover: moves squad members to cover that is closer to the threat.
  • Orderly-Advance: moves NPC along firing lines while covered by a teammate.
  • Search: Pairs of NPCs systematically search the local area.
A character may attempt to advance to cover, only to fallback after the player throws a grenade towards them.
Squad behaviours such as flanking are co-ordinated by the squad manager and not the NPCs themselves. Each AI doesn’t even know that the other exists, nevermind that they appear to be working together.

Conclusion

References

  • (Fikes, Richard E., and Nils J. Nilsson., 1972) STRIPS: A new approach to the application of theorem proving to problem solving. Artificial intelligence 2.3 (1972): 189–208.
  • (Fox, M., and Long, D., 2003) PDDL2. 1: An Extension to PDDL for Expressing Temporal Planning Domains. J. Artif. Intell. Res.(JAIR) 20 (2003): 61–124.
  • (Ghallab, Malik, Nau, Dana S. and Traverso, Paolo, 2004), Automated Planning: Theory and Practice, Morgan Kaufmann, ISBN 1–55860–856–7
  • (Orkin, J., 2004)Symbolic Representation of Game World State: Toward Real-Time Planning in Games. AAAI Challenges in Game AI Workshop 2004.
  • (Orkin, J., 2005) Agent Architecture Considerations for Real-Time Planning in Games. Proceedings of the 2007 conference for Artificial Intelligence and Interactive Digital Entertainment (AIIDE ’05).
  • (Orkin, J., 2006) Three States and a Plan: The AI of F.E.A.R. Proceedings of the 2006 Game Developers Conference (GDC ’06).
  • (Thompson, T. and Levine, J. 2009) Realtime Execution of Automated Plans Using Evolutionary Robotics. IEEE Symposium on Computational Intelligence and Games (CIG), September 2009.

--

--

Director of @AIandGames: providing consultancy in AI technologies as well as producing our YouTube series. Indie developer with @TableFlipGames.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Tommy Thompson

Tommy Thompson

Director of @AIandGames: providing consultancy in AI technologies as well as producing our YouTube series. Indie developer with @TableFlipGames.