Method, device, electronic device, and computer program product for influencing NPC behavior based on environmental attributes
By correlating the actual life time and game time in online games and adjusting the NPC behavior route according to spatial parameters, the problem of insufficient performance of NPC is solved, and the authenticity and fun of the game are improved.
Patent Information
- Application Number
- CN202210322964.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-29
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2042-03-29
AI Technical Summary
The lack of performance of NPCs in the prior art leads to poor experience of players in the game, especially due to the fixed daily behavior of NPCs and lack of changes.
By correlating the actual life time with game time and dynamically adjusting the NPC's behavior route according to the current spatial parameters that do not match the preset events or daily behavior tables, the behavioral route of the NPC is affected by environmental attributes.
It improves the authenticity of NPC character performance and the fun of the game, and enhances the game experience.
Smart Images

Figure CN114681921B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of online game technology, and in particular to a method, device, electronic device and computer program product for influencing NPC behavior based on environmental attributes. Background Art
[0002] In online games, NPCs, short for non-player characters, are a type of character in the game. They refer to characters in video games that are not controlled by real players. As games become larger and more complex, the demands for NPC performance will inevitably increase. The quality of NPC performance determines the player's experience of the game world. Given the large number and diverse types of NPCs, achieving this richness requires a vast amount of animation data (as currently implemented in AAA games). This large amount of animation data requires significant production costs and storage space. NPC performance typically boils down to processing and modifying the NPC's "daily behavior table," for example: at a certain time, where to go, what to do. Currently, most NPCs are linearly assigned a fixed daily behavior table. Unless a specific event triggers this, such as a player approaching the NPC and triggering a quest, the NPC's basic daily behavior remains unchanged, resulting in a lack of richness in NPC character performance and a lack of a compelling player experience. Summary of the Invention
[0003] In response to the deficiencies of the prior art, the present invention provides a method, device, electronic device and computer program product for influencing NPC behavior based on environmental attributes, which can improve the richness of NPC behavior based on environmental attributes.
[0004] To achieve the above objectives, the present invention is implemented through the following technical solutions:
[0005] In a first aspect, an embodiment of the present invention provides a method for influencing NPC behavior based on environmental attributes, comprising:
[0006] When the current first basic parameter matches the previous first basic parameter, obtain the current second basic parameter;
[0007] When the current second basic parameter does not match the previous second basic parameter, a control instruction is generated according to the current second basic parameter and the current behavior basic data.
[0008] Preferably, when the current first basic parameter matches the previous first basic parameter, before obtaining the current second basic parameter, the method further includes:
[0009] When the current first basic parameter does not match the previous first basic parameter, current behavior basic data matching the current first basic parameter is acquired according to the current first basic parameter.
[0010] Preferably, when the current second basic parameter does not match the previous second basic parameter, forming a control instruction according to the current second basic parameter and the current behavior basic data specifically includes:
[0011] When the current second basic parameter does not match the previous second basic parameter, read the feature data that matches the current second basic parameter;
[0012] Reading current behavior basic data associated with the feature data according to the feature data; updating the current behavior basic data according to the feature data;
[0013] The control instruction is formed according to the updated current behavior basic data.
[0014] Preferably, it also includes:
[0015] When the current second basic parameter matches the previous second basic parameter, the current behavior basic data is executed.
[0016] In a second aspect, an embodiment of the present invention provides a device for influencing NPC behavior based on environmental attributes, comprising:
[0017] An acquisition module, configured to acquire a current second basic parameter when the current first basic parameter matches a previous first basic parameter;
[0018] The control instruction forming module is used to form a control instruction according to the current second basic parameter and the current behavior basic data when the current second basic parameter does not match the previous second basic parameter.
[0019] Preferably, the control instruction forming module specifically includes:
[0020] a reading unit, configured to read characteristic data matching the current second basic parameter when the current second basic parameter does not match the previous second basic parameter;
[0021] a behavior updating unit, configured to read current behavior basic data associated with the characteristic data according to the characteristic data; and update the current behavior basic data according to the characteristic data;
[0022] A control instruction forming unit is used to form the control instruction according to the updated current behavior basic data.
[0023] Preferably, it also includes,
[0024] The execution module is used to execute the current behavior basic data when the current second basic parameter matches the previous second basic parameter.
[0025] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned method for influencing NPC behavior based on environmental attributes.
[0026] In a fourth aspect, an embodiment of the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable by the processor. When the processor executes the computer program, the method for influencing NPC behavior based on environmental attributes in the electronic device as described above is implemented.
[0027] The present invention has the following beneficial effects:
[0028] This invention not only correlates real-life time with game time, but also alters NPC behavior paths when current spatial parameters don't align with pre-set events or daily behavior tables. This aims to enhance the realism of NPC characters and increase the fun of the game. Specifically, different behaviors occur at different times, or the probability of behaviors occurring in different spaces varies. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 A flow chart of a method for influencing NPC behavior based on environmental attributes provided in Example 1 of the present invention;
[0030] Figure 2 A flow chart of a method for influencing NPC behavior based on environmental attributes provided in Example 1 of the present invention;
[0031] Figure 3 This is a structural diagram of an electronic device provided in Example 4 of the present invention. DETAILED DESCRIPTION
[0032] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0033] Example 1
[0034] This embodiment provides a method for influencing NPC behavior based on environmental attributes. Figure 1 A flow chart of a method for influencing NPC behavior based on environmental attributes is provided for this embodiment, specifically including:
[0035] S110, when the current first basic parameter matches the previous first basic parameter, obtaining the current second basic parameter;
[0036] Specifically, the first basic parameter is the time zone parameter of the player's current login, and the second basic parameter is the space zone, or the first basic parameter is the space zone parameter of the player's current login, and the second basic parameter is the time zone. The following embodiments of this application are explained with the first basic parameter as the time zone parameter of the player's current login, and the second basic parameter as the space zone: Specifically,
[0037] When the time zone parameters of the current player login are consistent with the time zone parameters of the previous login, the current environment zone parameters are obtained;
[0038] A game time that matches the login time difference is formed according to the login time difference; for example, if the login time difference in real life is 3 days, the game time that matches the time difference is 18 days, and the story of the game still proceeds normally.
[0039] The matching relationship between the login time difference and the game time can be adjusted according to actual conditions. The above is only an example and is not a specific limitation on this application.
[0040] Before step S110, the method further includes the following steps:
[0041] S109: When the current first basic parameter does not match the previous first basic parameter, obtain current behavior basic data that matches the current first basic parameter according to the current first basic parameter.
[0042] Specifically, when the time zone parameters of the current login do not match the time zone parameters of the previous login, behavioral state parameters that match the current NPC's game behavior state are obtained based on the current time zone. For example, if the login time difference in real life is 30 days, the game time that matches this time difference is 3 years. The NPC has transitioned from childhood to adolescence, and the game story unfolds based on the mission plots and environmental parameters of the adolescence. For another example, the difference in login time causes seasonal changes in the game, which in turn affects a certain element in the NPC's behavior table. For example, in the storyline, the NPC goes fishing by the river in the summer and ice-cutting by the river in the winter.
[0043] S110, when the current first basic parameter matches the previous first basic parameter, obtaining the current second basic parameter;
[0044] S120 : When the current second basic parameter does not match the previous second basic parameter, a control instruction is generated according to the current second basic parameter and the current behavior basic data.
[0045] The specific steps include
[0046] S1201: When the current second basic parameter does not match the previous second basic parameter, read feature data that matches the current second basic parameter;
[0047] Among them, the second basic parameter is a spatial area parameter. When the current second basic parameter does not match the previous second basic parameter, the feature data matching the current second basic parameter is read; for example, the environment of the unprecedented area that matches the current preset time zone is that the NPC is buying coffee at the convenience store, and the second basic parameter obtained by the detection at this time is that the NPC is by the river. The feature value of the river is inconsistent with the preset convenience store buying coffee, then it can be determined that the current second basic parameter does not match the state of the previous second basic parameter, the feature data is by the river, and the previous second basic parameter can be understood as the preset parameter or the parameter in the daily behavior table.
[0048] S1202: Reading current behavior basic data associated with the feature data according to the feature data; updating the current behavior basic data according to the feature data;
[0049] Specifically, based on the current feature data that has been obtained, for example, the feature data is "by the river", the NPC updates the behavior route of the NPC from the river to the store based on the basic parameters of "by the river".
[0050] S1203: Form the control instruction according to the updated current behavior basic data.
[0051] The control instructions are used to control the NPC to generate new behavioral action events that match the current space parameters.
[0052] In addition, when the current second basic parameter matches the previous second basic parameter, the current behavior basic data is executed.
[0053] When the current spatial area parameters are consistent with the preset parameters and the task parameters in the daily behavior table, the task of buying coffee is directly executed.
[0054] In the above embodiment, on the one hand, the actual life time is associated with the game time, and on the other hand, the NPC's behavior route is changed by judging that the current space parameters are inconsistent with the preset events or daily behavior table, aiming to improve the authenticity of the NPC character and enhance the fun of the game.
[0055] Similarly, using space as the first basic parameter, when an NPC's space is different from the previous one, the current behavior basic data can be generated based on this space to match the space. Then, based on this current behavior basic data and time changes, different control instructions can be generated. Time changes can be adjusted automatically according to the game environment, or the game environment's own time can be used as the basis for adjustment.
[0056] Example 2
[0057] An embodiment of the present invention provides a device for influencing NPC behavior based on environmental attributes, the device specifically comprising:
[0058] An acquisition module, configured to acquire a current second basic parameter when the current first basic parameter matches a previous first basic parameter;
[0059] The control instruction forming module is used to form a control instruction according to the current second basic parameter and the current behavior basic data when the current second basic parameter does not match the previous second basic parameter.
[0060] In a preferred embodiment, the control instruction forming module specifically includes:
[0061] a reading unit, configured to read characteristic data matching the current second basic parameter when the current second basic parameter does not match the previous second basic parameter;
[0062] a behavior updating unit, configured to read current behavior basic data associated with the characteristic data according to the characteristic data; and update the current behavior basic data according to the characteristic data;
[0063] A control instruction forming unit is used to form the control instruction according to the updated current behavior basic data.
[0064] In a preferred embodiment, it also includes:
[0065] The execution module is used to execute the current behavior basic data when the current second basic parameter matches the previous second basic parameter.
[0066] The working principle of this embodiment is the same as that of the first embodiment, so it will not be described in detail.
[0067] Example 3
[0068] An embodiment of the present application provides an electronic device, into which the device for influencing NPC behavior based on environmental attributes provided by an embodiment of the present application can be integrated. Figure 3 This is a schematic diagram of the structure of an electronic device provided in Example 4 of this application. Figure 3As shown, this embodiment provides an electronic device 400, which includes: one or more processors 420; a storage device 410 for storing one or more programs. When the one or more programs are executed by the one or more processors 420, the one or more processors 420 implement:
[0069] When the current first basic parameter matches the previous first basic parameter, obtain the current second basic parameter;
[0070] When the current second basic parameter does not match the previous second basic parameter, a control instruction is generated according to the current second basic parameter and the current behavior basic data.
[0071] 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 In the figure, a processor 420 is used as an example; the processor 420, the storage device 410, the input device 430 and the output device 440 in the electronic device can be connected via a bus or other means. Figure 2 The connection via bus 450 is taken as an example.
[0072] The storage device 410, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and module units, such as program instructions corresponding to the method of influencing NPC behavior based on environmental attributes in the embodiment of the present application.
[0073] The storage device 410 may primarily include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function; the data storage area may store data created based on the use of the terminal, etc. Furthermore, the storage device 410 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state memory device. In some instances, the storage device 410 may further include a memory remotely located relative to the processor 420, and such remote memory may be connected via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0074] The input device 430 may be used to receive input numbers, character information or voice information, and generate key signal input related to user settings and function control of the electronic device. The output device 440 may include a display screen, a speaker and other devices.
[0075] Example 4
[0076] In some embodiments, the methods described above may be implemented as a computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions for executing various aspects of the present disclosure. Specifically:
[0077] When the current first basic parameter matches the previous first basic parameter, obtain the current second basic parameter;
[0078] When the current second basic parameter does not match the previous second basic parameter, a control instruction is generated according to the current second basic parameter and the current behavior basic data.
[0079] The computer-readable storage medium mentioned above can be a tangible device that can hold and store instructions used by an instruction execution device. The computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. The computer-readable storage medium used herein is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through an electrical wire.
[0080] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in the computer-readable storage medium in each computing / processing device.
[0081] The computer program instructions for performing the disclosed operation can be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data or source code or the object code written in any combination of one or more programming languages, wherein the programming languages include object-oriented programming languages, and conventional procedural programming languages.Computer-readable program instructions can be performed completely on the user's computer, partially on the user's computer, performed as an independent software package, partly on the user's computer and partly on a remote computer, or performed completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer by any type of network-including local area network (LAN) or wide area network (WAN), or can be connected to an external computer (such as utilizing an Internet service provider to connect by the Internet). In certain embodiments, by utilizing the state information of computer-readable program instructions to carry out personalized customization electronic circuits, such as programmable logic circuits, field programmable gate arrays (FPGAs) or programmable logic arrays (PLA), this electronic circuit can perform computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0082] 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 device, thereby producing a machine such that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device is generated that implements the functions / actions specified in one or more blocks in the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, where these instructions cause the computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram.
[0083] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device, so that a series of operational steps are 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 implement the functions / actions specified in one or more blocks in the flowchart and / or block diagram.
[0084] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and the part of the module, program segment or instruction contains one or more executable instructions for realizing the prescribed logical function. In some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart, can be implemented by a dedicated hardware-based system that performs the prescribed function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0085] While various embodiments of the present disclosure have been described above, the foregoing description is intended to be illustrative, non-exhaustive, and not 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 selected to best explain the principles of the embodiments, their practical applications, or technical improvements to existing technologies, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for influencing NPC behavior based on environmental attributes, characterized in that: include, When the current first basic parameter does not match the previous first basic parameter, current behavior basic data matching the current first basic parameter is obtained based on the current first basic parameter; the current first basic parameter is the time zone parameter or space zone parameter of the player's current login, and the second basic parameter is the space zone parameter or time zone parameter complementary to the first basic parameter; When the current first basic parameter matches the previous first basic parameter, a game time matching the login time difference is formed according to the login time difference, and the current second basic parameter is obtained; When the current second basic parameter does not match the previous second basic parameter, a control instruction is formed according to the current second basic parameter and the current behavior basic data; the control instruction is used to generate an NPC behavior action event that matches the current space parameter.
2. The method of influencing NPC behavior based on environmental attributes according to claim 1, characterized in that: The step of acquiring current behavior basic data matching the current first basic parameter according to the current first basic parameter when the current first basic parameter does not match the previous first basic parameter includes: When the time zone parameters of the current login do not match the time zone parameters of the last login, the behavior state parameters that match the current NPC game behavior state are obtained according to the current time zone.
3. The method of influencing NPC behavior based on environmental attributes according to claim 1, characterized in that: When the current second basic parameter does not match the previous second basic parameter, forming a control instruction according to the current second basic parameter and the current behavior basic data specifically includes: When the current second basic parameter does not match the previous second basic parameter, read the feature data that matches the current second basic parameter; Reading current behavior basic data associated with the feature data according to the feature data; updating the current behavior basic data according to the feature data; The control instruction is formed according to the updated current behavior basic data.
4. The method of influencing NPC behavior based on environmental attributes according to claim 1, characterized in that: Also includes: When the current second basic parameter matches the previous second basic parameter, the current behavior basic data is executed.
5. The method of influencing NPC behavior based on environmental attributes according to claim 1, characterized in that: The matching relationship between login time difference and game time can be adjusted according to actual conditions.
6. A device for influencing NPC behavior based on environmental attributes, characterized in that: The device is used to perform the method according to any one of claims 1 to 5, and the device at least comprises: an acquisition module, in a state where the current first basic parameter does not match the previous first basic parameter, acquiring current behavior basic data that matches the current first basic parameter based on the current first basic parameter; the current first basic parameter is a time zone parameter or a space zone parameter of the player's current login, and the second basic parameter is a space zone parameter or a time zone parameter that is complementary to the first basic parameter; The acquisition module is configured to, when the current first basic parameter matches the previous first basic parameter, generate a game time that matches the login time difference based on the login time difference, and acquire the current second basic parameter; A control instruction forming module is used to form a control instruction based on the current second basic parameter and current behavior basic data when the current second basic parameter does not match the previous second basic parameter; the control instruction is used to generate an NPC behavior action event that matches the current space parameter.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method for influencing NPC behavior based on environmental attributes as claimed in any one of claims 1 to 5 is implemented.
8. A computer program product, characterized in that The method comprises a computer-readable code or a readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the method for implementing any one of claims 1 to 5 for influencing NPC behavior based on environmental attributes.
Citation Information
Patent Citations
Game program and game apparatus
JP2013121487A