Virtual object hit detection method, device, electronic device and storage medium

By detecting that the motion path of the virtual object coincides with the skill range, combined with discrete point and continuity detection, the missed detection problem in virtual object hit detection is solved, the detection accuracy and efficiency are improved, and the accuracy and fluency of the game are ensured.

CN115475386BActive Publication Date: 2025-08-15NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211143511.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-20
Publication Date
2025-08-15
Estimated Expiration
2042-09-20

AI Technical Summary

Technical Problem

Existing virtual object hit detection methods are prone to missed detection when the virtual object releases skills range or moves fast, resulting in low detection efficiency.

Method used

The hit is judged by detecting whether the motion path of the second virtual object coincides with the skill range, and combining discrete point detection and continuity detection, the hit detection process is optimized.

Benefits of technology

It improves the accuracy and efficiency of virtual object hit detection, reduces missed detection, and ensures the accuracy and fluency of the game process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115475386B_ABST
    Figure CN115475386B_ABST
Patent Text Reader

Abstract

The present application provides a method, device, electronic device, and storage medium for detecting a hit of a virtual object, including: responding to a skill release request of a first virtual object, controlling the first virtual object to release a skill in a virtual scene; then detecting whether at least a portion of the motion path of a second virtual object overlaps with the skill range corresponding to the skill; if so, determining that the second virtual object is hit by the skill released by the first virtual object. The present application can determine whether the second virtual object is hit by the skill released by the first virtual object by ensuring that at least a portion of the motion path of the second virtual object overlaps with the skill range corresponding to the skill released by the first virtual object. This can avoid missed detection problems caused by a small skill range for the skill released by the virtual object or a fast movement speed of the virtual object in the virtual scene, thereby improving not only the accuracy of virtual object hit detection but also the efficiency of virtual object hit detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of game technology, and in particular to a method, device, electronic device, and storage medium for detecting a hit of a virtual object. Background Art

[0002] In many games, players can control virtual objects to release area-of-effect skills. After a virtual object releases an area-of-effect skill, it is necessary to detect whether other virtual objects are hit by the skill and cause damage, stun, or health recovery to the hit virtual objects.

[0003] Existing hit detection methods generally use a frame-by-frame discrete point detection method. For each frame of data, the method determines whether the virtual object is within the skill range based on the position of the skill range in the virtual scene and the positions of each virtual object in the virtual scene. If the virtual object is within the skill range, it is determined that the virtual object has been hit by the skill. However, in actual games, the skill range of the virtual object is often small or the virtual object moves quickly in the virtual scene. In these cases, the use of a frame-by-frame discrete point detection method for virtual object hit detection is prone to missed detections, resulting in low virtual object hit detection efficiency. Summary of the Invention

[0004] In view of this, the purpose of this application is to provide a virtual object hit detection method, device, electronic device and storage medium, which can reduce missed detections in the virtual object hit detection process, and can not only improve the accuracy of virtual object hit detection, but also improve the efficiency of virtual object hit detection.

[0005] In a first aspect, an embodiment of the present application provides a hit detection method for a virtual object, the hit detection method comprising:

[0006] responding to a skill release request from the first virtual object, and controlling the first virtual object to release the skill in the virtual scene;

[0007] During the process of the first virtual object releasing a skill, detecting whether at least a portion of the motion path of the second virtual object overlaps with the skill range corresponding to the skill;

[0008] If they overlap, it is determined that the second virtual object is hit by the skill released by the first virtual object.

[0009] In a second aspect, an embodiment of the present application further provides a hit detection device for a virtual object, the hit detection device comprising:

[0010] A skill releasing module, configured to respond to a skill release request from the first virtual object and control the first virtual object to release the skill in the virtual scene;

[0011] A path detection module is configured to detect, during the process of the first virtual object releasing a skill, whether at least a portion of the motion path of the second virtual object overlaps with a skill range corresponding to the skill;

[0012] A skill hit module is used to determine that the second virtual object is hit by the skill released by the first virtual object if there is overlap.

[0013] In a third aspect, an embodiment of the present application further provides an electronic device comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory through the bus, and the processor executes the machine-readable instructions to perform the steps of the virtual object hit detection method as described above.

[0014] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the virtual object hit detection method described above are executed.

[0015] The technical solution provided by this application has at least the following beneficial technical effects:

[0016] The embodiment of the present application can respond to the skill release request of the first virtual object, control the first virtual object to release the skill in the virtual scene; detect whether at least part of the motion path of the second virtual object overlaps with the skill range corresponding to the skill; if overlapped, determine that the second virtual object is hit by the skill released by the first virtual object. The embodiment of the present application can determine whether the second virtual object is hit by the skill released by the first virtual object by the way that at least part of the motion path of the second virtual object overlaps with the skill range corresponding to the skill released by the first virtual object. This can avoid the problem of missed detection caused by the small skill range of the skill released by the virtual object or the fast movement speed of the virtual object in the virtual scene, which can not only improve the accuracy of virtual object hit detection, but also improve the efficiency of virtual object hit detection.

[0017] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.

[0019] Figure 1 A flowchart of a method for detecting a hit of a virtual object provided in an embodiment of the present application;

[0020] Figure 2 A schematic diagram of a skill range interface provided in an embodiment of the present application;

[0021] Figure 3 A flowchart of another virtual object hit detection method provided in an embodiment of the present application;

[0022] Figure 4 A schematic diagram of a class diagram provided in an embodiment of the present application;

[0023] Figure 5 A schematic structural diagram of a hit detection device for a virtual object provided in an embodiment of the present application;

[0024] Figure 6 A schematic structural diagram of another virtual object hit detection device provided in an embodiment of the present application;

[0025] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application for which protection is claimed, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work falls within the scope of protection of the present application.

[0027] In an optional embodiment, various cloud applications can be run under the cloud interaction system, such as cloud games. Taking cloud games as an example, cloud games refer to a gaming method based on cloud computing. In the cloud game operation mode, the operating body of the game program and the main body of the game screen presentation are separated. The storage and operation of the hit detection method are completed on the cloud game server. The role of the client device is to receive and send data and present the game screen. For example, the client device can be a display device with data transmission function close to the user side, such as a mobile terminal, TV, computer, PDA, etc.; however, the cloud game server in the cloud performs hit detection. When playing the game, the player operates the client device to send operation instructions to the cloud game server. The cloud game server runs the game according to the operation instructions, encodes and compresses the game screen and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the game screen.

[0028] In an optional embodiment, taking a game as an example, a local terminal device stores a game program and is used to present the game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, conventionally downloading and installing the game program through an electronic device and running it. The local terminal device can provide the graphical user interface to the player in a variety of ways, for example, it can be rendered and displayed on the terminal's display screen, or provided to the player through holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen is used to present the graphical user interface, the graphical user interface includes the game screen, and the processor is used to run the game, generate the graphical user interface, and control the display of the graphical user interface on the display screen.

[0029] Secondly, the application scenarios to which this application is applicable are introduced. This application can be applied to many games, such as real-time strategy games (RTS) or multiplayer online battle arena (MOBA), where players control virtual objects to release area-of-effect skills. When a virtual object releases an area-of-effect skill, it is necessary to detect whether other virtual objects are hit by the skill and cause damage, stun, or health recovery to the hit virtual objects.

[0030] Existing hit detection methods generally use a frame-by-frame discrete point detection method. For each frame of data, the method determines whether the virtual object is within the skill range based on the position of the skill range in the virtual scene and the positions of each virtual object in the virtual scene. If the virtual object is within the skill range, it is determined that the virtual object has been hit by the skill. However, in actual games, the skill range of the virtual object is often small or the virtual object moves quickly in the virtual scene. In these cases, the use of a frame-by-frame discrete point detection method for virtual object hit detection is prone to missed detections, resulting in low virtual object hit detection efficiency.

[0031] Based on this, the embodiments of the present application provide a virtual object hit detection method, device, electronic device and storage medium, which can reduce missed detections in the virtual object hit detection process, and can not only improve the accuracy of virtual object hit detection, but also improve the efficiency of virtual object hit detection.

[0032] See also Figure 1 , Figure 1 This is a flowchart of a method for detecting a hit of a virtual object provided by an embodiment of the present application. Figure 1 As shown in , the hit detection method provided by the embodiment of the present application includes:

[0033] S101, responding to a skill release request of a first virtual object, controlling the first virtual object to release the skill in a virtual scene;

[0034] S102, detecting whether at least a portion of a motion path of a second virtual object overlaps with a skill range corresponding to the skill;

[0035] S103: If they overlap, it is determined that the second virtual object is hit by the skill released by the first virtual object.

[0036] In step S101, the terminal device sends a skill release request to the cloud server in response to a touch operation on the skill control displayed on the graphical user interface. The cloud server responds to the skill release request of the first virtual object and controls the first virtual object to release the skill in the virtual scene.

[0037] Here, the first virtual object can be a virtual object in the game of the account of the game client logged into the terminal device, that is, a virtual object controlled by the player corresponding to the account, but the possibility that the first virtual object is controlled by other applications or artificial intelligence modules is not excluded. A virtual scene is a virtual scene displayed (or provided) when an application is running on a terminal or server. The virtual scene is a simulation environment of the real world, or a semi-simulation and semi-fictitious virtual environment, or a purely fictitious virtual environment. Optionally, the virtual scene is any one of a two-dimensional virtual scene and a three-dimensional virtual scene. The virtual environment can be the sky, land, ocean, etc., wherein the land includes environmental elements such as deserts and cities. During the normal game process, the graphical user interface provides virtual game controls for carrying virtual objects, such as skill controls. Virtual objects can be controlled by control instructions issued by the player to the terminal device in the game scene to perform actions such as skill release.

[0038] Here, the skill being released is a range-of-effect skill, effective within a certain range and applicable to multiple virtual objects. The skill range is pre-set by the game system. From the time the first virtual object releases the skill until the skill ends, the skill's position in the virtual scene can remain unchanged or change as the first virtual object's position in the virtual scene changes.

[0039] For example, if the second virtual object affected by the skill belongs to the same camp as the first virtual object, then the skill released by the first virtual object will help to assist the second virtual object. For example, the "blood recovery" skill released by the "Assist" in the relevant game can help to increase the vitality of the teammate hit by the "blood recovery" skill; if the second virtual object affected by the skill belongs to a different camp than the first virtual object, then the skill released by the first virtual object will cause damage or stun effect to the second virtual object. For example, the "Blizzard", "Firestorm", "Ice Cone" and other skills released by the "Mage" in the relevant game will cause damage to the hit enemy.

[0040] In step S102, while the first virtual object is releasing a skill, a real-time detection is performed to determine whether at least a portion of the motion path of the second virtual object overlaps with the skill range corresponding to the skill. Overlapping at least a portion of the motion path of the second virtual object with the skill range means that the area corresponding to the skill range covers at least a portion of the motion path of the second virtual object.

[0041] In an embodiment of the present application, whether at least part of the motion path of the second virtual object coincides with the skill range corresponding to the skill is detected in real time. In this way, a hit detection operation of the virtual object is performed for each frame of data, which can improve the accuracy of the hit detection.

[0042] In an optional embodiment, the method for real-time detecting whether at least a portion of the motion path of the second virtual object overlaps with the skill range corresponding to the skill is related to the regional shape of the skill range. When the regional shape of the skill range includes a regular pattern, the step of detecting whether at least a portion of the motion path of the second virtual object overlaps with the skill range corresponding to the skill includes:

[0043] Step 1021: Determine a target line between a second position of the second virtual object determined according to the current frame data and a first position of the second virtual object determined according to the previous frame data;

[0044] Step 1022: Detect whether at least a portion of the motion path of the second virtual object overlaps with the skill range corresponding to the skill based on the relative positional relationship between the target line and the skill range.

[0045] In step 1021, the second position of the second virtual object can be directly determined from the current frame data. Similarly, the first position of the second virtual object can also be directly determined from the previous frame data, wherein the first position and the second position can both be in the form of position coordinates, and then the target line between the second position and the first position is determined.

[0046] In step 1022, the relative position relationship includes a separation relationship, an intersection relationship, a tangent relationship and an inclusion relationship. If the target line and the skill range have an intersection relationship or an inclusion relationship, it is considered that at least part of the motion path of the second virtual object coincides with the skill range corresponding to the skill; if the target line and the skill range have a separation relationship or a tangent relationship, it is considered that the motion path of the second virtual object does not coincide with the skill range corresponding to the skill.

[0047] By using the relative position relationship between the target line consisting of the first position and the second position and the skill range, it is determined whether at least part of the motion path of the second virtual object coincides with the skill range corresponding to the skill. The judgment mechanism is simple and can avoid consuming a large amount of computer resources.

[0048] Specifically, the regular shape may be a two-dimensional regular shape, such as a circle, a polygon, etc., or a three-dimensional regular shape, such as a sphere, a cylinder, etc.

[0049] For example, when the regular graphic is a circle, it is detected whether the target line intersects with the skill range of the circle. If so, it means that the second virtual object moves through the skill range of the circle. If not, it means that the second virtual object does not move through the skill range of the circle.

[0050] Exemplarily, when the regular figure is a rectangle, detect whether one of the endpoints of the target line is within the skill range of the rectangle; if so, it indicates that the second virtual object passes through the skill range of the rectangle; if one of the endpoints of the target line is not within the skill range of the rectangle, determine whether the line segment formed by the two points has an intersection with the diagonal line segment of the skill range of the rectangle; if so, the second virtual object passes through the skill range of the rectangle.

[0051] For example, when the regular figure is a sphere, to detect whether the two endpoints of the target line are within the skill range of the sphere, the target line and the center of the sphere can be used to form a plane, and the algorithm of whether the target line and the circle intersect in the above method can be used to judge on the plane.

[0052] In step S103 , if at least a portion of the motion path of the second virtual object overlaps with the skill range corresponding to the skill, it is determined that the second virtual object is hit by the skill released by the first virtual object.

[0053] In the above steps, when at least part of the movement path of the second virtual object coincides with the skill range corresponding to the skill, it indicates that the second virtual object passed through the skill range corresponding to the skill during the process of the first virtual object releasing the skill, and further, it can be indicated that the second virtual object was hit by the skill released by the first virtual object within a certain period of time.

[0054] In an embodiment of the present application, after determining that the second virtual object is hit by a skill released by the first virtual object, the second position of the second virtual object determined based on the current frame data is saved. When the next frame data is detected, the currently saved second position can continue to be the first position.

[0055] In this way, the problem of being unable to calculate the motion path of the second virtual object due to lack of the pre-saved first position of the second virtual object can be avoided.

[0056] The embodiment of the present application can determine whether the second virtual object is hit by the skill released by the first virtual object by means of a method in which at least part of the motion path of the second virtual object overlaps with the skill range corresponding to the skill released by the first virtual object. This can avoid the problem of missed detection caused by the small skill range of the skill released by the virtual object or the fast movement speed of the virtual object in the virtual scene, and can not only improve the accuracy of virtual object hit detection, but also improve the efficiency of virtual object hit detection.

[0057] In an optional embodiment of the present application, step S102 further includes:

[0058] Step 10211: Detect whether the current state of the second virtual object meets the target detection condition;

[0059] Step 10222: If the current state of the second virtual object meets the target detection condition, detect whether at least a portion of the motion path of the second virtual object overlaps with the skill range corresponding to the skill.

[0060] In the above steps, the current state of the second virtual object needs to meet the target detection condition before continuing to detect whether at least part of the motion path of the second virtual object overlaps with the skill range corresponding to the skill.

[0061] Here, the target detection condition is a prerequisite for determining whether to perform continuity detection on the second virtual object (detecting whether at least part of the motion path of the second virtual object coincides with the skill range corresponding to the skill). If it is detected that the current state of the second virtual object meets the target detection condition, continuity detection is performed on the second virtual object. If it is detected that the second virtual object does not meet the target detection condition, the current position of the second virtual object in the virtual scene is saved, and the hit detection process is ended.

[0062] An embodiment of the present application can be set to determine whether the second virtual object is hit by the skill released by the first virtual object by detecting whether at least part of the motion path of the second virtual object coincides with the skill range corresponding to the skill in a specific scenario. For example, the specific scenario may be a scenario where the skill range of the skill released by the virtual object is small or the virtual object moves at a faster speed in the virtual scene, thereby saving computer resources to a certain extent.

[0063] In step 10211, the current state of the second virtual object satisfies the target detection conditions, including one of the following conditions: the second virtual object is detected at the first position determined based on the previous frame data; the moving speed of the second virtual object meets the preset conditions determined based on the skill range.

[0064] The target detection condition may include detecting the presence of a second virtual object at a first position determined based on data from a previous frame. Detecting the presence of the second virtual object at the first position indicates that the second virtual object is not in a teleporting state in the current specific scenario. In this case, whether the second virtual object was hit by a skill released by the first virtual object can be determined by detecting whether at least a portion of the second virtual object's motion path overlaps with the skill range corresponding to the skill. This avoids hit detection for the teleporting second virtual object during gameplay, thereby improving gameplay accuracy.

[0065] The target detection conditions may include the second virtual object's movement speed meeting a preset condition determined based on a skill range. This indicates that the second virtual object's movement speed meets the preset condition, and further, whether the second virtual object has been hit by the skill released by the first virtual object can be determined by detecting whether at least a portion of the second virtual object's movement path overlaps with the skill range corresponding to the skill. However, it should be noted that historical game data needs to be retrieved to determine the first position of the second virtual object determined based on the previous frame data. This ensures that the method of determining whether the second virtual object has been hit by the skill released by the first virtual object by detecting whether at least a portion of the second virtual object's movement path overlaps with the skill range corresponding to the skill can be implemented, thereby saving computer resources to a certain extent.

[0066] The target detection conditions can also include detecting the presence of a second virtual object at a first position determined based on the previous frame data and detecting that the second virtual object's movement speed satisfies a preset condition determined based on the skill range. First, the embodiment of the present application can be configured to save the second position of the second virtual object determined based on the current frame data after each detection, so that it can be used as the first position of the second virtual object determined based on the previous frame data in subsequent detections, thereby providing a basic condition for hit detection through the motion path of the second virtual object, saving time and improving the processing efficiency of the server. Second, the preset conditions determined based on the skill range will also vary depending on the regional shape of the skill range.

[0067] Specifically, it is determined that the movement speed of the second virtual object meets the preset condition determined according to the skill range in the following manner:

[0068] Obtaining a moving speed of a second virtual object in the virtual scene;

[0069] If the acquired moving speed is greater than a preset speed threshold, it is determined that the moving speed of the second virtual object meets a preset condition; wherein the preset speed threshold is determined according to the area shape and area size of the skill range.

[0070] In the above steps, the preset speed threshold can be set based on experience or determined by the following methods:

[0071] Specifically, the following speed judgment function may be used to determine whether the moving speed of the second virtual object meets the preset condition:

[0072] velocity≥threshold / DeltaTime;

[0073] DeltaTime represents a preset time period, velocity represents the moving speed of the second virtual object, and threshold represents a preset distance threshold; here, the preset time period is the duration corresponding to one frame.

[0074] Specifically, the threshold can be determined based on the shape and size of the skill range. Different area shapes require different calculation methods, and an empirical value can also be used.

[0075] For example, Figure 2 As shown, Figure 2 This is a schematic diagram of a skill range interface provided by an embodiment of the present application. For a circular skill range, a perpendicular line is drawn from a point 0.9r from the center of the circle on a radius r, and the length of the chord of the perpendicular line is used as the threshold.

[0076] It's important to note that the judgment function can be adjusted based on the skill ranges of different shapes. For skill ranges with unusual shapes, the preset speed threshold can be lowered to relax the conditions. For example, if there are performance constraints, the preset speed threshold can be increased to tighten the conditions. This means adjusting the preset speed threshold to achieve a balance between the game's skill hit miss rate and performance consumption. If, in this virtual match, not only the first virtual object is releasing skills, but also multiple second virtual objects are also releasing skills, the increased skill range will result in higher performance consumption. To meet the performance constraints, the conditions can be appropriately tightened, reducing the frequency of hit detection.

[0077] After step 10211, if the second virtual object does not meet the target detection condition, the second position of the second virtual object determined based on the current frame data is saved. When the next frame data is detected, the currently saved second position can continue to serve as the first position. This avoids the problem of being unable to calculate the motion path of the second virtual object due to the lack of the pre-saved first position of the second virtual object.

[0078] The embodiment of the present application can, when the current state of the second virtual object meets the target detection condition, determine whether the second virtual object is hit by the skill released by the first virtual object by means of a method in which at least part of the motion path of the second virtual object coincides with the skill range corresponding to the skill released by the first virtual object. This can not only save computer resources to a certain extent, but also avoid the problem of missed detection caused by the small skill range of the skill released by the virtual object or the fast movement speed of the virtual object in the virtual scene. It can not only improve the accuracy of virtual object hit detection, but also improve the efficiency of virtual object hit detection.

[0079] However, considering that the related scheme includes a lot of frame data, since each frame data needs to be hit detected, a lot of calculations are involved, which can easily lead to low processing efficiency, thus causing the game to freeze. In order to avoid the above problems, the embodiment of the present application provides another hit detection method for virtual objects. Figure 3 As shown in , the hit detection method provided by the embodiment of the present application includes:

[0080] S301, responding to a skill release request of a first virtual object, controlling the first virtual object to release the skill in a virtual scene;

[0081] S302: Detect whether the position of the second virtual object is within the skill range corresponding to the skill;

[0082] S303: If it is detected that the position of the second virtual object is not within the skill range corresponding to the skill, detecting whether the current state of the second virtual object meets the target detection condition;

[0083] S304: If the current state of the second virtual object meets the target detection condition, detecting whether at least a portion of the motion path of the second virtual object overlaps with the skill range corresponding to the skill;

[0084] S305: If they overlap, it is determined that the second virtual object is hit by the skill released by the first virtual object.

[0085] Among them, the description of step S301 and step S305 can refer to the description of the above step S101 and step S103, and the description of step S304 can refer to the description of the above step 10222. Since they have the same technical effects, the repeated content will not be repeated here.

[0086] In step S302, when the first virtual object releases a skill, it is detected whether the position of the second virtual object is within the skill range corresponding to the skill. Here, a single point detection algorithm is directly used.

[0087] Specifically, the single-point detection algorithm can be determined based on the shape of the skill range. This includes both two-dimensional and three-dimensional shapes. Two-dimensional shapes can be regular, such as circles and polygons, or irregular. Three-dimensional shapes can be regular, such as spheres and cylinders, or irregular.

[0088] Exemplarily, when the area is a regular shape such as a polygon, the following method is used to detect whether the second virtual object is within the skill range corresponding to the skill: the second position of the second virtual object is determined based on the current frame data; a ray is drawn from the second position, and based on the number of intersections between the ray and the skill range, the determination of whether the position of the second virtual object is within the skill range corresponding to the skill is made. When the area is circular or spherical, the following method is used to detect whether the second virtual object is within the skill range corresponding to the skill: the center position of the skill range and the second position of the second virtual object are determined based on the current frame data; the distance between the second position and the center position of the skill range is determined; and based on the relationship between the distance and a preset threshold, the determination of whether the second virtual object is within the skill range is made. For a circular area, the center position is the center of the circle, and the preset threshold is the radius of the circle; for a spherical area, the center position is the center of the sphere, and the preset threshold is the radius of the sphere.

[0089] For example, if the area is rectangular, draw a ray from the second position and count the number of intersections between this ray and all sides of the rectangle. If there is an odd number of intersections, the second virtual object is inside the skill range; if there is an even number of intersections, the second virtual object is outside the skill range.

[0090] In the above method, the embodiment of the present application first performs hit detection through a discrete single-point detection method. Under the condition that the hit detection is unsuccessful and the current state of the second virtual object meets the target detection condition, hit detection is then performed through a continuity detection method (detecting whether at least part of the motion path of the second virtual object coincides with the skill range corresponding to the skill). Since the single-point detection method consumes fewer computer resources than the continuous detection method, the above method can not only reduce the amount of calculation, thereby avoiding the problems of low processing efficiency and long time consumption due to the large amount of calculation, which is conducive to the smooth operation of the game, but also improve the accuracy of virtual object hit detection and the efficiency of virtual object hit detection.

[0091] In the embodiment of the present application, when the area shape of the skill range includes an irregular shape, the existing method of determining whether the target line has an intersection relationship with the skill range will result in a large error. That is, for the skill range with an irregular area shape, there is currently no mature algorithm that can determine whether the target line has an intersection relationship with the irregular skill range, which leads to the inability to perform a relatively accurate hit detection calculation. In order to solve the above-mentioned technical problems, the hit detection method provided in the embodiment of the present application also includes:

[0092] Step 401: Determine the interpolation quantity according to the area size of the skill range and the movement speed of the second virtual object.

[0093] In step 401, the moving distance of the second virtual object within the duration corresponding to one frame is determined based on the moving speed of the second virtual object and the duration corresponding to one frame; and the interpolation amount is determined based on the ratio between the area size of the skill range and the moving distance.

[0094] Specifically, the interpolation amount is determined by the following formula:

[0095]

[0096] Among them, times represents the interpolation number, DeltaTime represents the preset time period, velocity represents the moving speed of the second virtual object, and threshold represents the preset distance threshold, wherein the preset time period is the duration corresponding to one frame.

[0097] Step 402: insert an interpolation number of position points between a second position of the second virtual object determined according to the current frame data and a pre-stored first position of the second virtual object determined according to the previous frame data.

[0098] Here, position points are inserted on the line between the second position and the first position, wherein the number of inserted position points is the same as the determined interpolation number.

[0099] Step 403: Check whether any position point except the second position is within the skill range.

[0100] In an embodiment of the present application, when the area shape of the skill range is an irregular shape, the above-mentioned method can be used for hit detection, which makes the applicability of hit detection wider, so that the player is not restricted by the area shape of the skill range when performing hit detection, thereby improving the accuracy of hit detection on virtual objects.

[0101] In a related solution, a virtual object may teleport during a game. During the teleportation of a second virtual object, if a hit detection is performed on the second virtual object, the second virtual object may be hit during the teleportation process, causing confusion for the player. To avoid performing a hit detection on the teleported second virtual object during the game, the embodiments of the present application adopt the following method to avoid the above-mentioned technical problems:

[0102] If it is detected that the second virtual object moves instantaneously in the virtual scene, the pre-stored first position of the second virtual object determined according to the previous frame data is cleared.

[0103] In this way, during the process of the second virtual object teleporting, hit detection will not be performed on the teleported second virtual object, thereby avoiding hit detection on the teleported second virtual object during the game and improving the accuracy of the game.

[0104] It should be noted that when using the above-mentioned hit detection method in the embodiment of the present application, a class structure needs to be constructed in advance. The functions contained in the class structure include a single-point detection function (used to detect whether the second virtual object is within the skill range corresponding to the skill), a continuity detection function (used to detect whether the second virtual object passes through the skill range), a function for judging whether continuity detection is required (used to judge whether the detection switching condition is met), etc.; and corresponding subclasses can also be derived for skill ranges of different area shapes. For example, a reasonable class structure is adopted, a base class is set, and corresponding subclasses are derived for different shapes, such as a cuboid, a cylinder, a sphere, etc., to facilitate the subsequent addition of new shapes and the expansion of more needs. In this way, the class structure is reasonably designed, can cope with the addition of more area shapes, can better cope with the expansion of the actual needs of the game, and is easy to adjust and adapt.

[0105] For example, Figure 4 As shown, Figure 4 This is a schematic diagram of a class diagram provided by the embodiment of this application. Figure 4 As shown in the figure, the basic method BaseMethod includes the following algorithms: check_range is a detection function, which is the entry point of the hit detection process described above; discrete_check is a single-point detection function that needs to be overridden by subclasses; continuous_check is a continuity check function, implemented in the base class using an interpolation algorithm. If a subclass does not override it, interpolation is used as the default continuity check algorithm; the get_inter_num function returns the number of interpolations per frame and is called when the default continuity check is used; need_check_continuous determines whether continuity checking is needed and can be overridden in subclasses. Subclasses include SquareMethod, CircleMethod, CylinderMethod, SphereMethod, and RhombusMethod.

[0106] The virtual object hit detection method provided in the embodiment of the present application can detect whether the position of the second virtual object is within the skill range corresponding to the skill through a discrete single-point detection method. If it is detected that the position of the second virtual object is not within the skill range corresponding to the skill, then the current state of the second virtual object is detected to see if it meets the target detection condition. If the current state of the second virtual object meets the target detection condition, then at least part of the motion path of the second virtual object is detected to see if it overlaps with the skill range corresponding to the skill. If so, it is determined that the second virtual object is hit by the skill released by the first virtual object. This can avoid the problem of missed detection caused by the small skill range of the virtual object releasing the skill or the fast movement speed of the virtual object in the virtual scene, and can not only improve the accuracy of virtual object hit detection, but also improve the efficiency of virtual object hit detection. At the same time, a discrete point detection method is first used to detect whether the second virtual object is hit by the skill released by the first virtual object. When the discrete point detection method cannot detect whether the second virtual object is hit by the skill released by the first virtual object, and the current state of the second virtual object meets the target detection condition, the continuity detection method is continued to be used (by whether at least part of the motion path coincides with the skill range corresponding to the skill) to detect whether the second virtual object is hit by the skill released by the first virtual object. This can improve the accuracy and efficiency of virtual object hit detection without consuming a large amount of computing resources.

[0107] Based on the same inventive concept, the embodiment of the present application also provides a virtual object hit detection device corresponding to the virtual object hit detection method. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the above-mentioned virtual object hit detection method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0108] See also Figure 5 、 Figure 6 , Figure 5 This is a structural diagram of a virtual object hit detection device provided in an embodiment of the present application. Figure 6 This is a schematic diagram of the structure of another virtual object hit detection device provided in an embodiment of the present application. Figure 5 As shown in , the hit detection device 500 includes:

[0109] A skill releasing module 501 is configured to respond to a skill release request from a first virtual object and control the first virtual object to release a skill in a virtual scene;

[0110] A path detection module 502 is configured to detect whether at least a portion of a motion path of the second virtual object overlaps with a skill range corresponding to the skill;

[0111] The skill hit module 503 is configured to determine whether the second virtual object is hit by the skill released by the first virtual object if there is overlap.

[0112] In an optional embodiment of the present application, the path detection module 502 is specifically configured to:

[0113] detecting whether a current state of the second virtual object satisfies a target detection condition;

[0114] If the current state of the second virtual object meets the target detection condition, it is detected whether at least a portion of the motion path of the second virtual object overlaps with the skill range corresponding to the skill.

[0115] In an optional embodiment of the present application, the current state of the second virtual object satisfies the target detection condition, including one of the following conditions: the first position of the second virtual object determined based on the previous frame data is detected; the moving speed of the second virtual object satisfies the preset condition determined based on the skill range.

[0116] In an optional embodiment of the present application, the path detection module 502 determines whether the moving speed of the second virtual object satisfies the preset condition determined according to the skill range by:

[0117] Obtaining a moving speed of a second virtual object in the virtual scene;

[0118] If the acquired moving speed is greater than a preset speed threshold, it is determined that the moving speed of the second virtual object meets a preset condition; wherein the preset speed threshold is determined according to the area shape and area size of the skill range.

[0119] In an optional embodiment of the present application, the path detection module 502 is further configured to:

[0120] detecting whether the position of the second virtual object is within a skill range corresponding to the skill;

[0121] If it is detected that the position of the second virtual object is not within the skill range corresponding to the skill, it is detected whether the current state of the second virtual object meets the target detection condition.

[0122] In an optional embodiment of the present application, the path detection module 502 is further configured to:

[0123] Obtaining a second position of the second virtual object determined according to the current frame data;

[0124] Draw a ray with the second position as the starting point, and determine whether the position of the second virtual object is within the skill range corresponding to the skill based on the number of intersections between the ray and the skill range;

[0125] Or, obtaining the center position of the skill range and the second position of the second virtual object determined according to the current frame data;

[0126] determining a distance between the second position and the center position of the skill range;

[0127] Whether the second virtual object is within the skill range is determined based on a magnitude relationship between the distance and a preset threshold.

[0128] In an optional embodiment of the present application, the shape of the area of the skill range includes a regular pattern, and the path detection module 502 is further configured to:

[0129] Determining a target connection line between a second position of the second virtual object determined according to the current frame data and a pre-stored first position of the second virtual object determined according to the previous frame data;

[0130] According to the relative positional relationship between the target line and the skill range, it is detected whether at least a portion of the motion path of the second virtual object overlaps with the skill range corresponding to the skill.

[0131] Furthermore, if Figure 6 As shown, the shape of the area of the skill range includes an irregular shape, and the hit detection device 500 further includes an interpolation detection module 504, which is used to:

[0132] determining an interpolation amount based on the size of the area within the skill range and the movement speed of the second virtual object;

[0133] Inserting an interpolation number of position points between a second position of the second virtual object determined according to the current frame data and a pre-stored first position of the second virtual object determined according to the previous frame data;

[0134] Checks whether any position other than the second position is within the skill range.

[0135] In an optional embodiment of the present application, the interpolation detection module 504 is specifically configured to:

[0136] Determining a moving distance of the second virtual object within the duration corresponding to one frame according to the moving speed of the second virtual object and the duration corresponding to one frame;

[0137] The amount of interpolation is determined by the ratio between the area size of the skill range and the distance traveled.

[0138] In an optional embodiment of the present application, the hit detection device further includes a position storage module (not shown in the figure), which is configured to:

[0139] After determining that the second virtual object is hit by the skill released by the first virtual object, saving a second position of the second virtual object determined according to the current frame data;

[0140] Alternatively, after determining that the second virtual object does not meet the target detection condition, the second position of the second virtual object determined according to the current frame data is saved.

[0141] In an optional embodiment of the present application, the hit detection device further includes a position clearing module (not shown in the figure), which is configured to:

[0142] If it is detected that the second virtual object moves instantaneously in the virtual scene, the pre-stored first position of the second virtual object determined according to the previous frame data is cleared.

[0143] The virtual object hit detection device provided in the embodiment of the present application can detect whether the position of the second virtual object is within the skill range corresponding to the skill through a discrete point detection method. If it is detected that the position of the second virtual object is not within the skill range corresponding to the skill, it is detected whether the current state of the second virtual object meets the target detection condition; if the current state of the second virtual object meets the target detection condition, it is detected whether at least part of the motion path of the second virtual object coincides with the skill range corresponding to the skill. If so, it is determined that the second virtual object is hit by the skill released by the first virtual object. This can avoid the problem of missed detection caused by the small skill range of the virtual object releasing the skill or the fast movement speed of the virtual object in the virtual scene, which can not only improve the accuracy of virtual object hit detection, but also improve the efficiency of virtual object hit detection. At the same time, a discrete point detection method is first used to detect whether the second virtual object is hit by the skill released by the first virtual object. When the discrete point detection method cannot detect whether the second virtual object is hit by the skill released by the first virtual object, and the current state of the second virtual object meets the target detection condition, the continuity detection method is continued to be used (by whether at least part of the motion path coincides with the skill range corresponding to the skill) to detect whether the second virtual object is hit by the skill released by the first virtual object. This can improve the accuracy and efficiency of virtual object hit detection without consuming a large amount of computing resources.

[0144] See also Figure 7 , Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7 As shown in FIG, the electronic device 700 includes a processor 701, a memory 702 and a bus 703.

[0145] The memory 702 stores machine-readable instructions executable by the processor 701. When the electronic device 700 is running, the processor 701 communicates with the memory 702 via the bus 703, so that the processor 701 executes the following instructions during operation:

[0146] responding to a skill release request from the first virtual object, and controlling the first virtual object to release the skill in the virtual scene;

[0147] detecting whether at least a portion of a motion path of the second virtual object overlaps with a skill range corresponding to the skill;

[0148] If they overlap, it is determined that the second virtual object is hit by the skill released by the first virtual object.

[0149] In an optional embodiment of the present application, in the instructions executed by the processor 701, the step of detecting whether at least a portion of the motion path of the second virtual object overlaps with the skill range corresponding to the skill includes:

[0150] detecting whether a current state of the second virtual object satisfies a target detection condition;

[0151] If the current state of the second virtual object meets the target detection condition, it is detected whether at least a portion of the motion path of the second virtual object overlaps with the skill range corresponding to the skill.

[0152] In an optional embodiment of the present application, the current state of the second virtual object satisfies the target detection condition, including one of the following conditions: the first position of the second virtual object determined based on the previous frame data is detected; the moving speed of the second virtual object satisfies the preset condition determined based on the skill range.

[0153] In an optional embodiment of the present application, the instructions executed by the processor 701 determine whether the movement speed of the second virtual object meets the preset condition determined according to the skill range in the following manner:

[0154] Obtaining a moving speed of a second virtual object in the virtual scene;

[0155] If the acquired moving speed is greater than a preset speed threshold, it is determined that the moving speed of the second virtual object meets a preset condition; wherein the preset speed threshold is determined according to the area shape and area size of the skill range.

[0156] In an optional embodiment of the present application, in the instructions executed by the processor 701, the step of detecting whether the current state of the second virtual object meets the target detection condition includes:

[0157] detecting whether the position of the second virtual object is within a skill range corresponding to the skill;

[0158] If it is detected that the position of the second virtual object is not within the skill range corresponding to the skill, it is detected whether the current state of the second virtual object meets the target detection condition.

[0159] In an optional embodiment of the present application, in the instructions executed by the processor 701, the step of detecting whether the position of the second virtual object is within the skill range corresponding to the skill includes:

[0160] Obtaining a second position of the second virtual object determined according to the current frame data;

[0161] Draw a ray with the second position as the starting point, and determine whether the position of the second virtual object is within the skill range corresponding to the skill based on the number of intersections between the ray and the skill range;

[0162] Or, obtaining the center position of the skill range and the second position of the second virtual object determined according to the current frame data;

[0163] determining a distance between the second position and the center position of the skill range;

[0164] Whether the second virtual object is within the skill range is determined based on a magnitude relationship between the distance and a preset threshold.

[0165] In an optional embodiment of the present application, the shape of the area of the skill range includes a regular pattern, and the instructions executed by the processor 701 include the step of detecting whether at least a portion of the motion path of the second virtual object overlaps with the skill range corresponding to the skill, including:

[0166] Determining a target connection line between a second position of the second virtual object determined according to the current frame data and a pre-stored first position of the second virtual object determined according to the previous frame data;

[0167] According to the relative positional relationship between the target line and the skill range, it is detected whether at least a portion of the motion path of the second virtual object overlaps with the skill range corresponding to the skill.

[0168] In an optional embodiment of the present application, the shape of the area of the skill range includes an irregular shape, and the instructions executed by the processor 701 further include:

[0169] determining an interpolation amount based on the size of the area within the skill range and the movement speed of the second virtual object;

[0170] Inserting an interpolation number of position points between a second position of the second virtual object determined according to the current frame data and a pre-stored first position of the second virtual object determined according to the previous frame data;

[0171] Checks whether any position other than the second position is within the skill range.

[0172] In an optional embodiment of the present application, in the instructions executed by the processor 701, the step of determining the number of interpolations based on the area size of the skill range and the movement speed of the second virtual object includes:

[0173] Determining a moving distance of the second virtual object within the duration corresponding to one frame according to the moving speed of the second virtual object and the duration corresponding to one frame;

[0174] The amount of interpolation is determined by the ratio between the area size of the skill range and the distance traveled.

[0175] In an optional embodiment of the present application, the instructions executed by the processor 701 further include:

[0176] After determining that the second virtual object is hit by the skill released by the first virtual object, saving a second position of the second virtual object determined according to the current frame data;

[0177] Alternatively, after determining that the second virtual object does not meet the target detection condition, the second position of the second virtual object determined according to the current frame data is saved.

[0178] In an optional embodiment of the present application, the instructions executed by the processor 701 further include:

[0179] If it is detected that the second virtual object moves instantaneously in the virtual scene, the pre-stored first position of the second virtual object determined according to the previous frame data is cleared.

[0180] The embodiment of the present application can detect whether the position of the second virtual object is within the skill range corresponding to the skill through a discrete point detection method. If it is detected that the position of the second virtual object is not within the skill range corresponding to the skill, it is detected whether the current state of the second virtual object meets the target detection condition. If the current state of the second virtual object meets the target detection condition, it is detected whether at least part of the motion path of the second virtual object coincides with the skill range corresponding to the skill. If so, it is determined that the second virtual object is hit by the skill released by the first virtual object. This can avoid the problem of missed detection caused by the small skill range of the virtual object releasing the skill or the fast movement speed of the virtual object in the virtual scene, which can not only improve the accuracy of virtual object hit detection, but also improve the efficiency of virtual object hit detection. At the same time, a discrete point detection method is first used to detect whether the second virtual object is hit by the skill released by the first virtual object. When the discrete point detection method cannot detect whether the second virtual object is hit by the skill released by the first virtual object, and the current state of the second virtual object meets the target detection condition, the continuity detection method is continued to be used (by whether at least part of the motion path coincides with the skill range corresponding to the skill) to detect whether the second virtual object is hit by the skill released by the first virtual object. This can improve the accuracy and efficiency of virtual object hit detection without consuming a large amount of computing resources.

[0181] An embodiment of the present application further provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the following command is executed:

[0182] responding to a skill release request from the first virtual object, and controlling the first virtual object to release the skill in the virtual scene;

[0183] detecting whether at least a portion of a motion path of the second virtual object overlaps with a skill range corresponding to the skill;

[0184] If they overlap, it is determined that the second virtual object is hit by the skill released by the first virtual object.

[0185] In an optional embodiment of the present application, in the instructions executed by the computer-readable storage medium, the step of detecting whether at least a portion of the motion path of the second virtual object overlaps with the skill range corresponding to the skill includes:

[0186] detecting whether a current state of the second virtual object satisfies a target detection condition;

[0187] If the current state of the second virtual object meets the target detection condition, it is detected whether at least a portion of the motion path of the second virtual object overlaps with the skill range corresponding to the skill.

[0188] In an optional embodiment of the present application, the current state of the second virtual object satisfies the target detection condition, including one of the following conditions: the first position of the second virtual object determined based on the previous frame data is detected; the moving speed of the second virtual object satisfies the preset condition determined based on the skill range.

[0189] In an optional embodiment of the present application, in the instructions executed by the computer-readable storage medium, determining whether the movement speed of the second virtual object satisfies a preset condition determined according to the skill range is performed in the following manner:

[0190] Obtaining a moving speed of a second virtual object in the virtual scene;

[0191] If the acquired moving speed is greater than a preset speed threshold, it is determined that the moving speed of the second virtual object meets a preset condition; wherein the preset speed threshold is determined according to the area shape and area size of the skill range.

[0192] In an optional embodiment of the present application, in the instructions executed by the computer-readable storage medium, the step of detecting whether the current state of the second virtual object meets the target detection condition includes:

[0193] detecting whether the position of the second virtual object is within a skill range corresponding to the skill;

[0194] If it is detected that the position of the second virtual object is not within the skill range corresponding to the skill, it is detected whether the current state of the second virtual object meets the target detection condition.

[0195] In an optional embodiment of the present application, in the instructions executed by the computer-readable storage medium, the step of detecting whether the position of the second virtual object is within the skill range corresponding to the skill includes:

[0196] Obtaining a second position of the second virtual object determined according to the current frame data;

[0197] Draw a ray with the second position as the starting point, and determine whether the position of the second virtual object is within the skill range corresponding to the skill based on the number of intersections between the ray and the skill range;

[0198] Or, obtaining the center position of the skill range and the second position of the second virtual object determined according to the current frame data;

[0199] determining a distance between the second position and the center position of the skill range;

[0200] Whether the second virtual object is within the skill range is determined based on a magnitude relationship between the distance and a preset threshold.

[0201] In an optional embodiment of the present application, the shape of the area of the skill range includes a regular pattern, and the instructions executed by the computer-readable storage medium include the step of detecting whether at least a portion of the motion path of the second virtual object overlaps with the skill range corresponding to the skill, including:

[0202] Determining a target connection line between a second position of the second virtual object determined according to the current frame data and a pre-stored first position of the second virtual object determined according to the previous frame data;

[0203] According to the relative positional relationship between the target line and the skill range, it is detected whether at least a portion of the motion path of the second virtual object overlaps with the skill range corresponding to the skill.

[0204] In an optional embodiment of the present application, the shape of the area of the skill range includes an irregular shape, and the instructions executed by the computer-readable storage medium further include:

[0205] determining an interpolation amount based on the size of the area within the skill range and the movement speed of the second virtual object;

[0206] Inserting an interpolation number of position points between a second position of the second virtual object determined according to the current frame data and a pre-stored first position of the second virtual object determined according to the previous frame data;

[0207] Checks whether any position other than the second position is within the skill range.

[0208] In an optional embodiment of the present application, in the instructions executed by the computer-readable storage medium, the step of determining the number of interpolations based on the area size of the skill range and the movement speed of the second virtual object includes:

[0209] Determining a moving distance of the second virtual object within the duration corresponding to one frame according to the moving speed of the second virtual object and the duration corresponding to one frame;

[0210] The amount of interpolation is determined by the ratio between the area size of the skill range and the distance traveled.

[0211] In an optional embodiment of the present application, the instructions executed by the computer-readable storage medium further include:

[0212] After determining that the second virtual object is hit by the skill released by the first virtual object, saving a second position of the second virtual object determined according to the current frame data;

[0213] Alternatively, after determining that the second virtual object does not meet the target detection condition, the second position of the second virtual object determined according to the current frame data is saved.

[0214] In an optional embodiment of the present application, the instructions executed by the computer-readable storage medium further include:

[0215] If it is detected that the second virtual object moves instantaneously in the virtual scene, the pre-stored first position of the second virtual object determined according to the previous frame data is cleared.

[0216] The embodiment of the present application can detect whether the position of the second virtual object is within the skill range corresponding to the skill through a discrete point detection method. If it is detected that the position of the second virtual object is not within the skill range corresponding to the skill, it is detected whether the current state of the second virtual object meets the target detection condition. If the current state of the second virtual object meets the target detection condition, it is detected whether at least part of the motion path of the second virtual object coincides with the skill range corresponding to the skill. If so, it is determined that the second virtual object is hit by the skill released by the first virtual object. This can avoid the problem of missed detection caused by the small skill range of the virtual object releasing the skill or the fast movement speed of the virtual object in the virtual scene, which can not only improve the accuracy of virtual object hit detection, but also improve the efficiency of virtual object hit detection. At the same time, a discrete point detection method is first used to detect whether the second virtual object is hit by the skill released by the first virtual object. When the discrete point detection method cannot detect whether the second virtual object is hit by the skill released by the first virtual object, and the current state of the second virtual object meets the target detection condition, the continuity detection method is continued to be used (by whether at least part of the motion path coincides with the skill range corresponding to the skill) to detect whether the second virtual object is hit by the skill released by the first virtual object. This can improve the accuracy and efficiency of virtual object hit detection without consuming a large amount of computing resources.

[0217] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0218] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. There may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be through some communication interface, indirect coupling or communication connection of devices or units, which may be electrical, mechanical or other forms.

[0219] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0220] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0221] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0222] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The scope of protection of the present application is not limited thereto. Although the present application has been described in detail with reference to the above-mentioned embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-mentioned embodiments within the technical scope disclosed in the present application, or perform equivalent replacements for some of the technical features thereof. These modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A method for detecting a hit of a virtual object, characterized in that: The hit detection method includes: responding to a skill release request from the first virtual object, and controlling the first virtual object to release the skill in the virtual scene; Using a single point detection algorithm to detect whether the position of the second virtual object is within the skill range corresponding to the skill; If it is detected that the position of the second virtual object is not within the skill range corresponding to the skill, detecting whether the current state of the second virtual object meets the target detection condition; If the current state of the second virtual object satisfies the target detection condition, detecting whether at least a portion of the motion path of the second virtual object overlaps with a skill range corresponding to the skill; If they overlap, it is determined that the second virtual object is hit by the skill released by the first virtual object.

2. The hit detection method according to claim 1, wherein: The current state of the second virtual object satisfies the target detection condition, including one of the following conditions: detecting the presence of the second virtual object at a first position determined based on the previous frame data; and the moving speed of the second virtual object satisfies a preset condition determined based on the skill range.

3. The hit detection method according to claim 2, characterized in that: Determining whether the movement speed of the second virtual object satisfies a preset condition determined according to the skill range is performed in the following manner: Acquiring a moving speed of the second virtual object in the virtual scene; If the acquired moving speed is greater than a preset speed threshold, it is determined that the moving speed of the second virtual object meets a preset condition; wherein the preset speed threshold is determined according to the area shape and area size of the skill range.

4. The hit detection method according to claim 1, wherein: The step of detecting whether the position of the second virtual object is within the skill range corresponding to the skill includes: Obtaining a second position of the second virtual object determined according to current frame data; Draw a ray with the second position as a starting point, and determine whether the position of the second virtual object is within the skill range corresponding to the skill based on the number of intersections between the ray and the skill range; or, obtaining a center position of the skill range and a second position of the second virtual object determined according to current frame data; determining a distance between the second position and a center position of the skill range; Whether the second virtual object is within the skill range is determined according to a magnitude relationship between the distance and a preset threshold.

5. The hit detection method according to any one of claims 1 to 4, characterized in that: The area shape of the skill range includes regular shapes, The step of detecting whether at least a portion of the motion path of the second virtual object overlaps with the skill range corresponding to the skill includes: Determining a target connection line between a second position of the second virtual object determined according to the current frame data and a pre-stored first position of the second virtual object determined according to the previous frame data; According to the relative positional relationship between the target line and the skill range, it is detected whether at least a portion of the motion path of the second virtual object overlaps with the skill range corresponding to the skill.

6. The hit detection method according to any one of claims 1 to 4, characterized in that: The area shape of the skill range includes an irregular shape, and the hit detection method further includes: determining an interpolation amount based on a size of the skill range and a movement speed of the second virtual object; Inserting the interpolation number of position points between a second position of the second virtual object determined according to the current frame data and a pre-stored first position of the second virtual object determined according to the previous frame data; It is detected whether any position point other than the second position is within the skill range.

7. The hit detection method according to claim 6, characterized in that: The step of determining the interpolation quantity according to the area size of the skill range and the movement speed of the second virtual object includes: Determining a moving distance of the second virtual object within the duration corresponding to one frame according to the moving speed of the second virtual object and the duration corresponding to one frame; The interpolation amount is determined according to a ratio between the area size of the skill range and the movement distance.

8. The hit detection method according to claim 1, wherein: The hit detection method further includes: After determining that the second virtual object is hit by the skill released by the first virtual object, saving a second position of the second virtual object determined according to the current frame data; Alternatively, after determining that the second virtual object does not meet the target detection condition, the second position of the second virtual object determined according to the current frame data is saved.

9. The hit detection method according to claim 1, wherein: The hit detection method further includes: If it is detected that the second virtual object moves instantaneously in the virtual scene, the pre-stored first position of the second virtual object determined according to the previous frame data is cleared.

10. A virtual object hit detection device, characterized in that: The hit detection device comprises: A skill releasing module, configured to respond to a skill release request from the first virtual object and control the first virtual object to release the skill in the virtual scene; a path detection module, configured to use a single-point detection algorithm to detect whether the position of the second virtual object is within the skill range corresponding to the skill; if it is detected that the position of the second virtual object is not within the skill range corresponding to the skill, then detecting whether the current state of the second virtual object satisfies a target detection condition; if the current state of the second virtual object satisfies the target detection condition, then detecting whether at least a portion of the motion path of the second virtual object overlaps with the skill range corresponding to the skill; A skill hit module is used to determine that the second virtual object is hit by the skill released by the first virtual object if there is overlap.

11. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the memory communicate via the bus, and the processor executes the machine-readable instructions to perform the steps of the virtual object hit detection method as described in any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the virtual object hit detection method according to any one of claims 1 to 9 are executed.