
- 577 pages
- English
- ePUB (mobile friendly)
- Available on iOS & Android
eBook - ePub
About this book
Game AI Pro2: Collected Wisdom of Game AI Professionals presents cutting-edge tips, tricks, and techniques for artificial intelligence (AI) in games, drawn from developers of shipped commercial games as well as some of the best-known academics in the field. It contains knowledge, advice, hard-earned wisdom, and insights gathered from across the com
Frequently asked questions
Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Perlego offers two plans: Essential and Complete
- Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
- Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, weâve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere â even offline. Perfect for commutes or when youâre on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Game AI Pro 2 by Steven Rabin in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming Games. We have over one million books available in our catalogue for you to explore.
Information
Section V
Tactics, Strategy, and Spatial Awareness
Chapter 27
Looking for Trouble
Making NPCs Search Realistically
Rich Welsh
27.1 Introduction
Searching is so second nature to us that apart from the inconvenience of having misplaced something, weâre naturally able to effectively track down missing items. What thought processes do we go through while weâre searching? How can we take these and apply them to our nonplayer characters (NPCs) in order to make them appear more realistic when theyâre searching? If youâre searching for answers to these questions, then look no further!
27.2 Types of Searching
The main focus of this chapter is to outline the way in which NPCs search for hostile targets in a title that I am unable to name. Since the target in this game is a player character, the target will be referred to as âthe playerâ; however, in terms of implementation, this could be any target that is hostile to the NPC. The assumption is also made that the player is actively hiding from hostile NPCs. Despite these assumptions, a lot of the principles described here are suitable for almost any type of search. With that in mind, there are two main types of search that can occur in the game.
27.2.1 Cautious Search
A cautious style of searching is one in which the NPC has been alerted, but does not know whether their target is hostile. This style of searching is generally used when the NPC has been alerted by a stimulus without any knowledge of the source, for example, if a player throws a bottle to draw attention and lure an NPC. While the NPC is aware of the noise, they are unaware of whether the source is a friend or foe.
27.2.2 Aggressive Search
An aggressive search is one where the NPC knows about the target they are searching for and, at the very least, that their target is a hostile one. In most cases, the NPC will have previously seen the player and the player will have successfully evaded the NPC. However, any NPC that has knowledge of their target should employ this style of searchâthis includes reinforcement NPCs who have just entered the engagement or NPCs who have been informed of their hostile target by an ally.
27.3 Triggering a Search
The first key to making a search seem realistic is triggering it at the right time and telegraphing that transition to the player. Since the player is usually still nearby when the search is triggered, it is likely that they are still able to see or hear the NPCs who are about to hunt for them. Therefore, a poor decision on starting the search will be obvious to the player.
While it may not seem as important as the search itself, telegraphing the transition into a searching state to the player is vital to get right in order for players to be able to identify what will and will not cause NPCs to react. In most games, this transition is signaled by some dialogue and occasionally an accompanying animation.
27.3.1 Initial Stimulus-Based Trigger
An initial stimulus-based trigger is one in which the NPC goes from an unaware state into a searching state due to an indirect stimulus such as a sound. If the NPC is able to see the target directly, then they would enter a combat state rather than search, so in this situation the player must have created some kind of stimulus that was sensed without a direct line of sight to the player.
Stimuli received by NPCs can be divided into two categories. Hostile stimuli, such as gunfire and explosions, will trigger an aggressive search response. Although the target isnât known, it is assumed to be hostile from the type of stimulus received. Distraction stimuli on the other hand, for example, a bottle being thrown or a prop being knocked over, will trigger a cautious search.
27.3.2 Losing a Target
This method of triggering a search is one in which the NPCs had a direct line of sight to the target at some pointâwhether the player just briefly dashed across the NPCâs field of view or ran away when spotted or actively engaged in combat. When losing sight of a target, NPCs have knowledge of the last position and direction in which they were moving. Normally, if it were a person watching a target leave, they would be able to estimate the location of the target after losing sight. Simply using the targetâs last known velocity to estimate a current position after a time can cause problems however, as characters (especially players) donât move in perfectly straight lines.
One common problem with extrapolating a position in this manner arises when trying to...
Table of contents
- Preface
- Acknowledgments
- Web Materials
- Editors
- Contributors
- Section I - General Wisdom
- Section II - Architecture
- Section III - Movement and Pathfinding
- Section IV - Applied Search Techniques
- Section V - Tactics, Strategy, and Spatial Awareness
- Section VI - Character Behavior
- Section VII - Analytics, Content Generation, and Experience Management
- Chapter 39 - Analytics-Based AI Techniques for a Better Gaming Experience
- Chapter 40 - Procedural Content Generation: An Overview
- Chapter 41 - Simulation Principles from Dwarf Fortress
- Chapter 42 - Techniques for AI-Driven Experience Management in Interactive Narratives