NPC/Artifical Intelligence là gì

IntroductionWhen it comes to đoạn Clip games, immersion is key. All types of games ayên to lớn keep the player immersed in some size or another. In role-playing games, it is important to create a believable game world in order khổng lồ keep players immersed. A game world is made up of many things, but one aspect that is central to lớn immersion is the other characters that live sầu in the game world. These characters that fill a game world can be player-controlled or non-player controlled. This paper will focus on non-player characters (NPCs), how they contribute khổng lồ immersion, how they work, & how they can be improved.

Bạn đang đọc: NPC/Artifical Intelligence là gì


NPCs và Their Role in Games and Immersion

As mentioned before, a non-player character (NPC) is a character that is not directly controlled by a player in a game. These characters make up part of the game world in games. A game world in a game is essentially the setting of the game. All role-playing games (RPGs) have sầu a setting — such as the wild west, the medieval times, the distant future, etc. The NPCs in any given setting need to fit in to the world & behave sầu believably based on the setting of the game in order for the game to immerse the player.

There are some common roles and tasks that NPCs fulfill in all RPGs. NPCs in games will offer quests, talk, play games, fight, & generally go about their business — seemingly of their own không lấy phí will. They vày all these things khổng lồ create a game world that feels alive sầu with real people in it, which is generally how they relate to lớn immersion. When the NPCs in a game make the player feel like a believable facsimile of a person within the setting of the game, then the game has achieved immersion in regards to lớn NPCs.

Immersion is quite nebulous và subjective sầu, but is arguably the most important factor when measuring the chất lượng of a game. Despite the difficulty in measuring immersion, Jennett et. al. presented findings that suggest there may be methods lớn measure immersion both qualitatively and quantitatively <8>. A measurement for immersion could be a valuable tool when assessing the chất lượng of NPC artificial intelligence.

How Current NPCs Work

NPCs are typically controlled with state machines, which are a very comtháng method of controlling various software và hardware. In video clip games, state machines are used lớn determine the behavior of AI agents. A state machine, at its core, is a directed graph. In an NPC state machine graph, nodes denote behavior states và edges denote events. A simple state machine example in a game is shown in Figure 1, which shows the state of an NPC guard in a fictional game setting. This state machine consists of two nodes, ‘Standing Guard’, & ‘Attacking’, and one edge, ‘Player Seen’. This graph is simply meant khổng lồ illustrate what an NPC state machine could look like — typical NPC state machine in a real game would likely have tens, maybe hundreds of states. This form of behavior representation is fairly restrictive sầu, allowing for only a few predetermined responses to lớn events.



Figure 1: A simplified NPC state machine <9>.

Another aspect of NPC behavior modeling in games is dialogue. Dialogue between player-controlled characters and NPCs is usually modeled by a form of a state machine called a dialogue tree. In a dialogue tree, nodes represent a response from an NPC and edges represent dialogue from the player. An example of a dialogue tree is shown in Figure 2. This Model for controlling dialogue in games is fully dependent on game designers writing and animating every possible line of dialogue và then creating a digital representation of the dialogue tree for the whole conversation.



Figure 2: An example diagram of a dialogue tree <3>.

Problems with Current NPCs

Imagine a scenario where you are playing a game và interacting with a guard that is controlled by a state machine similar to lớn the one in Figure 1. You try sneaking by the guard, but they see you, attaông chồng, và then you run away. You try a couple more times to sneak by the guard with similar results. After a few more tries, you realize right where the blind spot is in the guard’s patrol route, enabling you to lớn easily sneak past them every time. While it is not totally impossible for this situation lớn happen in real life, it is highly implausible. The state machine controlling the guard in this situation restricts the AI agent to lớn performing only a few simple tasks and nothing more.

This situation illustrates the first problem with current NPCs: predictability. Because NPCs have sầu a finite, predetermined phối of behaviors (states), it does not take long for human players lớn learn these behaviors and exploit the mechanisms controlling the NPCs. This predictability breaks the player’s immersion because interaction with NPCs is not believable. In the example above, the player must come khổng lồ one of two conclusions; either the guard is incredibly incompetent at their job, or the guard is not a real and is simply represented by some machine, breaking the player’s immersion.

This mix of conclusions leads to lớn another problem with current NPCs that is related khổng lồ the first, which is the unrealistic reactions of NPCs in current games. NPCs cannot react realistically to emergent situations because their behaviors are predetermined. Continuing with the example from above, a more realistic reaction from the guard lớn repeated attempts by the player to lớn sneak by would be lớn take some sort of extra precaution in guarding the area, making it harder for people lớn slip by. Or, perhaps the guard decides lớn encác mục their guard buddies in laying a trap for the next person lớn attempt khổng lồ slip through their area. For a human, it is easy for to lớn come up with endless alternative sầu responses to an emergent behavior, but this is not so for current NPCs.

How NPCs can be Improved

Fuzzy State Machines

Similar lớn a regular state machine, a fuzzy state machine is made up of nodes that represent behaviors & edges that represent events. However, fuzzy state machines add a new wrinkle: trait checks. Figure 3 shows a fuzzy version of the state machine in Figure 1, in which a relation kiểm tra is used lớn determine the behavior of the NPC. In this particular model, the relationship check determines what state khổng lồ transition lớn based on whether the player has a positive sầu, neutral, or negative relationship with the NPC. In general, any agent trait can be used lớn insize a transition from one state to another in a fuzzy state machine. A small amount of randomness can also be added to lớn a trait kiểm tra to lớn reduce the predictability of NPC behavior.


Figure 4: An example of a relationship graph between characters in a game <9>.

Xem thêm: Ping Cao, Cách Giảm Ping Khi Chơi Game Online: 9 Bước (Kèm Ảnh)

One variant of a relationship graph that I particularly like is the directed, weighted relationship graph. In this variation, the direction of edges indicates that the character at the tail of the edge knows of the character at the head of the edge. This allows for situations lượt thích celebrity, where many people know of a celebrity, but the celebrity does not know all of their fans. The other aspect of this variation is that each edge is weighted. The weight of an edge signifies some characteristic — for instance, how much a character likes another. Information about things like who knows of who, who is friends with who, etc. can be useful for fuzzy state machine khổng lồ determine transitions khổng lồ other states.

Procedural Facial Animation

Figure 5: A set of facial meshes for khổng lồ be used as blendshapes for 3D facial animation. The larger faces on the left show the default/resting facial mesh. The smaller faces on the right each show a different morph target.

If an NPC in a game is to lớn appear have human emotion then it must have appropriate, believable facial animation. Animated movies & cutscenes in many games use custom facial animation for each scene, which are either created by an animation artist or through motion capture công nghệ. In the former method of facial animation, blendshapes <1>, also called morph targets, are usually the industry standard. In order lớn animate with blendshapes, several copies of a facial mesh are created and deformed inkhổng lồ different morph targets, each depicting a different facial expression or phonetic sound for the mouth (used lớn mã sản phẩm speech). See Figure 5 to observe a phối of facial meshes that hóa trang the morph targets for a face mesh. Varying degrees of facial expression can be configured easily by linearly interpolating between the vertices of the default face & a specific morph target. Morph targets can even be combined khổng lồ express mixed emotion. Given a set of morph targets for a face, any single frame in an animation can be expressed as a các mục of percentages, with each percentage corresponding khổng lồ the weight of a corresponding morph target.

Typically, each frame in an animation is created by an animator, by hand. However, it is possible khổng lồ remove the need for human frame-by-frame control through the use of procedural animation. In conjunction with some set of factors to inkhung the animation lượt thích a state machine, a relationship graph, and/or a phối of personality traits, blendshapes can be used to procedurally generate facial animation. Emotional status can be determined at each state in an NPC’s state machine based upon recent events, previous state, personality traits, và the relationship status between the given NPC và the characters they are interacting with. When used together, the combination of these systems can create a reasonable facsimile of realistic, appropriate human emotion.

Core Personality Characteristics

Human behavior typically differs based upon a person’s personality. For instance, extroverts typically seek attention & human interaction, while introverts vì chưng not. One person’s reaction to lớn a particular event will not necessarily be the same as another person’s because they differ in experience và personality. In order khổng lồ reflect this aspect of humanness in an NPC, a phối of core personality traits can be generated.

Figure 6: A graphical description of the ‘Big Five’ personality traits <13>.

One set of personality traits that should be considered are a mix commonly referred khổng lồ as the ‘Big Five’, which have sầu been collectively iterated on by researchers since the inception of this concept in the late 1950s at the U.S. Air Force Personnel Laboratory <14>. The five sầu factor model was introduced in 1990 <4> & was further refined by several groups of researchers <2, 6, 11>. The traits that 3D the ‘Big Five’ are: Openness, Conscientiousness, Extraversion, Agreeableness, and Neuroticism. Figure 6 displays a short description of each trait.

To translate these personality traits inkhổng lồ something a game engine can underst&, each trait can be represented as a percentage. In this Model, 0% represents that a character does not display the trait at all and 100% represents that a character fully displays a trait. With this encoding, these numbers can be used to lớn inkhung state changes in a fuzzy state machine model. ReHotline that fuzzy state machines use agent traits khổng lồ inkhung state changes. By representing each NPC with different, randomized personality traits like the ‘Big Five’, a game can achieve the effect of a quality personality for each NPC.

An Alternate Machine Learning

Machine learning is a powerful tool that can be applied lớn almost any problem space, which includes, theoretically, smarter NPCs in games. The great thing about machine learning algorithms is that they can produce a desired effect without the need for a human to design the algorithm. The problem with using them khổng lồ create a smarter NPC in games is that they need to lớn be trained on as large of a dataset as possible in order lớn produce the desired result. Said dataphối must include input đầu vào data & a desired output for each datapoint. For the task of creating a smarter NPC, it is challenging to define what a datapoint in a training datamix may look like. On top of that, compiling a large enough dataset to produce the desired results could be extremely laborious.

One method for training an NPC machine learning algorithm could be lớn utilize a machine learning algorithm lớn learn how khổng lồ properly react to a given sự kiện. For this method, the input đầu vào data for each datapoint would be an sự kiện, along with all relevant information for the NPC Mã Sản Phẩm to lớn react to the sự kiện. Assuming the NPC includes all the NPC improvements listed above, the relevant information would include the given NPC’s relationship graph and their personality traits, along with any information needed to encode the sự kiện và its actors. The output could be rated on a scale of 1 to lớn 10, with 1 representing a totally unrealistic reaction và 10 representing a completely realistic reaction. These scores would need to be determined and catalogued by a human obVPS manually.

The approach above is, admittedly, quite naive sầu. Given enough time, this approach would eventually produce the right results. However, the human grading requirement severely limits how fast the algorithm can learn to produce more correct results. This approach is just one attempt at training a smarter NPC machine learning algorithm, with innumerable alternate approaches that have yet to lớn be thought of.


While the gaming industry has continued lớn innovate in many areas over the years, NPC artificial intelligence has not been a part of that innovation. Current NPCs are controlled by basic state machines, & have been since NPCs first appeared in games. There are many problems with this basic Model, most notably being predictability & unrealistic reactions khổng lồ emergent behaviors. I propose four methods lớn increase immersion in relation to lớn NPCs: fuzzy state machines, relationship graphs, procedural facial animation, & core personality traits, along with an alternate approach that involves machine learning. I hope khổng lồ see changes to lớn NPCs in the near future, & maybe even take part in the process of improvement và innovation.

BibliographyChuang, E., and Bregler, C. 2002. Performance driven facial animation using blendshape interpolation. Tech. rep., Stanford University.Costa, Phường.T., Jr., McCrae, R.R.; Revised NEO Personality Inventory (NEO-PI-R) and NEO Five-Factor Inventory (NEO-FFI) manual. Odessa, FL: Psychological Assessment Resources, 1992.“Dialogue Tree.” Ultimate Pop Culture Wiki,, J.M., “Personality structure: Emergence of the five-factormã sản phẩm,” Annual Reviews of Psychology, 41, 417–440, 1990.Goldberg, L.R., “The structure of phenotypic personality traits,” American Psychologist, 48, 26–34, 1993.Jennett, Charlene, et al. “Measuring và Defining the Experience of Immersion in Games.” International Journal of Human-Computer Studies, vol. 66, no. 9, 2008, pp. 641–661., doi:10.1016/j.ijhcs.2008.04.004.L. Gruenwoldt & M. Katchabaw. Creating Reactive sầu Non Player Character Artificial Intelligence in Modern Video Games. In Proceedings of the 2005 GameOn North America Conference (2005).Norman, Warren T. “Toward an Adequate Taxonomy of Personality Attributes: Replicated Factor Structure in Peer Nomination Personality Ratings.” The Journal of Abnormal và Social Psychology, vol. 66, no. 6, June 1963, pp. 574–583. EBSCOhost, doi:10.1037/h0040291.Russell, M.T., Karol, D.; 16PF Fifth Edition administrator’s manual.” Champaign, IL: Institute for Personality và Ability Testing, 1994.S. Watson, W. Banzhaf, & A. Vardy. Automated kiến thiết for playability in computer game agents. IEEE Transactions on Computational Intelligence & AI in Games (CIG), 2014.Tupes, E.C., Christal, R.E.; “Recurrent Personality Factors Based on Trait Ratings,” Technical Report ASD-TR-61–97, Lackland Air Force Base, TX: Personnel Laboratory, Air Force Systems Comm&, 1961.Watson, Scott, et al. “Automated Design for Playability in Computer trò chơi Agents.” năm trước IEEE Conference on Computational Intelligence & Games, năm trước, doi:10.1109/cig.2014.6932860.

Chuyên mục: Kiến Thức Games