Information processing method and device, storage medium, and electronic device

By obtaining the current and previous legal position of the virtual object in the game, performing ray detection to judge the rationality of the position, and adjusting the position if necessary, the problem of collision blocking caused by unreasonable position of the virtual object is solved, and the game is improved Fairness and experience.

CN115445202BActive Publication Date: 2025-02-18NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211124721.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-15
Publication Date
2025-02-18
Estimated Expiration
2042-09-15

AI Technical Summary

Technical Problem

In the game, when multiple colliders forcefully squeeze each other, the virtual object may enter the inside of other models or fall below the ground, resulting in the collision blockage not taking effect, reducing the fairness of the game and player experience.

Method used

By obtaining the current position of the virtual object and the previous legal position, performing ray detection to obtain the collision surface, and determining whether the current position of the virtual object is an illegal position. If it is an illegal position, adjust its position to the previous legal position.

Benefits of technology

It effectively solves the problem of collision blocking failure caused by unreasonable position of virtual objects, and improves the fairness of the game and player experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115445202B_ABST
    Figure CN115445202B_ABST
Patent Text Reader

Abstract

The present disclosure is about an information processing method and device, a storage medium, and an electronic device, and relates to the field of computer technology. The method includes: obtaining the current position of a virtual object in a game and the last legal position relative to the current position; performing ray detection on the current position and the last legal position, obtaining a collision surface obtained by the ray detection, and judging whether the current position of the virtual object is an illegal position based on the collision surface; when determining that the current position of the virtual object is an illegal position, adjusting the current position of the virtual object to the last legal position. The present disclosure improves the fairness of the game and the game experience of the players.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] Physics engines are used in games that need to simulate the physical movement of real objects. Physics engines calculate movement, rotation, and collision reactions by assigning real physical properties to object collision bodies, thereby enhancing the realism of the player's gaming experience.

[0003] However, when multiple collision bodies in the game forcibly squeeze and collide with each other, the squeezed virtual object will enter other models or fall below the ground. When the squeezed virtual object enters other models or falls below the ground, the collision blocking of the model is ineffective, causing the virtual object that falls into the model to be able to see through or directly attack the virtual object outside the model, while the virtual object outside the model cannot attack the virtual object inside the model, and the physics engine cannot adjust the position of the squeezed virtual object, reducing the fairness of the game and the player's gaming experience.

[0004] Therefore, a new information processing method needs to be provided.

[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute prior art known to ordinary technicians in the field. Summary of the invention

[0006] The purpose of the present disclosure is to provide an information processing method, an information processing device, a computer-readable storage medium and an electronic device, thereby at least to a certain extent overcoming the problem that the physical engine cannot adjust the position of virtual objects due to the limitations and defects of related technologies, thereby reducing the fairness of the game and the player's gaming experience.

[0007] According to one aspect of the present disclosure, there is provided an information processing method, comprising:

[0008] Get the current position of the virtual object in the game and the last legal position relative to the current position;

[0009] Performing ray detection on the current position and the last legal position, acquiring a collision surface obtained by the ray detection, and determining whether the current position of the virtual object is an illegal position based on the collision surface;

[0010] When it is determined that the current position of the virtual object is an illegal position, the current position of the virtual object is adjusted to the last legal position.

[0011] In an exemplary embodiment of the present disclosure, performing ray detection on the current position and the last legal position to obtain a collision surface obtained by the ray detection includes:

[0012] Based on the current position of the virtual object, a ray is emitted to the last legal position to perform a first ray detection;

[0013] Based on the first ray detection, a collision surface between the current position of the virtual object and the last legal position is obtained, wherein the collision surface is a positive collision surface or a negative collision surface.

[0014] In an exemplary embodiment of the present disclosure, after obtaining the collision surface between the current position of the virtual object and the previous legal position, the information processing method further includes:

[0015] Acquire frontal collision information corresponding to the frontal collision surface and rearward collision information corresponding to the rearward collision surface;

[0016] Collision screening is performed according to the frontal collision information and the rearward collision information.

[0017] In an exemplary embodiment of the present disclosure, performing collision screening according to the frontal collision information and the rearward collision information includes:

[0018] Obtaining a collision type of the collision according to the frontal collision information and the rearward collision information;

[0019] According to the collision type, a first collision among the collisions that does not need to be detected is determined, and collision screening is performed on the first collision.

[0020] In an exemplary embodiment of the present disclosure, determining whether the current position of the virtual object is an illegal position includes:

[0021] Determining whether the positive collision surface corresponds to the negative collision surface and whether the first collision surface among the collision surfaces is a positive collision surface;

[0022] When the positive collision surface corresponds to the negative collision surface and the first collision surface is a positive collision surface, the current position of the virtual object is a legal position;

[0023] When the positive collision surface does not correspond to the negative collision surface or the first collision surface is not a positive collision surface, the current position of the virtual object may be an illegal position.

[0024] In an exemplary embodiment of the present disclosure, when the current position of the virtual object may be an illegal position, the information processing method further includes:

[0025] According to the collision type of the collision, determining whether the collision is a preset first type collision;

[0026] When it is determined that the collision is a preset first type of collision, the current position of the virtual object is an illegal position;

[0027] When it is determined that the collision is not a preset first type collision, a reverse detection is performed on the current position of the virtual object.

[0028] In an exemplary embodiment of the present disclosure, reverse detection of the current position of the virtual object includes:

[0029] Based on the current position of the virtual object, a ray is emitted in the opposite direction of the line connecting the current position and the last legal position to perform a second ray detection;

[0030] A first collision surface in the second ray detection is obtained, and when it is determined that there is an anti-collision surface in the collision surface of the second ray detection, and the anti-collision surface is a collision surface in the collision body corresponding to the unpaired anti-collision surface in the first ray detection, the current position of the virtual object is an illegal position.

[0031] In an exemplary embodiment of the present disclosure, determining whether the collision surface is a positive collision surface or a negative collision surface includes:

[0032] Acquire collision information obtained through the first ray detection;

[0033] Obtaining a reverse vector of the ray in the first ray detection, performing a dot product on the reverse vector and a normal vector of the collision surface in the collision information to obtain a dot product result;

[0034] The collision surface is judged to be a positive collision surface or a negative collision surface according to the dot product result.

[0035] According to one aspect of the present disclosure, there is provided an information processing device, including:

[0036] A position acquisition module, used to acquire the current position of a virtual object in the game and the last legal position relative to the current position;

[0037] A ray detection module, used to perform ray detection on the current position and the last legal position, obtain a collision surface obtained by the ray detection, and determine whether the current position of the virtual object is an illegal position based on the collision surface;

[0038] The position determination module is used to adjust the current position of the virtual object to the last legal position when determining that the current position of the virtual object is an illegal position.

[0039] According to one aspect of the present disclosure, a computer storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the information processing method described in any of the above exemplary embodiments is implemented.

[0040] According to one aspect of the present disclosure, there is provided an electronic device, including:

[0041] Processor; and

[0042] A memory, configured to store executable instructions of the processor;

[0043] The processor is configured to execute the information processing method described in any of the above exemplary embodiments by executing the executable instructions.

[0044] An information processing method provided by an embodiment of the present disclosure comprises the steps of obtaining a current position of a virtual object in a game and a previous legal position relative to the current position; performing ray detection on the current position and the previous legal position, obtaining a collision surface obtained by the ray detection, and judging whether the current position of the virtual object is an illegal position based on the collision surface; when it is determined that the current position of the virtual object is an illegal position, adjusting the current position of the virtual object to the previous legal position; on the one hand, in the game, by obtaining the current position and the previous legal position of the virtual object, and performing ray detection between the current position and the previous legal position of the virtual object, judging whether the current position of the virtual object is reasonable by using the collision surface obtained by the ray detection, and improving the efficiency of position detection of the virtual object by the ray detection; on the other hand, when the current position of the virtual object obtained by the ray detection is an illegal position, adjusting the current position of the virtual object, and taking the previous legal position as the current position of the virtual object, avoiding the problem in the related art that when the position of the virtual object is unreasonable, the collision blocking of the model is not effective and the physical engine cannot adjust the position of the virtual object squeezed into the model, thereby improving the fairness of the game and the game experience of the players.

[0045] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present invention, and together with the specification are used to explain the principles of the present invention. Obviously, the accompanying drawings described below are only some embodiments of the present invention, and for those of ordinary skill in the art, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0047] Figure 1A scene diagram in which a virtual object is located under the ground in a related technology according to an exemplary embodiment of the present disclosure is schematically shown.

[0048] Figure 2 A scene diagram in which a virtual object is located between a door and a bus in a related technology according to an exemplary embodiment of the present disclosure is schematically shown.

[0049] Figure 3 A scene diagram in which a virtual object is located inside a bus in a related technology according to an exemplary embodiment of the present disclosure is schematically shown.

[0050] Figure 4 The flowchart schematically shows an information processing method according to an exemplary embodiment of the present disclosure.

[0051] Figure 5 A flowchart of a method for performing ray detection on a current position and a previous legal position to obtain a collision surface obtained through ray detection according to an exemplary embodiment of the present disclosure is schematically shown.

[0052] Figure 6 A flowchart of an information processing method after obtaining a collision surface between a current position and a previous legal position according to an exemplary embodiment of the present disclosure is schematically shown.

[0053] Figure 7 A flowchart of a method for performing collision screening based on frontal collision information and rearward collision information according to an exemplary embodiment of the present disclosure is schematically shown.

[0054] Figure 8 A flowchart of a method for determining whether a current position of a virtual object is an illegal position according to an exemplary embodiment of the present disclosure is schematically shown.

[0055] Fig. 9 A schematic diagram schematically shows a collision surface according to an exemplary embodiment of the present disclosure.

[0056] Fig.10 A schematic diagram schematically shows a collision surface according to an exemplary embodiment of the present disclosure.

[0057] Fig.11 A flowchart of an information processing method when a current position of a virtual object may be an illegal position according to an exemplary embodiment of the present disclosure is schematically shown.

[0058] Fig.12 A flowchart of a method for reversely detecting the current position of a virtual object when it is determined that the collision is not a preset first type collision according to an exemplary embodiment of the present disclosure is schematically shown.

[0059] Fig.13A schematic diagram of a scenario for reversely detecting the current position of a virtual object according to an exemplary embodiment of the present disclosure is schematically shown.

[0060] Fig.14 A flowchart of a method for determining whether a collision surface is a positive collision surface or a negative collision surface according to an exemplary embodiment of the present disclosure is schematically shown.

[0061] Fig.15 A schematic diagram of a scenario for determining whether a collision surface is a positive collision surface or a negative collision surface according to an exemplary embodiment of the present disclosure is schematically shown.

[0062] Fig.16 A schematic diagram of a cosine trigonometric curve according to an example embodiment of the present disclosure is schematically shown.

[0063] Fig.17 A flowchart for updating the current position of a virtual object according to an exemplary embodiment of the present disclosure is schematically shown.

[0064] Fig.18 The following is a block diagram schematically showing an information processing device according to an exemplary embodiment of the present disclosure.

[0065] Fig.19 An electronic device for implementing the above information processing method according to an exemplary embodiment of the present invention is schematically shown. DETAILED DESCRIPTION

[0066] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present invention will be more comprehensive and complete, and the concept of the example embodiments will be fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present invention. However, those skilled in the art will appreciate that the technical solutions of the present invention may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present invention.

[0067] In addition, the accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0068] In games with physical movement of virtual objects, the physics engine calculates the movement, rotation, and collision reaction of virtual objects by assigning real physical properties to the virtual object collision body. While enjoying the realism and convenience brought by the physics engine, it also brings some problems. Figure 1 As shown in Figure 2, when a virtual object collides with a vehicle in the game, the virtual object will be squeezed under the ground; Figure 2 As shown, when the virtual object is between the door and the bus, when the virtual object opens and closes the door, the reference Figure 3 As shown, the virtual objects will be forced into the bus. After the virtual objects are squeezed into the bus, the collision blocking of the model is ineffective, causing the virtual objects inside the bus to be able to see through or shoot through the bus to hit the virtual objects outside, while the virtual objects outside the bus cannot see the attackers and cannot hit the attackers, which reduces the fairness of the game and the players' gaming experience.

[0069] In the collision of the physics engine, some can be modified through code or scenes. For example, to solve the problem of door jam collision in the game, the door in the game can be deleted or not allowed to open. However, the unfairness of the game caused by the player's operation is unavoidable.

[0070] In the related art, there are corresponding solutions to the problem of virtual objects falling below the ground. For example, in an aerial photography scene, the height accuracy of the scene terrain under the world coordinates is magnified, and the magnified accuracy is stored in the three RGB channels. The channels are saved in a large picture. When the picture is loaded in the game, the current position is proportionally converted to the position corresponding to the height map, the RGB value of the position in the height map is extracted and the height is calculated. When the current height is lower than the height map, it means that the virtual object has fallen under the ground of the model. At this time, the current height can be set to the height of the height map. However, the above method cannot solve the problem of virtual objects being squeezed into the inside of the model.

[0071] Based on one or more of the above problems, this exemplary embodiment first provides an information processing method, which can be run on a device terminal, which can include a desktop computer, a portable computer, a smart phone, a tablet computer, etc. Of course, those skilled in the art can also run the method of the present invention on other platforms as required, and this exemplary embodiment does not specifically limit this. Figure 4 As shown, the information processing method may include the following steps:

[0072] Step S410. Obtain the current position of the virtual object in the game and the last legal position relative to the current position;

[0073] Step S420: Perform ray detection on the current position and the last legal position, obtain a collision surface obtained by the ray detection, and determine whether the current position of the virtual object is an illegal position based on the collision surface;

[0074] Step S430: When it is determined that the current position of the virtual object is an illegal position, the current position of the virtual object is adjusted to the last legal position.

[0075] The above-mentioned information processing method obtains the current position of the virtual object in the game and the last legal position relative to the current position; performs ray detection on the current position and the last legal position, obtains the collision surface obtained by the ray detection, and judges whether the current position of the virtual object is an illegal position based on the collision surface; when it is determined that the current position of the virtual object is an illegal position, adjusts the current position of the virtual object to the last legal position; on the one hand, in the game, by obtaining the current position and the last legal position of the virtual object, and performing ray detection between the current position and the last legal position of the virtual object, the collision surface obtained by the ray detection is used to judge whether the current position of the virtual object is reasonable, and the efficiency of the position detection of the virtual object is improved by the ray detection; on the other hand, when the current position of the virtual object obtained by ray detection is an illegal position, the current position of the virtual object is adjusted, and the last legal position is used as the current position of the virtual object, thereby avoiding the problem in the related art that when the position of the virtual object is unreasonable, the collision blocking of the model is not effective and the physical engine cannot adjust the position of the virtual object squeezed into the model, thereby improving the fairness of the game and the game experience of the players.

[0076] Hereinafter, each step involved in the information processing method of the exemplary embodiment of the present disclosure is explained and illustrated in detail.

[0077] In step S410, the current position of the virtual object in the game and the last legal position relative to the current position are obtained.

[0078] The current position of the virtual object can be a legal position or an illegal position. In this example embodiment, the current position of the virtual object is not specifically limited. When the current position of the virtual object is inside the model or below the ground in the game scene, the current position of the virtual object is an illegal position; the last legal position is the legal position of the virtual object before it moves to the current position relative to the current position of the virtual object.

[0079] In step S420, ray detection is performed on the current position and the previous legal position to obtain a collision surface obtained by the ray detection, and based on the collision surface, it is determined whether the current position of the virtual object is an illegal position.

[0080] In this example embodiment, ray detection is that the physics engine draws a ray between the current position and the last legal position of the virtual object based on the two points, and returns collision information of the ray hitting the collision body. The collision information may include the collision body, the coordinates of the collision point, the normal of the collision surface, etc., wherein the normal of the collision surface is a vector perpendicular to the collision triangle.

[0081] In this example embodiment, the principle of culling collision faces inside the model is used to determine whether the current position of the virtual object is legal. Face culling is when drawing a model. In order to reduce rendering consumption, invisible model faces will be discarded and not drawn. For example, the faces inside the model, each model face is composed of three vertices. In the rendering process, the order in which the vertices are used to draw the triangle faces (clockwise or counterclockwise) will be used to determine whether a triangle is a forward triangle or a back triangle. By default, triangles defined by counterclockwise vertices will be processed as forward triangles. Face culling also exists in collision bodies. The collision in this example embodiment is a scene collision, which is a static collision. Each collision body has a collision group. When a collision occurs between collision bodies, the value of the collision group of the collision body is bitwise operated to determine whether the collision is a static collision. Other methods can also be used to determine whether the collision is a static collision, which is not specifically limited in this example embodiment.

[0082] refer to Figure 5 As shown, performing ray detection on the current position and the previous legal position to obtain a collision surface obtained by the ray detection may include step S510 and step S520:

[0083] Step S510. Based on the current position of the virtual object, a ray is emitted to the last legal position to perform a first ray detection;

[0084] Step S520: Based on the first ray detection, a collision surface between the current position of the virtual object and the previous legal position is obtained, wherein the collision surface is a positive collision surface or a negative collision surface.

[0085] In the following, step S510 and step S520 will be further explained and illustrated. Specifically, after the current position and the last legal position of the virtual object are obtained, the current position of the virtual object can be used as the starting point and the last legal position as the end point, a ray can be emitted, and a first ray detection can be performed. Based on the first ray detection, the collision surface between the current position and the last legal position of the virtual object can be obtained; wherein the collision surface can be a positive collision surface or a negative collision surface, and the collision surface is not specifically limited in this example embodiment.

[0086] In this example embodiment, reference Figure 6 As shown, after obtaining the collision surface between the current position of the virtual object and the previous legal position, the information processing method may further include step S610 and step S620:

[0087] Step S610. Acquire frontal collision information corresponding to the frontal collision surface and rearward collision information corresponding to the rearward collision surface;

[0088] Step S620: Perform collision screening according to the frontal collision information and the rearward collision information.

[0089] In the following, step S610 and step S620 will be further explained and illustrated. Specifically, first, after the collision surface between the current position and the previous legal position of the virtual object is obtained through the first ray detection, the detected collision surface is judged to determine whether the collision surface is a positive collision surface or a negative collision surface. When the collision surface is a positive collision surface, all positive collision information corresponding to the positive collision surface is obtained; when the collision surface is a negative collision surface, all negative collision information corresponding to the negative collision surface is obtained. After the positive collision information and the negative collision information are obtained, collision screening can be performed according to the positive collision information and the negative collision information.

[0090] For further reference, Figure 7 As shown, performing collision screening according to the frontal collision information and the rearward collision information may include step S710 and step S720:

[0091] Step S710: Obtaining the collision type of the collision according to the frontal collision information and the rearward collision information;

[0092] Step S720: According to the collision type, determine a first collision among the collisions that does not need to be detected, and perform collision screening on the first collision.

[0093] In the following, step S710 and step S720 will be further explained and illustrated. Specifically, after obtaining the frontal collision information and the rear collision information, the collision type of each collision can be obtained according to the collision grouping of the collision bodies included in the frontal collision information and the rear collision information; then, according to the collision type, it is determined whether the collision is a first collision that does not need to be detected. When the collision is a first collision that does not need to be detected, that is, when the collision is an invalid collision, the collision is eliminated. Among them, the first collision can be a road collision or a water collision. In this example embodiment, the collision type included in the first collision is not specifically limited, and the first collision can be determined according to the actual scene needs.

[0094] In this example embodiment, after obtaining the collision surface in the first ray detection and eliminating the invalid collisions in the collision, the current position of the virtual object can be judged according to the collision surface of the valid collision, referring to Figure 8 As shown, judging whether the current position of the virtual object is an illegal position may include steps S810 to S830:

[0095] Step S810: Determine whether the positive collision surface corresponds to the negative collision surface and whether the first collision surface among the collision surfaces is a positive collision surface;

[0096] Step S820: when the positive collision surface corresponds to the negative collision surface and the first collision surface is a positive collision surface, the current position of the virtual object is a legal position;

[0097] Step S830: When the positive collision surface does not correspond to the negative collision surface or the first collision surface is not a positive collision surface, the current position of the virtual object may be an illegal position.

[0098] The following will further explain and illustrate steps S810 to S830. Fig. 9 As shown, when the ray passes through the two collision bodies from the leftmost end of the first collision body, the positive collision surface 901 and the reverse collision surface 902 in the first collision body are corresponding, and the positive collision surface 903 and the reverse collision surface 904 in the second collision body are corresponding; refer to Fig.10As shown, the positive collision surface 1001 corresponds to the reverse collision surface 1002, and the collision surface 1003 is a redundant collision surface. When there is an extra reverse collision surface 1003 in the collision, according to the principle of eliminating the internal collision surface of the model, it can be determined that the starting point of the ray is located inside the first collision body; therefore, when judging the current position of the virtual object, it can be judged whether the positive collision surface in the collision corresponds to the reverse collision surface and whether the first collision surface is the positive collision surface; when the positive collision and the reverse collision are one-to-one corresponding and the first collision surface is the positive collision surface, it can be determined that the current position of the virtual object is a legal position, that is, the current position of the virtual object is not in the model or below the ground; when the positive collision surface does not correspond to the reverse collision surface and or the first collision surface is not the positive collision surface, it can be considered that the current position of the virtual object may be an illegal position.

[0099] In this example embodiment, a ray is emitted from the current position of the virtual object to the previous legal position for the first ray detection. When the current position of the virtual object is a legal position, a pair of positive collision surfaces and negative collision surfaces are obtained through the first ray detection, and the first collision surface among the obtained collision surfaces is definitely a positive collision surface. When the positive collision surface and the negative collision surface obtained through the first ray detection are not paired or the first collision surface is not a positive collision surface, it may be because some collision bodies themselves are single-sided and not closed collision bodies. Therefore, it is necessary to further judge the virtual object whose current position may be an illegal position.

[0100] refer to Fig.11 As shown, when the current position of the virtual object may be an illegal position, the information processing method may further include steps S1110 to S1130:

[0101] Step S1110. According to the collision type of the collision, determine whether the collision is a preset first type collision;

[0102] Step S1120: when it is determined that the collision is a preset first type of collision, the current position of the virtual object is an illegal position;

[0103] Step S1130: When it is determined that the collision is not a preset first type collision, reverse detection is performed on the position of the virtual object.

[0104] Below, step S1110-step S1130 will be further explained and illustrated. Specifically, when it is determined that the current position of the virtual object may be an illegal position, further judgment can be made through the collision type of the collision in the first ray detection. First, the collision type of the collision is obtained, and it is determined whether the obtained collision type is a preset first type collision. When the collision type is a preset first type collision, the current position of the virtual object is determined to be an illegal position; wherein, the preset first type collision can be a reverse terrain collision or other collision. In this example embodiment, the preset first type collision is not specifically limited. When the current position of the virtual object is below the ground, when a ray is sent to the upper legal position based on the current position of the virtual object for the first ray detection, the collision obtained by the first ray detection is a reverse terrain collision. In addition, when it is determined that the collision obtained by the first ray detection is not a preset first type collision, the current position of the virtual object can be reversely detected.

[0105] refer to Fig.12 As shown, when it is determined that the collision is not the preset first type collision, reverse detection is performed on the current position of the virtual object, which may include steps S1210 to S1230:

[0106] Step S1210. Based on the current position of the virtual object, a ray is emitted in the opposite direction of the line connecting the current position and the last legal position to perform a second ray detection;

[0107] Step S1220. Obtain the first collision surface in the second ray detection. When it is determined that there is a counter-collision surface in the collision surface of the second ray detection, and the counter-collision surface is a collision surface in the collision body corresponding to the unpaired counter-collision surface in the first ray detection, the current position of the virtual object is an illegal position.

[0108] In the following, step S1210 to step S1230 will be further explained and illustrated. Specifically, first, determine the direction of the line connecting the current position of the virtual object and the last legal position, then, based on the current position of the virtual object, emit a ray in the opposite direction of the line connecting the current position of the virtual object and the last legal position, that is, take the current position of the virtual object as the starting point, send a ray of a preset length in the opposite direction of the line connecting the current position of the virtual object and the last legal position, and perform a second ray detection, that is, in the second ray detection, the starting point of the ray is the current position of the virtual object. In this example embodiment, the length of the ray is not specifically limited, and those skilled in the art can determine the length of the ray emitted based on the current position of the virtual object as needed; then, obtain the collision surface in the second ray detection, and it is necessary to determine whether there is an anti-collision surface in the collision surface obtained by the second ray detection. When there is an anti-collision surface in the second ray detection, and the anti-collision surface is a collision surface in the collision body corresponding to the unpaired anti-collision surface in the first ray detection, it can be determined that the current position of the virtual object is an illegal position; otherwise, the current position of the virtual object is a legal position.

[0109] For example, in this exemplary embodiment, there are two collision bodies interlaced, refer to Fig.13 As shown, when there is an interlacing between collision body A and collision body B, in the first ray detection 1301, the reverse collision surface 1302 is an unpaired collision surface. Therefore, it is necessary to perform a reverse detection on the current position of the virtual object. When performing the reverse detection, the positive collision surface 1304, the reverse collision surface 1305 and the reverse collision surface 1306 can be obtained through the second ray detection 1303, wherein the positive collision surface 1304 corresponds to the reverse collision surface 1306, indicating that the current position of the virtual object is not in the collision body B, and the reverse collision surface 1305 is the surface in the collision body A corresponding to the unpaired reverse collision surface 1302 in the first ray detection, that is, the current position of the virtual object is in the collision body A, and the current position of the virtual object is an illegal position. Therefore, when a second ray detection is performed on the current position of the virtual object, it is necessary to determine whether there is an anti-collision surface in the collision surface of the second ray detection, and whether the anti-collision surface is a surface in a collision body corresponding to the unpaired anti-collision surface in the first ray detection. If so, the current position of the virtual object is an illegal position; otherwise, the current position of the virtual object is a legal position.

[0110] In this example embodiment, reference Fig.14 As shown, judging whether the collision surface is a positive collision surface or a negative collision surface may include steps S1410 to S1430:

[0111] Step S1410. Acquire collision information obtained through the first ray detection;

[0112] Step S1420. Obtain the reverse vector of the ray in the first ray detection, perform dot multiplication on the reverse vector and the normal vector of the collision surface in the collision information, and obtain a dot multiplication result;

[0113] Step S1430: Determine whether the collision surface is a positive collision surface or a negative collision surface according to the dot product result.

[0114] In the following, step S1410-step S1430 will be further explained and illustrated. Specifically, first, collision information obtained based on the first ray detection is obtained, wherein the collision information may include a collision body, a collision point coordinate, and a normal of a collision surface, etc. In this exemplary embodiment, the collision information is not specifically limited. After the collision information is obtained, a reverse vector pointing from the last legal position of the virtual object to the current position of the virtual object in the first ray detection, which is opposite to the ray direction, can also be obtained; then, the angle between the reverse vector and the normal of the collision surface in the collision information is obtained, and the reverse vector, the normal vector of the collision surface, and the angle between the reverse vector and the normal of the collision surface in the collision information are multiplied to obtain the dot product result. When the dot product result is less than 0, it indicates that the angle between the reverse vector and the normal of the collision surface in the collision information is greater than 90 degrees, that is, the current position of the virtual object is behind the normal of the collision surface, and the collision surface is a reverse collision surface; when the dot product result is greater than 0, the collision surface is a positive collision surface.

[0115] For example, refer to Fig.15 As shown in the figure, position A is the last legal position of the virtual object, and position B is the current position of the virtual object. When performing ray detection, a ray needs to be emitted from position B to position A. The physics engine will return the collision information of the ray, including the collision point P and the normal N of the collision surface. When the angle between the reverse direction AB of the ray and the normal N is θ, according to the vector dot multiplication formula AB*N=|AB|*|N|*cosθ and the cosine trigonometric function, Figure 1 6 In the cosine trigonometric curve diagram, when the included angle θ∈(90, 180), cosθ<0, then |AB|*|N|*cosθ<0, that is, when the dot product result is less than 0, θ>90, indicating that the current position of the virtual object is behind the normal N, that is, behind the collision surface, and the collision surface is a reverse collision surface; when the dot product result is greater than 0, it indicates that the collision surface is a positive collision surface.

[0116] In step S430, when it is determined that the current position of the virtual object is unreasonable, the current position of the virtual object is adjusted to the last legal position.

[0117] In this example embodiment, when the current position of the virtual object is detected and it is found that the current position of the virtual object is an illegal position, the current position of the virtual object can be adjusted to the last legal position of the virtual object, that is, the virtual object is pulled back to the last legal position; when it is determined that the current position of the virtual object is a legal position, the last legal position is updated as the current position of the virtual object, and the current position is synchronized to the server.

[0118] For example, refer to Fig.17 According to the flowchart shown, after entering the game scene, first, the coordinates of the last legal position of the virtual object are obtained from the server; then, the current position of the virtual object is detected to determine whether the current position of the virtual object is legal. When the current position of the virtual object is legal, the last legal position of the virtual object is updated to the current position of the virtual object, and the current position of the virtual object is synchronized to the server, and the current position of the virtual object is detected at preset intervals; when the current position of the virtual object is illegal, the current position of the virtual object is adjusted to the last legal position of the virtual object, that is, the virtual object is pulled back to the last legal position, and the current position of the virtual object is detected at preset intervals.

[0119] The information processing method provided by the exemplary embodiments of the present disclosure has at least the following advantages: on the one hand, in the game, by obtaining the current position and the last legal position of the virtual object, and performing ray detection between the current position and the last legal position of the virtual object, whether the current position of the virtual object is reasonable is judged by the collision surface obtained by the ray detection, and the efficiency of the position detection of the virtual object is improved by the ray detection; on the other hand, when the current position of the virtual object obtained by the ray detection is an illegal position, the current position of the virtual object is adjusted, and the last legal position is used as the current position of the virtual object, thereby avoiding the problem in the related art that when the position of the virtual object is unreasonable, the collision blocking of the model is not effective and the physical engine cannot adjust the position of the virtual object squeezed into the inside of the model, thereby improving the fairness of the game and the game experience of the player; on the other hand, when the first ray detection is performed on the virtual object, if it is detected that the current position of the virtual object may be an illegal position, the current position of the virtual object is reversely detected again, thereby ensuring the integrity of the collision detection and improving the accuracy of the current position detection of the virtual object.

[0120] The exemplary embodiment of the present disclosure also provides an information processing device, referring to Fig.18 As shown, it may include: a position acquisition module 1810 , a ray detection module 1820 and a position determination module 1830 .

[0121] in:

[0122] A position acquisition module 1810 is used to acquire the current position of a virtual object in the game and the last legal position relative to the current position;

[0123] A ray detection module 1820 is used to perform ray detection on the current position and the last legal position, obtain a collision surface obtained by the ray detection, and determine whether the current position of the virtual object is an illegal position based on the collision surface;

[0124] The position determination module 1830 is configured to adjust the current position of the virtual object to the last legal position when determining that the current position of the virtual object is an illegal position.

[0125] The specific details of each module in the above-mentioned information processing device have been described in detail in the corresponding information processing method, so they will not be repeated here.

[0126] In an exemplary embodiment of the present disclosure, performing ray detection on the current position and the last legal position to obtain a collision surface obtained by the ray detection includes:

[0127] Based on the current position of the virtual object, a ray is emitted to the last legal position to perform a first ray detection;

[0128] Based on the first ray detection, a collision surface between the current position of the virtual object and the last legal position is obtained, wherein the collision surface is a positive collision surface or a negative collision surface.

[0129] In an exemplary embodiment of the present disclosure, after obtaining the collision surface between the current position of the virtual object and the previous legal position, the information processing method further includes:

[0130] Acquire frontal collision information corresponding to the frontal collision surface and rearward collision information corresponding to the rearward collision surface;

[0131] Collision screening is performed according to the frontal collision information and the rearward collision information.

[0132] In an exemplary embodiment of the present disclosure, performing collision screening according to the frontal collision information and the rearward collision information includes:

[0133] Obtaining a collision type of the collision according to the frontal collision information and the rearward collision information;

[0134] According to the collision type, a first collision among the collisions that does not need to be detected is determined, and collision screening is performed on the first collision.

[0135] In an exemplary embodiment of the present disclosure, determining whether the current position of the virtual object is an illegal position includes:

[0136] Determining whether the positive collision surface corresponds to the negative collision surface and whether the first collision surface among the collision surfaces is a positive collision surface;

[0137] When the positive collision surface corresponds to the negative collision surface and the first collision surface is a positive collision surface, the current position of the virtual object is a legal position;

[0138] When the positive collision surface does not correspond to the negative collision surface or the first collision surface is not a positive collision surface, the current position of the virtual object may be an illegal position.

[0139] In an exemplary embodiment of the present disclosure, when the current position of the virtual object may be an illegal position, the information processing method further includes:

[0140] According to the collision type of the collision, determining whether the collision is a preset first type collision;

[0141] When it is determined that the collision is a preset first type of collision, the current position of the virtual object is an illegal position;

[0142] When it is determined that the collision is not a preset first type collision, a reverse detection is performed on the current position of the virtual object.

[0143] In an exemplary embodiment of the present disclosure, reverse detection of the current position of the virtual object includes:

[0144] Based on the current position of the virtual object, a ray is emitted in the opposite direction of the line connecting the current position and the last legal position to perform a second ray detection;

[0145] A first collision surface in the second ray detection is obtained, and when it is determined that there is an anti-collision surface in the collision surface of the second ray detection, and the anti-collision surface is a collision surface in the collision body corresponding to the unpaired anti-collision surface in the first ray detection, the current position of the virtual object is an illegal position.

[0146] In an exemplary embodiment of the present disclosure, determining whether the collision surface is a positive collision surface or a negative collision surface includes:

[0147] Acquire collision information obtained through the first ray detection;

[0148] Obtaining a reverse vector of the ray in the first ray detection, performing a dot product on the reverse vector and a normal vector of the collision surface in the collision information to obtain a dot product result;

[0149] The collision surface is judged to be a positive collision surface or a negative collision surface according to the dot product result.

[0150] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0151] In addition, although the steps of the method of the present invention are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0152] In an exemplary embodiment of the present invention, an electronic device capable of implementing the above method is also provided.

[0153] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".

[0154] Refer to the following Fig.19 1900 according to this embodiment of the present invention will be described. Fig.19 The electronic device 1900 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0155] like Fig.19 As shown, the electronic device 1900 is in the form of a general computing device. The components of the electronic device 1900 may include, but are not limited to: at least one processing unit 1910, at least one storage unit 1920, a bus 1930 connecting different system components (including the storage unit 1920 and the processing unit 1910), and a display unit 1940.

[0156] The storage unit stores program codes, which can be executed by the processing unit 1910, so that the processing unit 1910 performs the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification. For example, the processing unit 1910 can perform the following steps: Figure 1 The steps S110 shown in the figure are as follows: obtaining the current position of the virtual object in the game and the last legal position relative to the current position; S120: performing ray detection on the current position and the last legal position, obtaining a collision surface obtained by the ray detection, and judging whether the current position of the virtual object is an illegal position based on the collision surface; S130: when it is determined that the current position of the virtual object is an illegal position, adjusting the current position of the virtual object to the last legal position.

[0157] The storage unit 1920 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 19201 and / or a cache storage unit 19202 , and may further include a read-only storage unit (ROM) 19203 .

[0158] The storage unit 1920 may also include a program / utility 19204 having a set (at least one) of program modules 19205, such program modules 19205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0159] Bus 1930 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0160] The electronic device 1900 may also communicate with one or more external devices 2000 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1900, and / or communicate with any device that enables the electronic device 1900 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1950. Furthermore, the electronic device 1900 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 1960. As shown, the network adapter 1960 communicates with other modules of the electronic device 1900 via a bus 1930. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0161] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present invention.

[0162] In an exemplary embodiment of the present invention, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of this specification is stored. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to perform the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of this specification.

[0163] The program product for implementing the above method according to an embodiment of the present invention may adopt a portable compact disk read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus, or device.

[0164] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0165] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0166] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0167] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0168] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0169] Other embodiments of the invention will readily occur to those skilled in the art after considering the specification and practicing the invention invented herein. This application is intended to cover any variations, uses or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art that are not invented by the present invention. The specification and examples are to be considered exemplary only, and the true scope and spirit of the invention are indicated by the claims.

Claims

1. An information processing method, characterized in that: include: Obtaining the current position of a virtual object in the game and the last legal position relative to the current position; wherein, when the virtual object is located inside the model or below the ground in the game scene, the position of the virtual object is an illegal position; when the virtual object is not inside the model or below the ground, the position of the virtual object is a legal position; Performing ray detection on the current position and the last legal position, acquiring a collision surface obtained by the ray detection, and determining whether the current position of the virtual object is an illegal position based on the collision surface; When it is determined that the current position of the virtual object is an illegal position, the current position of the virtual object is adjusted to the last legal position.

2. The information processing method according to claim 1, characterized in that: Performing ray detection on the current position and the last legal position to obtain a collision surface obtained by the ray detection includes: Based on the current position of the virtual object, a ray is emitted to the last legal position to perform a first ray detection; Based on the first ray detection, a collision surface between the current position of the virtual object and the last legal position is obtained, wherein the collision surface is a positive collision surface or a negative collision surface.

3. The information processing method according to claim 2, characterized in that: After obtaining the collision surface between the current position of the virtual object and the previous legal position, the information processing method further includes: Acquire frontal collision information corresponding to the frontal collision surface and rearward collision information corresponding to the rearward collision surface; Collision screening is performed according to the frontal collision information and the rearward collision information.

4. The information processing method according to claim 3, performing collision screening according to the frontal collision information and the rearward collision information, comprising: Obtaining a collision type of the collision according to the frontal collision information and the rearward collision information; According to the collision type, a first collision among the collisions that does not need to be detected is determined, and collision screening is performed on the first collision.

5. The information processing method according to claim 3, characterized in that: Determining whether the current position of the virtual object is an illegal position includes: Determining whether the positive collision surface corresponds to the negative collision surface and whether the first collision surface among the collision surfaces is a positive collision surface; When the positive collision surface corresponds to the negative collision surface and the first collision surface is a positive collision surface, the current position of the virtual object is a legal position; When the positive collision surface does not correspond to the negative collision surface or the first collision surface is not a positive collision surface, the current position of the virtual object may be an illegal position.

6. The information processing method according to claim 5, characterized in that: When the current position of the virtual object may be an illegal position, the information processing method further includes: According to the collision type of the collision, determining whether the collision is a preset first type collision; When it is determined that the collision is a preset first type of collision, the current position of the virtual object is an illegal position; When it is determined that the collision is not a preset first type collision, a reverse detection is performed on the current position of the virtual object.

7. The information processing method according to claim 6, characterized in that: Performing reverse detection on the current position of the virtual object includes: Based on the current position of the virtual object, a ray is emitted in the opposite direction of the line connecting the current position and the last legal position to perform a second ray detection; A first collision surface in the second ray detection is obtained, and when it is determined that there is an anti-collision surface in the collision surface of the second ray detection, and the anti-collision surface is a collision surface in the collision body corresponding to the unpaired anti-collision surface in the first ray detection, the current position of the virtual object is an illegal position.

8. The information processing method according to any one of claims 2 to 7, characterized in that: Determining whether the collision surface is a positive collision surface or a negative collision surface includes: Acquire collision information obtained through the first ray detection; Obtaining a reverse vector of the ray in the first ray detection, performing a dot product on the reverse vector and a normal vector of the collision surface in the collision information to obtain a dot product result; The collision surface is judged to be a positive collision surface or a negative collision surface according to the dot product result.

9. An information processing device, characterized in that: include: A position acquisition module, used to acquire the current position of a virtual object in the game and the last legal position relative to the current position; wherein, when the virtual object is located inside the model or below the ground in the game scene, the position of the virtual object is an illegal position; when the virtual object is not inside the model or below the ground, the position of the virtual object is a legal position; A ray detection module, used to perform ray detection on the current position and the last legal position, obtain a collision surface obtained by the ray detection, and determine whether the current position of the virtual object is an illegal position based on the collision surface; The position determination module is used to adjust the current position of the virtual object to the last legal position when determining that the current position of the virtual object is an illegal position.

10. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the information processing method according to any one of claims 1 to 8 is implemented.

11. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the information processing method according to any one of claims 1 to 8 by executing the executable instructions.

Citation Information

Patent Citations

  • Collision synchronization method, client, and storage medium

    CN108540454A

  • Method and device for processing virtual model in game

    CN111167120A