CN114712858A - NPC behavior decision method and device, electronic equipment and computer program product - Google Patents

NPC behavior decision method and device, electronic equipment and computer program product Download PDF

Info

Publication number
CN114712858A
CN114712858A CN202210341603.2A CN202210341603A CN114712858A CN 114712858 A CN114712858 A CN 114712858A CN 202210341603 A CN202210341603 A CN 202210341603A CN 114712858 A CN114712858 A CN 114712858A
Authority
CN
China
Prior art keywords
behavior
parameter
probability
npc
current
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210341603.2A
Other languages
Chinese (zh)
Inventor
赵男
胡婷婷
包炎
林越浩
刘超
李鑫培
师锐
施一东
杨雯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mihoyo Technology Shanghai Co ltd
Original Assignee
Mihoyo Technology Shanghai Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mihoyo Technology Shanghai Co ltd filed Critical Mihoyo Technology Shanghai Co ltd
Priority to CN202210341603.2A priority Critical patent/CN114712858A/en
Publication of CN114712858A publication Critical patent/CN114712858A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • A63F13/56Computing the motion of game characters with respect to other game characters, game objects or elements of the game scene, e.g. for simulating the behaviour of a group of virtual soldiers or for path finding
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • A63F13/58Controlling game characters or game objects based on the game progress by computing conditions of game characters, e.g. stamina, strength, motivation or energy level
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention relates to the technical field of online games, in particular to a NPC behavior decision method, a device, electronic equipment and a computer program product, wherein the NPC behavior decision method comprises the steps of reading a current time parameter and a current position parameter, and forming and acquiring a behavior set matched with the current time parameter and the current position parameter according to the current time parameter and the current position; calculating the occurrence probability of each behavior in the behavior set according to the current time parameter and the current environment to form a behavior probability parameter; the behavior matched with the maximum value of the behavior probability parameter is triggered as a target behavior.

Description

NPC behavior decision method and device, electronic equipment and computer program product
Technical Field
The invention relates to the technical field of online games, in particular to a NPC behavior decision method, a NPC behavior decision device, electronic equipment and a computer program product.
Background
NPC broadly refers to any character in a game that is not controlled by a player. With the continuous development of computer games, higher requirements are put on the intelligence of the NPC, and the intelligent behaviors of the NPC in tactics, strategies and decision methods need to be considered to enhance the playability of the games. At present, the game engine mostly adopts an artificial intelligence introduction mode to enhance the intelligence of the NPC, and although the game engine introducing the artificial intelligence technology enhances the intelligent expression of the virtual character to a certain extent, the game engine still has a plurality of defects. Because the game engines need developers to compile behavior rules in advance, the development task is heavy, the behavior mode of the non-player role is very limited, and the player can easily predict the behavior in the game, so that the game loses interest and novelty quickly; in addition, these game engines do not effectively allow virtual characters to present an action performance that is consistent with the context of the game interaction, undermining the immersion of the game player in the game.
Disclosure of Invention
In view of the deficiencies of the prior art, the present invention provides a method, an apparatus, an electronic device and a computer program product for determining NPC behavior, wherein,
a decision-making method for NPC (neutral network controller) behaviors comprises the following steps:
reading the current time parameter and the current position parameter, and forming a behavior set matched with the current time parameter and the current position parameter according to the current time parameter and the current position;
calculating the occurrence probability of each behavior in the behavior set according to the current time parameter and the current environment to form a behavior probability parameter;
the behavior matched with the maximum value of the behavior probability parameter is triggered as a target behavior.
Preferably, the above method for deciding NPC behavior, wherein: the calculating the occurrence probability of each behavior according to the current time parameter to form a behavior probability parameter specifically includes:
reading a behavior parameter set of the NPC role and the current state parameter of the NPC role; the behavior parameter set comprises each behavior and a behavior base probability matched with the behavior;
reading a behavior parameter adjustment value matched with the changed state parameter under the state that the state parameter is changed;
and adjusting the probability of each current action according to the parameter adjustment value and the action basic probability to form the action probability parameter.
Preferably, the above method for deciding NPC behavior, wherein: the forming of the changed state parameters specifically comprises:
acquiring the type of a trigger event under the condition of acquiring the trigger event;
and adjusting the state parameters under the state that the type of the trigger event is matched with a preset type.
Preferably, the above method for deciding NPC behavior, wherein: adjusting the probability of each current behavior according to the parameter adjustment value and the behavior base probability to form the behavior probability parameter, specifically:
forming a first initial value of each behavior basic probability according to the parameter adjustment value and the behavior basic probability;
reading a destination matched with the first initial value according to the first initial value;
forming a second adjustment value according to the current position information and the destination;
and forming the behavior probability parameter according to the second adjusting value and the first initial value.
Preferably, the above method for deciding NPC behavior, wherein: further comprising:
playing animation data matched with the target behavior according to the target behavior in a current visual environment;
and forming characteristic data according to the target behavior in the current invisible environment, and establishing the association relationship between the characteristic data and the NPC role until the characteristic data is displayed.
In another aspect, the present application further provides a system for determining NPC behavior, wherein: comprises the steps of (a) preparing a mixture of a plurality of raw materials,
the reading unit is used for reading the current time parameter and the current position parameter and forming a behavior set matched with the current time parameter and the current position parameter according to the current time parameter and the current position;
the behavior probability parameter forming unit is used for calculating the occurrence probability of each behavior in the behavior set according to the current time parameter and the current environment to form a behavior probability parameter;
and the target behavior forming unit is used for triggering the behavior matched with the maximum value of the behavior probability parameter as the target behavior.
Preferably, the above decision system for NPC behavior, wherein: the behavior probability parameter forming unit specifically includes:
the basic probability device reads a behavior parameter set of the NPC role and the current state parameter of the NPC role; the behavior parameter set comprises each behavior and a behavior base probability matched with the behavior;
the calculating device reads a behavior parameter adjusting value matched with the changed state parameter in the state that the state parameter changes; and adjusting the probability of each current action according to the parameter adjustment value and the action basic probability to form the action probability parameter.
Preferably, the above decision system for NPC behavior, wherein: further comprising:
the display device plays animation data matched with the target behavior according to the target behavior in a current visual environment; and forming characteristic data according to the target behavior in the current invisible environment, and establishing the association relationship between the characteristic data and the NPC role until the characteristic data is displayed.
In another aspect, the present invention further provides a computer readable storage medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method for determining NPC behavior as described in any one of the above.
Finally, the present application further provides an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements any one of the above NPC behavior decision methods when executing the computer program.
And acquiring the target behavior with the maximum occurrence probability according to each time and place by setting the occurrence probability of each behavior in different time and different positions. The purpose of adjusting the NPC behavior action is realized to enable the NPC behavior to be in a random state, and the NPC behavior has a human-like thinking mode and behavior action. The novelty and the interest of the game are enhanced, the game player can generate better game experience, and the experience sense of the player in the game process is increased.
Drawings
FIG. 1 is a schematic flow chart of a NPC behavior decision method provided by the present invention;
FIG. 2 is a schematic diagram of a NPC behavior parameter table in the NPC behavior decision method provided by the present invention;
FIG. 3 is a schematic flow chart of a NPC behavior decision method provided by the present invention;
FIG. 4 is a schematic flow chart of a NPC behavior decision method provided by the present invention;
fig. 5 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
Example one
The present embodiment provides a method for determining NPC behavior, wherein: each NPC character has a behavior parameter table, such as that shown in fig. 2, which records all executable behaviors of the NPC character, such as getting up, eating, drinking, fishing, sleeping, falling down, each behavior having different occurrence probabilities at different times and different locations, including,
and step S110, reading the current time parameter and the current position parameter, and forming a behavior set matched with the current time parameter and the current position parameter according to the current time parameter and the current position.
The current time parameter is the time when the above-mentioned decision method is executed, for example, the current time point in the game environment is 8: 03 points, the time parameter at this time is 8: 03. the location parameters may be implemented by a positioning system in the gaming environment.
And step S120, calculating the occurrence probability of each behavior in the behavior set according to the current time parameter and the current environment to form a behavior probability parameter.
The behavior set records all behaviors that the NPC role can execute, but the probability of each behavior mode is not fixed. For example, the current NPC role may perform the actions of: getting up, eating, drinking, fishing, sleeping, falling, the NPC character does not perform actions other than the above, such as smoking.
Each time behavior is at different time and different positions, different behaviors are set with different occurrence probabilities, for example, the current nine o' clock, the NPC role A is at the edge of a river, at the moment, the NPC role A originally plans to have 100% probability of hiking to the hotel to go to work and hiking to change clothes, the probability of 10% is, however, due to the sudden change of weather, the NPC role A starts to pour heavy rain, the distance from the current position to the hotel is 2 kilometers, the distance from the current position to the home is 0.2 kilometer, the probability of 20% for the NPC role A to hiking to the hotel is reduced, and the probability of 100% for the hiking to take shelter from rain is increased from 10%.
And step S130, triggering the behavior matched with the maximum value of the behavior probability parameter as a target behavior. The target behavior is the behavior executed by the NPC role A.
According to the NPC behavior decision method, the probability of each behavior in different time and different positions is set, and the target behavior with the maximum occurrence probability is obtained according to each time and place. The purpose of adjusting the NPC behavior is realized to make the NPC behavior in a random state, and have a thinking way and behavior actions similar to human beings. The novelty and the interest of the game are enhanced, the game player can generate better game experience, and the experience sense of the player in the game process is increased.
As a further preferred embodiment, in step S120, calculating the occurrence probability of each behavior according to the current time parameter to form a behavior probability parameter specifically includes:
step S1201, reading a behavior parameter set of the NPC role and the current state parameter of the NPC role; the behavior parameter set comprises each behavior and a behavior base probability matched with the behavior;
the current status parameter is determined according to the current status of the NPC character, for example, if the current NPC character picks up a gold, the NPC character is in an excited state, and if the current NPC character falls, the NPC character is in a dropped state. The state parameter directly affects the probability of behavior occurring.
The technical probability is a probability value recorded in the current behavior list, and the probability value may be an initial probability value or a probability value adjusted by a previous trigger behavior, which is not specifically limited herein.
Step S1202, reading a behavior parameter adjustment value matched with the changed state parameter in the state that the state parameter is changed; for example, the original state of the NPC character is excited, and if the original excited state changes into a lost state due to a fall, it is determined that the state parameter has changed.
It should be noted that the change of the state parameter is based on the change of the action or event. In the state without action or event trigger, the probability of the state parameter change is low.
After the state parameters are changed, the state parameters and the personality parameters of the NPC role form changed behavior adjustment values.
For example, the NPC character is currently in an excited state and suddenly falls down, but since the behavior of the NPC character belongs to the cheerful type, although the behavior of the NPC character affects the state parameters, the impact capability is relatively weak, and the adjustment range of the behavior parameter adjustment value matched with the changed state parameters is relatively small.
For another example, the NPC character is currently in an excited state and suddenly falls down, but since the behavior of the NPC character belongs to a pessimistic depression type, the falling behavior directly affects the state parameters, the influence is relatively large, and the adjustment range of the behavior parameter adjustment value matched with the changed state parameters is relatively large.
The forming method of the changed state parameters specifically comprises the following steps:
step S12021, acquiring the type of the trigger event under the condition of acquiring the trigger event; wherein a triggering event may be understood as an event or an action that is capable of changing a state parameter. The trigger event may be preset or random. The type of trigger event includes at least sensitive or non-sensitive.
For example, the NPC character is sensitive to some events and is insensitive to some events, for example, the NPC character is insensitive to "being knocked over" and sensitive to "falling into foot", so that when the trigger event is "being knocked over", the probability of the state parameter of the NPC changing greatly is not high, and when the trigger event is "falling into foot", the probability of the state parameter of the NPC changing greatly is high.
Step S12022, adjusting the state parameter when the type of the trigger event matches a preset type. Different adjustment state parameters are formed according to different types of trigger events.
And step S1203, adjusting the probability of each current behavior according to the parameter adjustment value and the behavior basic probability to form the behavior probability parameter. Specifically, the method comprises the following steps:
step S12031, forming a first initial value of each behavior basic probability according to the parameter adjustment value and the behavior basic probability;
step S12032, reading a destination matched with the first initial value according to the first initial value;
step S12033, forming a second adjusting value according to the current position information and the destination;
step S12034, forming the behavior probability parameter according to the second adjustment value and the first initial value.
Wherein the first initial value is intended for screening possible destinations of the NPC character, for example, when the NPC falls, the possible destinations are a bar, a river and a home, and then the probability values according to the bar, the river and the home are promoted, that is, the bar first initial value, the river first initial value and the home first initial value are formed. And continuing to perform addressing operation on the bar, the river and the home from the current position respectively to form a second adjustment value, wherein the second adjustment value is used for determining a final destination, for example, the bar is closest to the current destination, the bar has a second adjustment value of 90, the river is farthest from the current destination, the river has a second adjustment value of 10, the home is moderate from the current destination, and the home has a second adjustment value of 50, so as to form probability parameters according to the second adjustment value, the first initial value and respective weights.
As a further preferred embodiment, further comprising:
step S140, playing animation data matched with the target behavior according to the target behavior in the current visual environment; and forming characteristic data according to the target behavior in the current invisible environment, and establishing the association relationship between the characteristic data and the NPC role until the characteristic data is displayed. And if the visual environment is within the visual range of the player, the animation data matched with the target behaviors are played at the moment. For example, when the NPC falls, the work is not continued, and a user selects to play a bar, and animation data for playing the bar is played. The environment cannot be made to be that no player is around the NPC at present, for example, the NPC falls down, is stained with soil on one's body, because no player is around it this moment, the picture that the NPC fell down can not be observed by the player, actually "falls down" on the technical level, only is characteristic data "soil", wait this NPC when being in visual environment, this characteristic data is shown.
Example two
In another aspect, the present application further provides a system for determining NPC behavior, wherein: comprises the steps of (a) preparing a mixture of a plurality of raw materials,
the reading unit is used for reading the current time parameter and the current position parameter and forming a behavior set matched with the current time parameter and the current position parameter according to the current time parameter and the current position;
the behavior probability parameter forming unit is used for calculating the occurrence probability of each behavior in the behavior set according to the current time parameter and the current environment to form a behavior probability parameter;
and the target behavior forming unit is used for triggering the behavior matched with the maximum value of the behavior probability parameter as the target behavior.
Preferably, the above method for deciding NPC behavior, wherein: the behavior probability parameter forming unit specifically includes:
the basic probability device reads a behavior parameter set of the NPC role and the current state parameter of the NPC role; the behavior parameter set comprises each behavior and a behavior base probability matched with the behavior;
the calculating device reads a behavior parameter adjusting value matched with the changed state parameter in the state that the state parameter changes; and adjusting the probability of each current action according to the parameter adjustment value and the action basic probability to form the action probability parameter.
Preferably, the above method for deciding NPC behavior, wherein: further comprising:
the display device plays animation data matched with the target behavior according to the target behavior in a current visual environment; and forming characteristic data according to the target behavior in the current invisible environment, and establishing the association relationship between the characteristic data and the NPC role until the characteristic data is displayed.
The working principle of the present embodiment is the same as that of the first embodiment, and therefore, the description thereof is not repeated.
EXAMPLE III
The embodiment of the application provides electronic equipment, and the NPC behavior expression device based on the influence of the environmental attributes provided by the embodiment of the application can be integrated in the electronic equipment. Fig. 5 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present application. As shown in fig. 5, the present embodiment provides an electronic device 400, which includes: one or more processors 420; storage 410 to store one or more programs that, when executed by the one or more processors 420, cause the one or more processors 420 to implement:
reading the current time parameter and the current position parameter, and forming a behavior set matched with the current time parameter and the current position parameter according to the current time parameter and the current position;
calculating the occurrence probability of each behavior in the behavior set according to the current time parameter and the current environment to form a behavior probability parameter;
the behavior matched with the maximum value of the behavior probability parameter is triggered as the target behavior.
As shown in fig. 5, the electronic device 400 includes a processor 420, a storage device 410, an input device 430, and an output device 440; the number of the processors 420 in the electronic device may be one or more, and one processor 420 is taken as an example in fig. 5; the processor 420, the storage device 410, the input device 430, and the output device 440 in the electronic apparatus may be connected by a bus or other means, and are exemplified by a bus 450 in fig. 2.
The storage device 410 is a computer-readable storage medium, and can be used to store software programs, computer-executable programs, and module units, such as program instructions corresponding to the method for influencing NPC behavior based on environmental attributes in the embodiment of the present application.
The storage device 410 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the storage 410 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, storage 410 may further include memory located remotely from processor 420, which may 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.
The input means 430 may be used to receive input numbers, character information, or voice information, and to generate key signal inputs related to user settings and function control of the electronic device. The output device 440 may include a display screen, speakers, etc.
Example four
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 embodied thereon for carrying out various aspects of the present disclosure. Specifically, the method comprises the following steps:
reading the current time parameter and the current position parameter, and forming a behavior set matched with the current time parameter and the current position parameter according to the current time parameter and the current position;
calculating the occurrence probability of each behavior in the behavior set according to the current time parameter and the current environment to form a behavior probability parameter;
the behavior matched with the maximum value of the behavior probability parameter is triggered as a target behavior.
The computer-readable storage medium described above may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, 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 Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device over a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic 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 computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembly instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including an object oriented programming language, as well as conventional procedural programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
These computer-readable program instructions may be provided to a processing unit of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or technical improvements to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (10)

1. A decision method for NPC (neutral Point coordination) behaviors is characterized by comprising the following steps:
reading the current time parameter and the current position parameter, and forming a behavior set matched with the current time parameter and the current position parameter according to the current time parameter and the current position;
calculating the occurrence probability of each behavior in the behavior set according to the current time parameter and the current environment to form a behavior probability parameter;
the behavior matched with the maximum value of the behavior probability parameter is triggered as a target behavior.
2. The method of claim 1, wherein the NPC behavior decision-making method comprises: the calculating the occurrence probability of each behavior according to the current time parameter to form a behavior probability parameter specifically includes:
reading a behavior parameter set of the NPC role and the current state parameter of the NPC role; the behavior parameter set comprises each behavior and a behavior base probability matched with the behavior;
reading a behavior parameter adjustment value matched with the changed state parameter under the state that the state parameter is changed;
and adjusting the probability of each current action according to the parameter adjustment value and the action basic probability to form the action probability parameter.
3. The method of claim 2, wherein the NPC behavior decision-making method comprises: the forming of the changed state parameters specifically comprises:
acquiring the type of a trigger event under the condition of acquiring the trigger event;
and adjusting the state parameters under the condition that the type of the trigger event is matched with a preset type.
4. The method of claim 2, wherein the NPC behavior decision-making method comprises: adjusting the probability of each current behavior according to the parameter adjustment value and the behavior base probability to form the behavior probability parameter, specifically:
forming a first initial value of each behavior basic probability according to the parameter adjustment value and the behavior basic probability;
reading a destination matched with the first initial value according to the first initial value;
forming a second adjustment value according to the current position information and the destination;
and forming the behavior probability parameter according to the second adjusting value and the first initial value.
5. The method of claim 1, wherein the NPC behavior decision-making method comprises: further comprising:
playing animation data matched with the target behavior according to the target behavior in a current visual environment;
and forming characteristic data according to the target behavior in the current invisible environment, and establishing the association relationship between the characteristic data and the NPC role until the characteristic data is displayed.
6. A decision making system for NPC behavior, characterized by: comprises the steps of (a) preparing a mixture of a plurality of raw materials,
the reading unit is used for reading the current time parameter and the current position parameter and forming a behavior set matched with the current time parameter and the current position parameter according to the current time parameter and the current position;
the behavior probability parameter forming unit is used for calculating the occurrence probability of each behavior in the behavior set according to the current time parameter and the current environment to form a behavior probability parameter;
and the target behavior forming unit is used for triggering the behavior matched with the maximum value of the behavior probability parameter as the target behavior.
7. The system of claim 6, wherein the NPC behavior decision-making system comprises: the behavior probability parameter forming unit specifically includes:
the basic probability device reads a behavior parameter set of the NPC role and the current state parameter of the NPC role; the behavior parameter set comprises each behavior and a behavior base probability matched with the behavior;
the calculating device reads a behavior parameter adjusting value matched with the changed state parameter in the state that the state parameter changes; and adjusting the probability of each current action according to the parameter adjustment value and the action basic probability to form the action probability parameter.
8. The system of claim 6, wherein the NPC behavior decision-making system comprises: further comprising:
the display device plays animation data matched with the target behavior according to the target behavior in a current visual environment; and forming characteristic data according to the target behavior in the current invisible environment, and establishing the association relationship between the characteristic data and the NPC role until the characteristic data is displayed.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the decision-making method for the NPC behaviour according to any one of claims 1 to 5 when executing the computer program.
10. A computer program product, comprising computer readable code or a readable storage medium carrying computer readable code, which when run in a processor of an electronic device, the processor in the electronic device performs a decision method for implementing the NPC behaviour of any one of claims 1 to 5.
CN202210341603.2A 2022-03-29 2022-03-29 NPC behavior decision method and device, electronic equipment and computer program product Pending CN114712858A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210341603.2A CN114712858A (en) 2022-03-29 2022-03-29 NPC behavior decision method and device, electronic equipment and computer program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210341603.2A CN114712858A (en) 2022-03-29 2022-03-29 NPC behavior decision method and device, electronic equipment and computer program product

Publications (1)

Publication Number Publication Date
CN114712858A true CN114712858A (en) 2022-07-08

Family

ID=82242059

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210341603.2A Pending CN114712858A (en) 2022-03-29 2022-03-29 NPC behavior decision method and device, electronic equipment and computer program product

Country Status (1)

Country Link
CN (1) CN114712858A (en)

Similar Documents

Publication Publication Date Title
CN108339270A (en) The processing method of static component, rendering intent and device in scene of game
KR102258278B1 (en) Seasonal reward distribution system
CN111249735B (en) Path planning method and device for control object, processor and electronic device
CN108939535B (en) Sound effect control method and device for virtual scene, storage medium and electronic equipment
CN113332725B (en) Game scenario deduction method and device, electronic equipment and storage medium
KR102494361B1 (en) Determining the quality of electronic games based on the developer involvement matrix
KR101872000B1 (en) Method for applying interaction in Virtual Reality
CN114669055A (en) Control method and device based on game running environment, electronic equipment and computer program product
JP7009523B2 (en) Dynamic level of destruction details in electronic game display
CN117482527A (en) Virtual character control method, editing method, device and electronic equipment
CN113018862A (en) Virtual object control method and device, electronic equipment and storage medium
CN114712858A (en) NPC behavior decision method and device, electronic equipment and computer program product
CN114681920A (en) NPC behavior expression method and device based on player behavior influence, electronic equipment and computer program product
CN114797107A (en) NPC behavior-based random processing method and system, electronic equipment and computer program product
CN113946604B (en) Staged go teaching method and device, electronic equipment and storage medium
CN115671735A (en) Object selection method and device in game and electronic equipment
JP6704017B2 (en) Video game processing program and video game processing system
CN113935099A (en) Method and device for processing components of virtual model and electronic equipment
CN114681919B (en) NPC interaction influence-based NPC expression method, device, medium and electronic equipment
CN114681921A (en) NPC behavior expression method and device based on environment attribute influence, electronic equipment and computer program product
CN113244620A (en) Role playing game implementation method and electronic equipment
KR20200107784A (en) Method for providing game service to provide guide contents in game and apparatus thereof
CN113457145B (en) Weather control method, device, equipment and storage medium for game scene
CN114653064A (en) Control method and system based on NPC self-circulation performance, electronic equipment and computer program product
US20240123347A1 (en) Game interactive control method and apparatus, storage medium and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination