Npc behavior performance method and device based on player behavior influence, electronic equipment and computer program product
By reading the feature data of NPCs and player characters and generating control commands based on the threshold matching of the feature data, the problem of the lack of richness in NPC behavior performance is solved, thus improving the game experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- MIHAYOU TECH (SHANGHAI) CO LTD
- Filing Date
- 2022-03-29
- Publication Date
- 2026-04-14
AI Technical Summary
In existing technologies, the behavior of NPCs lacks richness, resulting in an insufficient player experience in the game.
By reading the feature data of NPCs and player characters, control commands are generated based on the threshold matching of feature data, and display data is generated to enrich the behavior of NPCs, including the establishment of basic attribute data and daily behavior tables, as well as the updating of interactive events and time differences based on player behavior.
It enhances the richness of NPC behaviors and the gaming experience, and strengthens the self-circulation and diversity of daily behaviors of NPCs through the influence of player behavior.
Smart Images

Figure CN114681920B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of online game technology, specifically to a method, device, electronic device, and computer program product for NPC behavior performance based on player behavior. Background Technology
[0002] Multiplayer games provide a virtual world or some other imagined game space where players control one or more player characters, participate in in-game activities, and / or acquire in-game assets. A player character (also called a avatar or PC) can be considered the player's representation in the game. The game engine receives input from the player, determines the player character's activities, decides the outcome of events, and presents the player with game screens explaining what is happening. In some multiplayer games, each player can control one or more player characters.
[0003] In some games, game engines can manage and display non-player characters (NPCs). Unlike player characters, who are actively controlled by the player, NPCs derive their movement, actions, and decisions from the game engine. Game engines can provide NPCs in a game to make the game space more realistic or because the game lacks player characters. Because NPCs are not controlled by player input, they can sometimes appear lifeless or indistinguishable from one another. Furthermore, the basic daily behaviors of NPCs are often fixed, leading to a lack of richness in NPC character expression and a less than ideal player experience. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides a method, device, electronic device, and computer program product for NPC behavior performance based on player behavior influence, which can improve the richness of NPC behavior performance based on player behavior influence.
[0005] To achieve the above objectives, the present invention provides the following technical solution:
[0006] Firstly, embodiments of the present invention provide a method for NPC behavior based on the influence of player behavior, specifically including:
[0007] Read the first and second feature data of the current NPC character;
[0008] A first control command is generated when the first feature data matches a first threshold.
[0009] A second control command is generated when the second feature data matches the second threshold.
[0010] Display data is generated based on the first control instruction and / or the second control instruction.
[0011] Preferably, before reading the first and second feature data of the current NPC character, the process also includes:
[0012] Establish basic attribute data and daily behavior tables that match NPCs;
[0013] When an NPC character and a player character collide, read the first basic event value of the current NPC character; and form the first feature data based on the basic event value.
[0014] Read the current player's second basic characteristic data, and form the second characteristic data based on the second basic characteristic data.
[0015] Preferably, when an NPC character and a player character collide, the first basic event value of the current NPC character is read; forming the first feature data based on the basic event value includes:
[0016] When an NPC character and a player character collide, read the player's last interaction with the current NPC character and the time of the last interaction.
[0017] The basic event value is updated based on the previous interaction behavior, interaction time, historical basic event value, time difference, and the basic parameters of the NPC.
[0018] The first feature data is formed based on the basic event values.
[0019] Preferably, the second basic feature data of the current player is read, and the second feature data is formed based on the second basic feature data, specifically including:
[0020] Read the second basic characteristic data of the current player character;
[0021] Given that the second basic feature data is not less than the reference feature data, the second feature data is formed based on the second basic feature data.
[0022] Secondly, embodiments of the present invention provide an NPC behavior performance device based on the influence of player behavior, including...
[0023] The reading module is used to read the first and second feature data of the current NPC character.
[0024] The first control instruction forming module is used to form a first control instruction when the first feature data matches the first threshold.
[0025] The second control instruction forming module is used to form a second control instruction when the second feature data matches the second threshold.
[0026] The display module is used to generate display data according to the first control instruction and / or the second control instruction.
[0027] Preferably, it also includes,
[0028] The basic information creation module is used to create basic attribute data and daily behavior tables that match the NPCs;
[0029] The first feature data forming module is used to read the first basic event value of the current NPC character when an NPC character and a player character collide; and to form the first feature data based on the basic event value.
[0030] The second feature data forming module is used to read the current player's second basic feature data and form the second feature data based on the second basic feature data.
[0031] Preferably, the first feature data forming module further includes,
[0032] The first reading unit is used to read the player's last interaction with the current NPC and the last interaction time when the NPC and player characters collide.
[0033] The event update unit is used to update the basic event value based on the previous interaction behavior, interaction time, historical basic event value, time difference value, and the basic parameters of the NPC.
[0034] The first feature data forming unit is used to form first feature data based on the basic event value.
[0035] Preferably, the second feature data forming module further includes,
[0036] The second reading unit is used to read the second basic characteristic data of the current player character;
[0037] The second feature data forming unit is used to form the second feature data based on the second basic feature data when the second basic feature data is not less than the reference feature data.
[0038] Thirdly, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the NPC behavior performance method based on player behavior as described above.
[0039] Fourthly, embodiments of the present invention provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the NPC behavior performance method based on player behavior influence in the electronic device described above.
[0040] The present invention has the following beneficial effects:
[0041] By acquiring the basic event parameter set of interaction events between NPC characters and player characters, as well as the feedback data of NPCs to players' own basic attributes, the basic event values are updated based on the previous interaction behavior, interaction time, historical basic event values, time difference, and the basic parameters of the NPCs, such as age, occupation, and other basic attribute data. On this basis, the frequency parameter of event occurrence value is superimposed, which accumulates over time to affect the daily behavior of NPCs and improves the richness of NPC behavior. Attached Figure Description
[0042] Figure 1 This is a flowchart of a method for NPC behavior based on player behavior influence, provided in Embodiment 1 of the present invention.
[0043] Figure 2 This is a flowchart of a method for NPC behavior based on player behavior influence, provided in Embodiment 1 of the present invention.
[0044] Figure 3 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. Detailed Implementation
[0045] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0046] Example 1
[0047] This embodiment provides a method for NPC behavior based on the influence of player behavior. Figure 1 This embodiment provides a flowchart of a method for NPC behavior representation based on player behavior, specifically including:
[0048] S110, Read the first and second feature data of the current NPC character;
[0049] Specifically, the primary characteristic data of an NPC character refers to the set of basic event parameters for interactions between the NPC character and the player character. Illustratively, character interactions are determined by distance and collision, for example, by a collision detection model or by other methods, such as root point determination.
[0050] When an NPC and a player interact, the system reads the player's last interaction with the current NPC and the last interaction time. For example, if a player frequently visits the fisherman's fish shop, the system updates the basic value of the player's visit to the fisherman's fish shop event to form the first feature data based on the last interaction between the player and the fisherman, the interaction time, the historical basic event value, the time difference, and the basic parameters of the NPC.
[0051] The second feature data can be understood as the feedback data of the NPC to the player's own basic attributes; for example, the player's own basic attributes can be reputation system, hatred system, admiration system, etc. Based on these player's own basic attributes, when a player with high reputation enters the NPC, the NPC will perform admiration or admiration behavior towards the player. S120, A first control command is formed when the first feature data matches the first threshold.
[0052] Specifically, the first control command is the NPC's model switching command. When the NPC character completes basic events of interaction with the player and accumulates to the first threshold, the model switching command is formed. This can include changes in personality, physique, and willingness to take risks. For example, the fisherman NPC has a thin physique. When the basic interaction event of the player frequently visiting the fisherman's fish shop is triggered, the fisherman's fish shop becomes very popular. When the basic event value of the exchange accumulates to a certain value, a model switching command can be formed, such as affecting the change of the fisherman's physique, and the fisherman's physique switches to a plump physique.
[0053] S130, A second control command is generated when the second feature data matches the second threshold.
[0054] Specifically, the second control command is the NPC's behavior command. For example, the player's own basic attributes can be reputation system, hatred system, admiration system, etc. Based on these player's own basic attributes, the NPC can generate corresponding behavior feedback data, and generate behavior command based on the behavior feedback data. For example, when a player with high reputation walks into the NPC, the NPC will perform admiration and admiration behavior towards the player.
[0055] S140. Form display data according to the first control instruction and / or the second control instruction.
[0056] Specifically, based on the NPC's model switching commands and NPC's behavioral action commands, the daily NPC behavior table is added, modified, and updated to reflect the rich self-cycle of NPCs.
[0057] For example, when players frequently visit the fisherman's shop, and the number of visits exceeds a predetermined threshold, the fisherman's income increases, altering his corresponding basic attribute data, such as making him increasingly overweight and his clothing more ornate; player behavior can influence certain areas or locations in an NPC's daily activities, thus indirectly affecting the NPC's daily behavior; players can frequently stand next to an NPC without any interaction, simply observing, and when the number of observations reaches a certain threshold, it can influence the NPC's personality or behavior, making the NPC appear unnatural; frequently being near an NPC and inputting certain sounds can, after AI voice recognition, affect the NPC's daily behavior.
[0058] Generally, the first and second thresholds are calculated using a neural network model. For example, this neural network model is set up on a server, and the emotional data of NPCs and the corresponding activity data when these emotions arise are input into the model. Emotions such as happiness, sadness, worry, fear, panic, surprise, frustration, and longing, as well as activity events such as receiving rewards, being injured, failing to complete a task, encountering bad guys, completing a difficult task in a short time, failing a task, and missing loved ones, are used to train the neural network model and calculate the corresponding first and second thresholds.
[0059] In a preferred embodiment, before step S110, reading the first and second feature data of the current NPC character, the method further includes:
[0060] S1091. Establish basic attribute data and daily behavior tables that match NPCs;
[0061] Specifically, the system obtains basic attribute data and daily behavior tables that match the NPCs. The basic attribute data includes the NPC's personality, profession, age, dream, adventurousness, model appearance, etc., and may include one or more of these. The basic attribute data can be initialized and set with relevant initial values. For example, if the fisherman's personality is calm, his age is 56, his dream is to take his apprentice fishing, and his adventurousness value is 70, etc., the daily behavior table is the fisherman's basic daily work process. For example, if the fisherman gets up at 7 am and goes to the seaside to fish at 9 am, then the corresponding NPC will always be fishing at the seaside.
[0062] S1092. When an NPC character and a player character collide, read the first basic event value of the current NPC character; and form the first feature data based on the basic event value.
[0063] When an NPC and a player character collide, the system reads the player's last interaction with the current NPC and the last interaction time. Based on the last interaction, interaction time, historical basic event value, time difference, and the NPC's basic parameters, such as age and profession, the system updates the basic event value. It should be noted that the interaction is between the player and the NPC; the last interaction time is the time of the player's last interaction during their last login period; the historical basic event value is the basic event value after the player's last interaction; and the time difference is the time difference during which the player has not logged into the game. This time difference is only valid if it exceeds several months; otherwise, it is invalid. The system then forms the first feature data based on the basic event value.
[0064] S1093. Read the second basic feature data of the current player, and form the second feature data based on the second basic feature data.
[0065] Specifically, the system reads the current player character's second basic characteristic data. This second basic characteristic data can be the player's reputation system, hatred system, admiration system, etc. Based on these basic attributes of the player, and if the second basic characteristic data is not less than the reference characteristic data, the NPC can generate corresponding behavioral feedback data, that is, form the second characteristic data. Behavioral action commands are then generated based on this behavioral feedback data. For example, when a player with high reputation approaches an NPC, the NPC will show admiration or affection towards the player.
[0066] In the above embodiments, by acquiring the basic event parameter set of the interaction events between NPC characters and player characters, as well as the feedback data of NPCs to players' own basic attributes, the basic event values are updated based on the previous interaction behavior, interaction time, historical basic event values, time difference, and the basic parameters of the NPCs, such as age, occupation, and other basic attribute data. On this basis, the parameter of "number of times" is superimposed, which accumulates over time to affect the daily behavior of NPCs and improves the richness of NPC behavior.
[0067] Example 2
[0068] This invention provides an NPC behavior representation device based on player behavior, the device specifically comprising:
[0069] The reading module is used to read the first and second feature data of the current NPC character.
[0070] The first control instruction forming module is used to form a first control instruction when the first feature data matches the first threshold.
[0071] The first control instruction forming module is used to form a second control instruction when the second feature data matches the second threshold.
[0072] The display module is used to generate display data according to the first control instruction and / or the second control instruction.
[0073] The working principle of this embodiment is the same as that of Embodiment 1, so it will not be described in detail.
[0074] Example 3
[0075] This application provides an electronic device that can integrate the NPC behavior performance device based on player behavior influence provided in this application. Figure 3 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of this application. Figure 3 As shown, this embodiment provides an electronic device 400, which includes: one or more processors 420; and a storage device 410 for storing one or more programs, which, when executed by the one or more processors 420, cause the one or more processors 420 to perform:
[0076] Read the first and second feature data of the current NPC character;
[0077] A first control command is generated when the first feature data matches a first threshold.
[0078] A second control command is generated when the second feature data matches the second threshold.
[0079] Display data is generated based on the first control instruction and / or the second control instruction.
[0080] like Figure 3 As shown, the electronic device 400 includes a processor 420, a storage device 410, an input device 430, and an output device 440; the number of processors 420 in the electronic device can be one or more. Figure 3 Taking a processor 420 as an example; the processor 420, storage device 410, input device 430, and output device 440 in the electronic device can be connected via a bus or other means. Figure 2 For example, China and Israel are connected via bus 450.
[0081] Storage device 410, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and module units, such as the program instructions corresponding to the NPC behavior performance method based on player behavior influence in the embodiments of this application.
[0082] Storage device 410 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function; the data storage area may store data created based on terminal usage. Furthermore, storage device 410 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory, or other non-volatile solid-state storage device. In some instances, storage device 410 may further include memory remotely located relative to processor 420, which can be connected via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0083] Input device 430 can be used to receive input digital, character, or voice information, and to generate key signal inputs related to user settings and function control of the electronic device. Output device 440 may include devices such as a display screen and a speaker.
[0084] Example 4
[0085] In some embodiments, the methods described above can be implemented as a computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of this disclosure. Specifically:
[0086] Read the first and second feature data of the current NPC character;
[0087] A first control command is generated when the first feature data matches a first threshold.
[0088] A second control command is generated when the second feature data matches the second threshold.
[0089] Display data is generated based on the first control instruction and / or the second control instruction.
[0090] The aforementioned computer-readable storage medium can be a tangible device capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example, but not limited to, electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage medium as used herein is not to be construed as a transient signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0091] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper cables, fiber optic cables, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to computer-readable storage media within the respective computing / processing device.
[0092] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages and conventional procedural programming languages. The computer-readable program instructions may execute entirely on a user's computer, partially on a user's computer, as a standalone software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.
[0093] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processing unit of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0094] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0095] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of devices, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0096] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for NPC behavior performance based on player behavior influence, characterized in that, include: Read the first feature data and the second feature data of the current NPC character; the first feature data refers to the basic event parameter set of the interaction event between the NPC character and the player character; the second feature data is the feedback data of the NPC to the player's own basic attributes; specifically, based on the player's own basic attributes, if the second basic feature data is not less than the reference feature data, the NPC forms the corresponding behavioral feedback data, that is, forms the second feature data. A first control command is formed when the first feature data matches a first threshold. The first control command is an NPC model switching command, which is formed when the NPC character accumulates the first threshold after completing basic events of interaction with the player. A second control command is generated when the second feature data matches a second threshold; the second control command is specifically a behavior action command of the NPC. A display data is generated based on the first control instruction and / or the second control instruction; specifically, based on the NPC's model switching instruction and the NPC's behavior action instruction, the NPC's daily behavior table is added, modified, and updated to reflect the NPC's rich self-loop; Before reading the first and second characteristic data of the current NPC character, the process includes: establishing basic attribute data and daily behavior tables that match the NPC; reading the first basic event value of the current NPC character when the NPC character and the player character collide; forming the first characteristic data based on the first basic event value; reading the second basic characteristic data of the current player character; and forming the second characteristic data based on the second basic characteristic data.
2. The method for NPC behavior representation based on player behavior influence according to claim 1, characterized in that, When an NPC character and a player character collide, read the first basic event value of the current NPC character; The first feature data is formed based on the first basic event value, including: When an NPC character and a player character collide, read the player's last interaction with the current NPC character and the time of the last interaction. The first basic event value is updated based on the previous interaction behavior, interaction time, historical basic event value, time difference, and the basic parameters of the NPC. The first feature data is formed based on the first basic event value.
3. The method for NPC behavior representation based on player behavior influence according to claim 1, characterized in that, Read the current player's second basic characteristic data, and form the second characteristic data based on the second basic characteristic data, specifically including: Read the second basic characteristic data of the current player character; Given that the second basic feature data is not less than the reference feature data, the second feature data is formed based on the second basic feature data.
4. A device for NPC behavior representation based on player behavior, characterized in that, include, The reading module is used to read the first feature data and the second feature data of the current NPC character; the first feature data refers to the basic event parameter set of the interaction event between the NPC character and the player character; the second feature data is the feedback data of the NPC to the player's own basic attributes; The first control instruction forming module is used to form a first control instruction when the first feature data matches a first threshold; the first control instruction is an NPC model switching instruction, which is formed when the NPC character completes basic events of interacting with the player and accumulates to the first threshold. The second control instruction forming module is used to form a second control instruction when the second feature data matches the second threshold; the second control instruction is specifically a behavior action instruction of the NPC. The display module is used to generate display data according to the first control instruction and / or the second control instruction; specifically, according to the NPC's model switching instruction and the NPC's behavior action instruction, it adds, modifies and updates the NPC's daily behavior table to reflect the NPC's rich self-loop; The device also includes a basic information establishment module, used to establish basic attribute data and daily behavior tables that match the NPC; The first feature data formation module is used to read the first basic event value of the current NPC character when an NPC character and a player character collide. The first feature data is formed based on the first basic event value; The second feature data forming module is used to read the current player's second basic feature data and form the second feature data based on the second basic feature data.
5. The NPC behavior performance device based on player behavior influence according to claim 4, characterized in that, The first feature data forming module also includes, The first reading unit is used to read the player's last interaction with the current NPC and the last interaction time when the NPC and player characters collide. The event update unit is used to update the first basic event value based on the previous interaction behavior, interaction time, historical basic event value, time difference, and the basic parameters of the NPC. The first feature data forming unit is used to form first feature data based on the first basic event value.
6. The NPC behavior performance device based on player behavior influence according to claim 4, characterized in that, The second feature data forming module also includes, The second reading unit is used to read the second basic characteristic data of the current player character; The second feature data forming unit is used to form the second feature data based on the second basic feature data when the second basic feature data is not less than the reference feature data.
7. A computer program product, characterized in that, Includes computer-readable code, or a readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in the processor of an electronic device, the processor in the electronic device executes a method for implementing the NPC behavior performance method based on the influence of player behavior according to any one of claims 1 to 3.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements any one of the NPC behavior performance methods as described in claims 1 to 3 based on the influence of player behavior.
Citation Information
Patent Citations
Method of changing non-player role behavior model
TW201524564A