Data processing method, electronic device, computer readable medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2026-08-11
AI Technical Summary
[0003]但是,对水体与游戏角色交互过程的模拟还不完整,游戏中的水体与现实世界的差异较大,玩家的游戏体验还有待进一步提升
[0036]This disclosure provides a data processing method, an electronic device executing the data processing method, and a computer-readable medium storing a computer program capable of implementing the data processing method. In this disclosure, when a character enters water and collides with a collision box, the force and direction attribute information of the collision box is assigned to the character to simulate the scenario where the character experiences the force of water flow upon entering the water. While the character is in the water, its position within the collision box can be further determined, and different force information is assigned to the character at different positions, thereby simulating the scenario where different water flows at different locations in the water exert different forces on the character. After determining the force exerted by the water flow, the character's motion state after being affected by the water flow is further determined, thereby simulating the scenario where the character's motion state differs at different positions in the water. This makes the game scene effects, especially the water effects, more realistic, which is beneficial for improving the player's gaming experience.
Smart Images

Figure CN116407830B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a data processing method, an electronic device, and a computer-readable medium. Background Technology
[0002] To enhance the player's gaming experience, not only do game characters and game scenes need to be perfectly integrated, but the game scenes also need to be closer to the real world. Water is an important part of the game scene, and the animated water scenes are becoming increasingly realistic in appearance. Furthermore, the physics collision engine can simulate the interaction between water and game characters.
[0003] However, the simulation of the interaction between water and game characters is not yet complete. The water in the game differs significantly from the real world, and the player's gaming experience needs further improvement. Summary of the Invention
[0004] This disclosure provides a data processing method, an electronic device, and a computer-readable medium.
[0005] In a first aspect, embodiments of this disclosure provide a data processing method, including:
[0006] Determine the character's position information within the collision box corresponding to the water body;
[0007] The force information of the character is determined based on the position information, wherein the force information represents the force exerted by the water flow on the character when the character is in the water body, and the force exerted on the character is different at different positions in the collision box;
[0008] Based on the force information and the character's initial movement state information, the character's current movement state information is determined, wherein the character's movement state information characterizes the character's motion state.
[0009] In some embodiments, the collision box includes multiple nested sub-collision boxes; the step of determining the position information of the character in the collision box corresponding to the water body includes:
[0010] When the character collides with the target sub-collision box, the character's initial movement direction is obtained, wherein the target sub-collision box is any one of the multiple sub-collision boxes, and the character's initial movement direction indicates whether the character enters the target sub-collision box or leaves the target sub-collision box.
[0011] When the initial movement direction of the character indicates that the character enters the target sub-collision box, the position information is determined to be that the character is located between the target sub-collision box and the first adjacent sub-collision box, wherein the target sub-collision box is nested outside the first adjacent sub-collision box and is adjacent to the first adjacent sub-collision box;
[0012] When the initial movement direction of the character indicates that the character leaves the target sub-collision box, the position information is determined to be that the character is located between the target sub-collision box and the second adjacent sub-collision box, wherein the target sub-collision box is nested inside the second adjacent sub-collision box and is adjacent to the second adjacent sub-collision box.
[0013] In some embodiments, the step of determining the force information acting on the character based on the position information includes:
[0014] When the character is located between the target sub-collision box and the first adjacent sub-collision box, the force information of the character is determined according to the force information corresponding to the target sub-collision box.
[0015] When the character is located between the target sub-collision box and the second adjacent sub-collision box, the force information of the character is determined according to the force information corresponding to the second adjacent sub-collision box.
[0016] Wherein, the force corresponding to the target sub-collision box is greater than the force corresponding to the first adjacent sub-collision box, and the force corresponding to the target sub-collision box is less than the force corresponding to the second adjacent sub-collision box.
[0017] In some embodiments, the step of determining the position information of a character in a collision box corresponding to a body of water includes:
[0018] Determine the relative positional relationship between the character and the reference object in the collision box;
[0019] The location information is determined based on the relative positional relationship.
[0020] In some embodiments, the step of determining the relative positional relationship between the character and a reference object in the collision box includes:
[0021] The reference object is controlled to emit a first ray into the collision box;
[0022] When the first ray comes into contact with the character, the distance between the character and the reference object is determined based on the length of the first ray, and the relative positional relationship is obtained.
[0023] In some embodiments, the step of determining the relative positional relationship between the character and a reference object in the collision box includes:
[0024] Control the character to fire a second ray into the collision box;
[0025] When the second ray comes into contact with the reference object, the distance between the character and the reference object is determined based on the length of the second ray, and the relative positional relationship is obtained.
[0026] In some embodiments, the step of determining the force information acting on the character based on the position information includes:
[0027] The force information acting on the character is determined based on the relative positional relationship, wherein the magnitude of the force acting on the character is negatively correlated with the distance between the reference object and the character.
[0028] In some embodiments, the step of determining the position information of a character in a collision box corresponding to a body of water includes:
[0029] When the character collides with the collision box, the initial movement state information of the character is obtained, wherein the movement state information represents the movement direction and movement speed of the character;
[0030] Obtain the control data of the character controlled by the player;
[0031] Based on the character's initial movement state information and the control data, the current position information of the character in the collision box is determined.
[0032] In a second aspect, embodiments of this disclosure provide an electronic device, including:
[0033] One or more processors;
[0034] A memory having stored one or more programs that, when executed by one or more processors, cause the one or more processors to implement the data processing method provided in the first aspect of the present disclosure.
[0035] Thirdly, embodiments of this disclosure provide a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the data processing method provided in the first aspect of embodiments of this disclosure.
[0036] This disclosure provides a data processing method, an electronic device executing the data processing method, and a computer-readable medium storing a computer program capable of implementing the data processing method. In this disclosure, when a character enters water and collides with a collision box, the force and direction attribute information of the collision box is assigned to the character to simulate the scenario where the character experiences the force of water flow upon entering the water. While the character is in the water, its position within the collision box can be further determined, and different force information is assigned to the character at different positions, thereby simulating the scenario where different water flows at different locations in the water exert different forces on the character. After determining the force exerted by the water flow, the character's motion state after being affected by the water flow is further determined, thereby simulating the scenario where the character's motion state differs at different positions in the water. This makes the game scene effects, especially the water effects, more realistic, which is beneficial for improving the player's gaming experience. Attached Figure Description
[0037] The accompanying drawings are provided to further illustrate the embodiments of this disclosure and form part of the specification. They are used together with the embodiments of this disclosure to explain the disclosure and do not constitute a limitation thereof. The above and other features and advantages will become more apparent to those skilled in the art from the detailed description of exemplary embodiments with reference to the accompanying drawings, in which:
[0038] Figure 1 This is a flowchart of a data processing method according to an embodiment of this disclosure;
[0039] Figure 2 This is a flowchart of some steps in another data processing method according to an embodiment of this disclosure;
[0040] Figure 3 This is a schematic diagram of a collision box composed of multiple nested sub-collision boxes in an embodiment of this disclosure;
[0041] Figure 4 This is a flowchart of some steps in another data processing method according to an embodiment of this disclosure;
[0042] Figure 5 This is a flowchart of some steps in another data processing method according to an embodiment of this disclosure;
[0043] Figure 6 This is a block diagram of an electronic device according to an embodiment of the present disclosure. Detailed Implementation
[0044] To enable those skilled in the art to better understand the technical solutions of this disclosure, the data processing methods, electronic devices, and computer-readable media provided in this disclosure will be described in detail below with reference to the accompanying drawings.
[0045] Exemplary embodiments will be described more fully below with reference to the accompanying drawings; however, these exemplary embodiments may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will enable those skilled in the art to fully understand the scope of this disclosure.
[0046] Where there is no conflict, the various embodiments of this disclosure and the features thereof in the embodiments may be combined with each other.
[0047] As used herein, the term “and / or” includes any and all combinations of one or more related enumerated entries.
[0048] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. As used herein, the singular forms “a” and “the” are also intended to include the plural forms unless the context clearly indicates otherwise. It will also be understood that when the terms “comprising” and / or “made of” are used in this specification, the presence of the stated feature, integral, step, operation, element, and / or component is specified, but the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof is not excluded.
[0049] Unless otherwise specified, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and will not be interpreted as having an idealized or overly formal meaning, unless expressly so defined herein.
[0050] Firstly, referring to Figure 1 This disclosure provides a data processing method, including:
[0051] S1. Determine the character's position information in the collision box corresponding to the water body;
[0052] S2. Determine the force information of the character based on the position information, wherein the force information represents the force exerted by the water flow on the character when it is in the water body, and the force exerted on the character is different at different positions in the collision box;
[0053] S3. Based on the force information and the character's initial movement state information, determine the character's current movement state information, wherein the character's movement state information represents the character's motion state.
[0054] In this embodiment of the disclosure, the character can be an object with living attributes currently controlled by the player in the game, such as a human or an animal; or it can be an object without living attributes currently controlled by the player. This embodiment of the disclosure does not impose any special limitations on this.
[0055] In this embodiment of the disclosure, the water body includes, but is not limited to, rivers, lakes, ponds, etc., in the game scene. In some embodiments, water flow is generated in the water body, thereby exerting a force on the character in the water body.
[0056] In this embodiment of the disclosure, the collision box corresponding to the water body is used to detect the relative positional relationship between the character and the water body through collision detection. In some embodiments, the shape of the collision box is consistent with the shape of the water body, and the interior of the collision box corresponds to the interior of the water body. When the character is inside the collision box, it means that the character is in the water body. When the character collides with the collision box, it means that the character enters or leaves the water body. For example, when the character moves from the outside of the collision box to the inside of the collision box and collides with the collision box, it means that the character enters the water body; when the character moves from the inside of the collision box to the outside of the collision box and collides with the collision box, it means that the character leaves the water body.
[0057] In this embodiment of the disclosure, the collision box has a force attribute. In some embodiments, the force attribute of the collision box includes the magnitude and direction of the force. When a character moves from outside the collision box to inside the collision box and collides with the collision box, the force attribute of the collision box is assigned to the character, indicating that the character is subjected to the force of the water flow after entering the water body; when a character moves from inside the collision box to outside the collision box and collides with the collision box, the force attribute of the collision box is removed from the character, indicating that the character is no longer subjected to the force of the water flow after leaving the water body.
[0058] In this embodiment, the force information acting on the character represents the magnitude and direction of the force exerted on the character by the water flow in the water body. In this embodiment, the force acting on the character at different positions within the collision box varies. This can mean that the magnitude of the force acting on the character at different positions differs, or that the direction of the force acting on the character at different positions differs, or that both the magnitude and direction of the force acting on the character at different positions differ. This embodiment does not impose any particular limitation on this. In this embodiment, by assigning different forces to the character at different positions within the collision box through steps S1 and S2, scenarios can be simulated where the magnitude of the water flow varies at different positions within the water body, and consequently, the force exerted by the water flow on the character varies. For example, the magnitude of the water flow varies depending on the shape of the water body at different locations; the water flow is stronger closer to the center and weaker further away from the center.
[0059] In this embodiment, the character's motion state changes after being acted upon by the force of the water flow. This change can be a change in direction, a change in speed, or a simultaneous change in both. This embodiment does not impose any specific limitations on this. In this embodiment, the character's motion state information includes, but is not limited to, the character's direction and speed. Step S3, based on the force information and the character's initial motion state information, determines the character's current motion state, representing the character's motion state after being acted upon by the force of the water flow. The character's initial motion state can be stationary or moving; this embodiment does not impose any specific limitations on this. The change in the character's current motion state relative to its initial motion state after being acted upon by the water flow includes, but is not limited to, an increase or decrease in speed or a change in direction.
[0060] The data processing method provided in this embodiment assigns the force and direction attribute information of the collision box to the character when the character enters the water and collides with the collision box, to simulate the scene where the character is affected by the force of the water flow when entering the water. When the character is in the water, the position of the character in the collision box can be further determined, and different force information is assigned to the character at different positions, thereby simulating the scene where the force applied to the character is different due to the different water flow at different positions in the water. After determining the force of the water flow on the character, the movement state of the character after being affected by the water flow is further determined, thereby simulating the scene where the movement state of the character is different at different positions in the water, making the effect of the game scene, especially the effect of the water in the game scene, more realistic and improving the player's gaming experience.
[0061] In some embodiments, the collision box corresponding to the water body consists of multiple nested sub-collision boxes. When a character collides with any of the sub-collision boxes, the character's position within the collision box can be determined based on the character's movement direction and the position of the sub-collision box that collided with the character.
[0062] Accordingly, in some embodiments, the collision box includes multiple nested sub-collision boxes; see reference Figure 2 The steps to determine the character's position information in the collision box corresponding to the water body include:
[0063] S111. When the character collides with the target sub-collision box, the initial movement direction of the character is obtained, wherein the target sub-collision box is any one of the multiple sub-collision boxes, and the initial movement direction of the character indicates that the character enters the target sub-collision box or leaves the target sub-collision box.
[0064] S112. When the initial movement direction of the character indicates that the character enters the target sub-collision box, the position information is determined to be that the character is located between the target sub-collision box and the first adjacent sub-collision box, wherein the target sub-collision box is nested outside the first adjacent sub-collision box and is adjacent to the first adjacent sub-collision box.
[0065] S113. When the initial movement direction of the character indicates that the character leaves the target sub-collision box, the position information is determined to be that the character is located between the target sub-collision box and the second adjacent sub-collision box, wherein the target sub-collision box is nested inside the second adjacent sub-collision box and is adjacent to the target sub-collision box.
[0066] Figure 3 This is a schematic diagram of a collision box composed of multiple nested sub-collision boxes in an embodiment of this disclosure. It should be noted that... Figure 3 The collision box, composed of multiple nested concentric sub-collision boxes, is merely an illustrative example, and the shape of the collision box is not specifically limited in this embodiment. In some embodiments, the shape of the collision box is consistent with that of the water body, and the shapes of the sub-collision boxes that make up the collision box are also consistent with the shape of the water body. For example, multiple nested sub-collision boxes can be rectangles, triangles, or ellipses of different sizes but the same shape, or they can be irregular shapes of different sizes but the same shape.
[0067] like Figure 3 As shown, the collision box includes nested sub-collision boxes A1, A2, and A3. Sub-collision box A1 is nested outside and adjacent to sub-collision box A2, and sub-collision box A2 is nested outside and adjacent to sub-collision box A3. Correspondingly, sub-collision box A2 is nested inside and adjacent to sub-collision box A1, and sub-collision box A3 is nested inside and adjacent to sub-collision box A2. If a character moves from inside sub-collision box A1 to inside sub-collision box A2 and collides with sub-collision box A2, sub-collision box A2 is the target sub-collision box, sub-collision box A3 is the first adjacent sub-collision box, and sub-collision box A1 is the second adjacent sub-collision box. When a character collides with sub-collision box A2, the character's movement direction can be determined. Based on the character's movement direction and the position of sub-collision box A2 within the collision box, the character's position within the collision box is determined. That is, after the collision, the character enters sub-collision box A2 and is located between sub-collision box A2 and sub-collision box A3. When a character moves from inside sub-collision box A2 into sub-collision box A1 and collides with sub-collision box A2, the character's movement direction can be determined. Based on the character's movement direction and the position of sub-collision box A2 within the collision box, the character's position within the collision box is determined. That is, after the collision, the character enters sub-collision box A1 and is located between sub-collision box A1 and sub-collision box A2.
[0068] In some embodiments, each sub-collision box has a force attribute, and different sub-collision boxes have different force attributes. In some embodiments, the force attributes of a sub-collision box include the magnitude and direction of the force. When a character enters a sub-collision box, the force attribute of that sub-collision box is assigned to the character, so that the character experiences different forces in different sub-collision boxes, indicating that the force experienced by the character is different at different positions within the collision box.
[0069] Accordingly, in some embodiments, reference is made to Figure 2 The step of determining the force information acting on the character based on the location information includes:
[0070] S211. When the character is located between the target sub-collision box and the first adjacent sub-collision box, the force information of the character is determined according to the force information corresponding to the target sub-collision box.
[0071] S212. When the character is located between the target sub-collision box and the second adjacent sub-collision box, the force information of the character is determined according to the force information corresponding to the second adjacent sub-collision box.
[0072] Wherein, the force corresponding to the target sub-collision box is greater than the force corresponding to the first adjacent sub-collision box, and the force corresponding to the target sub-collision box is less than the force corresponding to the second adjacent sub-collision box.
[0073] It should be noted that "a character is located between the target sub-collision box and the first adjacent sub-collision box" means that the character is located within the target sub-collision box; "a character is located between the target sub-collision box and the second adjacent sub-collision box" means that the character is located within the second adjacent sub-collision box. "A character entering the target sub-collision box" includes both colliding with the first adjacent sub-collision box and then leaving the first adjacent sub-collision box to enter the target sub-collision box, and colliding with the target sub-collision box and then entering the target sub-collision box from the second adjacent sub-collision box.
[0074] It should also be noted that the smallest sub-collision box among multiple nested sub-collision boxes, or the center of multiple nested sub-collision boxes, represents the position with the greatest water flow in the water body; the larger the sub-collision box sum, the smaller the corresponding force, indicating that the farther the character is from the position with the greatest water flow in the water body, the smaller the force of the water flow it receives.
[0075] In this embodiment of the disclosure, within any sub-collision box, the character may be subjected to forces of the same direction and magnitude, or the character may be subjected to forces of different directions but the same magnitude at different positions within the sub-collision box. This embodiment of the disclosure does not impose any special limitations on this.
[0076] In some embodiments, a reference object is set in the collision box. The position of the character in the collision box is determined based on the relative positional relationship between the reference object and the character.
[0077] Accordingly, in some embodiments, reference is made to Figure 4 The steps to determine the character's position information in the collision box corresponding to the water body include:
[0078] S121. Determine the relative positional relationship between the character and the reference object in the collision box;
[0079] S122. Determine the position information based on the relative positional relationship.
[0080] In the embodiments of this disclosure, the reference object can be a point, a line, or an object. This disclosure does not impose any particular limitation on this. For example, the reference object may be the center point of the collision box, or the center line of the collision box.
[0081] In this embodiment of the disclosure, the relative positional relationship between the character and the reference object includes the distance between the character and the reference object and / or the angle between the character and the reference object. This embodiment of the disclosure does not impose any special limitations on this.
[0082] In some embodiments, the reference object corresponds to the location of the strongest water flow in the body of water. The greater the distance between the character and the reference object, the smaller the force exerted by the water flow on the character.
[0083] This disclosure does not specifically limit how the relative positional relationship between the character and the reference object in the collision box is determined. In some embodiments, rays are used to determine the relative positional relationship between the character and the reference object.
[0084] It should be noted that, in this embodiment, the ray is a directional line emitted from the starting point, used for target detection. For example, when the ray contacts the target, it can acquire information characterizing what the target is, its attributes, and its motion state, and feed this information back to the starting point. For example, the ray can also carry information characterizing what the starting point is, its attributes, and its motion state; when the ray contacts the target, the target can acquire this information. In this embodiment, when the ray contacts the target, the distance between the target's pre-starting point can also be determined based on the ray.
[0085] In some embodiments, a reference object is used as the starting point, and a first ray is emitted from the reference object. When the first ray contacts any character, the distance between the character and the reference object is determined based on the first ray, and then the relative positional relationship between the character and the reference object is determined.
[0086] Accordingly, in some embodiments, the step of determining the relative positional relationship between the character and a reference object in the collision box includes:
[0087] The reference object is controlled to emit a first ray into the collision box;
[0088] When the first ray comes into contact with the character, the distance between the character and the reference object is determined based on the length of the first ray, and the relative positional relationship is obtained.
[0089] The embodiments disclosed herein do not impose any special limitation on the specific form of the first ray. For example, the first ray may be a mesh-like ray, a parallel ray, or any custom-defined form.
[0090] This disclosure does not specifically limit how the distance between the character and the reference object is determined based on the first ray. In some embodiments, the length of the first ray is fixed when it contacts the character; in this case, the fixed length of the first ray is used as the distance between the character and the manipulated object. In some embodiments, the reference object emits multiple first rays of different lengths; contact of the first ray with the character means that the end of the first ray contacts the character; in this case, the length of the first ray that contacts the character is determined as the distance between the character and the reference object.
[0091] In some embodiments, a character is used as a starting point, and a second ray is emitted from the character. When the second ray contacts a reference object, the distance between the character and the reference object is determined based on the second ray, thereby determining the relative positional relationship between the character and the reference object.
[0092] In some embodiments, the step of determining the relative positional relationship between the character and a reference object in the collision box includes:
[0093] Control the character to fire a second ray into the collision box;
[0094] When the second ray comes into contact with the reference object, the distance between the character and the reference object is determined based on the length of the second ray, and the relative positional relationship is obtained.
[0095] The embodiments disclosed herein do not impose any special limitations on the specific form of the second ray. For example, the second ray can be a mesh-like ray, a parallel ray, or any custom-defined form.
[0096] This disclosure does not specifically limit how the distance between the character and the reference object is determined based on the second ray. In some embodiments, the length of the second ray is fixed when it contacts the reference object; in this case, the fixed length of the second ray is used as the distance between the character and the controlled object. In some embodiments, the character emits multiple second rays of different lengths; contact between the second ray and the reference object means that the end of the second ray contacts the reference object; in this case, the length of the second ray that contacts the controlled object is determined as the distance between the character and the reference object.
[0097] In this embodiment of the disclosure, when a character emits a second ray, it is not necessary for every object in the game scene to emit a ray, thereby saving computing resources and improving computational efficiency.
[0098] In some embodiments, the reference object corresponds to the location of the strongest water flow in the body of water. The greater the distance between the character and the reference object, the smaller the force exerted by the water flow on the character.
[0099] Accordingly, in some embodiments, reference is made to Figure 4 The step of determining the force information acting on the character based on the location information includes:
[0100] S22. Determine the force information of the character based on the relative positional relationship, wherein the magnitude of the force on the character is negatively correlated with the distance between the reference object and the character.
[0101] In some embodiments, when a character enters a collision box, the character's position within the collision box is determined by recording the player's control data.
[0102] Accordingly, in some embodiments, reference is made to Figure 5 The steps to determine the character's position information in the collision box corresponding to the water body include:
[0103] S131. When the character collides with the collision box, the initial movement state information of the character is obtained, wherein the movement state information represents the movement direction and movement speed of the character.
[0104] S132. Obtain the control data of the character controlled by the player;
[0105] S133. Based on the character's initial movement state information and the control data, determine the current position information of the character in the collision box.
[0106] It should be noted that the position information of the character in the collision box determined by steps S131 to S133 can be expressed as the relative positional relationship between the character and the reference object in the collision box, or it can be expressed as the absolute position of the character in the collision box. This embodiment of the disclosure does not impose any special limitations on this.
[0107] In a second aspect, embodiments of this disclosure provide a data processing apparatus, comprising:
[0108] The positioning module is used to determine the character's position information in the collision box corresponding to the water body;
[0109] The force calculation module is used to determine the force information of the character based on the position information, wherein the force information represents the force exerted by the water flow on the character when it is in the water body, and the force exerted on the character is different at different positions in the collision box;
[0110] The motion control module is used to determine the current motion state information of the character based on the force information and the character's initial movement state information, wherein the character's movement state information represents the character's motion state.
[0111] In some embodiments, the collision box includes a plurality of nested sub-collision boxes;
[0112] The positioning module is used to obtain the initial movement direction of the character when the character collides with a target sub-collision box, wherein the target sub-collision box is any one of a plurality of sub-collision boxes, and the initial movement direction of the character indicates that the character enters or leaves the target sub-collision box; when the initial movement direction of the character indicates that the character enters the target sub-collision box, the position information is determined to be that the character is located between the target sub-collision box and a first adjacent sub-collision box, wherein the target sub-collision box is nested outside the first adjacent sub-collision box and is adjacent to the first adjacent sub-collision box; when the initial movement direction of the character indicates that the character leaves the target sub-collision box, the position information is determined to be that the character is located between the target sub-collision box and a second adjacent sub-collision box, wherein the target sub-collision box is nested inside the second adjacent sub-collision box and is adjacent to the second adjacent sub-collision box.
[0113] In some embodiments, the force calculation module is used to determine the force information received by the character based on the force information corresponding to the target sub-collision box when the character is located between the target sub-collision box and the first adjacent sub-collision box; and to determine the force information received by the character based on the force information corresponding to the second adjacent sub-collision box when the character is located between the target sub-collision box and the second adjacent sub-collision box; wherein the force corresponding to the target sub-collision box is greater than the force corresponding to the first adjacent sub-collision box, and the force corresponding to the target sub-collision box is less than the force corresponding to the second adjacent sub-collision box.
[0114] In some embodiments, the positioning module is used to determine the relative positional relationship between the character and a reference object in the collision box; and to determine the position information based on the relative positional relationship.
[0115] In some embodiments, the positioning module is used to control the reference object to emit a first ray into the collision box; when the first ray contacts the character, the distance between the character and the reference object is determined according to the length of the first ray, and the relative positional relationship is obtained.
[0116] In some embodiments, the positioning module is used to control the character to emit a second ray into the collision box; when the second ray contacts the reference object, the distance between the character and the reference object is determined according to the length of the second ray, and the relative positional relationship is obtained.
[0117] In some embodiments, the force calculation module is used to determine the force information of the character based on the relative positional relationship, wherein the magnitude of the force of the character is negatively correlated with the distance between the reference object and the character.
[0118] In some embodiments, the positioning module is used to acquire the initial movement state information of the character when the character collides with the collision box, wherein the movement state information represents the movement direction and movement speed of the character; acquire the control data of the player controlling the character; and determine the current position information of the character in the collision box based on the initial movement state information of the character and the control data.
[0119] Thirdly, referring to Figure 6 This disclosure provides an electronic device, which includes:
[0120] One or more processors 101;
[0121] The memory 102 stores one or more programs, which, when executed by one or more processors, enable the one or more processors to implement the data processing method provided in the first aspect of the embodiments of this disclosure.
[0122] One or more I / O interfaces 103 are connected between the processor and the memory and configured to enable information exchange between the processor and the memory.
[0123] The processor 101 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the memory 102 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I / O interface (read / write interface) 103 is connected between the processor 101 and the memory 102, enabling information exchange between the processor 101 and the memory 102, including but not limited to a data bus (Bus).
[0124] In some embodiments, the processor 101, memory 102, and I / O interface 103 are interconnected via bus 104, and thus connected to other components of the computing device.
[0125] Fourthly, embodiments of this disclosure provide a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the data processing method provided in the first aspect of embodiments of this disclosure.
[0126] It will be understood by those skilled in the art that all or some of the steps, systems, or apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0127] Example embodiments have been disclosed herein, and while specific terminology has been used, it is for illustrative purposes only and should be construed as such, and is not intended to be limiting. In some instances, it will be apparent to those skilled in the art that features, characteristics, and / or elements described in connection with particular embodiments may be used alone, or in combination with features, characteristics, and / or elements described in connection with other embodiments, unless otherwise expressly indicated. Therefore, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of this disclosure as set forth by the appended claims.
Claims
1. A data processing method, comprising: Determine the character's position information within the collision box corresponding to the water body; The force information of the character is determined based on the position information, wherein the force information represents the force exerted by the water flow on the character when the character is in the water body, and the force exerted on the character is different at different positions in the collision box; Based on the force information and the character's initial movement state information, the character's current movement state information is determined, wherein the character's movement state information represents the character's motion state. The collision box includes multiple nested sub-collision boxes; the smallest sub-collision box among the nested sub-collision boxes, or the center of the nested sub-collision boxes, is used to represent the location of the strongest water flow in the water body; the step of determining the position information of the character in the collision box corresponding to the water body includes: When the character collides with the target sub-collision box, the character's initial movement direction is obtained, wherein the target sub-collision box is any one of the multiple sub-collision boxes, and the character's initial movement direction indicates whether the character enters the target sub-collision box or leaves the target sub-collision box. When the initial movement direction of the character indicates that the character enters the target sub-collision box, the position information is determined to be that the character is located between the target sub-collision box and the first adjacent sub-collision box, wherein the target sub-collision box is nested outside the first adjacent sub-collision box and is adjacent to the first adjacent sub-collision box; When the initial movement direction of the character indicates that the character has left the target sub-collision box, the position information is determined to be that the character is located between the target sub-collision box and the second adjacent sub-collision box, wherein the target sub-collision box is nested inside the second adjacent sub-collision box and is adjacent to the second adjacent sub-collision box; wherein the step of determining the force information acting on the character based on the position information includes: When the character is located between the target sub-collision box and the first adjacent sub-collision box, the force information of the character is determined according to the force information corresponding to the target sub-collision box. When the character is located between the target sub-collision box and the second adjacent sub-collision box, the force information of the character is determined according to the force information corresponding to the second adjacent sub-collision box. Wherein, the force corresponding to the target sub-collision box is greater than the force corresponding to the first adjacent sub-collision box, and the force corresponding to the target sub-collision box is less than the force corresponding to the second adjacent sub-collision box.
2. An electronic device, comprising: One or more processors; A memory having stored one or more programs that, when executed by one or more processors, cause the one or more processors to implement the data processing method according to claim 1.
3. A computer-readable medium having a computer program stored thereon, the program being executed by a processor to implement the data processing method according to claim 1.