Hit detection and processing methods, devices, equipment, and media

By locking the hit determination state and dynamically calculating the number of hit processing times, the problem of lost hit calculation caused by frame rate fluctuations is solved, ensuring that the logical processing of hit events matches the real time, thus improving the accuracy of game interaction and system stability.

CN121695494BActive Publication Date: 2026-11-17GUANGZHOU CULUO TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202610075133.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-20
Publication Date
2026-11-17
Estimated Expiration
2046-01-20

AI Technical Summary

Technical Problem

Traditional hit detection methods are prone to prolonged single-frame duration when frame rate fluctuates, leading to lost hit calculations and the merging of multiple events that should occur at the logical level, failing to accurately reflect the real interaction process in the virtual environment.

Method used

By locking the hit determination state, determining the hit interval time based on the number of hits that occur during collisions, monitoring the frame length interval time in real time, dynamically calculating the number of hit processing operations to be performed, and executing the corresponding number of hit logic processing operations within the current frame, the number of logical processing operations for the hit event is strictly matched with the actual physical time.

Benefits of technology

Automatically compensate for missed hits due to insufficient frame sampling when frame rate fluctuates, improves the accuracy of interactive logic and the reliability of simulation results, avoids frame rate fluctuations caused by compensation calculations, maintains the overall efficiency and stability of system operation, and avoids visual frame skipping or stuttering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121695494B_ABST
    Figure CN121695494B_ABST
Patent Text Reader

Abstract

This application relates to a hit detection processing method, apparatus, device, and medium. The method includes: responding to a hit detection event triggered by a collision between entities in a game scene; locking the hit determination state corresponding to the event; determining a hit interval time associated with the event based on the number of hit calculations corresponding to the collision; monitoring the frame length interval time in real time from the last hit processing moment to the current frame playback moment in the hit determination state; obtaining the number of hit processing operations to be performed within the current frame based on the hit interval time and the frame length interval time; and performing hit logic processing corresponding to the number of hit processing operations within the current frame based on the number of hit processing operations. This application ensures the accuracy of the hit calculation count under game frame rate fluctuations, effectively controls overall performance overhead, and achieves efficient coordination between logic updates and screen performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of game interaction technology, and in particular to a hit detection processing method, apparatus, device, and medium thereof. Background Technology

[0002] In game development, collision detection and handling between different virtual entities are fundamental to ensuring the accuracy of interaction logic. The traditional approach is to synchronize the hit detection logic with the system's screen rendering frame rate. In each update cycle that generates a new screen, the collision status between entities in the virtual environment is checked, and a corresponding hit damage or effect calculation is immediately triggered. The original intention of this processing mode, which is deeply coupled with the frame cycle, is to ensure simple synchronization between logic updates and visual presentation.

[0003] However, due to factors such as hardware load and scene complexity, the frame rate of the application often fluctuates under this processing method that relies on a fixed frame rhythm. This can cause the duration of a single frame to be much longer than expected. When a continuous collision event should trigger multiple discrete hit calculations within the corresponding time period, the traditional frame-by-frame detection mechanism will fail due to the sudden decrease in sampling frequency. This results in only one detection being performed within a single frame with a long duration, thus losing the multiple hit calculations that should have occurred. This leads to the merging of multiple events that should have occurred at the logical level, causing errors in damage calculations or state applications based on cumulative counts, and failing to accurately reflect the real interaction process in the virtual environment.

[0004] Therefore, existing technologies still have certain shortcomings in the hit detection process when handling entity collision logic. Summary of the Invention

[0005] The purpose of this application is to solve the above-mentioned problems by providing a hit detection processing method and corresponding apparatus, equipment, non-volatile readable storage medium, and computer program product.

[0006] According to one aspect of this application, a hit detection processing method is provided, comprising: In response to a hit detection event triggered by a collision between entities in the game scene, the hit determination state corresponding to the event is locked, and the hit interval time associated with the event is determined based on the number of hit calculations corresponding to the collision. In the hit determination state, the frame length interval time from the last hit processing time to the current frame playback time is monitored in real time, and the number of hit processing times to be performed in the current frame is obtained based on the hit interval time and the frame length interval time. Based on the number of hits processed, the hit logic processing corresponding to that number is executed within the current frame.

[0007] According to another aspect of this application, a hit detection processing apparatus is provided, comprising: The event response module is set to respond to the hit detection event triggered by the collision of entities in the game scene, lock the hit determination state corresponding to the event, and determine the hit interval time associated with the event based on the number of hit settlements corresponding to the collision. The execution judgment module is set to monitor the frame length interval time from the last hit processing time to the current frame playback time in the hit judgment state, and obtain the number of hit processing times to be executed in the current frame based on the hit interval time and the frame length interval time. The hit processing module is configured to perform hit logic processing corresponding to the number of hits within the current frame, based on the number of hits processed.

[0008] According to another aspect of this application, a hit detection processing device is provided, including a central processing unit and a memory, wherein the central processing unit is configured to invoke and run a computer program stored in the memory to perform the steps of the method described in this application.

[0009] According to another aspect of this application, a non-volatile readable storage medium is provided, which stores a computer program implemented according to the hit detection processing method in the form of computer-readable instructions, wherein the computer program, when invoked by a computer, executes the steps included in the method.

[0010] According to another aspect of this application, a computer program product is provided, comprising a computer program / instructions that, when executed by a processor, implement the steps of the method.

[0011] This application locks the hit determination state in response to collision events and determines the hit interval time based on a preset number of hit settlements. It then monitors the frame length interval time in real time to dynamically calculate the number of hit processing steps that need to be supplemented. This allows for automatic compensation for lost hit processing due to insufficient frame sampling when frame rate fluctuates or single-frame duration increases. It ensures a strict match between the logical processing number of hit events and the actual physical time of the collision, thus solving the problem of cumulative damage or state application errors caused by event merging in traditional frame-by-frame detection methods. This improves the accuracy of the interaction logic and the reliability of simulation results. Furthermore, this application only needs to repeat the hit logic processing based on the locked hit determination state during hit compensation, without backtracking or re-performing high-performance overhead operations such as physical collision detection and entity screening. This design, which separates high-cost event detection from low-cost event logic processing, results in extremely low resource consumption during compensation, effectively avoiding the risk of frame rate fluctuations exacerbated by compensation calculations. It maintains the overall efficiency and stability of the system while ensuring processing accuracy. Furthermore, this application achieves asynchronous coordination between logic calculation and screen rendering by centrally executing multiple hit logic processes within the current screen frame. As a result, the replenishment of the hit count only affects the background logic state, while the screen rendering can be independently and smoothly updated according to the actual timestamp. This visually avoids further frame skipping or stuttering phenomena that may be caused by logic compensation, which not only further maintains the continuity of user experience, but also provides a more efficient architectural support for handling time-sensitive interactive events. Attached Figure Description

[0012] Figure 1 This application provides an exemplary network architecture; Figure 2 This is a schematic flowchart of one embodiment of the hit detection processing method of this application; Figure 3 This is a schematic block diagram of the hit detection and processing device of this application; Figure 4 This is a schematic diagram of a hit detection processing device used in this application. Detailed Implementation

[0013] The technical solution of this application can be widely applied to various network architectures to adapt to different types and scales of game applications. In a network architecture such as... Figure 1In the typical network architecture shown, the player's terminal device accesses the game service cluster via the network. This cluster consists of multiple game servers 81. A microservice architecture manages and maintains the operational resources of these game servers 81, providing multiple service instances. Each service instance is responsible for a different service. For example, some service instances can be used to maintain the front-end service for the terminal device 80 to access the game, while others can each be responsible for the gameplay service of one or more maps in the game's world map, providing players with corresponding map dungeon gameplay. The player's terminal device 80 has a computer program product installed and running according to the character interaction control method of this application, or the terminal device can be connected to a cloud server container, where the computer program product runs. After the computer program product runs, it accesses the game service cluster, enabling the player to control their in-game character through the terminal device, interact with various service instances of the game, and explore and interact with different maps.

[0014] Each service instance can maintain a real-time connection with the player's terminal device 80 via the network, handling various events and interactions in the game, such as player character movement, attacks, and item usage. The server provides necessary data support to the terminal device to ensure smooth game operation. This data includes, but is not limited to, map model datasets, which contain map model data for each map and resource model data for its scene resources, such as buildings, player character models, non-player character models, and various other creature or non-creature models, used by the terminal device 80 to render and generate corresponding real-time images. Based on the received map model dataset, the terminal device 80 can generate high-quality real-time images and display them in the graphical user interface, presenting the corresponding game scene to the player. Players obtain visual information about the game through real-time images of the game scene, thereby implementing gameplay.

[0015] This application not only applies to the gaming experience for single players but can also be extended to multiplayer online game environments. In multiplayer games, multiple players' (users') terminal devices simultaneously connect to the game service cluster. Each service instance needs to handle interaction requests from multiple players and update the game status in real time. This application ensures that each player receives consistent and high-quality character interaction control in multiplayer game scenarios, while optimizing the resource utilization of servers and terminal devices and improving the overall operational efficiency of the game system.

[0016] In an exemplary application scenario of this application, consider a massively multiplayer online role-playing game (MMORPG) where players can freely explore a vast open-world map and control their character to enter various specific dungeon maps to complete quests. In this game, the player character can frequently switch between different maps, such as switching from a bustling city map to a mysterious dungeon map, or from one room to another.

[0017] The technical solution of this application can be deployed in various virtual environment systems that require high-precision real-time interactive logic, including but not limited to video games, simulation training systems, virtual reality applications, and physical simulation platforms. In common implementation architectures, the game system can run entirely locally on a single client, or it can be implemented in a distributed architecture where the client and server collaborate. In this architecture, the client can be responsible for real-time rendering, user input response, and local logic calculation, while the server can be responsible for authoritative status verification and data synchronization between multiple users. The method provided in this application can be implemented in the logic processing layer of either of the above architectures.

[0018] In the virtual environment where the technical solution of this application can be deployed, collision detection and damage calculation between entities can be used as one of the core interaction logics. Their accuracy and real-time performance directly affect the user experience and the simulation credibility of the system. Traditional implementations tightly couple this logic to the fixed frame rhythm of the rendering loop. However, fluctuations in hardware performance and changes in scene load often lead to unstable frame intervals, resulting in the loss of sampled discrete events based on frames. This application aims to provide a more stable processing mechanism. Its design can coordinate with the physics system, logic update system, and rendering system in mainstream game engines, ensuring that the processing of interactive events is strictly synchronized with the passage of time, while maintaining the operating efficiency of the game system.

[0019] To facilitate understanding of the specific implementation methods of this application, the following provides a general explanation of the basic concepts involved in the technical solution. A hit detection event refers to a signal triggered by collisions between entities in a virtual environment, marking the start of a pending hit interaction. A hit determination state is a set of logical conditions and data locked after the event is triggered, including at least a hit interval time for controlling the processing rhythm and rule parameters defining the processing rules. Hit logic processing refers to the specific effect calculations performed based on the hit determination state, such as damage value calculation and status effect application. The number of executions needs to be dynamically determined by comparing the frame length interval time with the hit interval time. These concepts together constitute a processing technique that separates event detection, state management, and time-driven compensation calculation.

[0020] After providing a general overview of the exemplary network architecture and application scenarios of this application, as well as some basic concepts, the following will continue to describe several specific embodiments of this application.

[0021] Please see Figure 2 The hit detection processing method of this application, in some embodiments, includes the following steps: Step S3100: In response to a hit detection event triggered by a collision between entities in the game scene, lock the hit determination state corresponding to the event, and determine the hit interval time associated with the event based on the number of hit settlements corresponding to the collision.

[0022] In the modern gaming world, such as in a massively multiplayer online role-playing game (MMORPG), players can control a character to unleash various skills on a giant monster. Within the game's combat logic, the attack range of any weapon—whether it's ranged magic missiles and arrows, or melee weapon strikes and ground slams—is uniformly abstracted as a configurable projectile object. For example, in one scenario, the configuration data for a skill cast by the character might specify that upon successfully hitting the target, the skill will trigger a total of six damage calculations over a duration of, say, 1.5 seconds.

[0023] When a player presses the corresponding skill key, the game character can begin casting their attack. Simultaneously, the game logic generates an attack hitbox bound to this skill instance, covering a ring-shaped area around the character. This hitbox represents the projectile object of the attack and moves synchronously with the character's rotation. When this attack hitbox comes into contact with the collision volume of a monster character, the game engine's physics collision detection module immediately recognizes this overlap. The physics module doesn't need to process the game logic at this point; it simply sends a signal to the game's logic processing layer. This signal sending can be considered the triggering of a hit detection event.

[0024] In this implementation, a hit detection event is triggered when two entities in the game scene collide and meet preset conditions. This event can be emitted by the game engine's physics system when it detects contact between the colliding entities, and it carries basic information about the collision, such as the entity that initiated the collision, the entity that was collided with, and the specific time of the collision. The triggering condition can be a specific combination of tags between the colliding entities, such as a colliding entity with a player skill tag making contact with a colliding entity with an enemy character tag. Upon receiving this event, an independent hit determination state can be immediately created for this collision. Locking this state means that the system will establish a unique data context for this specific collision interaction. This context is used to record and manage all subsequent related processing logic and ensure that during the duration of this interaction, no repeated events caused by the same pair of entities due to the same collision contact are responded to, thereby avoiding repeated execution of logic. This hit determination state is usually represented by a state object or data structure created in memory, which at least records the entity pair that triggered the event and the initial collision time.

[0025] Next, the hit interval associated with this event needs to be determined. This is calculated based on the number of hit resolutions corresponding to this collision. The number of hit resolutions can refer to the preset total number of hit logic processes expected to be executed during this continuous collision contact. For example, a continuous fire burn effect can be designed to cause a total of 6 instances of damage within 0.3 seconds, so the number of instances is 6. This number can be directly read from the skill configuration data of the entity initiating the collision, or it can be dynamically obtained by looking up a table based on the state of the collided entity. After determining the total number of instances, the hit interval is obtained by dividing the expected total duration of this collision interaction by the number of hit resolutions. For example, if the total duration is 0.3 seconds and the number of resolutions is 6, then the hit interval is 0.05 seconds. The total duration can also be obtained from the skill configuration or calculated based on the entity's attributes.

[0026] In one implementation, the hit interval can be a pre-configured fixed value, eliminating the need for calculation each time. In this case, the step can directly read the configured value, and the calculated or read hit interval will be stored in the locked hit determination state as a core parameter for controlling the processing rhythm.

[0027] Step S3200: In the hit determination state, monitor the frame length interval time from the last hit processing time to the current frame playback time in real time, and obtain the number of hit processing times to be performed in the current frame based on the hit interval time and the frame length interval time.

[0028] In this implementation, within the game engine's main loop, whenever the system prepares to render a new frame, the logic update module iterates through and processes all active hit determination states. For each locked hit determination state, two key data points are read: the last time the hit logic processing was successfully executed (recorded in that state), and the pre-calculated and stored hit interval. First, the precise current time is obtained, i.e., the logical time point at which the current frame begins playing. Then, the time elapsed from the last hit processing time to the present moment is calculated; this time length is defined as the frame length interval.

[0029] The frame interval reflects the amount of real time that has elapsed since the last processing. It can vary in length due to fluctuations in the game's frame rate. For example, when the game is running smoothly, this value is only 0.016 seconds, while when encountering a performance bottleneck, this value increases to 0.2 seconds or longer. Therefore, it is necessary to use this actual elapsed time to determine how many hits that are logically executed at a fixed rhythm have been missed.

[0030] The core principle of calculating the number of hits required is to compare the frame interval with the hit interval. Specifically, the frame interval is divided by the hit interval to obtain a floating-point number. This result represents the theoretical number of hits that should have been performed in the recently elapsed time. Since the number of hits must be an integer, this theoretical value needs to be rounded down to obtain the actual number of executions. One implementation method is to use floor decomposition, that is, to only take the integer part of the floating-point number. If the hit interval is 0.1 seconds and the calculated frame interval is 0.35 seconds, then the theoretical number of hits is 3.5. After floor decomposition, we get 3 hits that need to be performed in the current frame. This floor decomposition method ensures that hits that have not reached the time interval are not executed prematurely, thus guaranteeing the strictness of the timing.

[0031] In one implementation, a time accumulator can be maintained to accumulate the fractional portion of the time remaining after dividing the frame interval time by the hit interval time in the current calculation—that is, the time margin that is less than a complete hit interval—into a dedicated variable for the hit determination state. In the next monitoring, although the starting point for calculating the frame interval time is the time of the previous hit processing, this accumulated time margin will be added to the current frame interval time first, and then the division operation will be performed. This ensures that the total number of hit processing times corresponds exactly to the actual time under long-term operation, avoiding the cumulative error caused by multiple rounding.

[0032] After obtaining the required number of hit processing operations, this value is either stored in the hit determination state or directly passed to guide the actual number of times the hit settlement function is called within the current frame. Simultaneously, the previous hit processing time recorded in the hit determination state needs to be updated. The update strategy matches the method of calculating the number of hits. If a simple rounding down method is used, the new previous hit processing time can be set to the original time plus the actual number of hit processing operations multiplied by the hit interval. If a time margin accumulation method is used, the new previous hit processing time is usually directly set to the playback time of the current frame, while the time margin is saved for future use. This allows for a dynamic and precise determination of how many hit logic processing operations need to be compensated for each frame, based on a fixed hit interval and fluctuating frame intervals.

[0033] Step S3300: Based on the number of hits processed, execute the hit logic processing corresponding to the number of hits within the current frame.

[0034] The number of hit logic processes that need to be executed within the current frame will be used to start executing the corresponding number of hit logic processes. The hit logic process can be a series of processes that calculate and apply the collision results according to the game rules. Its core purpose is to actually apply the logical effect of a hit to the hit entity. Typical hit logic processes include calculating the damage value based on the attacker's attack power, the hit entity's defense power, and the skill multiplier, adding debuff status to the hit entity, triggering the audio and video playback command for the hit effect, and accumulating combo counts or charging resources, etc.

[0035] When performing these processes, the rules parameters stored together with the hit determination state are required. These rules parameters define the specific processing logic of this hit event, such as the ID of the damage calculation formula called, the type and duration of the additional state, and the strength of the knockback force. The game system will extract this set of unified rules parameters from the hit determination state in advance for all hit processing to be performed in the current frame, forming a shared context for logical processing, thereby ensuring that the rule basis of each discrete processing remains consistent in the same continuous hit event.

[0036] Next, the game system will perform multiple rapid loop calls within a frame update cycle, based on the required number of hit processing operations. Each loop call constitutes a complete and independent hit logic processing process. One implementation is a simple loop structure where the loop variable increments from 1 to the number of hit processing operations, and each iteration calls the same preset hit calculation function. Another implementation is batch processing, where, based on the number of hits N, the required basic data is copied N times and submitted to a subsystem supporting parallel or batch computing for one-time processing to improve runtime efficiency. Before each loop call, these input data specific to that time can be dynamically generated or obtained. One implementation method is to generate a random number in real-time within the loop body as the damage fluctuation coefficient for that time; another method is to maintain a sequence number that changes with the number of processing operations and obtain the specific parameter correction value corresponding to the sequence number through lookup tables or other methods.

[0037] After each hit logic processing is completed, direct effect data is generated, such as a specific damage value of 150 points or a status indicator of burning. This effect data of the current processing is immediately submitted to the game's status management system to update the real-time status of the hit entity. For example, the damage value is added to the hit entity's current health deduction queue, or the status indicator is added to its status effect list. This instant submission method ensures that even if multiple hit processing is performed within a frame, the logical state of the game world can immediately advance to the correct point in time after all compensations are completed, maintaining the accuracy of the logical timing.

[0038] After all the hit logic processing iterations have been completed, the game system can generate a summary event or perform final state synchronization. For example, it can broadcast the total damage accumulated within the current frame to other game systems to trigger a unified damage display or hit feedback animation. This decouples high-frequency logic operations from relatively low-frequency performance updates, avoiding resource conflicts or inefficiencies caused by multiple modifications to the performance state within a single frame. At this point, all compensation processing for the hit determination state within the current frame is complete. The game system will then enter the monitoring loop for the next frame, or determine whether the entire hit event has been processed based on the remaining number of calculations recorded in the hit determination state.

[0039] As demonstrated by the above embodiments, by locking the hit determination state and determining the hit interval time in response to the hit detection event triggered by collision, and then dynamically calculating and compensating for the number of hit processing operations to be performed in real time by monitoring the frame length interval time, this application can ensure that the cumulative number of hit logic processing operations can be strictly synchronized with the real physical time when the game frame rate fluctuates, thereby solving the problem of insufficient damage or state calculations and inaccurate results caused by frame sampling loss. At the same time, this embodiment only performs a complete collision detection and determination once when the event is triggered, and the subsequent compensation processing only involves efficient logic calculation, avoiding repeated high-overhead physical calculations. This ensures that no significant performance loss is introduced while maintaining calculation accuracy, effectively maintaining the smooth and stable operation of the system.

[0040] Based on any embodiment of the method in this application, in response to a hit detection event triggered by a collision between entities in a game scene, the hit determination state corresponding to the event is locked, and the hit interval time associated with the event is determined based on the number of hit calculations corresponding to the collision, including: Step S3110: In response to the hit detection event, extract the total number of hit settlements and the total hit settlement time associated with the event.

[0041] When the game logic system receives a hit detection event from the physics system, the event is a data packet, which contains at least the identifier of the initiating entity that triggered the collision, the identifier of the hit entity, and the unique identifier of the skill or attack used. Based on this information, the pre-set settlement rules for this hit at the logic level can be obtained, the core of which is the total number of hit settlements and the total hit settlement time.

[0042] The extraction process first queries the in-game skill configuration data table based on the skill identifier in the event. The total number of hit settlements refers to the total number of independent logical processes that the skill is required to execute during the duration of a single hit event. For example, a melee skill defined as "Quick Pierce" may be configured to complete 3 consecutive damage checks within 0.9 seconds after an attack hits. In this case, the total number of hit settlements extracted is 3.

[0043] The total hit settlement time corresponds to the total time window expected to complete all the aforementioned hits. Continuing with the previous example, the skill configuration will explicitly state that the total duration of these 3 damage checks is 0.9 seconds; this 0.9 seconds is the total hit settlement time. In another implementation, the total number of hits and the total time do not necessarily need to be configured directly side-by-side, but rather linked through other means. The skill configuration could only define "damage interval 0.3 seconds" and "maximum continuous hit count 4". In this case, it is necessary to calculate (0.3 seconds * 4) to derive the total time as 1.2 seconds and the total number of hits as 4.

[0044] The total number of hits and the total time of hit settlement extracted in this way can serve as the basis for all subsequent calculations. They will be temporarily stored or directly assigned to the newly created hit judgment state object for this event, ensuring that the core rhythm of the processing logic is driven by pre-designed data, rather than hard-coded in the program flow, so that different skills can have different hit settlement frequencies and durations.

[0045] Step S3120: Based on the total number of hit settlements and the total hit settlement time, obtain the standard time interval corresponding to a single hit settlement as the hit interval time.

[0046] After successfully extracting the total number of hit settlements and the total hit settlement time, the basic time unit controlling the rhythm between each hit logic processing is calculated, namely the hit interval. One method to obtain the hit interval is through division. By using the total hit settlement time as the dividend and the total number of hit settlements as the divisor, performing a division calculation, the quotient is the standard time interval corresponding to a single hit settlement. If a skill's total hit settlement time is 1.2 seconds and the total number of hits is 6, then by dividing 1.2 seconds by 6, the hit interval is 0.2 seconds. This means that ideally, a hit logic processing should be executed every 0.2 seconds.

[0047] In another implementation, the hit interval time may not be a calculated value, but a fixed value directly preset in the skill configuration. When extracting parameters, this preset interval time value is read directly, and the above division calculation process is skipped. This makes it applicable to skill designs with fixed settlement rhythms that do not need to be correlated with the total duration.

[0048] Whether obtained through calculation or direct reading, the hit interval time will be stored in the hit determination state object created for the event. This value can then serve as the core benchmark for monitoring the passage of time and determining whether frame interpolation is needed.

[0049] Step S3130: Determine the rule parameters for this hit determination based on the attributes and status of the entities involved in the hit detection event, and associate and store the hit interval time with the rule parameters to complete the locking of the hit determination status.

[0050] In this implementation, once the hit interval is determined, specific settlement rules need to be defined for this particular hit event. These rules can be collectively referred to as rule parameters. The process of determining the rule parameters requires querying the current attributes and states of both entities involved in this hit detection event. First, the identifiers of the attacking and attacked entities are obtained from the event, and their real-time data is queried. The relevant attributes of the attacking entity may include its attack power, skill level, damage bonus coefficient provided by equipment, and special effects that may be triggered, such as "this attack will definitely be a critical hit." The state of the attacked entity may include its defense, resistance to specific damage types, and whether it is currently in a state that can affect the hit settlement, such as "in a blocking state" or "vulnerable to fire damage."

[0051] Based on this dynamic information, a set of rule parameters specific to this hit determination can be generated. This set of parameters may include: a reference ID pointing to a specific damage calculation formula, a base damage value calculated by combining the attributes of both parties, a Boolean flag indicating whether the "knockback" effect is triggered, and the effect strength and duration of the "burn" status added by this attack. These parameters are used to characterize all the details of this hit logic processing.

[0052] The previously calculated or retrieved hit interval time can then be bound to this dynamically generated set of rule parameters and stored together in a newly created hit determination state object. This object is typically a data structure instantiated in memory. Completing this storage operation represents locking the hit determination state. Locking means that during the duration of this collision, this state object is marked as the only valid and authoritative data source for handling this interaction event. Subsequent compensation logic will be driven directly based on the hit interval time and rule parameters stored in this object, instead of relying on the attributes of the original entity for repeated determinations. This ensures the consistency of the settlement logic from event triggering to end and lays a solid data foundation for efficient and accurate frame interpolation calculation.

[0053] Through the above implementation methods, this application can extract the preset total number of hits and total time from the hit detection events, and calculate the standard hit interval time accordingly. At the same time, it dynamically determines the complete set of rule parameters based on the real-time attributes of the entities involved in the event, and stores and locks these core information as a unique hit judgment state. This ensures that the processing frequency and logical rules of each hit event are accurately solidified in the initialization stage, providing a stable and authoritative basis for subsequent compensation calculations based on the passage of time. Furthermore, by completing all detections and parameter bindings at once, it is not necessary to repeat high-overhead physical collision detection and dynamic rule judgment when the frame rate fluctuates in the future. Thus, while ensuring that the number of hits strictly matches the real time and eliminating calculation errors, it effectively avoids the additional performance burden introduced by the compensation logic, and achieves a reliable balance between accuracy and efficiency.

[0054] Based on any embodiment of the method in this application, the hit interval time is associated and stored with the rule parameters to lock the hit determination state, including: Step S3210: Create a hit status identifier corresponding to the hit detection event, bind the hit interval time and the rule parameter to the hit status identifier, and mark the hit determination status as locked during the effective time of the hit status identifier.

[0055] To respond to hit detection events and centrally manage the processing logic, the game system can generate a hit status identifier uniquely corresponding to the event. This identifier can be an incrementing numeric ID, a globally unique string, or a memory address pointing to a specific data structure in memory. Its core function is to serve as a unique index key for this hit event throughout its entire lifecycle. After generating this identifier, the determined hit interval and rule parameters derived from the entity attribute state can be bound to it. This can be achieved by creating a new data object whose internal fields directly store the hit interval and rule parameter set, while the object itself serves as the hit status identifier; alternatively, a global mapping table can be maintained, using the generated hit status identifier as the key and the data block composed of the hit interval and rule parameters as the value.

[0056] Once the binding is complete, the hit status identifier enters its effective period. The effective period can start from the moment the identifier is created, and its end is determined by the subsequent hit termination conditions. During this period, the data context represented by this hit status identifier is marked as a locked hit judgment state. This mark means that when processing logic updates, it can be identified and corresponding compensation calculations can be performed based on this state. At the same time, if the physical system or other logic modules report the same collision event of the same entity pair again, it will also be able to identify through this identifier that the event is in the locked processing stage, thereby ignoring or discarding duplicate events, ensuring that the entire processing flow is based on a unified and fixed set of data, until the hit interaction ends naturally. In this way, efficient and unambiguous tracking and processing of multiple independent hit events that may occur simultaneously can be achieved through identifier-based management.

[0057] Step S3220: Continuously monitor the collision contact state between entities that trigger the hit detection event. When the preset hit end condition is reached, clear the hit state flag to release the hit determination state.

[0058] Once the hit status flag is active and the hit determination state is locked, the collision contact state between the entities that triggered the hit detection event can be monitored in a continuous loop. The monitoring behavior is usually linked to the logic update of the game engine every frame. In each frame, by querying the physics engine or checking the overlap state of the collider components, it is determined whether the collision contact between the attacking entity and the hit entity still exists.

[0059] The preset hit termination condition is a logical rule that determines when the hit event ends. This condition includes at least the following situations: The first is that the collision contact state disappears naturally, that is, the physical system detects that the colliding bodies of the two entities no longer overlap or contact each other, which usually means that the attack range has moved out of the target; the second is that the total number of hit settlements has been completed, that is, the cumulative number of hit logic processing executed has reached the total number of extractions corresponding to this event; the third is that the maximum time limit has been reached. For example, from the start of the event trigger, even if the collision continues, it will only be effective within the set maximum duration, and it will be considered to end after the timeout.

[0060] When any of the above conditions is met, the preset hit termination condition is determined to have been met. At this point, a cleanup operation is performed, removing the hit status identifier from the active state management list and releasing all memory data bound to it. Logically, the cleanup operation releases the lock on the hit determination state; thereafter, time monitoring and compensation calculations related to this identifier will no longer be tracked or processed. If a collision occurs again between the same pair of entities, it will be treated as a completely new hit detection event, ensuring timely resource release. Furthermore, each hit event has a clear start and end boundary, maintaining logical clarity and resource management efficiency.

[0061] The above embodiments not only lock the hit determination state by creating a unique hit status identifier for the hit detection event and binding key parameters, ensuring that all subsequent compensation calculations throughout the entire cycle from the start to the end of the collision are executed based on a fixed and complete data context, thus eliminating logical inconsistencies caused by real-time changes in entity states or repeated event triggering, but also continuously monitor the collision state and promptly clear the identifier when the precise termination conditions are met. This automatically releases resources and terminates the processing flow, ensuring not only the accuracy of the hit count compensation and the independence and integrity of the event, but also achieving efficient management and reclamation of system resources. As a result, while maintaining high-precision logical calculations, memory leaks and invalid calculations are avoided, improving overall operating efficiency and stability.

[0062] Based on any embodiment of the method in this application, the number of hit processes to be performed within the current frame is obtained based on the hit interval and the frame length interval, including: Step S3310: Obtain a first hit count value based on the ratio relationship between the frame length interval time and the hit interval time, and perform a floor operation on the first hit count value to obtain the hit processing count.

[0063] Once the frame interval of the current frame and the hit interval stored in the hit determination state are determined, the theoretical number of hits that should occur within the current time window can be calculated. This calculation can be accomplished by establishing a ratio between the two times. The game system can use the frame interval as the dividend and the hit interval as the divisor, performing a division operation. The quotient is the first hit count value. This value can be configured as a floating-point number, representing the theoretical number of hit logic processing operations that should have occurred within the recently passed time span, if executed strictly according to the ideal interval. For example, if the frame interval is 0.35 seconds and the hit interval is 0.1 seconds, then the calculated first hit count value is 3.5. Since the hit processing in the game logic must be executed in integer units, the first hit count value needs to be discretized. This implementation uses a floor function, discarding the decimal part and retaining only the integer part. The integer obtained after this operation is the final determined hit processing count. Continuing with the previous example, rounding down 3.5 yields a hit count of 3. The mathematical basis for using rounding down instead of rounding is the strictness of time logic. This ensures that only when a complete hit interval has actually elapsed within the frame interval will a valid process be counted. Any remaining time that is less than a complete interval will not be prematurely calculated within the current frame. This guarantees that the trigger point of each hit logic process on the timeline is strictly aligned with the preset ideal interval time, thus avoiding timing errors or misalignments caused by rounding errors.

[0064] Step S3320: Obtain the length of logical time already occupied in the current frame according to the ratio relationship between the number of hits and the hit interval time, subtract the length of logical time already occupied from the frame length interval time, and accumulate the remaining time into the frame length interval time of the next monitoring.

[0065] Once the number of hit processing operations is determined by rounding down, further precise calculation of the logical time corresponding to these operations within the current frame allows for better handling of the remaining time that could not constitute a complete hit. Specifically, the length of logical time already occupied within the current frame is calculated. This calculation is based on a direct multiplication relationship, multiplying the determined number of hit processing operations by the hit interval time stored in the hit determination state. For example, if the number of hit processing operations is 3 and the hit interval time is 0.1 seconds, then the length of logical time already occupied is 0.3 seconds. This result represents the time span that has been determined to be consumed on the logical timeline within this frame to perform these compensation processing operations. Next, the length of logical time already occupied is subtracted from the actual frame length interval time of this frame. The difference generated by this subtraction operation is the remaining time. The remaining time represents the fractional time that has already passed but is insufficient to satisfy the next complete hit interval. For example, if the frame length interval time is 0.35 seconds, subtracting the occupied 0.3 seconds gives a remaining time of 0.05 seconds.

[0066] In this implementation, the game system does not discard the remaining time but accumulates it for calculation in the next detection. Specifically, a variable dedicated to accumulation, such as "cumulative time surplus," can be maintained in the hit determination state object. Each time the remaining time is obtained, it is added to this variable. When calculating the new frame length interval in the next frame, the calculation is not directly from the previous hit processing time to the current time. Instead, the accumulated time surplus is added to the calculation result in advance, serving as the new total time length for calculating the multiplier relationship. This ensures that, from a macroscopic time scale, every fraction of time less than one interval is retained and participates in subsequent calculations, thereby eliminating the cumulative error that may be caused by multiple rounding down and ensuring the accuracy of the total number of hit processing operations over long periods of operation.

[0067] The synergistic effect of the above embodiments determines the number of hit processing operations to be compensated within each frame by dividing the frame length interval time by the hit interval time and rounding down. This ensures that each hit logic processing is triggered only after a complete hit interval has elapsed in the logical time, thereby maintaining strict alignment of event triggering on the timeline and eliminating timing errors caused by improper rounding. Furthermore, by calculating and deducting the already occupied logical time based on the determined number of times and accumulating the remaining time into the calculation of the next frame, this embodiment achieves full utilization of fragmented time, eliminates the cumulative error that may be caused by multiple discretization processes, and ensures that the total number of hit processing operations accumulated under any duration and frame rate fluctuation can be absolutely matched with the real physical time, thereby ensuring the accuracy of the calculation results at the algorithm level.

[0068] Based on any embodiment of the method in this application, and based on the number of hit processing operations, hit logic processing corresponding to that number is performed within the current frame, including: Step S3410: Based on the rule parameters determined in the hit determination state, initialize the hit context data corresponding to the hit logic processing to be executed this time.

[0069] Once the number of hit processing operations to be performed within the current frame is determined, the runtime data environment on which this batch processing depends can be prepared in advance before executing the specific hit logic processing. This environment data can be called hit context data. The process of initializing the hit context data uses the locked rule parameters in the hit determination state as the sole input source. These rule parameters define the core logic of this hit settlement, such as the specific damage algorithm reference, the type and strength of the status effect, and the knockback force. The game system extracts these parameters completely from the hit determination state and organizes and encapsulates them in a form suitable for fast and multiple accesses. For example, a temporary data structure is created, whose internal fields directly correspond to the values ​​of each rule parameter. This establishes a unified, stable, and efficient data foundation for the hit logic processing that will be executed multiple times in the current frame. This ensures that the basic rules used for each independent hit settlement call are completely consistent within the same compensation batch, thereby eliminating the risk of inconsistency in settlement caused by changes in the external entity state within the frame. At the same time, preloading the data into an independent context avoids the performance overhead of repeatedly querying the hit determination state or original entity attributes in subsequent loops, enabling multiple compensation processes to be executed at high speed.

[0070] Step S3420: Based on the number of hits processed, a preset hit calculation function is continuously called within the current frame. Each call to the hit calculation function is to perform corresponding damage effect calculation and status effect calculation based on the hit context data.

[0071] Based on a predetermined number of hits, the game system can initiate a loop within the logical update period of the current frame. The core of this loop involves repeatedly calling a predefined hit calculation function. This function is an independent program module that encapsulates the logic for calculating damage and status effects. Internally, it implements a specific algorithm to calculate the final interaction result based on input parameters. Each time this function is called, the system passes initialized hit context data as its core input. The hit context data provides the basic rule framework for this hit event, such as fixed parameters like the damage calculation formula, base damage value, and additional status type. Based on this unified data foundation, the hit calculation function can perform a complete damage and status effect calculation. The damage calculation may include calculating specific damage values ​​based on attack and defense attributes, while the status effect calculation may include determining the duration or number of negative status effects applied to the hit entity.

[0072] In one implementation, to simulate the randomness that may exist in multiple independent hits under real-world conditions, in addition to passing common hit context data, a unique instantaneous variable specific to that call can be injected each time the hit calculation function is called. Specifically, an independent random number can be generated before each call as a fluctuation coefficient for this damage calculation, or an incrementing sequence number can be used to determine whether a critical hit is triggered. This ensures that even if multiple compensation processes are performed within a single frame, each process is logically independent and may produce different results. Thus, through this continuous calling method based on a fixed context and injected instantaneous variables, the logical compensation for all missing hits can be completed efficiently and accurately in a very short time. All calculation results will take effect immediately and update the game world state, thereby precisely advancing the game logic timeline to the end of the current frame, effectively compensating for processing opportunities lost due to frame rate fluctuations.

[0073] Step S3430: Each time the hit settlement function is called, update the state data of the corresponding entity according to the corresponding settlement result.

[0074] Each time the hit resolution function completes, it generates a set of definitive results. These results include the specific damage value inflicted, the type of status effect applied, and its parameters. For example, a burn effect lasting 5 seconds might deal 10 damage per second. These logical results must be immediately applied to the corresponding entity in the game world. The update process first locates the hit entity recorded in the hit detection event. Based on the damage value in the resolution result, the corresponding health points can be directly deducted from the hit entity's status data. This can be seen as directly modifying the entity's core attributes, ensuring its logical state reflects the hit effect in real time. For status effects included in the resolution result, the game system adds them as a new entry to the hit entity's status effect management list. This entry fully records all parameters such as effect type, intensity, and remaining duration, enabling subsequent game logic to correctly identify and process the effect.

[0075] If the settlement result contains other immediately effective logical instructions, such as knockback displacement or resource theft, the game system will also execute the corresponding state update routine synchronously within the current frame. All update operations are based on the independent results generated by this function call, and are completed sequentially and immediately within the loop body based on the context data of this hit. This tight loop from call to settlement to immediate effect ensures that even if multiple hit processing is performed in a single frame, the authoritative state of the game world can be logically and accurately advanced to the correct time point after all compensations are completed, eliminating logical timing errors or state inconsistencies caused by batch delayed application of results.

[0076] Through the above embodiments of this application, unified hit context data is initialized based on locked rule parameters, establishing a stable and efficient computational foundation for multiple compensation processes within the current frame. This ensures the logical consistency of all discrete settlements in the same hit event. Subsequently, the hit settlement function is continuously called based on the precisely calculated number of hit processes, efficiently completing the logical compensation for all missing counts within a single frame update cycle. This method decouples high-overhead physical detection from low-overhead logical settlement, achieving accurate frame interpolation while avoiding performance loss. Furthermore, each settlement result is immediately applied to the corresponding entity's state data update, enabling the authoritative logical state of the game world to advance to the point in time after compensation is completed in real time and accurately. This eliminates potential state delays or asynchrony issues caused by batch processing, ultimately achieving a good match between hit logic processing and the passage of real time while maintaining system operating efficiency.

[0077] Based on any embodiment of the method in this application, it further includes: Step S3510: After completing all the hit logic processing, generate a processing completion event corresponding to the number of hit processing, and extract the state change data corresponding to the event.

[0078] After continuously calling the hit calculation function and completing the real-time status update within the current frame, the game system determines that all compensation batches for that hit status have been executed. At this point, a processing completion event can be generated. This event is a signal used for internal system notification, which clearly marks that the event corresponding to the specific hit status identifier has completed all logical compensation in this frame update.

[0079] While generating events, it's necessary to extract and summarize the cumulative impact from the multiple hit logic processes executed during this compensation phase. This impact data can be collectively referred to as state change data. The extraction process can be accomplished by accessing a temporary data buffer that has been initialized and cumulatively written to within the function's processing loop. State change data includes at least the total damage value from all hits within the current frame, a list of all applied state effects and their parameters, and the cumulative amount of any potentially triggered special effects such as knockback and lifesteal. This crucially aggregates the results of high-frequency and discrete logic processing. It doesn't repeatedly calculate damage; rather, it collects and encapsulates the results that have occurred and have been applied to the entity's logical state in real time at the data level. The generated events and their accompanying aggregated data provide efficient and accurate input for system modules that depend on hit results but don't need to or shouldn't be triggered with every hit, such as user interface damage display, hit sound effect playback, and achievement statistics. This effectively bridges and decouples the logic calculation layer from the performance feedback layer.

[0080] Step S3520: Synchronize the state change data to the state management module of the game scene, so that the state management module can drive the effect update of the audio-visual performance feedback corresponding to the number of hits.

[0081] After generating the completed event and extracting the aggregated state change data, this data also needs to be sent to the central system responsible for coordinating the game's presentation layer, namely the game scene's state management module. Synchronization can be achieved by calling dedicated interface functions provided by the state management module or by pushing an event object containing state change data into its message queue. As the intermediary between the game's logic state and its audiovisual presentation, the state management module's core responsibility is to receive state change notifications from various game logic systems and schedule corresponding presentation resources accordingly.

[0082] Upon receiving the data packet, the status management module parses it. Based on the number of hits recorded in the data packet and the detailed effect list it contains, the module drives a series of audio-visual feedback corresponding to this compensation. For example, it generates a combined damage number that pops up above the head of the hit entity based on the total damage value, or plays multiple rapidly flashing hit effects based on the number of hits. For applied status effects, it triggers the appearance or update of corresponding status icons on the user interface. In terms of audio, it plays a general multi-hit sound effect, or adjusts the intensity and rhythm of the sound effect according to the attack type and the number of hits.

[0083] Step S3530: After confirming that the state change data has been synchronized, clear the hit context data initialized for this hit logic processing.

[0084] Once the state change data has been successfully submitted to the state management module, the corresponding resource cleanup operation can be performed. This confirmation can be achieved by receiving an acknowledgment signal from the state management module or by calling a blocking synchronization interface and receiving a successful return value. This signifies that all logic and performance tasks driven by this hit logic processing have been completed. Subsequently, the game system can locate the hit context data initialized in the preceding steps for performing this intra-frame compensation. This data is a temporary structure existing in memory, and its mission has been completed. The game system can mark the memory area occupied by this data structure as reusable by calling the memory release function or setting its reference to null. If the hit context data is shared by multiple logic frames or threads, its lifecycle is managed by reducing the reference count, etc. When the reference count reaches zero, the actual memory release is performed. This cleanup operation ensures that the computing resources temporarily allocated for intra-frame compensation can be reclaimed in a timely manner during resource management, preventing memory leaks or continuous growth of invalid memory usage that may be caused by high-frequency triggering of compensation logic. Furthermore, by promptly cleaning up the temporary data generated during this process, a clean and efficient runtime environment can be maintained for processing the next hit determination state or updating the game logic of the next frame.

[0085] The embodiments described above generate a unified processing completion event and extract aggregated state change data after completing all compensation hit processing within a single frame. This efficiently summarizes the previously scattered multiple logical results, providing a clear and complete processing basis for subsequent systems. Subsequently, by synchronizing this aggregated data to a dedicated state management module, which centrally drives audio-visual performance feedback matching the number of compensations, effective decoupling and coordination between high-frequency logical calculations and high-quality visual and auditory effects are achieved. This ensures both the accuracy and richness of performance feedback and avoids performance interference caused by the logic layer directly driving the performance. Finally, after data synchronization is completed, the temporarily initialized hit context data is immediately cleared, ensuring the timely recycling and efficient utilization of game system resources and preventing memory accumulation and consumption that may be caused by frequent operation of the compensation mechanism. Thus, while ensuring logical accuracy and smooth performance, the stability and resource cleanliness of the system's long-term operation are maintained.

[0086] Based on any embodiment of the method in this application, prior to the step of responding to a hit detection event triggered by an entity collision in the game scene, the method further includes: Step S3610: Register a dedicated hit event handling system in the runtime logic layer of the game engine, and configure the initialization parameters of the hit event handling system, wherein the initialization parameters include the interface for obtaining the hit settlement count and the execution interface for the hit logic processing.

[0087] In this embodiment, when the game engine starts or the corresponding game module is loaded, an independent hit event handling system can be created and registered in the runtime logic layer. This registration can be completed through the module registration mechanism provided by the engine, such as adding the system class instance to the update module list of the engine's main loop, or registering it as a service in the engine's service container to ensure that it can receive the update call of the engine every frame and process the corresponding message events.

[0088] When creating a system instance, its initialization parameters also need to be configured. These parameters are essentially the key logic access points required for the game system to run, provided in the form of function pointers, delegates, or interface references. Initialization parameters include an interface for obtaining the hit settlement count, which defines how the system queries and retrieves the total number of hit settlements corresponding to a specific hit detection event from an external data source such as a skill configuration table or entity attribute manager. Another required parameter is the execution interface for hit logic processing, which points to a function or method capable of performing specific settlement logic such as single-instance damage calculation and status application based on given parameters.

[0089] The configuration process can be completed in the system constructor or a dedicated initialization method by assigning the implementation of a specific function passed from outside to the corresponding interface reference within the system. For example, a method in the game's skill manager that returns the number of damage hits based on a skill ID can be assigned to the system's hit count acquisition interface. Through this configuration, the hit event handling system is correctly connected to the specific business logic and data source of the game project, becoming a functional module that is both independent and reusable, and can also work collaboratively with specific game rules.

[0090] Step S3620: Mount the hit event handling system to the main update loop of the game engine and set its update priority to be no lower than that of the physics system and the animation system.

[0091] In this implementation, the registered hit event handling system is integrated into the core scheduling sequence of the game engine. During the main update loop, the system's update function can be registered to a specific stage or queue of the loop by calling the engine's provided interface. Simultaneously, the execution priority of this system's update function is set to be equal to or higher than the priority of the physics system's update function, and also equal to or higher than the priority of the animation system's logical updates such as calculating bone transformations. This ensures that before rendering each frame, the game engine calls the update logic of each system sequentially according to the predetermined priority order. The hit event handling system's update function will be called after the physics system completes collision detection and emits an event, and before the animation system updates the bones based on the new state. This timing arrangement allows the hit event handling system to receive the hit detection events generated by the physics system in real time, and to complete all hit logic processing and state updates before the animation system renders using the final entity state. This ensures the timing correctness and data consistency from collision occurrence, logic calculation to animation performance.

[0092] Through the synergistic effect of the above embodiments, this application registers a dedicated hit event handling system and configures its key data and logic interfaces, integrating the originally potentially scattered hit detection and compensation logic into an independent, reusable module. This improves the modularity and maintainability of the code. Furthermore, by mounting this system to the engine's main update loop with a priority no lower than that of the physics and animation systems, this application strictly establishes its execution sequence in each frame, ensuring that physical collision events can be responded to in real time and that all logical compensation calculations can be fully effective before animation rendering. This ensures, at the architectural level, that the data flow from physical interaction and logical calculation to visual performance is smooth, error-free, and strictly synchronized, eliminating display anomalies or logical errors that may be caused by disordered update order.

[0093] Please see Figure 3According to one aspect of this application, a hit detection processing device includes an event response module 4100, an execution determination module 4200, and a hit processing module 4300. The event response module 4100 is configured to respond to a hit detection event triggered by a collision between entities in a game scene, lock the hit determination state corresponding to the event, and determine the hit interval time associated with the event based on the number of hit calculations corresponding to the collision. The execution determination module 4200 is configured to monitor in real time the frame length interval time from the last hit processing time to the current frame playback time under the hit determination state, and obtain the number of hit processing operations to be performed within the current frame based on the hit interval time and the frame length interval time. The hit processing module 4300 is configured to perform hit logic processing corresponding to the number of hit processing operations within the current frame.

[0094] Based on any embodiment of the device in this application, the event response module 4100 includes: a data extraction unit, configured to extract the total number of hit settlements and the total hit settlement time associated with the hit detection event in response to the hit detection event; a time acquisition unit, configured to obtain the standard time interval corresponding to a single hit settlement as the hit interval time based on the total number of hit settlements and the total hit settlement time; and an association storage unit, configured to determine the rule parameters for this hit determination based on the attributes and status of the entities involved in the hit detection event, and associate and store the hit interval time with the rule parameters to complete the locking of the hit determination status.

[0095] Based on any embodiment of the device in this application, the associated storage unit includes: an identifier creation subunit, configured to create a hit status identifier corresponding to the hit detection event, bind the hit interval time and the rule parameter to the hit status identifier, and mark the hit determination state as locked during the effective time of the hit status identifier; and a status release subunit, configured to continuously monitor the collision contact state between entities that trigger the hit detection event, and clear the hit status identifier when a preset hit end condition is reached, thereby releasing the hit determination state.

[0096] Based on any embodiment of the device in this application, the execution determination module 4200 includes: a count value acquisition unit, configured to acquire a first hit count value based on the ratio relationship between the frame length interval time and the hit interval time, and perform a floor operation on the first hit count value to obtain the hit processing count; and a time processing unit, configured to acquire the logical time length already occupied in the current frame according to the ratio relationship between the hit processing count and the hit interval time, subtract the occupied logical time length from the frame length interval time, and accumulate the obtained remaining time into the frame length interval time of the next monitoring.

[0097] Based on any embodiment of the device in this application, the hit processing module 4300 includes: a data initialization unit, configured to initialize the hit context data corresponding to the hit logic processing to be executed this time based on the rule parameters determined in the hit determination state; a function call unit, configured to continuously call a preset hit settlement function in the current frame based on the number of hit processing operations, wherein each call of the hit settlement function performs corresponding damage effect calculation and status effect calculation based on the hit context data; and a data update unit, configured to update the status data of the corresponding entity according to the corresponding settlement result each time the hit settlement function is called.

[0098] Based on any embodiment of the device in this application, it further includes: an event completion module, configured to generate a processing completion event corresponding to the number of hit processing operations after all hit logic processing operations have been completed, and extract state change data corresponding to the event; a data synchronization module, configured to synchronize the state change data to the state management module of the game scene, so that the state management module drives the effect update of the audio-visual performance feedback corresponding to the number of hit processing operations; and a data clearing module, configured to clear the hit context data initialized for this hit logic processing operation after determining that the state change data has been synchronized.

[0099] Based on any embodiment of the device in this application, it further includes: a parameter configuration module, configured to register a dedicated hit event handling system in the runtime logic layer of the game engine, and configure the initialization parameters of the hit event handling system, wherein the initialization parameters include the interface for obtaining the hit settlement count and the execution interface for the hit logic processing; and a system mounting module, configured to mount the hit event handling system to the main update loop of the game engine, and set its update priority to be no lower than the update priority of the physics system and the animation system.

[0100] Another embodiment of this application also provides a hit detection processing device. For example... Figure 4 The diagram shows the internal structure of a hit detection processing device. This device includes a processor, a computer-readable storage medium, a memory, and a network interface connected via a system bus. The computer-readable, non-volatile storage medium stores an operating system, a database, and computer-readable instructions. The database stores information sequences, and when executed by the processor, these computer-readable instructions enable the processor to implement a hit detection processing method.

[0101] The processor of the hit detection processing device provides computing and control capabilities to support the operation of the entire hit detection processing device. The memory of the hit detection processing device can store computer-readable instructions, which, when executed by the processor, cause the processor to perform the hit detection processing method of this application. The network interface of the hit detection processing device is used for communication with a terminal.

[0102] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the hit detection processing device to which the present application is applied. The specific hit detection processing device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0103] In this embodiment, the processor is used to execute... Figure 3 The specific functions of each module are described, and the memory stores the program code and various data required to execute the above modules or sub-modules. The network interface is used to realize data transmission between user terminals or servers. In this embodiment, the non-volatile readable storage medium stores the program code and data required to execute all modules in the hit detection processing device of this application, and the server can call the server's program code and data to execute the functions of all modules.

[0104] This application also provides a non-volatile readable storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the hit detection processing method of any embodiment of this application.

[0105] This application also provides a computer program product, including a computer program / instructions that, when executed by one or more processors, implement the steps of the method described in any embodiment of this application.

[0106] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The aforementioned storage medium can be a computer-readable storage medium such as a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM).

Claims

1. A hit detection processing method characterized by comprising: include: In response to a hit detection event triggered by a collision between entities in a game scene, the system locks the hit determination state corresponding to the event and determines the hit interval time associated with the event based on the number of hit settlements corresponding to the collision. This includes: determining the rule parameters for this hit determination based on the attributes and states of the entities involved in the hit detection event; associating and storing the hit interval time with the rule parameters to lock the hit determination state; the rule parameters are used to define the processing logic of the hit detection event, including: creating a hit state identifier corresponding to the hit detection event; binding the hit interval time with the rule parameters to the hit state identifier; marking the hit determination state as locked during the effective time of the hit state identifier; continuously monitoring the collision contact state between entities that triggered the hit detection event; and clearing the hit state identifier when a preset hit termination condition is reached to release the hit determination state. In the hit determination state, the frame length interval time from the last hit processing time to the current frame playback time is monitored in real time, and the number of hit processing times to be performed in the current frame is obtained based on the hit interval time and the frame length interval time. Based on the number of hits processed, the hit logic processing corresponding to that number is executed within the current frame.

2. The hit detection processing method according to claim 1, characterized by, The response to a hit detection event triggered by an entity collision in the game scene locks the hit determination state corresponding to the event, and determines the hit interval time associated with the event based on the number of hit calculations corresponding to the collision, including: In response to the hit detection event, extract the total number of hit settlements and the total hit settlement time associated with the event; Based on the total number of hit settlements and the total time of hit settlements, the standard time interval corresponding to a single hit settlement is obtained as the hit interval time.

3. The hit detection processing method according to claim 2, characterized in that, The step of obtaining the number of hit processing operations to be performed within the current frame based on the hit interval and the frame length interval includes: The first hit count value is obtained based on the ratio relationship between the frame length interval time and the hit interval time, and the first hit count value is rounded down to obtain the hit processing count. The length of logical time already occupied within the current frame is obtained based on the ratio between the number of hits and the hit interval. The length of logical time already occupied is subtracted from the frame length interval, and the remaining time is accumulated into the frame length interval of the next monitoring.

4. The hit detection processing method according to claim 3, characterized in that, The step of performing hit logic processing corresponding to the number of hits within the current frame, based on the number of hits, includes: Based on the rule parameters determined in the hit determination state, initialize the hit context data corresponding to the hit logic processing to be executed this time; Based on the number of hits processed, a preset hit calculation function is continuously called within the current frame. Each call to the hit calculation function performs corresponding damage effect calculation and status effect calculation based on the hit context data. Each time the hit settlement function is called, the state data of the corresponding entity is updated according to the corresponding settlement result.

5. The hit detection processing method according to claim 4, characterized in that, Also includes: After completing all hit logic processing, a processing completion event corresponding to the number of hit processing is generated, and the state change data corresponding to the event is extracted. The state change data is synchronized to the state management module of the game scene, so that the state management module can drive the effect update of the audio-visual performance feedback corresponding to the number of hits. After confirming that the state change data has been synchronized, the hit context data initialized for this hit logic processing is cleared.

6. The hit detection processing method according to any one of claims 1-5, characterized in that, Prior to the step of responding to a hit detection event triggered by an entity collision in the game scene, the method further includes: Register a dedicated hit event handling system in the runtime logic layer of the game engine, and configure the initialization parameters of the hit event handling system, wherein the initialization parameters include the interface for obtaining the hit settlement count and the execution interface for the hit logic processing. The hit event handling system is attached to the main update loop of the game engine, and its update priority is set to be no lower than that of the physics system and the animation system.

7. A hit detection processing device, characterized in that, include: The event response module is configured to respond to hit detection events triggered by collisions between entities in the game scene. It locks the hit determination state corresponding to the event and determines the hit interval time associated with the event based on the number of hit settlements corresponding to the collision. This includes: determining rule parameters for the current hit determination based on the attributes and states of the entities involved in the hit detection event; associating and storing the hit interval time with the rule parameters to lock the hit determination state; the rule parameters defining the processing logic for the hit detection event, including: creating a hit state identifier corresponding to the hit detection event; binding the hit interval time with the rule parameters to the hit state identifier; marking the hit determination state as locked during the effective time of the hit state identifier; continuously monitoring the collision contact state between entities that triggered the hit detection event; and clearing the hit state identifier when a preset hit termination condition is met to release the hit determination state. The execution judgment module is set to monitor the frame length interval time from the last hit processing time to the current frame playback time in the hit judgment state, and obtain the number of hit processing times to be executed in the current frame based on the hit interval time and the frame length interval time. The hit processing module is configured to perform hit logic processing corresponding to the number of hits within the current frame, based on the number of hits processed.

8. The hit detection processing device according to claim 7, characterized in that, Also includes: The parameter configuration module is configured to register a dedicated hit event handling system in the runtime logic layer of the game engine and configure the initialization parameters of the hit event handling system. The initialization parameters include the interface for obtaining the number of hits and the execution interface for the hit logic processing. The system mounting module is configured to mount the hit event handling system to the main update loop of the game engine, and its update priority is set to be no lower than that of the physics system and the animation system.

9. A hit detection processing device, comprising a central processing unit and a memory, characterized in that, The central processing unit is used to invoke and run a computer program stored in the memory to perform the steps of the method as described in any one of claims 1 to 6.

10. A non-volatile readable storage medium, characterized in that, It stores, in the form of computer-readable instructions, a computer program implemented according to any one of claims 1 to 6, which, when invoked by a computer, executes the steps included in the corresponding method.

Citation Information

Patent Citations

  • Virtual prop operation method and device, storage medium and electronic device

    CN111054066A