Game control method, electronic device, and program product
By introducing a first attribute parameter and a state machine mechanism, the system enables non-player-controlled virtual characters to intelligently switch between multiple states, solving the problem of monotonous virtual character behavior patterns, enhancing game immersion and strategic interaction, and optimizing resource scheduling.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-22
- Publication Date
- 2026-05-29
AI Technical Summary
In existing technologies, the behavior patterns of virtual characters controlled by non-players are simplistic and lack strategic interaction with players, resulting in insufficient game immersion and challenge.
By introducing a first attribute parameter, the system enables intelligent switching between multiple states for non-player-controlled virtual characters. It also optimizes resource scheduling using state machines and listening mechanisms, thereby enhancing strategic interaction between virtual characters and players.
It enhances the game's immersion and playability, optimizes the game system's resource allocation efficiency, and strengthens the strategic depth between players and virtual characters.
Smart Images

Figure CN122097970A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of game technology, and more particularly to a game control method, electronic device, and computer program product. Background Technology
[0002] In related technologies, the behavior control of non-player-controlled virtual characters typically employs simple distance judgment or fixed patrol path triggering mechanisms. When a player enters the virtual character's alert range, an attack state is directly triggered, resulting in abrupt state transitions lacking smooth logic. This triggering method fails to adequately consider the specific behavioral differences of players during gameplay. The virtual character cannot respond differently to various game events generated by the player, leading to a lack of effective strategic interaction between the virtual character's pursuit behavior and the player's actual actions. This reduces the game's immersion and challenge, and also limits the richness of gameplay. Summary of the Invention
[0003] The purpose of this disclosure is to provide a game control method, device, electronic device, and program product to solve the technical problems of monotonous behavior patterns and poor interactive experience of non-player-controlled virtual characters.
[0004] In a first aspect, this disclosure provides a graphical user interface (GUI) provided via a terminal device, displaying a game scene and a first virtual object within the game scene, wherein the first virtual object is a non-player-controlled virtual character; the method includes: controlling the first virtual object to be in a first state in the game scene; while the first virtual object is in the first state, in response to detecting a game event corresponding to a second virtual object, controlling the updating of a first attribute parameter, wherein the second virtual object is a virtual object controlled by the terminal device; if the first attribute parameter satisfies a first condition, controlling the first virtual object to change from the first state to a second state; while the first virtual object is in the second state, controlling the first virtual object to maintain listening; during the period of maintaining listening, in response to detecting a game event, controlling the updating of the first attribute parameter; if the first attribute parameter satisfies a second condition, controlling the first virtual object to change from the second state to a third state; if the duration of maintaining listening reaches a first preset duration and the first attribute parameter does not satisfy the second condition, controlling the reset of the first attribute parameter and controlling the first virtual object to return to the first state.
[0005] Secondly, this disclosure provides a game control device, comprising: a display module for providing a graphical user interface, displaying a game scene and a first virtual object in the game scene, wherein the first virtual object is a non-player-controlled virtual character; a state control module for controlling the first virtual object to be in a first state in the game scene; a first attribute parameter management module for controlling the updating of first attribute parameters in response to detecting a game event corresponding to a second virtual object when the first virtual object is in the first state, wherein the second virtual object is a virtual object controlled by a terminal device; the state control module is further configured to control the first virtual object to maintain listening when the first virtual object is in a second state; the first attribute parameter management module is further configured to control the updating of first attribute parameters in response to detecting a game event during the maintaining listening process; the state control module is further configured to control the first virtual object to adjust from the second state to a third state when the first attribute parameters meet a second condition; and the state control module is further configured to control the reset of the first attribute parameters and control the first virtual object to return to the first state when the duration of maintaining listening reaches a first preset duration and the first attribute parameters do not meet the second condition.
[0006] Thirdly, this disclosure provides an electronic device including a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the steps in the game control method described in any of the preceding claims.
[0007] Fourthly, this disclosure provides a computer program product that stores a computer program, which, when executed by a processor, implements the steps of any of the above-described game control methods.
[0008] This disclosure provides a game control method, device, electronic device, and program product. By introducing a first attribute parameter to quantify and accumulate different game events, it enables non-player-controlled virtual objects to intelligently switch between multiple states, making the behavior logic of virtual characters more realistic, enhancing the strategic depth of the game between players and virtual characters, enriching the game's combat levels and playability, and optimizing the resource scheduling efficiency of the game system through the hierarchical management and listening mechanism of the state machine. Attached Figure Description
[0009] Figure 1 A schematic diagram of a system architecture according to an embodiment of this disclosure is shown; Figure 2 A flowchart illustrating a game control method according to an embodiment of this disclosure is shown; Figure 3 A schematic diagram of a game control device according to an embodiment of the present disclosure is shown; Figure 4 A schematic diagram of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation
[0010] Exemplary embodiments of this disclosure will be described more fully below with reference to the accompanying drawings.
[0011] The accompanying drawings are schematic illustrations of this disclosure and are not necessarily drawn to scale. Some block diagrams shown in the drawings may be functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in hardware modules or integrated circuits, or in networks, processors, or microcontrollers. Implementations can be carried out in various forms and should not be construed as limited to the examples set forth herein. The features, structures, or characteristics described in this disclosure can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough description of embodiments of this disclosure. However, those skilled in the art will recognize that one or more specific details may be omitted when implementing the technical solutions of this disclosure, or other methods, components, apparatuses, steps, etc., may be used to replace one or more specific details.
[0012] To make the objectives, technical solutions, and advantages of this disclosure clearer, the embodiments of this disclosure will be described in further detail below with reference to the accompanying drawings.
[0013] Figure 1A system architecture diagram of the operating environment of this embodiment is shown. This system architecture may include a first client 110, a second client 120, and a server 130. The first client 110 and the second client 120 are terminal devices that have installed and run game client programs, such as mobile phones, tablets, personal computers, smart wearable devices, game consoles, etc. They have display functions and can display a graphical user interface, which may include the operating system interface or the application interface. The first client 110 is the client used by the first game account, and the second client 120 is the client used by the second game account; that is, the game client program running on the first client 110 is logged into the first game account, and the game client program running on the second client 120 is logged into the second game account. The server 130 generally refers to the backend system providing game services in this exemplary embodiment; it can be a single server or a cluster of multiple servers. A game server program is deployed on the server 130 to perform server-side game data processing. The first client 110, the second client 120, and the server 130 can be connected via wired or wireless communication links for data transmission. For example, the first client 110 can send information (such as an editing assistance request) to the second client 120 through the server 130, and the second client 120 can send information (such as an edited first game lineup) to the first client 110 through the server 130. In addition, the first client 110 and the second client 120 can also communicate directly through wired or wireless means.
[0014] In one implementation, the above method can be implemented and executed based on a cloud interaction system. The cloud interaction system can be based on the aforementioned system architecture. Various cloud applications can run under the cloud interaction system, such as cloud gaming. Taking cloud gaming as an example, cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming operating mode, the game program's execution entity and the game screen presentation entity are separated. The storage and execution of in-game control and interaction methods are completed on the cloud gaming server (such as the aforementioned server 130). The cloud gaming client (such as the aforementioned first client 110 and second client 120) includes receiving and sending data, as well as presenting the game screen. For example, the cloud gaming client can be a display device with data transmission capabilities located close to the user, such as a mobile terminal, television, computer, or PDA; while the game control is performed by the cloud gaming server in the cloud. When playing or editing, the player operates the cloud gaming client to send operation commands to the cloud gaming server. The cloud gaming server runs the game according to the operation commands, encodes and compresses game screen data, returns it to the cloud gaming client via the network, and finally decodes and outputs the game screen through the cloud gaming client.
[0015] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0016] This embodiment provides a game control method. Figure 2 This is a flowchart of a game control method according to an embodiment of the present disclosure, such as... Figure 2 As shown, the process includes the following steps: Step S110: Control the first virtual object to be in the first state in the game scene; Step S120: When the first virtual object is in the first state, in response to detecting the game event corresponding to the second virtual object, the first attribute parameter is updated, wherein the second virtual object is a virtual object controlled by the terminal device; Step S130: If the first attribute parameter satisfies the first condition, control the first virtual object to change from the first state to the second state; Step S140: When the first virtual object is in the second state, control the first virtual object to keep listening; Step S150: While maintaining the listening process, in response to the detection of a game event, control the update of the first attribute parameter; Step S160: If the first attribute parameter satisfies the second condition, control the first virtual object to change from the second state to the third state; Step S170: If the listening duration reaches the first preset duration and the first attribute parameter does not meet the second condition, control the reset of the first attribute parameter and control the first virtual object to return to the first state.
[0017] The method provided in this embodiment enables the terminal device to control the orderly transitions of a first virtual object between a first state, a second state, and a third state, and to achieve a progressive response of a non-player-controlled virtual character to player actions based on the accumulation and reset mechanism of the first attribute parameters. This multi-level state switching mechanism not only enhances the tension and strategic depth of player interaction with the game environment, increasing the game's immersion and richness, but also optimizes the computational logic of AI decision-making through the temporal control of the state machine, reducing unnecessary consumption of system resources and effectively solving the technical problems of abrupt NPC state switching and lack of behavioral hierarchy in traditional games.
[0018] The steps described above are explained in detail below.
[0019] In step S110, the first virtual object is controlled to be in a first state in the game scene. In application, this method provides a graphical user interface through a terminal device, displaying the game scene and the first virtual object within the game scene. The first virtual object is a non-player-controlled virtual character. By controlling the state of the first virtual object, the behavior management of the virtual character in the game scene is achieved.
[0020] Specifically, an initial behavioral state of the first virtual object is established. By setting it to the first state, the first virtual object can perform basic scene interaction behaviors in the game scene, providing a basic operating environment for subsequent responses to game events and state transitions.
[0021] The terminal device can be a hardware device used to provide a graphical user interface and process game logic, such as a smartphone, tablet, personal computer, or game console, which are electronic devices with computing power and display functions.
[0022] In an alternative implementation, the terminal device can be a mobile terminal, such as a smartphone or tablet, which receives touch commands from the user via a touchscreen.
[0023] In an alternative implementation, the terminal device can be a fixed game console that displays a graphical user interface via an external display and connects to a game controller to receive operation commands.
[0024] In an alternative implementation, the terminal device can be a personal computer that receives precise user input via a keyboard and mouse.
[0025] It should be noted that the terminal device may be only one of the above embodiments, or it may be multiple of the above embodiments simultaneously. For example, the terminal device may be a smartphone, or it may be connected to a TV as a display terminal via screen mirroring, while maintaining the touch operation function of the phone to achieve a multi-screen interactive gaming experience.
[0026] The graphical user interface (GUI) is an interactive interface displayed on the terminal device screen, including the visual presentation of the game scene and various interactive controls, used to display the virtual environment, character status, and game information. As a visual medium for players to interact with the game world, the GUI presents the state changes of the first and second virtual objects in the game scene in real time, providing an immersive gaming experience.
[0027] In an alternative implementation, the graphical user interface can be presented as a third-person perspective game view, displaying a panoramic view of the game scene and the relative positional relationship between the first virtual object and the second virtual object.
[0028] The game scene can be a virtual game environment space, including terrain, buildings, obstacles, and other environmental elements, providing a place for the first and second virtual objects to interact and move. As the carrier of game events, the game scene provides a spatial environment for the first virtual object to perform state behaviors (such as patrolling and searching), and carries physical simulations such as sound propagation and line-of-sight occlusion.
[0029] In an alternative implementation, the game scenario can be an enclosed building interior environment containing multiple rooms, corridors, and bunkers, providing ample space for tactical movement.
[0030] In an alternative implementation, the game scene can be an open wilderness environment, including undulating terrain, vegetation, and water, which affects the range of sound propagation and the character's field of vision.
[0031] In an alternative implementation, the game scene can be a hybrid environment, combining indoor and outdoor areas, including interactive doors and windows, and destructible obstacles. For example, in a city ruins scene, a second virtual object can block the direct pursuit of the first virtual object by closing an iron gate, but the noise generated by closing the gate will attract the attention of the first virtual object and increase its first attribute parameter. The player needs to make a trade-off between quietness and blocking.
[0032] It should be noted that the game scene may be only one of the above embodiments, or it may be multiple of the above embodiments simultaneously. For example, the game scene may include an indoor building area and an adjacent outdoor courtyard area. The two areas have different sound propagation characteristics and field of view occlusion effects, and the first virtual object may exhibit different patrol paths and perception sensitivities in different areas.
[0033] The first virtual object can be an AI character controlled by the game system, possessing autonomous decision-making capabilities and able to change its state based on environmental changes and player behavior. As a non-player-controlled character in the game, the first virtual object provides dynamic challenges and interactive objects for the second virtual object by transitioning between different states, driving the development of the game process.
[0034] In an alternative implementation, the first virtual object can be a humanoid creature with an anthropomorphic appearance and movements, equipped with melee weapons or special equipment. For example, the first virtual object may appear as a tall creature wielding a huge weapon, moving slowly in the game scene, dragging the weapon to produce a recognizable sound signature. This sound cues help the player determine the approximate distance and location of the first virtual object.
[0035] In an alternative implementation, the first virtual object can be a mechanical character. For example, the first virtual object is represented as a quadrupedal walking mechanical device equipped with an auditory detection module, which can accurately locate the direction of the sound source and move to that location. Its mechanical structure makes it produce a unique metallic clanging sound when it moves.
[0036] In an alternative implementation, the first virtual object can be a fantasy creature with supernatural perception and special movement methods, such as teleportation or flight. For example, the first virtual object may appear as a ghost, be able to walk on walls, maintain low visibility while patrolling, and only reveal its full form when entering an attack state, giving the player a sudden fright experience.
[0037] It should be noted that the first virtual object may be only one of the above embodiments, or it may be multiple of the above embodiments simultaneously. For example, the first virtual object may be humanoid in appearance, but also possess mechanical sensor visual characteristics, combining two types of perception to enhance the complexity and sense of threat of the character.
[0038] Among them, non-player-controlled virtual characters can be virtual character entities controlled by the game's artificial intelligence system rather than by real players, possessing preset behavioral logic and state response mechanisms. The controlling entity of the first virtual object is clearly defined as the system AI, ensuring that it can automatically switch between states according to preset rules (such as the first condition and the second condition), without being directly controlled by the player.
[0039] In an alternative implementation, the non-player-controlled virtual character can be a hostile NPC whose artificial intelligence is configured to actively search for and attempt to interact with the second virtual object. For example, the character is equipped with a hostility detection module that automatically calculates the threat level and decides whether to switch to an attack state when the second virtual object is detected entering a specific range. This configuration makes the first virtual object exhibit initiative and aggression.
[0040] In one alternative implementation, the non-player-controlled virtual character can be a neutral NPC that normally follows a fixed patrol route and only changes its behavior when provoked. For example, the character initially moves along a preset path in a loop, pauses its patrol and turns towards the source of the sound when it hears an unusual sound, and resumes its original route if no threat is found, exhibiting environmental responsiveness rather than persistent hostility.
[0041] In an alternative implementation, the non-player-controlled virtual character can be an environment-responsive entity capable of changing behavior based on changes in the game scene over time or triggered by special events. For example, the character may remain in a dormant state during the day (first state), automatically activate and enter patrol state at night, and react sensitively to light and sound events, thus increasing the strategic nature of the game's temporal dimension.
[0042] It should be noted that the non-player-controlled virtual character can be just one of the above implementation methods, or it can be multiple of the above implementation methods simultaneously. For example, the first virtual object can be a hostile NPC, or it can transform into a neutral type at certain stages according to the game's plot, with dynamic behavior pattern configuration, increasing the depth of character development.
[0043] The first state can be the basic behavioral state of the first virtual object. In this state, the first virtual object performs regular patrol or standby behaviors and has low sensitivity to game events. As the default running state of the first virtual object, the first state provides the initial baseline for the state machine and serves as the reference starting point for transitions to other states (the second state and the third state).
[0044] In an optional implementation, the first state can be a patrol state, in which the first virtual object moves along a predetermined path in the game scene and emits recognizable environmental sounds. For example, the first virtual object drags a weapon back and forth in a corridor, producing the sound of metal rubbing against the ground, indicating its approximate location and distance to the second virtual object. This sound cues are an important basis for players to judge safe distances.
[0045] In an alternative implementation, the first state can be a dormant state, in which the first virtual object remains in a fixed position and only performs low-frequency environmental scanning.
[0046] In an alternative implementation, the first state can be a vigilant waiting state, in which the first virtual object moves randomly within a specific area, occasionally stopping to observe its surroundings. For example, the first virtual object randomly selects checkpoints within the camp's boundary, pauses at each checkpoint for a few seconds to look around, and then continues to the next randomly selected checkpoint, exhibiting an irregular patrol pattern.
[0047] It should be noted that the first state can be just one of the above embodiments, or it can be multiple of the above embodiments simultaneously. For example, the first virtual object can alternately perform patrol behavior and random inspection behavior in the first state. Combining the characteristics of the two modes makes the AI behavior more unpredictable.
[0048] In one specific application, after the terminal device launches the game application, an abandoned hospital scene is displayed on the graphical user interface. The first virtual object is presented as a hostile creature wielding a giant scythe, initially controlled in the first state (patrol state). In this state, the first virtual object patrols back and forth along the hospital corridor, dragging the scythe and producing a continuous metallic scraping sound. The second virtual object (the survivor controlled by the player) is located in a ward on the same floor. Observing the movement route and sound cues of the first virtual object through the graphical user interface, the player decides whether to lie in wait or look for an escape route, taking advantage of the gaps in the first virtual object's patrol to move.
[0049] In step S120, specifically, this step is used to introduce an external stimulus response mechanism in the basic operating state of the first virtual object. By detecting various game events triggered by the second virtual object, the value of the first attribute parameter is dynamically adjusted to provide a quantitative basis for the state transition of the first virtual object and establish a mapping relationship from player behavior to AI response.
[0050] The second virtual object can be a virtual character entity that players can directly control through their terminal devices. It is the main object of operation in the game and can perform various behaviors such as movement, interaction, and combat. As the trigger source for game events, the behavior generated by the second virtual object will directly affect the changes in the first attribute parameter, thereby driving the state transition of the first virtual object and forming a dynamic game relationship between the player and the AI.
[0051] In this context, the virtual object controlled by the terminal device can be a player character entity that establishes a control connection with the terminal device. Its behavior is determined by the player through input devices (touchscreen, gamepad, keyboard, etc.), and it is the main body of game interaction. Clearly defining the source of game events, distinguishing it from the AI control of the first virtual object, ensures that the update of the first attribute parameters is triggered by the player's active behavior, thereby enhancing the game's interactivity and responsiveness.
[0052] Game events can be specific behaviors or phenomena that occur within the game scene and can be detected and processed by the game system, including sound generation, eye contact, and physical interaction. Serving as a bridge connecting the behavior of the second virtual object and the state changes of the first virtual object, game events achieve dynamic updates of the first attribute parameters by quantifying the impact of different types of events.
[0053] In an alternative implementation, game events can be sound-generated events, triggered by the movement, interaction, or use of items by the second virtual object, with different sound intensities and propagation ranges. For example, running generates high-intensity sound events per second, while crouching generates only low-intensity sound events. The two contribute differently to the growth of the first attribute parameter, and the player needs to choose the movement method based on distance and status.
[0054] In an alternative implementation, the game event can be a line-of-sight event, triggered by an instantaneous detection when the second virtual object enters the field of view of the first virtual object. For example, when the second virtual object emerges from behind cover and is seen directly by the first virtual object, a full increase in the first attribute parameter is immediately triggered, causing the first virtual object to directly enter the third state, ignoring the current aggro accumulation process.
[0055] In an optional implementation, game events can be physical interaction events, including actions such as opening doors, destroying obstacles, and picking up items. For example, when the second virtual object opens a rusty iron door, it produces a unique creaking sound. This sound event is recognized by the system and converted into a corresponding increase in the first attribute parameter, indicating that a player is active on the first virtual object, and the sound has unique identification characteristics.
[0056] It should be noted that game events can be just one of the above implementation methods, or multiple of them simultaneously. For example, a complete operation of the second virtual object can include sound events and physical interaction events, both of which are detected simultaneously and accumulated to calculate the first attribute parameter, or a specific combination of events can trigger additional bonus effects.
[0057] The first attribute parameter can be a numerical parameter used to quantify the alertness or hostility of the first virtual object towards the second virtual object, reflecting the threat level through the cumulative impact of game events. As the core criterion for state transitions, the first attribute parameter, by quantifying the accumulated perception of the first virtual object, achieves an automatic triggering mechanism from the first state to the second and third states. The first virtual object is configured with a detection range; game actions performed by game objects within the detection range will be detected if they generate game parameters that meet the specified conditions.
[0058] In an alternative implementation, the first attribute parameter can be a hate value system, with a value ranging from 0 to 100, dynamically increasing or decreasing according to the type and frequency of detected game events. For example, running behavior increases by 20 points per second, jumping behavior increases by 25 points each time, and a state transition is triggered when the value accumulates to 60. This numerical feedback allows the player to anticipate the reaction of the first virtual object.
[0059] In an alternative implementation, the first attribute parameter can be an alertness meter, visualized to the player via a progress bar in the graphical user interface. For example, when a second virtual object approaches a first virtual object, a red progress bar gradually fills at the edge of the screen, indicating to the player that the level of danger detected is increasing, and the player can adjust their action strategy based on the changes in the progress bar.
[0060] In an optional implementation, the first attribute parameter can be a multi-level threat index, with different numerical ranges corresponding to different AI behavioral tendencies. For example, 0-30 is a safe range, 31-60 is a attention range, 61-99 is a vigilance range, and 100 is a hostile range. Within each range, the patrol route and search range of the first virtual object are adjusted accordingly, exhibiting a progressive alert response.
[0061] It should be noted that the first attribute parameter can be only one of the above embodiments, or it can be multiple of the above embodiments simultaneously. For example, the system can maintain an internal aggro value, or it can display a corresponding alertness meter to the player through a graphical user interface, providing both internal and external parameter representations to enhance the game's comprehensibility.
[0062] In one specific application, the first virtual object is in patrol mode (first state), and the second virtual object (controlled by the player) is within the first virtual object's sound perception range. The second virtual object performs a running action, generating continuous sound game events. After the system detects this game event, it increases the first attribute parameter (aggro value) by 20 points per second. Simultaneously, the second virtual object opens a nearby door, generating a physical interaction event, which additionally increases the aggro value by 15 points. As the first attribute parameter continues to accumulate, the alert indicator displayed on the graphical user interface gradually rises, prompting the player to be detected by the first virtual object and to quickly find cover or stop moving to reduce the risk of being discovered.
[0063] In step S130, when the first attribute parameter accumulates to a specific standard, the behavior mode of the first virtual object is automatically triggered to change, from the basic patrol state to a higher alert level search state, realizing the first upgrade of AI behavior.
[0064] The first condition can be a preset numerical threshold or logical judgment standard used to determine whether the first attribute parameter has reached a critical value sufficient to trigger a state transition. As a trigger for the transition from the first state to the second state, the first condition, by setting a clear threshold (such as the value 60), ensures that the first virtual object changes its behavior pattern only after accumulating sufficient alertness, avoiding overly sensitive or sluggish state responses.
[0065] In an optional implementation, the first condition can be a fixed numerical threshold, and the condition is determined to be met when the first attribute parameter reaches or exceeds the fixed value.
[0066] In an alternative implementation, the first condition can be a dynamically calculated threshold, which dynamically adjusts the triggering criteria based on the game difficulty or the distance to the first virtual object. For example, when the first virtual object is far away, the threshold can be automatically lowered to compensate for the distance factor and increase the adaptive difficulty of the game.
[0067] In an optional implementation, the first condition can be a composite condition, which, in addition to numerical requirements, must also meet specific environmental factors or time conditions. For example, the first condition is only considered met when the first attribute parameter reaches 60 points and the game scene is at night. During the daytime, even if the value meets the standard, the state transition is not triggered, reflecting the impact of different environments on AI perception.
[0068] It should be noted that the first condition can be only one of the above embodiments, or multiple of the above embodiments simultaneously. For example, the system can be configured with both a fixed threshold and a dynamic adjustment mechanism, automatically selecting the applicable judgment standard based on the current game scenario, or forcibly using a composite judgment condition at specific plot points.
[0069] The second state can be a highly alert state for the first virtual object. In this state, the first virtual object suspends routine patrols and focuses on perceiving and investigating specific areas or directions. As a transitional buffer between the first and third states, the second state gathers more environmental information by maintaining listening behavior, deciding whether to return to normal patrols or enter an attack state, thus increasing the layering and strategic nature of the AI's behavior.
[0070] In an alternative implementation, the second state can be a search state, where the first virtual object stops moving and turns towards the nearest sound source, remaining still to improve perception sensitivity. For example, when the aggression value reaches 60, the first virtual object immediately stops its patrolling, stands still, and looks around.
[0071] In an alternative implementation, the second state can be an investigation state, in which the first virtual object slowly moves toward the last known sound location, carefully checking possible hiding places along the way.
[0072] In an optional implementation, the second state can be an alert state, in which the first virtual object remains stationary but the scanning frequency is increased, and the field of view is temporarily expanded. For example, after the first virtual object enters the second state, its fan-shaped field of view expands from 90 degrees to 180 degrees, the scanning speed is increased, and the second virtual object moving from the flank can be detected more quickly, but this state is time-limited.
[0073] It should be noted that the second state can be just one of the above embodiments, or it can be multiple of the above embodiments simultaneously. For example, the first virtual object can first enter a static search, and if no threat is detected, it can switch to a slow investigation, combining multiple high-alert behavior modes, or selecting different second state manifestation methods according to the environment.
[0074] In a specific application, the first virtual object is controlled to switch from patrol state (first state) to search state (second state). The first virtual object stops moving, the graphical user interface shows that it has entered alert mode, and at the same time, an ear UI prompt appears on the player's screen, indicating that the player is in the first virtual object's perception focus area. The player needs to stop moving immediately and find cover to avoid it.
[0075] In step S140, specifically, the openness of the perception channel is maintained in a high-alert state, and environmental sound information is collected through continuous listening behavior to provide real-time data support for subsequent judgment on whether to switch to the third state or return to the first state, ensuring that the first virtual object maintains environmental sensitivity during the search.
[0076] Among them, "keep listening" can be a continuous perceptual behavior performed by the first virtual object in the second state. It monitors dynamic changes in the game scene in real time through virtual sensory systems (such as auditory and visual scanning), especially new game events generated by the second virtual object. As the core behavioral feature of the second state, "keep listening" achieves dual judgment of the time dimension and event dimension of the state machine by continuously updating the timestamp and the first attribute parameter, ensuring that the first virtual object does not remain in a high-alert state indefinitely.
[0077] In step S150, specifically, this step is used to establish an incremental response mechanism during the duration of the second state, by continuing to detect game events to accumulate or adjust the first attribute parameters, providing a dynamic basis for the first virtual object to decide whether to enter the attack state or return to the patrol state, and realizing the dynamic balance of values inside the state machine.
[0078] In this context, game events detected during sustained monitoring can be new player behavior signals detected during the second state of sustained monitoring, including sound, visual contact, or other interactive behaviors, which can further accumulate the alertness of the first virtual object. As input signals for maintaining or upgrading the alertness level in the search state, continuous sound source updates enable the first virtual object to track the latest location of the second virtual object and decide whether to enter an attack state. For example, game events detected during sustained monitoring can be continuous sound tracking, with the first virtual object updating its direction based on the real-time location of the sound.
[0079] The first attribute parameter, updated during the monitoring process, can be a dynamically accumulated value in the second state, reflecting the degree of confirmation of the location of the second virtual object by the first virtual object and the degree of hostility escalation. This value may increase due to new events or decay over time. As a real-time indicator for measuring whether the second condition is met, continuous updates during the monitoring period enable a smooth transition from temporary alert to confirmed attack or a final reset when the condition is not met.
[0080] In step S160, specifically, this step is used to establish a high threshold triggering mechanism. When the first attribute parameter accumulates to a higher standard or meets a specific immediate condition, the first virtual object is triggered to switch from search behavior to attack behavior, completing the ultimate state transition of hostility confirmation, marking that the player has been upgraded from a potential threat to a confirmed target.
[0081] The second condition can be a more stringent trigger threshold or immediate judgment standard than the first condition. It serves as a critical condition to confirm that the first virtual object has fully located the second virtual object and decided to initiate active interaction (attack). As the final judgment basis for the transition from the second state to the third state, by setting a threshold higher than the first condition (such as 100), it ensures that the attack behavior is only triggered when there is sufficient alertness or direct visual confirmation, thus avoiding premature attacks that could lead to game imbalance.
[0082] In an alternative implementation, the second condition can be a high numerical threshold, such as 100 points of hatred, which is higher than the first condition of 60 points and requires a longer period of time or more intense behavior to satisfy.
[0083] In an alternative implementation, the second condition can be an instant trigger condition, which ignores the current value of the first attribute parameter and is immediately satisfied as long as a specific game event (such as being attacked or being directly looked at) occurs.
[0084] In an optional implementation, the second condition can be a composite condition that requires both numerical and temporal requirements to be met simultaneously. For example, the first attribute parameter must reach 100 points and the first virtual object must continuously track the sound source for more than 2 seconds before the second condition is met and the attack state is entered. This prevents instantaneous numerical values from triggering the attack immediately and increases the realism of the confirmation process.
[0085] It should be noted that the second condition can be just one of the above embodiments, or it can be multiple of the above embodiments simultaneously. For example, the system can be configured to have both numerical thresholds and instant triggering conditions, and the conversion can be triggered when either condition is met, or the system can switch between different conditions according to the game stage.
[0086] The third state can represent the active attack state of the first virtual object. In this state, the first virtual object performs actions such as chasing, attacking, or capturing the second virtual object, and has enhanced movement speed and aggression. As the final alert level of the state machine, the third state indicates that the first virtual object has completed the transition from passive response to active attack, providing a climax of the game's confrontation phase, and can return to a lower state or continue the pursuit through subsequent conditions.
[0087] In an alternative implementation, the third state can be a pursuit state, in which the first virtual object gains a movement speed bonus and moves rapidly toward the current or last known position of the second virtual object.
[0088] In an alternative implementation, the third state can be a combat state, where the first virtual object performs a specific sequence of attack actions when it approaches the second virtual object.
[0089] In one specific application, the first virtual object is in a search state, and its first attribute parameter accumulates to 100 points, satisfying the second condition (threshold 100). The system immediately controls the first virtual object to switch from the search state (second state) to the attack state (third state). The first virtual object suddenly increases its movement speed and rushes towards the second virtual object. A bright red warning light and heartbeat sound effect are displayed on the graphical user interface, indicating that the player has entered a high-risk combat phase. The second virtual object must immediately escape or find cover, using obstacles in the scene to evade the pursuit of the first virtual object until the disengagement condition is met, causing the first virtual object to return to a low state.
[0090] In step S170, specifically, a timeout reset mechanism is established. When the first virtual object remains in a high alert state for a certain period of time but does not receive sufficient stimulation to confirm the threat, the accumulated alert value is automatically cleared and the object returns to the basic patrol state, thus avoiding indefinite stay in the high alert state and providing the game with a breathing period and strategy cycle.
[0091] The first preset duration can be a pre-defined maximum listening time limit, defining the longest duration for which the first virtual object can maintain listening in the second state. Once this duration is reached, a reset mechanism is triggered. As a time constraint condition for the state machine, the first preset duration prevents the first virtual object from searching indefinitely due to a single stimulus, ensuring the rationality of the game rhythm and AI behavior, and providing players with a time window to escape.
[0092] In one alternative implementation, the first preset duration can be a fixed duration, such as 6 seconds. Regardless of the intensity of the event detected previously, a forced reset occurs after 6 seconds. For example, after the first virtual object enters the search state, a 6-second countdown begins. If 100 points of aggro are not accumulated during this period, the aggro is reset to zero after 6 seconds, and patrolling resumes. This fixed duration allows players to memorize safe hiding times.
[0093] In an optional implementation, the first preset duration can be a dynamically increasing duration, which is dynamically adjusted according to the number of times the second state is entered or the game difficulty.
[0094] Resetting the first attribute parameter can be an operation that clears the current value of the first attribute parameter to zero or restores it to the initial default value (usually 0), indicating that the first virtual object abandons the current vigilance accumulation, believing that the threat has been eliminated or cannot be confirmed. As a cleanup mechanism after timeout or disengagement, resetting the first attribute parameter ensures that the first virtual object does not carry over the previous vigilance accumulation to the next round of patrol, maintaining the independence and fairness of each state transition.
[0095] In an alternative implementation, resetting the first attribute parameter can be done in a direct zeroing mode, immediately setting the value to 0 without any reservation.
[0096] In an alternative implementation, the first attribute parameter can be reset in a decay mode, gradually reducing the value as it returns to the first state, rather than instantly clearing it to zero. For example, after a listening timeout, the first virtual object returns to the patrol state, and the aggro value gradually decays from its current value to 0 over 5 seconds. If an event is detected again during this period, it can continue to accumulate, providing a brief memory window.
[0097] In an alternative implementation, resetting the first attribute parameter can be done in a partial retention mode, where a certain percentage of the value is retained as a base alertness when the value is reset to zero. For example, 10% of the previous value is retained during the reset (e.g., decreasing from 80 to 8), allowing the first virtual object to enter a high alert state more quickly when it encounters an event again, reflecting the memory effect and the cumulative stress mechanism.
[0098] It should be noted that resetting the first attribute parameter can be just one of the above implementation methods, or it can be multiple of the above implementation methods simultaneously. For example, under normal circumstances, it can be directly reset to zero, but in a specific story mode, a decay mode can be used, or different strategies can be adopted according to the type of the first virtual object (such as retaining some values for elite monsters and completely resetting them to zero for ordinary monsters).
[0099] Furthermore, when the first attribute of the first virtual object is reset to a range matching the first state, control is activated to return to the first state. This can be a state transition operation that restores the behavior pattern of the first virtual object from the second state (search) back to the first state (patrol), marking the end of an alert cycle. As a fallback mechanism of the state machine, after completing the listening cycle and confirming no threat, returning to the first state allows the first virtual object to resume normal behavior, preparing for the next possible alert cycle and maintaining the activity of the game AI.
[0100] In a specific application, the first virtual object enters a search state (second state) and continues listening, accumulating its first attribute parameter to 75 points (not meeting the second condition of 100 points). The listening duration reaches the first preset duration of 6 seconds, during which the second virtual object (player) does not generate any new game events. The system then resets the first attribute parameter to 0 and controls the first virtual object to return to the first state (patrol state).
[0101] In a game control method provided in one embodiment of the application, in response to detecting a game event corresponding to a second virtual object, the control update of the first attribute parameter includes: Step S210: In response to detecting a sound event corresponding to the second virtual object, control the execution of the first attribute parameter accumulation operation; and In step S220, in response to detecting an event that satisfies the instantaneous condition, the control adjusts the first attribute parameter to satisfy the second condition.
[0102] The method provided in this embodiment enriches the response dimensions of non-player-controlled virtual characters to game events through a differentiated attribute parameter update mechanism. This enhances the realism and strategic nature of the interaction, optimizes the triggering logic of game state transitions, and thus improves the player's immersive experience while solving the problem of rigid interaction caused by the monotony of state switching in traditional games.
[0103] The above plan will be explained in detail below.
[0104] In step S210, specifically, when the first virtual object is in the first state, the system continuously monitors sound events triggered by the second virtual object in the game scene. Once such an event is detected, the system performs an accumulation operation on the first attribute parameter according to a preset rule to quantify and accumulate the trace information exposed by the second virtual object, thereby achieving a progressive assessment of the potential threat level and providing data support for subsequent state transitions.
[0105] The sound event corresponding to the second virtual object can be an acoustic feedback identifier generated when the second virtual object performs a specific action in the game scene. This identifier is associated with the type and intensity of the second virtual object's behavior and is used to trigger a quantitative update of the first attribute parameter. Simultaneously, as an environmental element in the game scene, this sound event can reflect the location information and behavior pattern of the second virtual object, providing multi-dimensional input for the state decision-making of the first virtual object. Game operations corresponding to the second virtual object can be implemented through click operations, swipe operations, long-press operations, and / or other operations. For example, a click operation can control the second virtual object to perform movement or interactive behaviors to generate corresponding sound events.
[0106] Sound events may include footstep acoustic signals generated by the second virtual object performing movement behavior, and sound events may include environmental acoustic disturbances generated by the second virtual object performing interactive behavior. For example, when the second virtual object performs the operation of opening a virtual door or triggering a mechanism, the system identifies the specific audio characteristics corresponding to the interactive behavior and controls the first attribute parameter to increase a value that matches the complexity of the interaction.
[0107] It should be noted that the sound event corresponding to the second virtual object may be only one of the above embodiments, or it may be multiple of the above embodiments at the same time.
[0108] The first attribute parameter accumulation operation can be a calculation process that performs incremental adjustment of the numerical parameters representing the threat level based on the intensity of the detected event. This process converts the acoustic input into a quantifiable state transition index, which is used to control the timing of the state switching of the first virtual object. The cumulative effect of the exposure time of the second virtual object is reflected through the gradual numerical accumulation, avoiding frequent state fluctuations caused by instantaneous misjudgment.
[0109] In an optional implementation, the first attribute parameter accumulation operation may include performing linear accumulation based on the duration of the sound event. For example, for the continuous movement behavior of a second virtual object, the system increases the attribute parameter by a fixed value per second until it stops detecting the sound event, thereby achieving a continuous quantitative assessment of the continuous exposure situation.
[0110] In an alternative implementation, the first attribute parameter accumulation operation may include performing differential accumulation based on the type of the sound event.
[0111] It should be noted that the first attribute parameter accumulation operation can be only one of the above embodiments, or it can be multiple of the above embodiments at the same time.
[0112] In step S220, specifically, when the system detects an event that meets a specific instantaneous triggering condition, it immediately adjusts the first attribute parameter directly to the threshold level that meets the second condition, without going through a gradual accumulation process, thereby achieving an instant response to key game events, accelerating the rapid transition of the first virtual object from the current state to the next state, and ensuring the ability to handle emergency threats in real time.
[0113] Among these, events meeting the instantaneous condition can be emergency exposure scenarios that exceed a preset threshold. This scenario indicates a direct visual contact or forced interaction between the second and first virtual objects, and can be determined as a high-risk state without relying on acoustic accumulation. It triggers a state transition in the first virtual object rather than a gradual transformation. The detection of events meeting the instantaneous condition can be achieved through click, swipe, long-press, and / or other operations. For example, a click can trigger the detection of visual collision or attack events to confirm that the instantaneous condition is met.
[0114] In an optional implementation, the event that satisfies the instantaneous condition may include the second virtual object entering the direct field of view of the first virtual object. For example, when the second virtual object appears within the fan-shaped field of view of the first virtual object without any obstruction, the system immediately determines that the instantaneous condition is met.
[0115] In an alternative implementation, an event that satisfies the transient condition may include a second virtual object performing an attack hit operation on a first virtual object.
[0116] In an optional implementation, an event that satisfies the transient condition may include a breakthrough change in the occlusion relationship between the second virtual object and the first virtual object. For example, when the second virtual object rapidly moves from behind an obstruction to an unobstructed area and enters the monitoring range, the system determines that this positional change event satisfies the transient condition.
[0117] It should be noted that the event that satisfies the instantaneous condition may be only one of the above embodiments, or it may be multiple of the above embodiments at the same time.
[0118] Among them, adjusting the first attribute parameter to meet the second condition can be an assignment operation that sets the numerical parameter representing the threat level to a preset full value or target threshold. This operation bypasses the gradual accumulation process and directly establishes the qualification for state transition, which is used to trigger the direct transformation of the first virtual object from the first state to the third state, realizing an instantaneous leap in state rather than a gradual transition.
[0119] In an optional implementation, adjusting the first attribute parameter to satisfy the second condition may include directly setting the parameter value to its maximum value. For example, when a second virtual object is detected entering the field of view, the system immediately adjusts the first attribute parameter from its current value to the maximum value of 100, directly satisfying the second condition of entering the attack state.
[0120] In a specific application, the first virtual object is in the first patrol state. When the second virtual object is running nearby, the system continuously detects sound events and increments the first attribute parameter by 20 points every second. If the second virtual object enters the fan-shaped field of view of the first virtual object during the accumulation process, the system immediately detects an event that meets the instantaneous conditions, directly adjusts the first attribute parameter to the full value of 100 points, and triggers the first virtual object to switch directly from the patrol state to the attack state.
[0121] In a game control method provided in one embodiment of the application, the control to perform a first attribute parameter accumulation operation includes: Step S310: Determine the cumulative amplitude based on the attributes of the sound event; Step S320: Control the accumulation of the first attribute parameter according to the accumulation magnitude.
[0122] The method provided in this embodiment enables non-player characters to achieve refined perception and response to the acoustic environment in game scenes by differentially identifying different attribute characteristics of sound events and configuring corresponding numerical accumulation standards. This avoids the rigidity of reactions caused by simple binary detection, enhances the causal relationship between player behavior and game feedback to improve interactive immersion, enriches the game strategy level and content depth through a multi-dimensional sound processing mechanism, and establishes a parameterizable sound event processing framework, solving the technical defects of traditional games where sound triggering logic is simple and difficult to expand.
[0123] The above plan will be explained in detail below.
[0124] In step S310, specifically, a mapping relationship between sound event characteristics and the rate of increase of hatred value is established. By analyzing the root behavior category and propagation characteristics of sound generation, the value of the first attribute parameter that should be increased per unit time is dynamically calculated, so that the virtual object can distinguish acoustic stimuli of different threat levels and adjust the sensitivity and response intensity of state transition accordingly.
[0125] In step S320, specifically, this step calls a preset numerical calculation logic, takes the accumulation amplitude determined in step S310 as the input parameter, and incrementally updates the first attribute parameter currently held by the first virtual object, thereby realizing the numerical conversion of sound perception to alertness state and providing a quantitative judgment basis for subsequent state machine transitions.
[0126] In a game control method provided in one embodiment of the application, detecting an event that meets instantaneous conditions includes: Step S410: Detect whether the second virtual object is within the field of view of the first virtual object; Step S420: In response to detecting that the second virtual object is within the field of view, it is determined that the instantaneous condition is met.
[0127] The method provided in this embodiment enables the game system to achieve real-time triggering through a visual detection mechanism, in addition to the sound event accumulation mechanism. When the second virtual object enters the field of vision of the first virtual object, the state transition is triggered immediately. This not only enhances the tension and realism of the interaction between the player and the game character, but also enriches the diversity of the behavioral logic of non-player characters in the game, while solving the technical problem of state switching response delay in computer game scenes.
[0128] The above plan will be explained in detail below.
[0129] In step S410, specifically, the spatial relationship between the second virtual object controlled by the player and the field of view defined by the first virtual object is monitored in real time to determine whether the spatial prerequisite for immediate triggering is met. This detection process continues to run in the game loop. When the position coordinates of the second virtual object fall into the visible area defined by the first virtual object, it is considered that the detection condition is met, providing the necessary basis for subsequent immediate triggering state transition.
[0130] The field of view can be defined as the spatial boundary area that defines the perceptible visual information of the first virtual object in the virtual game scene. This area is dynamically determined based on the current position, orientation, and preset perception parameters of the first virtual object. This spatial boundary area serves as a geometric constraint for determining whether the second virtual object is immediately perceived by the first virtual object. It not only defines the spatial scope of the detection operation but also serves as a spatial prerequisite for instantaneous condition determination, deciding whether the second virtual object needs to gradually increase its first attribute parameter through the accumulation mechanism of sound events, or directly trigger the instantaneous condition by entering this spatial boundary area. At the game logic implementation level, this field of view can be correlated with factors such as the behavioral state of the first virtual object, ambient lighting conditions, and obstacle distribution to form a dynamically adjusted visible area. This complements the temporal accumulation mechanism of sound events, jointly constituting a multimodal perception triggering system, enhancing the realism and strategic diversity of the first virtual object's environmental perception.
[0131] In an optional implementation, the field of view can be a dynamically oriented visual area based on the current orientation of the first virtual object. This area updates its coverage in real time as the orientation of the first virtual object's head or body changes. It is typically represented as a fan-shaped or cone-shaped spatial area with the position of the first virtual object as the vertex, the facing direction as the central axis, and a specific angle as the subtended angle. Its geometric parameters can be dynamically adjusted according to the type, level, or current state of the first virtual object.
[0132] In an optional implementation, the field of view can be a hierarchical visual area with distance attenuation characteristics. This area is divided into multiple concentric or overlapping sub-regions based on the distance between it and the first virtual object. Each sub-region corresponds to a different detection sensitivity or triggering condition. The near-field area provides high-sensitivity instant detection, while the far-field area requires additional judgment conditions to confirm that the detection is valid.
[0133] In an alternative implementation, the field of view can be a variable area that is dynamically adjusted according to ambient lighting conditions. The size, shape, or effective distance of this area changes with the ambient light intensity, weather conditions, or special effects in the game scene. It maintains a standard size in bright environments and shrinks accordingly in low-light environments to simulate the effect of reduced visibility.
[0134] It should be noted that the field of view may be only one of the above embodiments, or it may be multiple of the above embodiments.
[0135] Furthermore, the spatial relationship between the second virtual object and the field of view is determined in real time. By periodically acquiring the current position coordinates and boundary volume information of the second virtual object and the geometric parameters of the field of view of the first virtual object, a spatial geometric algorithm is used to calculate the inclusion relationship or intersection state between the two to determine whether the second virtual object is currently located within the spatial boundary of the field of view.
[0136] In an alternative implementation, the geometric determination can be based on a bounding box intersection algorithm. This algorithm constructs a 3D bounding box of the field of view of the first virtual object and a role bounding box of the second virtual object, and uses spatial geometric calculations to detect whether the volumes of the two boundaries overlap or intersect.
[0137] In an alternative implementation, the detection can be based on visibility determination by line-of-sight projection. This method involves emitting a virtual ray from the observation point of a first virtual object to the target point of a second virtual object, detecting whether the ray collides with an obstacle in the scene along its propagation path, and combining this with distance judgment to determine whether the second virtual object is within the field of view.
[0138] It should be noted that detecting whether something is in the business can be just one of the above embodiments, or it can be multiple of the above embodiments at the same time.
[0139] In step S420, specifically, if the second virtual object is detected to be within the field of view of the first virtual object, it is formally confirmed that the instantaneous condition for immediately triggering a state transition is met. This determination operation converts the spatial position detection result into a logical judgment signal, enabling the first attribute parameter to bypass the conventional accumulation process and directly adjust to the threshold that satisfies the state transition, thereby realizing a rapid jump mechanism from the first state to the third state.
[0140] The instantaneous condition can be a criterion for immediately triggering the adjustment of the first attribute parameter to the target threshold. This criterion differs from the gradual triggering mechanism that accumulates the first attribute parameter step by step through sound events. It allows the system to bypass the intermediate accumulation stage and directly set the first attribute parameter to a value that meets the state transition requirements when a specific spatial event is detected. This criterion, distinct from the sound event accumulation mechanism, is primarily designed to address emergency situations where a second virtual object suddenly appears within the visual range of the first virtual object. It allows bypassing the gradual accumulation process in specific scenarios to directly achieve the parameter conditions required for state transition, thus realizing a rapid response mechanism. In implementation, this criterion can be expressed as a Boolean logic expression, a threshold comparison condition, or a specific event type identifier. When the detection operation returns a positive result, the criterion is evaluated as true, thereby immediately initiating the adjustment process of the first attribute parameter and the subsequent state transition process, ensuring that the first virtual object can react instantly to sudden visual stimuli.
[0141] In a specific application, when the system detects that a second virtual object suddenly enters the field of view of the first virtual object, it immediately performs a determination operation, marks the instantaneous condition as met, sets a Boolean flag and generates an instant event, triggers the first attribute parameter to be adjusted to the full value immediately, thereby controlling the first virtual object to switch from patrol state to attack state instantly without the need for sound accumulation process, realizing an instant response to sudden visual stimuli.
[0142] In a game control method provided in one embodiment of the application, when the first virtual object is in a third state, it further includes: Step S610: When the first virtual object is in the third state, determine the moving target based on the location of the first sound source, wherein the location of the first sound source is the location where the game event occurs; Step S620: Control the first virtual object to move towards the moving target.
[0143] The method provided in this embodiment enables non-player-controlled virtual characters to perform intelligent movement and positioning based on the location of sound in the third state. By transforming the spatial attributes of game events into navigation targets, the environmental perception and tracking capabilities of virtual characters are enhanced.
[0144] The above plan will be explained in detail below.
[0145] In step S610, specifically, when a non-player-controlled virtual character enters the third state based on changes in attribute parameters, the system obtains the spatial coordinate information corresponding to the sound events in the game scene in real time, and maps the coordinates to the virtual character's movement destination, thereby establishing a logical connection between sound stimuli and spatial movement.
[0146] The location of the first sound source can be the spatial coordinate point of the sound event generated in the game scene, which is used to convert auditory information into spatial navigation data.
[0147] In an optional implementation, the first sound source location can be the coordinates of footsteps generated when the player controls a virtual object to perform a movement action, and this location is updated in real time as the player moves. In an alternative implementation, the first sound source location can be the instantaneous sound coordinates generated when the player controls the virtual object to interact with the environment, such as the location point when opening a door or using an item.
[0148] In an optional implementation, the first sound source location can be the audible sound source location determined by a sound ray detection algorithm, taking into account the actual perceptible location after obstruction by obstacles.
[0149] It should be noted that the first sound source location can be only one of the above embodiments, or it can be multiple of the above embodiments simultaneously. For example, the first sound source location can correspond to both the real-time location of the player's movement behavior and the instantaneous location of the interaction behavior, and the final movement target can be determined through weighted calculation.
[0150] The location of a game event can be the spatial coordinates used in the game logic to record the origin of a specific action or event, serving as a spatial identifier corresponding to the location of the first sound source, and used to accurately mark the physical source of the sound. Alternatively, the location of a game event can be the spatial positioning data when a player controls a virtual object to perform a specific operation.
[0151] The moving target can be the navigation endpoint coordinates determined by the first virtual object in the third state based on sound source analysis. This serves as a destination parameter controlling the virtual object's movement behavior, enabling intelligent path planning based on auditory perception. Alternatively, the moving target can be the nearest reachable valid point in the game's navigation grid, calculated using a pathfinding algorithm based on the location of the first sound source.
[0152] In an alternative implementation, the moving target can be a precise coordinate point that coincides with the location of the first sound source, and the first virtual object moves to that point along the shortest path in a straight line.
[0153] In an alternative implementation, the moving target can be a random point within a certain radius around the location of the first sound source, used to simulate the uncertainty of the search operation.
[0154] In an optional implementation, the moving target can be a predicted point extending from the line connecting the first sound source location and the current first virtual object location, used to predict the direction of sound source movement.
[0155] It should be noted that the moving target may be only one of the above embodiments, or it may be multiple of the above embodiments simultaneously. For example, the moving target may simultaneously include precise coordinates and surrounding random points. It first moves to the precise coordinates to search, and if no target is found, it patrols among the surrounding random points.
[0156] In step S620, specifically, after determining the spatial coordinates of the moving target, the system drives the non-player controlled virtual object to perform displacement behavior through behavior tree or state machine instructions, so that the virtual object gradually approaches the sound source location along the calculation path, realizing active tracking based on sound cues.
[0157] Moving towards a target can be a directional displacement action performed by a non-player-controlled virtual object in the third state. Moving towards a target can also be a path-following action calculated by a pathfinding algorithm, which can be achieved through automatic navigation, waypoint following, or other movement control methods.
[0158] In one exemplary application of this embodiment, the non-player-controlled virtual object is in a third state (search state), and the system continuously listens for game events. When the player-controlled virtual object performs a running action on the second floor of a building, the system detects the sound event and records its location as the first sound source location. Based on the sound source location, the system determines a specific coordinate on the second floor of the building as the moving target. Subsequently, the system controls the non-player-controlled virtual object to move from the first-floor lobby along the stairs to the second-floor coordinate location. If the player makes a sound again during this period, the moving target is continuously updated. If no player is detected after reaching the target, the system maintains the listening state and waits for new sound cues.
[0159] In one embodiment of this application, a game control method further includes: Step S710: When the first virtual object is in the third state, in response to detecting that the second virtual object is within the first attack range of the first virtual object, control the first virtual object to execute the first attack command. Step S720: In response to the hit result, control the execution of the first attack mode; wherein, the damage parameter of the first attack mode is the first damage parameter; Step S730: In response to a miss result, when the second virtual object is detected to be within the second attack range of the first virtual object, the second attack mode is executed; wherein, the damage parameter of the second attack mode is the second damage parameter, and the first damage parameter is greater than the second damage parameter.
[0160] The method provided in this embodiment enables a layered attack strategy for non-player-controlled virtual characters by distinguishing between the first attack range and the second attack range after the first virtual object enters the third state, and selecting a differentiated first attack mode or second attack mode based on whether the attack hits or not. This not only enriches the combat interaction layers in the game, but also requires players to flexibly adjust their response strategies according to the distance and attack results.
[0161] The above plan will be explained in detail below.
[0162] In step S710, specifically, after the first virtual object successfully transitions from the second state to the third state, the system continuously monitors the spatial positional relationship between the second virtual object and the first virtual object. When it is determined that the second virtual object has entered a preset first attack range, the generation and execution of a first attack command are triggered. This command is used to initiate a specific attack action sequence for the first virtual object.
[0163] The first attack range can be the effective area within a specific distance around the first virtual object. It typically serves to define the spatial boundaries for the first virtual object to perform long-range grabbing or high-threat attack actions.
[0164] In an optional implementation, the first attack range can be configured as a fan-shaped or circular area extending along the direction of the first virtual object, corresponding to the maximum effective distance at which the first virtual object can attack using a specific weapon or skill. For example, in a game scenario where the first virtual object is equipped with a grappling hook weapon, the first attack range can be set as a circular area with a radius of five meters centered on the location of the first virtual object. When the second virtual object controlled by the player enters this area, the system determines that the attack trigger condition is met and controls the first virtual object to extend its grappling hook in an attempt to drag the second virtual object.
[0165] In an alternative implementation, the first attack range can be dynamically adjusted based on the current orientation of the first virtual object, and only be effective within a specific angular range.
[0166] In an optional implementation, the first attack range can be determined in association with the terrain environment and dynamically adjusted according to the height difference.
[0167] It should be noted that the first attack range may be only one of the above embodiments, or it may be multiple of the above embodiments at the same time.
[0168] The first attack command can be the command that triggers the first virtual object to execute a specific attack action. It typically serves to initiate the attack animation playback, damage calculation, and subsequent attack mode selection processes.
[0169] In an optional implementation, the first attack command can be configured to trigger the first virtual object to perform a grappling hook throwing action. This command includes sub-commands such as target position locking, animation state machine switching, and collision detection activation. For example, when the second virtual object enters the first attack range, the system sends the first attack command, controlling the first virtual object to play a pre-attack animation and launch the grappling hook entity. If the grappling hook collides with the second virtual object, it is considered a hit; otherwise, it is considered a miss.
[0170] In an optional implementation, the first attack command may include target tracking logic, adjusting the attack direction in real time based on the movement of the second virtual object during command execution. For example, within 0.5 seconds of the first virtual object's attack preparation animation, the system continuously calculates the displacement vector of the second virtual object and dynamically adjusts the orientation of the first virtual object to ensure the accuracy of the attack. This attack command with a prediction mechanism improves the attack hit rate and increases the difficulty for players to dodge.
[0171] In an alternative implementation, the first attack command can be tied to a cooldown mechanism, with a cooldown period of a specific duration following execution. For example, the first attack command could be set to execute once every 10 seconds. Even if a second virtual object remains within the first attack range during the cooldown period, the system will not respond to trigger a new first attack command, requiring the player to utilize the cooldown interval for tactical movement or counterattacks.
[0172] It should be noted that the first attack command may be only one of the above embodiments, or it may be multiple of the above embodiments simultaneously. For example, the first attack command may include a simple single attack trigger, or it may also have target tracking capabilities and be subject to a cooldown time, forming a complex attack behavior tree.
[0173] In a specific application, when a non-player-controlled monster character (the first virtual object) enters an attack state (the third state), the system continuously monitors the distance between the player character (the second virtual object) and the monster. When the player approaches within five meters (entering the first attack range), the monster immediately executes a grappling hook attack, extending its claws to attempt to grab the player. If the grappling hook successfully contacts the player model, it is considered a hit, and the system enters a high-damage attack sequence; if the player dodges by rolling, it is considered a miss, and the system determines whether to trigger a rapid pursuit attack based on the current distance.
[0174] In step S720, specifically, when the system determines that the first attack command has been successfully applied to the second virtual object (i.e., a hit result has been generated), the system controls the first virtual object to switch to the first attack mode. This mode is configured with higher damage output parameters to reflect the severe penalty effect after the attack is successful.
[0175] The hit result determines whether the attack action has made effective contact with the target. It typically triggers high-damage feedback, activates specific attack recovery animations, and influences the subsequent combat rhythm.
[0176] In an optional implementation, the hit result can be determined by a collision detection system. When the attack judgment box of the first virtual object intersects with the hit judgment box of the second virtual object, the system records the hit status and calculates the damage.
[0177] In an alternative implementation, the hit result can be combined with a specific location determination to produce differentiated effects based on the different contact locations.
[0178] It should be noted that the hit result can be only one of the above implementation methods, or it can be multiple of the above implementation methods at the same time.
[0179] The first attack mode can be a high-damage attack sequence executed after the first attack command hits successfully. It can usually be configured with a relatively long attack preparation time and recovery time, as well as a high damage output value per attack. The aim is to sacrifice attack frequency and movement flexibility in exchange for a high damage return per attack, forming a strong suppression and threat effect on the second virtual object. It is manifested as a slow heavy attack form, which contrasts sharply with the subsequent second attack mode.
[0180] The first damage parameter quantifies the damage inflicted by the first attack mode. It typically determines the extent to which the second virtual object's health is reduced, and its value directly impacts game difficulty balance and combat pace. Its value is significantly higher than the second damage parameter, reflecting the high-risk, high-reward nature of the first attack mode. For example, the first damage parameter can be set to a fixed value of 60 points, balanced based on the second virtual object's total health to ensure that two hits are enough to kill a full-health target.
[0181] In step S730, specifically, when the first attack command fails to make effective contact with the second virtual object (i.e., misses), and the second virtual object is still within the second attack range, the system controls the first virtual object to switch to the second attack mode, which is configured with lower damage output but usually has a faster execution speed, in order to maintain continuous suppression of the player.
[0182] The second attack range can be a spatial area within a specific distance around the first virtual object, typically less than or equal to the first attack range. It usually serves to determine the distance and provide a quick close-range attack opportunity even if a miss occurs, ensuring that the first virtual object does not lose all attack opportunities due to a single miss.
[0183] The second attack mode can be a rapid sequence of attack actions executed when a miss occurs and the second virtual object enters the second attack range. It can typically be configured with significantly shorter wind-up and wind-up durations and / or relatively lower single-hit damage output than the first attack mode.
[0184] The second damage parameter can be a numerical indicator that quantifies the damage caused by the second attack mode, and its value is less than that of the first damage parameter. In an optional implementation, the second damage parameter can be set to a fixed value of 20 points, which is only one-third of the first damage parameter (60 points).
[0185] In one specific embodiment, the player-controlled character encounters a Butcher Boss (first virtual object) in the abandoned factory map. When the Boss enters its attack state (third state), it first checks the player's distance. When the player is more than 10 meters away, the Boss continues its pursuit. Once the player enters the 10-meter range (first attack range), the Boss immediately executes a grappling hook throw (first attack command). If the grappling hook hits the player, the player is forcibly dragged to the Boss's front, and the Boss then executes a slow slash with a 1.2-second wind-up (first attack mode), dealing 60 points of high damage (first damage parameter), after which it enters a state of stun. If the player successfully dodges the grappling hook by rolling to the side (miss result), the Boss quickly closes in. When the player enters the 2-meter range (second attack range), the Boss switches to a rapid slash attack (second attack mode), swinging at a frequency of once every 0.4 seconds, dealing 20 points of damage each time (second damage parameter). The player needs to find opportunities to counterattack or escape amidst the high-frequency attacks.
[0186] In a game control method provided in one embodiment of this application, in a first attack mode, the first attack mode is configured with a first attack delay duration, and in a second attack mode, the second attack mode is configured with a second attack delay duration, wherein the first pre- and post-attack duration is greater than the second pre- and post-attack duration.
[0187] Specifically, by configuring a longer first attack delay for the first attack mode triggered after executing the first attack command, and a shorter second attack delay for the second attack mode triggered directly, high-damage attacks have longer startup and recovery animations while low-damage attacks have shorter startup and recovery animations, forming a combat rhythm that combines fast and slow attacks. This balances the practical value of different attack modes and increases the strategic judgment dimension of the combat process.
[0188] The first attack delay duration can be the total time parameter required from the attack command taking effect to the complete end of the attack action when the first virtual object executes the first attack mode. Specifically, it covers the two key periods of the attack pre-attack phase and the attack post-attack phase. It is used to balance the high output capability by extending the action stun time of high-damage attacks, giving the second virtual object sufficient reaction time and evasion window, while increasing the strategic risk of the first virtual object when executing heavy attacks, and preventing high-damage attacks from being used continuously without penalty.
[0189] The second attack delay duration can be the extremely short transition time parameter required from the confirmation of the attack initiation command to the completion of the attack action when the first virtual object executes the second attack mode. It usually only includes a very short pre-animation preparation and a cancelable or negligible post-animation phase, which is used to support low-damage but high-frequency continuous attack output, maintain a continuous sense of pressure on the second virtual object, and at the same time reduce the penalty cost of a single mistake by shortening the stun time.
[0190] In an alternative implementation, the second attack delay duration can be set to a fast action duration that is much shorter than the first attack delay duration.
[0191] In an optional implementation, the second attack delay duration can be optimized by canceling the after-animation technique, so that the remaining attack animation is interrupted immediately after the damage determination takes effect, and the system directly enters the standby state or connects with other action commands.
[0192] In an alternative implementation, the second attack delay duration can be designed in conjunction with mobility, allowing a balance between the stiffness restriction of the first attack delay duration and completely free movement. Specifically, during the attack pre-animation phase, sliding or turning is allowed at a certain percentage (e.g., 30% to 50%) of the movement speed, and the movement speed is immediately restored to 100% during the attack post-animation phase.
[0193] It should be noted that the second attack delay duration can be just one of the above embodiments, or it can be multiple of the above embodiments simultaneously.
[0194] In a game control method provided by one embodiment of the application, the step of determining the cumulative amplitude based on the attributes of the sound event includes: Step S8010: Determine the cumulative magnitude based on the behavior type.
[0195] The method provided in this embodiment enables the determination of differentiated cumulative magnitudes by distinguishing different behavior types, which can more realistically simulate the differences in sensitivity of non-player-controlled virtual characters to different behaviors, improve the richness of game strategies and the immersive interactive experience of players, and solve the problem of monotonous behavioral feedback caused by fixed numerical accumulation in traditional games.
[0196] The above plan will be explained in detail below.
[0197] The attributes of the sound event include behavior type; the behavior type includes movement behavior and interaction behavior. In step S8010, the cumulative magnitude is determined according to the behavior type.
[0198] Specifically, by identifying the behavior category of sound events triggered by the second virtual object in the game scene, and determining the specific value of the accumulated first attribute parameter based on this category, behaviors of different levels of danger can trigger different levels of alertness. This maintains the sensitivity of the monitoring mechanism while avoiding a uniform response strategy for all behaviors, demonstrating the intelligent discrimination capability of non-player-controlled virtual characters. The attribute of the sound event can be identifying information describing the cause of the sound, which is associated with the specific action performed by the second virtual object, used to distinguish the degree of sensory stimulation of the first virtual object by different behaviors.
[0199] In an alternative implementation, the attributes of a sound event can be set as multi-dimensional parameters, including but not limited to behavior type, sound intensity, duration, etc., wherein the behavior type is used as the primary index parameter to determine the basic cumulative amplitude.
[0200] Among them, the behavior type can be a classification definition of the action nature of the second virtual object, used to distinguish the basic functional categories of the action in the game mechanism, and serves as a direct input parameter for the calculation of the cumulative amplitude.
[0201] In one optional implementation, the behavior types can be divided into two main categories: movement behavior and interaction behavior. Movement behavior includes active actions that change spatial position, such as walking, running, jumping, and crouching. Interaction behavior includes actions that interact with environmental elements, such as opening doors, picking up items, using props, and triggering mechanisms. Each type of behavior corresponds to a preset cumulative amplitude base.
[0202] In an alternative implementation, the behavior type can be further subdivided into multiple subcategories, such as movement behavior can be subdivided into slow movement and fast movement, and interaction behavior can be subdivided into silent interaction and loud interaction, with different subcategories corresponding to different cumulative amplitude gradients.
[0203] In an alternative implementation, the behavior type can be set to a composable mode, that is, when the second virtual object performs multiple behaviors simultaneously, the system identifies the composite behavior type and calculates the combined cumulative magnitude.
[0204] It should be noted that the behavior type can be only one of the above embodiments, or it can be multiple of the above embodiments at the same time.
[0205] The cumulative magnitude can be the amount of value that the first attribute parameter increases when a single sound event is triggered. This amount of value determines the sensitivity of the first virtual object to a specific behavior.
[0206] In an optional implementation, the accumulation increment can be set to a fixed value, i.e., each type of behavior corresponds to a fixed amount of hate value increase, with movement behavior increasing by 15 and interaction behavior increasing by 20.
[0207] In an alternative implementation, the cumulative amplitude can be set to a floating range value, randomly determined or dynamically calculated within a certain range based on the intensity of the specific behavior or environmental factors. For example, the base value of the cumulative amplitude for the running behavior is 20, but if the second virtual object is carrying a heavy object, the cumulative amplitude may decrease to 12; if the running occurs on a metal floor and generates more noise, the cumulative amplitude may increase to 28.
[0208] In an optional implementation, the cumulative magnitude can be set to a cumulative addition mode, that is, when the same type of behavior is triggered multiple times in a short period of time, the cumulative magnitude increases successively or is calculated by weighting based on historical behavior records.
[0209] It should be noted that the cumulative magnitude can be only one of the above embodiments, or it can be multiple of the above embodiments at the same time.
[0210] In a game control method provided in one embodiment of this application, controlling a first virtual object to keep listening includes: Step S1010: While controlling the first virtual object to maintain its current position unchanged within a first preset time period, control the first virtual object to remain stationary while listening.
[0211] Specifically, when the first virtual object enters the second state in response to the first attribute parameter satisfying the first condition, the system triggers the position locking mechanism, which keeps the virtual object in its current position or moves slightly around the position, while maintaining the monitoring of game events (such as sound events or events that detect the player character appearing in the field of vision). In this way, the system simulates the natural behavior of a non-player character who stops and listens carefully to the surrounding noise after noticing an anomaly.
[0212] The first preset duration can be a dynamic time threshold determined based on the number of times the second state is entered. This time threshold is used to limit the maximum duration for which the first virtual object maintains static listening behavior in the second state. This dynamic duration mechanism is closely related to the state transition history of the first virtual object. By recording and analyzing the cumulative frequency of entering the second state, the first virtual object can adaptively adjust its listening duration after repeatedly entering the alert state. On the one hand, this avoids the game behavior becoming patterned due to a fixed duration. On the other hand, by gradually extending the alert time, it reflects the logical reaction of non-player characters to continuous abnormal situations, thereby effectively balancing the game difficulty curve and providing players with a more layered and challenging stealth combat experience.
[0213] In an optional implementation, the first preset duration can be positively correlated with the number of times the second state is entered. That is, each time the second state is entered, a fixed time increment is added to the base value of the first preset duration. For example, when the first virtual object enters the second state for the first time, the first preset duration is set to the base value of 6 seconds. If the virtual object has entered the second state twice before, the current first preset duration is automatically adjusted and accumulated to 7 seconds according to the rule of increasing by 0.5 seconds each time. This makes non-player characters exhibit a longer period of cautious listening behavior after repeatedly encountering anomalies, creating a more oppressive stealth environment for players, while giving players tactical space to avoid pursuit by strategically waiting in silence.
[0214] In an optional implementation, the first preset duration can be a variable that grows non-linearly based on the frequency of entering the second state. When the number of times the second state is entered exceeds a threshold within a unit of time, the growth rate of the first preset duration increases significantly. The accelerated growth mechanism reflects the virtual object's high level of vigilance towards frequent anomalies.
[0215] In an optional implementation, the first preset duration can be a loop mechanism that triggers a duration reset after the number of times the second state is entered reaches a certain cumulative value. When the cumulative number exceeds the upper limit, the first preset duration is restored to the initial base value. This periodic reset avoids the game rhythm from being dragged out due to excessively long listening time.
[0216] It should be noted that the method for determining the first preset duration may be only one of the above embodiments, or it may be multiple of the above embodiments.
[0217] In a game control method provided in one embodiment of the application, in response to detecting that a second virtual object is within a first attack range of a first virtual object, controlling the first virtual object to execute a first attack command includes: Step S1110: Control the detection time interval; wherein, the time interval is the duration since the last execution of the first attack command; Step S1120: In response to the time interval meeting the preset time condition, control the execution of the first attack command.
[0218] The method provided in this embodiment introduces a time interval detection mechanism into the attack control of virtual objects, effectively controlling the rationality of the attack frequency, avoiding continuous suppression of player-controlled virtual objects by non-player-controlled virtual characters, and significantly improving the strategic depth of the game and the fairness of the interactive experience.
[0219] The above plan will be explained in detail below.
[0220] Specifically, when the second virtual object is detected to be within the attack range of the first virtual object, the system controls the timing of the attack by monitoring the time elapsed since the last execution of the attack command. The first virtual object is only allowed to execute a new attack command when the time interval meets the preset time condition, thereby achieving rhythm control of the attack behavior.
[0221] Among them, the time elapsed since the last execution of the first attack command can be used as a numerical parameter to quantify the time span between two attack actions. This parameter reflects the length of time that the first virtual object has taken from completing the last attack action to the current judgment time. As a key time basis for determining whether a new attack is allowed, it directly affects the tightness of the attack rhythm and the game difficulty curve.
[0222] Among them, the time interval meeting the preset time condition can be the logical judgment result triggered when the detected time interval reaches or exceeds the minimum attack interval threshold preset by the system. This condition ensures that the first virtual object will not launch attacks continuously in a short period of time, provides a reasonable reaction and avoidance window for the second virtual object, and maintains the balance of the game rhythm, avoiding excessive consumption of computing resources on intensive attack judgment calculations.
[0223] In one optional implementation, the time interval satisfying the preset time condition can be a fixed cooldown time that detects whether the current time interval is greater than or equal to 10 seconds. For example, after the first virtual object launches a grappling attack, the system is set to prevent the grappling attack from being launched again within 10 seconds. Only when the timer shows that 10 seconds or more have passed is the next grappling attack allowed to be triggered, thus achieving a regular attack rhythm.
[0224] In an optional implementation, the time interval satisfying the preset time condition can be a dynamically adjusted cooling time.
[0225] In one optional implementation, the time interval meeting the preset time condition can be a phased time determination: attacks are completely prohibited for the first 5 seconds, low-damage fast attacks are allowed from 5 to 8 seconds, and high-damage slow attacks are allowed only after 8 seconds. For example, the system sets two thresholds: unlocking fast attack permission at 5 seconds and unlocking slow attack permission at 8 seconds, thereby realizing dynamic switching and strategy selection of attack methods.
[0226] It should be noted that the time interval satisfying the preset time condition can be only one of the above embodiments, or it can be multiple of the above embodiments at the same time.
[0227] One embodiment of the application provides a game control method that further includes: Step S1210: In response to causing damage to the second virtual object through the first attack mode or the second attack mode, control the first virtual object to enter a stun state; wherein the duration of the stun state is a third preset duration.
[0228] The method provided in this embodiment enables players to have a tactical window to counterattack or escape after an attack hits by setting a stun state, which enhances the interactive experience and strategic depth of the confrontation process. It also enables the behavior rhythm of the first virtual object to be parameterized by preset duration, which enriches the mechanism layers of the game combat system. At the same time, it realizes precise timing control of the state of non-player-controlled virtual characters, which solves the real-time problem in the state management of game objects.
[0229] Specifically, when the first virtual object successfully hits the second virtual object and causes damage through any attack mode, the system immediately triggers the stun state transition logic, forcing the first virtual object to enter a stun state where it cannot move, and controls the duration of this state based on a preset third duration parameter, thereby creating a time window for the second virtual object to tactically escape or counterattack after the attack hits, while ensuring the controllability of the game's combat rhythm through the timing control of the state machine.
[0230] The first attack mode or the second attack mode causing damage to the second virtual object can be a hit event in which the first virtual object, based on different tactical distances and attack strategies, successfully acts on the second virtual object and produces a damage judgment result by executing differentiated attack methods during combat interaction. Specifically, this includes situations where the target is successfully hit by a slow attack with high damage over a large area or a fast attack with low damage.
[0231] Among them, the stiff state can be a mandatory object behavior restriction state, which is used to temporarily freeze one or more of the first virtual object's movement ability, attack ability or other behavioral output ability after the attack hits, so that it is in a restricted animation playback state that cannot perform follow-up attacks or continuous attacks. Specifically, it is the after-animation phase in which the first virtual object wipes its weapon, withdraws its attack posture or restores its balance after successfully causing damage.
[0232] The third preset duration can be a time parameter used to quantify the duration of the rigid state, representing the time interval between the first virtual object entering the rigid state and automatically deactivating the state and regaining its ability to move freely.
[0233] In an optional implementation, the third preset duration can be set to a fixed value of 1.5 seconds. This duration is a constant parameter applicable to the stun state caused by all attack modes, ensuring that the second virtual object obtains the same escape window regardless of the type of attack that hits.
[0234] In an optional implementation, the third preset duration can also be dynamically differentiated according to the differences in attack modes.
[0235] It should be noted that the third preset duration may be only one of the above embodiments, or it may be multiple of the above embodiments.
[0236] One embodiment of the application provides a game control method that further includes at least one of the following: Step S1310: When the first virtual object is in the first state, in response to the fact that the distance between the second virtual object and the first virtual object meets the preset distance threshold, the first visual prompt is displayed on the graphical user interface. In step S1320, when the first virtual object is in the second state, in response to the distance between the second virtual object and the first virtual object meeting a preset distance threshold, the second visual prompt is displayed.
[0237] The method provided in this embodiment enables a differentiated visual cue mechanism to be triggered based on distance conditions when the first virtual object is in different states. This allows players to intuitively perceive the relative distance between themselves and the first virtual object and the corresponding alert level, thereby adjusting their behavior strategies in a timely manner to avoid being detected. This significantly improves the interactive experience and immersion of the game. At the same time, the state-related cue mechanism enriches the strategic layers and information transmission efficiency of the game.
[0238] The above plan will be explained in detail below.
[0239] In step S1310, specifically, when the first virtual object maintains the first state and is in a specific behavior mode, the system continuously monitors the spatial position information of the second virtual object relative to the first virtual object, determines the distance between the two, and when the distance parameter drops below a preset threshold, triggers the visual feedback mechanism of the graphical user interface, generates and dynamically displays the first visual prompt, so as to clearly inform the player that they have entered the perception influence range of the first virtual object and prompt the player to carefully control their behavior to avoid triggering further tracking mechanisms.
[0240] In step S1320, specifically, after the first virtual object is converted to the second state, the system maintains a distance monitoring mechanism for the second virtual object. When the distance between the two is detected to meet the preset conditions, a second visual prompt that is visually distinct from the first visual prompt is presented on the graphical user interface. This prompt is used to indicate that the first virtual object is currently in a highly alert listening state, conveying a more urgent danger signal to the player and prompting the player to take more covert action strategies to avoid being detected by the first virtual object.
[0241] In an exemplary application of this embodiment, the first virtual object is initially in a patrol state (first state) moving along a fixed route. When the second virtual object (player character) approaches from the side to a distance of 18 meters, a light red breathing light effect (first visual cue) is immediately displayed on the edge of the graphical user interface screen because the distance meets the preset threshold. Subsequently, the first virtual object detects the sound and enters a search state (second state). The player attempts to remain still and hide, but the distance is still within 12 meters. At this time, a flashing gold ear icon (second visual cue) is superimposed on the interface, indicating that the player is currently in a high-alert listening state and must remain absolutely still to avoid being discovered.
[0242] One embodiment of the application provides a game control method that further includes: Step S13110, in response to the second virtual object's life value parameter being reduced to zero; wherein, the reduction is performed by the first virtual object in the third state; Step S13120: Control the setting of the state of the second virtual object to an unrecoverable state.
[0243] Specifically, when a first virtual object controlled by a non-player launches an attack on a second virtual object controlled by a terminal device while in a third state, causing the second virtual object's health value parameter to drop to zero, the system responds to the health value reset event and sets the state of the second virtual object to an unresurrectable state, thereby ending the current confrontation and restricting the second virtual object's subsequent game behavior, ensuring that the final result of the attack is deterministically executed.
[0244] The method provided in this embodiment ensures the finality of the confrontation when the first virtual object successfully reduces the health parameter of the second virtual object to zero in the third state by setting an unreviveable state. This avoids the disruption to the game rhythm and strategic depth caused by the infinite resurrection mechanism, enhances the player's sense of tension and accomplishment in high-pressure confrontation, and ensures the consistency and certainty of game state data. It effectively solves the technical problem of conflict between resurrection logic and defeat judgment in game process management, enriches the behavioral feedback level of non-player controlled characters and the playability of the game.
[0245] refer to Figure 3 As shown, this disclosure provides a game control device 300, including: Display module 310 is used to provide a graphical user interface, which displays a game scene and a first virtual object in the game scene, wherein the first virtual object is a non-player-controlled virtual character. The state control module 320 is used to control the first virtual object to be in the first state in the game scene; The first attribute parameter management module 330 is used to update the first attribute parameter in response to detecting a game event corresponding to the second virtual object when the first virtual object is in the first state, wherein the second virtual object is a virtual object controlled by the terminal device; The state control module 320 is also used to control the first virtual object to keep listening when the first virtual object is in the second state; The first attribute parameter management module 330 also has the function of controlling the update of the first attribute parameter in response to the detection of game events while keeping the monitoring in progress; The state control module 320 is also used to control the first virtual object to change from the second state to the third state when the first attribute parameter meets the second condition; The state control module 320 is also used to control the reset of the first attribute parameter and control the first virtual object to return to the first state when the duration of the listening reaches the first preset duration and the first attribute parameter does not meet the second condition.
[0246] The apparatus provided in this disclosure has the following technical effects: By introducing a first attribute parameter to quantify and accumulate different game events, the system enables intelligent switching of virtual objects controlled by non-players between multiple states. This makes the behavior logic of virtual characters more realistic, enhances the strategic depth of the game between players and virtual characters, enriches the game's combat levels and playability, and optimizes the resource scheduling efficiency of the game system through the hierarchical management and listening mechanism of the state machine.
[0247] The specific details of each part of the above-mentioned device have been described in detail in the method section of the implementation plan. For any undisclosed details, please refer to the implementation plan of the method section, and therefore will not be repeated here.
[0248] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to exemplary embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0249] Exemplary embodiments of this disclosure also provide a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the methods described above.
[0250] Implementing the above method steps using a computer program has the following technical effects: By introducing a first attribute parameter to quantify and accumulate different game events, the system enables intelligent switching of virtual objects controlled by non-players between multiple states. This makes the behavior logic of virtual characters more realistic, enhances the strategic depth of the game between players and virtual characters, enriches the game's combat levels and playability, and optimizes the resource scheduling efficiency of the game system through the hierarchical management and listening mechanism of the state machine.
[0251] In one implementation, the computer program product can be a tangible product, such as a computer-readable storage medium storing a computer program. The readable storage medium can be based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, and includes, but is not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory, hard disk drive (HDD), solid-state drive (SSD), etc. For example, the computer program product can be a non-volatile storage medium storing a computer program, such as read-only memory, NAND flash memory, etc.
[0252] In one implementation, the computer program product can be an intangible product. For example, the computer program product can be a virtual digital product, such as an executable file or installation package containing a computer program.
[0253] Computer program code can be written in one or more programming languages. Examples of programming languages include C, Java, and C++. Program code can execute entirely on the user's computing device, partially on the user's computing device, or as a standalone software package. It can also execute partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, such as a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via an internet connection provided by a mobile network operator).
[0254] Computer programs can be carried or transmitted via signals such as electrical, magnetic, optical, electromagnetic, and infrared rays. Electronic devices can convert signals carrying computer programs into digital signals, thereby running the computer programs. When a computer program runs on an electronic device, its code is used to cause the electronic device to execute (more specifically, to be executed by the processor of the electronic device) the method steps of various embodiments of this disclosure.
[0255] Exemplary embodiments of this disclosure also provide an electronic device, which may be the first client 110, the second client 120, or the server 130 described above. The electronic device includes a processor and a memory. The memory stores executable instructions for the processor, such as computer programs. The processor executes these executable instructions to perform the method steps of various exemplary embodiments of this disclosure.
[0256] Implementing the above method steps using electronic devices has the following technical advantages: By introducing a first attribute parameter to quantify and accumulate different game events, the system enables intelligent switching of virtual objects controlled by non-players between multiple states. This makes the behavior logic of virtual characters more realistic, enhances the strategic depth of the game between players and virtual characters, enriches the game's combat levels and playability, and optimizes the resource scheduling efficiency of the game system through the hierarchical management and listening mechanism of the state machine.
[0257] The following is for reference. Figure 4 The electronic device is illustrated by way of a general-purpose computing device. It should be understood that... Figure 4 The electronic device 1100 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.
[0258] like Figure 4 As shown, the electronic device 1100 may include: a processor 1110, a memory 1120, a bus 1130, an I / O (input / output) interface 1140, and a network adapter 1150.
[0259] Memory 1120 may include volatile memory, such as RAM 1121 and cache unit 1122, and may also include non-volatile memory, such as ROM 1123. Memory 1120 may also include one or more program modules 1124, such program modules 1124 including, but not limited to: operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. For example, program module 1124 may include the modules in the above-described apparatus.
[0260] The processor 1110 may include one or more processing units, such as an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor, and / or an NPU (Neural-Network Processing Unit).
[0261] The processor 1110 can be used to execute executable instructions stored in the memory 1120 to perform method steps of various embodiments of the present disclosure.
[0262] Bus 1130 is used to connect different components of electronic device 1100 and may include a data bus, an address bus and a control bus.
[0263] Electronic device 1100 can communicate with one or more external devices 1200 (such as keyboard, mouse, external controller, etc.) through I / O interface 1140.
[0264] Electronic device 1100 can communicate with one or more networks via network adapter 1150. For example, network adapter 1150 can provide mobile communication solutions such as 3G / 4G / 5G, or wireless communication solutions such as wireless LAN, Bluetooth, and near-field communication. Network adapter 1150 can communicate with other modules of electronic device 1100 via bus 1130.
[0265] In one embodiment, the electronic device 1100 further includes a display for displaying a graphical user interface.
[0266] although Figure 4As not shown in the diagram, other hardware and / or software modules may also be configured in the electronic device 1100, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (Redundant Arrays of Independent Disks) systems, tape drives, and data backup storage systems.
[0267] As can be seen from the above, the technical solutions disclosed herein can be implemented as methods, apparatus, systems, computer program products, storage media, electronic devices, etc. Those skilled in the art will understand that various aspects of this disclosure can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which may be referred to as "circuit," "module," or "system," respectively.
[0268] It should be understood that this disclosure is not limited to the specific methods, steps, or structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. Those skilled in the art will readily conceive of other embodiments based on the specific implementations provided in this disclosure. Therefore, the specific implementations provided in this disclosure are merely exemplary, and the scope and spirit of this disclosure are indicated by the claims, and should cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary technical means in the art not disclosed in this disclosure.
Claims
1. A game control method, characterized in that, A graphical user interface is provided through a terminal device, in which a game scene and a first virtual object in the game scene are displayed, wherein the first virtual object is a non-player-controlled virtual character; the method includes: Control the first virtual object to be in a first state in the game scene; When the first virtual object is in the first state, in response to detecting a game event corresponding to the second virtual object, the first attribute parameter is updated, wherein the second virtual object is a virtual object controlled by the terminal device; When the first attribute parameter satisfies the first condition, the first virtual object is controlled to change from the first state to the second state; When the first virtual object is in the second state, control the first virtual object to keep listening; While maintaining the listening process, in response to the detection of the game event, the control updates the first attribute parameter; When the first attribute parameter satisfies the second condition, the first virtual object is controlled to change from the second state to the third state; If the listening duration reaches the first preset duration and the first attribute parameter does not meet the second condition, control the reset of the first attribute parameter and control the first virtual object to return to the first state.
2. The method according to claim 1, characterized in that, The step of controlling the update of the first attribute parameter in response to detecting a game event corresponding to the second virtual object includes at least one of the following: In response to the detection of a sound event corresponding to the second virtual object, control the execution of the first attribute parameter accumulation operation; In response to detecting an event that satisfies a transient condition, the control adjusts the first attribute parameter to satisfy the second condition.
3. The method according to claim 2, characterized in that, The control performs a first attribute parameter accumulation operation, including: The accumulation amplitude is determined based on the attributes of the sound event; The control performs the accumulation of the first attribute parameter according to the accumulation magnitude.
4. The method according to claim 2, characterized in that, The detection of an event that satisfies the instantaneous condition includes: Detect whether the second virtual object is within the field of view of the first virtual object; In response to detecting that the second virtual object is within the field of view, it is determined that the instantaneous condition is met.
5. The method according to claim 1, characterized in that, The method further includes: When the first virtual object is in the third state, the moving target is determined according to the location of the first sound source, wherein the location of the first sound source is the location where the game event occurs; Control the first virtual object to move toward the moving target.
6. The method according to claim 1, characterized in that, The method further includes: When the first virtual object is in the third state, in response to detecting that the second virtual object is within the first attack range of the first virtual object, the first virtual object is controlled to execute a first attack command; In response to the hit result, control executes the first attack mode; wherein, the damage parameter of the first attack mode is the first damage parameter; In response to a miss result, when the second virtual object is detected to be within the second attack range of the first virtual object, the execution of a second attack mode is controlled; wherein, the damage parameter of the second attack mode is a second damage parameter, and the first damage parameter is greater than the second damage parameter.
7. The method according to claim 3, characterized in that, The attributes of the sound event include behavior type; the behavior type includes movement behavior and interaction behavior; The step of determining the cumulative amplitude based on the attributes of the sound event includes: The cumulative magnitude is determined based on the behavior type.
8. The method according to claim 1, characterized in that, The control of the first virtual object to keep listening includes: While controlling the first virtual object to maintain its current position unchanged within the first preset time period, the first virtual object is controlled to remain stationary while listening.
9. The method according to claim 6, characterized in that, The step of controlling the first virtual object to execute a first attack command in response to detecting that the second virtual object is within the first attack range of the first virtual object includes: Control the detection time interval; wherein, the time interval is the duration since the last execution of the first attack command; In response to the time interval meeting a preset time condition, the first attack command is executed.
10. The method according to claim 6, characterized in that, The method further includes: In response to causing damage to the second virtual object through the first attack mode or the second attack mode, the first virtual object is controlled to enter a stun state; wherein the duration of the stun state is a third preset duration.
11. The method according to claim 1, characterized in that, The method further includes at least one of the following: When the first virtual object is in the first state, in response to the fact that the distance between the second virtual object and the first virtual object meets a preset distance threshold, the first visual prompt is displayed on the graphical user interface. When the first virtual object is in the second state, in response to the distance between the second virtual object and the first virtual object meeting a preset distance threshold, a second visual prompt is displayed.
12. An electronic device, characterized in that, It includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the game control method according to any one of claims 1 to 11.
13. A computer program product, characterized in that, The computer program product stores a computer program that, when executed by a processor, implements the game control method according to any one of claims 1 to 11.