Role control method and device, electronic equipment, and computer readable medium
By simulating the dynamic properties of target objects in a fluid space within the game, the force and movement properties of the character are determined, thus solving the problem of the difference between the game scene and the real world and enhancing the immersive experience of the game.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI MIHAYOULIYUE TECH CO LTD
- Filing Date
- 2021-12-31
- Publication Date
- 2026-05-19
AI Technical Summary
In existing games, the interaction between game scenes and the real world differs significantly, resulting in a less immersive gaming experience.
By simulating the dynamic properties of a target object in a fluid space, the force information of a character in the fluid space is determined. Based on the force information and the character's initial movement property information, the target's movement property information is calculated, thus realizing the simulation of the interaction between objects in the fluid space.
It improves the realism of fluid space effects in game scenes, enhancing the player's immersive gaming experience.
Smart Images

Figure CN116407841B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a method for controlling a role, a device for controlling a role, an electronic device, and a computer-readable medium. Background Technology
[0002] With the rapid development of the gaming industry, gamers have increasingly higher demands for gaming experiences. To provide gamers with an immersive gaming experience, it is not only necessary for game characters and game scenes to perfectly match, but also for game scenes to closely resemble the real world. The closeness of game scenes to the real world is reflected not only in the realism of the game scene graphics, but also in the degree to which the interaction process between characters and the game scene is similar to the same interaction process in the real world.
[0003] However, some game scenes still differ significantly from the real world. Summary of the Invention
[0004] This disclosure provides a method for controlling a character, a device for controlling a character, an electronic device, and a computer-readable medium.
[0005] In a first aspect, embodiments of this disclosure provide a method for controlling a role, including:
[0006] The force information of the character in the fluid space is determined based on the dynamic attribute information of the target object in the fluid space, wherein the force information represents the force exerted by the target object on the character through the fluid space, and the dynamic attribute information of the target object represents the motion state of the target object.
[0007] Based on the force information and the character's initial movement attribute information, the character's target movement attribute information is determined.
[0008] In some embodiments, prior to the step of determining the force information of a character in the fluid space based on the dynamic attribute information of a target object in the fluid space, the control method further includes:
[0009] The dynamic attribute information of the target object is obtained, wherein the dynamic attribute information includes the moving speed and moving direction of the target object.
[0010] In some embodiments, the step of obtaining the dynamic attribute information of the target object includes:
[0011] The target object is controlled to emit a first ray of a first preset length into the fluid space, wherein the first ray carries information characterizing the moving speed and moving direction of the target object;
[0012] When the first ray comes into contact with the character, the movement speed and direction of the target object are determined based on the first ray.
[0013] In some embodiments, the step of obtaining the dynamic attribute information of the target object includes:
[0014] Control the character to emit a second ray of a second preset length into the fluid space;
[0015] When the second ray comes into contact with the target object, it feeds back the target object's movement speed and direction to the character.
[0016] In some embodiments, prior to the step of determining the force information of a character in the fluid space based on the dynamic attribute information of a target object in the fluid space, the control method further includes:
[0017] Determine the force application information of at least one component of the target object as the dynamic attribute information of the target object, wherein one component corresponds to a region in the fluid space, and the force application information of the component characterizes the force applied by the target object to the region corresponding to the component.
[0018] The steps for determining the force information of a character in the fluid space based on the dynamic attribute information of a target object in the fluid space include:
[0019] The force information is determined based on the force information corresponding to the target area, wherein the target area is the area where the character is located in the fluid space.
[0020] In some embodiments, the step of determining the force information based on the applied force information corresponding to the target area includes:
[0021] The target object is controlled to emit a third ray of a third predetermined length into the fluid space, wherein the third ray carries force information of the corresponding component.
[0022] When any of the third rays comes into contact with the character, the force information is determined based on the force information corresponding to the target area, wherein the target area is the area corresponding to the component of the third ray that comes into contact with the character.
[0023] In some embodiments, the step of determining the force information based on the applied force information corresponding to the target area includes:
[0024] Control the character to emit a fourth ray of a fourth preset length into the fluid space;
[0025] When the fourth ray comes into contact with the target object, the force information is determined according to the force information corresponding to the target area, wherein the target area is the area corresponding to the component that the fourth ray comes into contact with.
[0026] In some embodiments, the step of determining force information of at least one component of the target object includes:
[0027] Based on the current animation state information of the target object, the force application information of each component is determined.
[0028] In some embodiments, the step of determining force information of at least one component of the target object includes:
[0029] Obtain the collision box corresponding to each of the components, wherein the collision box is used to store the force information of the corresponding component;
[0030] The force information of each component is determined based on each of the collision boxes.
[0031] In some embodiments, the step of determining the force information of a character in the fluid space based on the dynamic attribute information of a target object in the fluid space includes:
[0032] Based on the dynamic attribute information of the target object, determine the magnitude and direction of the force exerted by the target object on the character through the fluid space;
[0033] Determine the delay duration of the force exerted by the target object on the character through the fluid space, wherein the delay duration characterizes the time during which the force exerted by the target object on the character through the fluid space acts on the character.
[0034] In some embodiments, the step of determining the target movement attribute information of the character based on the force information and the character's initial movement attribute information includes:
[0035] Based on the magnitude and direction of the force exerted on the character by the target object through the fluid space and the delay duration, the movement attribute information of the character after the delay duration is determined, and the target movement attribute information is obtained.
[0036] In some embodiments, the step of determining the force information of a character in the fluid space based on the dynamic attribute information of a target object in the fluid space further includes:
[0037] The initial force information is determined based on the dynamic attribute information of the target object;
[0038] Based on the dynamic attribute information of the target object, the initial movement attribute information of the character, and the distance between the target object and the character, the attenuation ratio is determined, wherein the attenuation ratio characterizes the attenuation effect of the fluid space on the force.
[0039] The force information of the character is determined based on the initial force information and the attenuation ratio.
[0040] In some embodiments, the dynamic attribute information of the target object includes the target object's movement speed and direction of movement; the step of determining the force information of the character in the fluid space based on the dynamic attribute information of the target object in the fluid space includes:
[0041] Based on the target object's moving speed and direction, the force exerted by the target object on the character through the fluid space is determined, and the force information is obtained.
[0042] In some embodiments, the step of determining the force information of a character in the fluid space based on the dynamic attribute information of a target object in the fluid space includes:
[0043] Based on the dynamic attribute information of the target object, the flow attribute information of the first fluid in the fluid space is determined, wherein the flow attribute information of the first fluid characterizes the flow state of the first fluid.
[0044] Based on the flow property information of the first fluid, the force information of the character is determined, wherein the force information of the character represents the force exerted on the character by the first fluid.
[0045] In some embodiments, the step of determining the force information of a character in the fluid space based on the dynamic attribute information of a target object in the fluid space includes:
[0046] Based on the dynamic attribute information of the target object and the initial flow attribute information of the second fluid in the fluid space, the target flow attribute information of the second fluid is determined;
[0047] Based on the target flow property information of the second fluid, the force information of the character is determined, wherein the force information of the character represents the force exerted on the character by the second fluid.
[0048] Secondly, embodiments of this disclosure provide a control device for a role, comprising:
[0049] The force analysis module is used to determine the force information of the character in the fluid space based on the dynamic attribute information of the target object in the fluid space. The force information represents the force exerted by the target object on the character through the fluid space, and the dynamic attribute information of the target object represents the motion state of the target object.
[0050] The motion control module is used to determine the target movement attribute information of the character based on the force information and the character's initial movement attribute information.
[0051] Thirdly, embodiments of this disclosure provide an electronic device, including:
[0052] One or more processors;
[0053] 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 control method for a role provided in the first aspect of the present disclosure.
[0054] Fourthly, embodiments of this disclosure provide a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the role control method provided in the first aspect of embodiments of this disclosure.
[0055] In this embodiment of the disclosure, the force information of the character affected by the target object in the fluid space is determined based on the dynamic attribute information of the target object in the fluid space, and the target movement attribute information of the character after being affected by the target object is determined based on the force information of the character and the initial movement attribute information of the character. Thus, the motion state of the character after being affected by the target object is determined, realizing the simulation of the scene where objects in the fluid space can interact through the fluid space. This makes the effect of the game scene, especially the effect of the fluid space in the game scene, more realistic and is conducive to providing players with an immersive game experience. Attached Figure Description
[0056] 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:
[0057] Figure 1 This is a flowchart of a method for controlling a role in an embodiment of this disclosure;
[0058] Figure 2 This is a flowchart of another control method for a role in this disclosure embodiment;
[0059] Figure 3 This is a schematic diagram of the components of a target object in an embodiment of this disclosure;
[0060] Figure 4 This is a flowchart of another method for controlling a role in this disclosure embodiment;
[0061] Figure 5 This is a block diagram of the control device for a role in an embodiment of this disclosure;
[0062] Figure 6 This is a block diagram of an electronic device according to an embodiment of the present disclosure. Detailed Implementation
[0063] To enable those skilled in the art to better understand the technical solutions of this disclosure, the control method, control device, electronic equipment, and computer-readable medium of the role provided in this disclosure will be described in detail below with reference to the accompanying drawings.
[0064] 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.
[0065] Where there is no conflict, the various embodiments of this disclosure and the features thereof in the embodiments may be combined with each other.
[0066] As used herein, the term “and / or” includes any and all combinations of one or more related enumerated entries.
[0067] 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.
[0068] 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.
[0069] Firstly, referring to Figure 1 This disclosure provides a method for controlling a role, including:
[0070] S1. Determine the force information of the character in the fluid space based on the dynamic attribute information of the target object in the fluid space, wherein the force information represents the force exerted by the target object on the character through the fluid space, and the dynamic attribute information of the target object represents the motion state of the target object.
[0071] S2. Based on the force information and the character's initial movement attribute information, determine the character's target movement attribute information.
[0072] 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.
[0073] In this embodiment, the target object can be a living object such as a character or animal that is part of the game scene, or it can be a non-living object that is part of the game scene, such as a whale or a ship in water. The target object can also be a living object or a non-living object controlled by other players, such as a character or animal. This embodiment does not impose any special limitations on this.
[0074] In this embodiment of the disclosure, the fluid space may include a body of water, such as a river, lake, or pond in a game scene, in which the target object and character can move; the fluid space may also include the atmosphere, in which the target object and character can float or fly. This embodiment of the disclosure does not impose any special limitations on this.
[0075] In this embodiment, the dynamic attribute information of the target object can characterize the motion state of the target object in the fluid space. In some embodiments, the motion state of the target object in the fluid space includes the movement of the target object in the fluid space, and the dynamic attribute information of the target object includes, but is not limited to, the direction of movement and the speed of movement. In some embodiments, the motion state of the target object in the fluid space includes the actions of the components of the target object itself. For example, if the target object is a whale, the whale's motion attributes include the swaying of its fins, tail, and other components. In some embodiments, the motion state of the target object includes both the movement of the target object in the fluid space and the actions of its components. This embodiment does not impose any special limitations on this.
[0076] In this embodiment, the target object exerts a force on the character through the fluid space. This means that the target object moves within the fluid space, or the movement of a component of the target object acts on the fluid space, and the force is transmitted to the character through the fluid space. The force information of the character represents the magnitude and direction of the force acting on the character. After the character is subjected to the force of the target object through the fluid space, its motion state will change. The change in the character's motion state can be a change in the direction of movement, a change in the speed of movement, or a change in both the direction of movement and the speed of movement simultaneously. This embodiment does not impose any special limitations on this. In this embodiment, the character's initial motion attribute information represents the character's initial motion state, and the character's target motion attribute information represents the character's motion state after being acted upon by the target object. The character's motion attribute information includes, but is not limited to, the character's direction of movement and speed of movement. The character's initial motion state can be stationary or moving; this embodiment does not impose any special limitations on this. The change in the character's motion state relative to its initial motion state after being affected by the target object includes, but is not limited to, an increase or decrease in the speed of movement and a change in the direction of movement.
[0077] Taking a water body as the fluid space and a ship as the target object as an example, when the ship travels in the water, it transmits force to the player-controlled character by squeezing the water. When the player-controlled character is initially stationary in the water, it will move as the ship squeezes the water; when the player-controlled character is initially swimming in the water, the force exerted by the ship squeezing the water will cause the character's movement speed to increase or decrease; when there is an angle between the character's movement direction and the ship's movement direction, the character's movement direction will also change. In this embodiment, by executing step S1, the force information of the character is determined based on the dynamic attribute information representing the ship's motion state, simulating the force exerted on the character by the ship squeezing the water; by executing step S2, the target movement attribute information of the character is determined based on the character's force information and initial movement attribute information, simulating the change in the character's movement speed, direction, and other motion states after being affected by the ship's movement. Steps S1 and S2 simulate the scenario where the movement of a ship in the water affects the character in the water.
[0078] The character control method provided in this disclosure determines the force information of the character affected by the target object in the fluid space based on the dynamic attribute information of the target object in the fluid space, and determines the target movement attribute information of the character after being affected by the target object based on the force information of the character and the initial movement attribute information of the character, thereby determining the movement state of the character after being affected by the target object. This realizes the simulation of the scene where objects in the fluid space can interact through the fluid space, making the effect of the game scene, especially the effect of the fluid space in the game scene, more realistic and conducive to providing players with an immersive game experience.
[0079] In some embodiments, by acquiring the target object's movement speed and direction as the target object's dynamic attribute information, and determining the force applied to the character through the fluid space based on the target object's movement speed and direction, the simulation of the target object's movement affecting the character through the fluid space is realized.
[0080] Accordingly, in some embodiments, reference is made to Figure 2 Before the step of determining the force information of the character in the fluid space based on the dynamic attribute information of the target object in the fluid space, the control method further includes:
[0081] S3. Obtain the dynamic attribute information of the target object, wherein the dynamic attribute information includes the moving speed and moving direction of the target object.
[0082] This disclosure does not specifically limit how the dynamic attribute information of the target object is obtained. In this disclosure, the target object can be deterministic; for example, there may be only one target object in the fluid space, and all objects in the fluid space will be subject to the force of this target object. In this case, the movement speed and direction of the target object can be determined based on the real-time loaded information of the target object.
[0083] In this embodiment of the disclosure, the target object can also be dynamically changing. For example, there may be multiple objects in the fluid space that can exert force on a character, and each object only exerts force on characters within a certain range around it. As the target object and / or the character moves, the object exerting the force on the character will change, that is, the object acting as the target object will change; or, the target object only exerts force on characters within a certain range around it. As the target object and / or the character moves, the character only experiences the force from the target object when the distance between the character and the target object is less than a preset threshold. The force exerted on the character by the target object will go through a process of going from zero to one or from one to zero. In this case, the target object is first detected, and then the movement speed and direction of the detected target object are obtained.
[0084] This disclosure does not impose special limitations on how to detect a target object and determine its moving speed and direction when the target object is dynamically changing. In some embodiments, ray detection is used to obtain the target object's moving speed and direction.
[0085] 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. Alternatively, 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, the ray can be of finite or infinite length; this embodiment does not impose any special limitation on this.
[0086] In some embodiments, the target object is used as the starting point, and a first ray is emitted from the target object, carrying the dynamic attribute information of the target object. When the first ray comes into contact with any character, it indicates that the character will be affected by the force of the target object. Based on the dynamic attribute information of the target object carried in the first ray, the movement speed and direction of the target object can be determined, and thus the force information of the character can be determined.
[0087] Accordingly, in some embodiments, the step of obtaining the dynamic attribute information of the target object includes:
[0088] The target object is controlled to emit a first ray of a first preset length into the fluid space, wherein the first ray carries information characterizing the moving speed and moving direction of the target object;
[0089] When the first ray comes into contact with the character, the movement speed and direction of the target object are determined based on the first ray.
[0090] 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.
[0091] In some embodiments, the first preset length of the first ray is equal to a preset threshold, indicating that the target object only exerts a force on a character whose distance from it is less than the preset threshold. For example, when a character moves to a position where the distance from the target object is less than or equal to the preset threshold, or when the target object moves to a position where the distance from the character is less than or equal to the preset threshold, the first ray emitted by the target object will come into contact with the character. At this time, the movement speed and direction of the target object can be determined based on the first ray, thereby determining the force information on the character.
[0092] It should be noted that when multiple objects exist in the game scene, each object emits a first ray of a certain length. The object that emits the first ray that comes into contact with the character is the target object, indicating that the character is subjected to a force from that object. In this embodiment, the lengths of the first rays emitted by different objects can be the same or different. This embodiment does not impose any special limitations on this. In some embodiments, the different lengths of the first rays emitted by different objects indicate that the range of the force transmitted by different objects through the fluid space is different, thus making it closer to reality.
[0093] In some embodiments, the character is taken as the starting point, and a second ray is emitted from the character. When the second ray comes into contact with any object in the game scene, it means that the character will be affected by the force exerted by the object through the fluid space. The object is the target object. When the second ray comes into contact with the target object, it can obtain and feed back the dynamic attribute information of the target object, thereby determining the movement speed and direction of the target object, and then determining the force information of the character.
[0094] Accordingly, in some embodiments, the step of obtaining the dynamic attribute information of the target object includes:
[0095] Control the character to emit a second ray of a second preset length into the fluid space;
[0096] When the second ray comes into contact with the target object, it feeds back the target object's movement speed and direction to the character.
[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] 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.
[0099] In some embodiments, the second preset length of the second ray is equal to a preset threshold, indicating that the character will be subjected to a force from the target object when the distance between the character and the target object is less than or equal to the preset threshold. For example, when the character moves to a position where the distance between the character and the target object is less than or equal to the preset threshold, or when the target object moves to a position where the distance between the character and the character is less than or equal to the preset threshold, the second ray emitted by the character will come into contact with the target object. At this time, the movement speed and direction of the target object can be determined based on the feedback information, thereby determining the force information of the character.
[0100] In some embodiments, information about the force exerted on the fluid space by the target object when it moves or performs an action is preset and stored. By obtaining the preset force information, the force information of the character can be determined, thereby realizing the simulation of the influence of the target object on the character through the fluid space when it moves or performs an action.
[0101] In some embodiments, the target object can be divided into at least one component, and when the target object is in a fluid space, different components correspond to different regions in the fluid space. In some embodiments, the components have different shapes, different actions, and different forces exerted by each component on its corresponding region; when the target object moves in different directions, the forces exerted by each component on its corresponding region also differ. Figure 3 As shown, the fluid space is water, and the target object is a whale. The whale is divided into nine parts, each exerting a different force on the water. Even within the same part, different movements exert different forces on the water; for example, the force exerted on the water differs depending on whether the fins swing forward or backward. By pre-setting and storing the forces exerted by each part on its corresponding area, the force information of the character in different areas of the fluid space can be determined. This simulates the influence of different parts of the target object on the character through the fluid space.
[0102] Accordingly, in some embodiments, reference is made to Figure 4 Before the step of determining the force information of the character in the fluid space based on the dynamic attribute information of the target object in the fluid space, the control method further includes:
[0103] S4. Determine the force application information of at least one component of the target object as the dynamic attribute information of the target object, wherein one component corresponds to a region in the fluid space, and the force application information of the component characterizes the force applied by the target object to the region corresponding to the component.
[0104] The steps for determining the force information of a character in the fluid space based on the dynamic attribute information of a target object in the fluid space include:
[0105] S12. Determine the force information based on the force information corresponding to the target area, wherein the target area is the area where the role is located in the fluid space.
[0106] This disclosure does not impose any special limitations on the force application information. For example, the force application information includes the direction and magnitude of the force applied by the component to the character in the corresponding area. In this disclosure, the force application information of different components may be the same or different; when the target object moves in different directions, the force application information of different components may be the same or different; the force application information corresponding to different actions of the same component may be the same or different. This disclosure does not impose any special limitations in this regard.
[0107] In some embodiments, the target object is divided into at least one component, and the force information of different components is different, the force information of different components is also different when the target object moves in different directions, and the force information corresponding to different actions of the same component can also be different, thereby making it more realistic and improving the player's gaming experience.
[0108] In some embodiments, each component of the target object is taken as a starting point, and a third ray is emitted from each component of the target object. The third ray carries the force information of the corresponding component. When the third ray comes into contact with any character, it indicates that the character is located in the region of the fluid space corresponding to the component, and the character will be affected by the force of the component. The force information of the character can be determined based on the force information of the component carried in the third ray.
[0109] Accordingly, in some embodiments, the step of determining the force information based on the applied force information corresponding to the target area includes:
[0110] The target object is controlled to emit a third ray of a third predetermined length into the fluid space, wherein the third ray carries force information of the corresponding component.
[0111] When any of the third rays comes into contact with the character, the force information is determined based on the force information corresponding to the target area, wherein the target area is the area corresponding to the component of the third ray that comes into contact with the character.
[0112] The embodiments disclosed herein do not impose any special limitations on the specific form of the third ray. For example, the third ray can be a mesh-like ray, a parallel ray, or any custom-defined form.
[0113] In some embodiments, the third preset length of the third ray is equal to a preset threshold, indicating that the components of the target object only exert force on elements within a distance of the preset threshold. The lengths of the third rays emitted by different components of the target object may be the same or different, indicating that the range of the force exerted by different components of the target object through the fluid space may be the same or different. This disclosure does not impose any special limitations on this aspect.
[0114] In some embodiments, a character is taken as the starting point, and a fourth ray is emitted from the character. When the fourth ray comes into contact with any component of the target object, it indicates that the character will be affected by the force exerted by that component through the fluid space. When the fourth ray comes into contact with the component, the force information of that component can be obtained, thereby determining the force information of the character.
[0115] Accordingly, in some embodiments, the step of determining the force information based on the applied force information corresponding to the target area includes:
[0116] Control the character to emit a fourth ray of a fourth preset length into the fluid space;
[0117] When the fourth ray comes into contact with the target object, the force information is determined according to the force information corresponding to the target area, wherein the target area is the area corresponding to the component that the fourth ray comes into contact with.
[0118] In this embodiment of the disclosure, when a character emits a fourth ray, it is not necessary for every component of every object in the game scene to emit a ray, thereby saving computing resources and improving computational efficiency.
[0119] The embodiments disclosed herein do not impose any special limitations on the specific form of the fourth ray. For example, the fourth ray can be a mesh ray, a parallel ray, or any custom-defined form.
[0120] In some embodiments, the fourth preset length of the fourth ray is equal to a preset threshold, indicating that when the distance between the character and the component of the target object is less than or equal to the preset threshold, the character will be subjected to the force of the component of the target object.
[0121] In some embodiments, the force application information is stored in text form or in the form of animation. This disclosure does not impose any particular limitation on this. When the force application information is stored in the form of animation, the force application information can be determined based on the animation state.
[0122] Accordingly, in some embodiments, the step of determining the force information of at least one component of the target object includes: determining the force information of each of the components based on the current animation state information of the target object.
[0123] In this embodiment of the disclosure, the motion state of the target object is represented by the animation of the target object in a game scene, and the animation state information refers to the information corresponding to the animation of the target object. In this embodiment of the disclosure, the force application information of each component of the target object is stored in the animation state information, and the force application information of each component can be determined based on the animation state information.
[0124] In some embodiments, collision boxes are configured for each component of the target object. The collision boxes are used to store the force information of the corresponding component. During game execution, the force information of the component can be determined by obtaining the collision box corresponding to the component.
[0125] Accordingly, the step of determining the force information of at least one component of the target object includes: obtaining a collision box corresponding to each component, wherein the collision box is used to store the force information of the corresponding component; and determining the force information of each component based on each collision box.
[0126] In some embodiments, by acquiring the collision boxes corresponding to each component, the force information of each component is determined, and then each component of the target object emits a third ray carrying the force information into the fluid space.
[0127] In some embodiments, a character fires a fourth ray into the fluid space. When the fourth ray contacts any component, it triggers the collision box corresponding to that component and obtains the force information stored in the collision box.
[0128] In some embodiments, the movement of a target object in a fluid space or the action of components of the target object acts on the fluid space and thus exerts a force on the character, which can be applied to the character in real time. For example, in a scenario simulating a target object and a character being sufficiently close, the character's motion state in the fluid space changes in real time as the target object moves in the fluid space. Taking a fluid space as water and a target object as a ship as an example, when the ship travels in the water, the motion state of a character sufficiently close to the ship changes in real time as the ship moves. For example, in a scenario simulating a fluid space where the speed of force transmission is sufficiently fast, the character's motion state in the fluid space changes in real time as the target object moves in the fluid space.
[0129] In some embodiments, the movement of a target object in a fluid space or the action of a component of the target object acts on the fluid space and thus exerts a force on the character. This force acts on the character after a certain time delay, simulating the transmission process of force in the fluid space. For example, taking a body of water as the fluid space and a ship as the target object, when the ship travels in the water, it will cause waves or currents. The waves or currents will only act on the character when they are transmitted to it.
[0130] Accordingly, in some embodiments, the step of determining the force information of a character in the fluid space based on the dynamic attribute information of a target object in the fluid space includes: determining the magnitude and direction of the force exerted by the target object on the character through the fluid space based on the dynamic attribute information of the target object; and determining the delay duration of the force exerted by the target object on the character through the fluid space, wherein the delay duration characterizes the time during which the force exerted by the target object on the character through the fluid space acts on the character.
[0131] In this embodiment, the delay time of the force applied by the target object to the character through the fluid space is used to simulate the transmission process of force in the fluid space. This makes the interaction between the object and the character in the fluid space more realistic, which is beneficial to improving the game effect and experience.
[0132] In some embodiments, given the magnitude and direction of the force exerted on the character by the target object through the fluid space, and the delay duration of the force exerted on the character by the target object through the fluid space, the target movement attribute information of the character determined based on the force information and the character's initial movement attribute information is movement attribute information characterizing the character's motion state after the delay duration.
[0133] Accordingly, the step of determining the target movement attribute information of the character based on the force information and the character's initial movement attribute information includes: determining the character's movement attribute information after the delay time based on the magnitude and direction of the force applied to the character by the target object through the fluid space and the delay time, thereby obtaining the target movement attribute information.
[0134] In this embodiment, the transmission process of force in fluid space is demonstrated by changing the character's motion state after a delay. This makes the interaction between objects and the character in fluid space more realistic, thus improving the game's effects and experience.
[0135] In some embodiments, the attenuation effect of force transmission in a fluid space is simulated. For example, taking a body of water as the fluid space and a ship as the target object, when the ship is traveling in the water, the farther the character is from the ship, the smaller the force it experiences; the closer the character is to the ship, the greater the force it experiences.
[0136] Accordingly, in some embodiments, the step of determining the force information of the character in the fluid space based on the dynamic attribute information of the target object in the fluid space further includes:
[0137] The initial force information is determined based on the dynamic attribute information of the target object;
[0138] Based on the dynamic attribute information of the target object, the initial movement attribute information of the character, and the distance between the target object and the character, the attenuation ratio is determined, wherein the attenuation ratio characterizes the attenuation effect of the fluid space on the force.
[0139] The force information of the character is determined based on the initial force information and the attenuation ratio.
[0140] In this embodiment of the disclosure, the initial force information is the force directly applied to the fluid by the target object, which is equivalent to the force experienced by the character when the force transmission attenuation effect in the fluid space is not considered, or when the distance between the character and the target object is close enough.
[0141] In this embodiment of the disclosure, the attenuation ratio represents the proportion by which the force is attenuated when it is transmitted to the character in the fluid space, compared to the initial force information. The attenuation ratio is positively correlated with the distance between the character and the target object.
[0142] In this embodiment of the disclosure, by simulating the attenuation effect of force transmission in the fluid space through the attenuation ratio, the interaction process between objects and characters in the fluid space can be made more realistic, which is beneficial to improving the game effect and experience.
[0143] This disclosure does not impose any special limitations on the process of determining the force information of the character based on the dynamic attribute information of the target object.
[0144] In some embodiments, in a scenario simulating the interaction between an object and a character in a fluid space, the force exerted by the target object on the fluid space as it moves directly acts on the character, without considering the influence of the fluid within the fluid space. In this scenario, the force information on the character is directly calculated based on the dynamic attributes of the target object, such as its movement speed and direction.
[0145] Accordingly, the dynamic attribute information of the target object includes the target object's movement speed and direction of movement; the step of determining the force information of the character in the fluid space based on the dynamic attribute information of the target object in the fluid space includes:
[0146] Based on the target object's moving speed and direction, the force exerted by the target object on the character through the fluid space is determined, and the force information is obtained.
[0147] This disclosure does not specifically limit how the force information of the character is determined based on the moving speed and direction of the target object. In some embodiments, the force on the character is determined based on the moving speed and direction of the target object using actual physical calculations such as fluid dynamics. In some embodiments, the force on the character is determined based on the moving speed and direction of the target object using a predefined transformation formula, wherein the predefined transformation formula is a simplification and approximation of physical calculations such as fluid dynamics, which can save computing resources and improve efficiency. In some embodiments, the force on the character is determined based on the moving speed and direction of the target object using a preset speed-force mapping relationship.
[0148] It should be noted that in scenarios where objects and characters interact in a simulated fluid space, setting the force exerted by the target object on the fluid space as it moves directly acts on the character, without considering the influence of the fluid in the fluid space, simplifies the calculation process of the force information of the character, thereby improving the game's running efficiency and reducing development difficulty.
[0149] In some embodiments, in a scenario simulating the interaction between an object and a character in a fluid space, the process of a target object applying force to a character through the fluid space includes: the target character moving and applying force to the fluid in the fluid space, causing a change in the flow state of the fluid in the fluid space; the fluid with the changed flow state acting on the character, thus causing the force generated by the movement of the target character to ultimately act on the character. In this scenario, when determining the force information of the character in the fluid space based on the dynamic attribute information of the target object in the fluid space, it is necessary to first determine the effect of the target object on the flow state of the fluid in the fluid space, and then determine the force information of the character based on the flow state of the fluid.
[0150] Accordingly, the step of determining the force information of the character in the fluid space based on the dynamic attribute information of the target object in the fluid space includes:
[0151] Based on the dynamic attribute information of the target object, the flow attribute information of the first fluid in the fluid space is determined, wherein the flow attribute information of the first fluid characterizes the flow state of the first fluid.
[0152] Based on the flow property information of the first fluid, the force information of the character is determined, wherein the force information of the character represents the force exerted on the character by the first fluid.
[0153] It should be noted that in scenarios simulating the interaction between objects and characters in a fluid space, setting the target character to move and apply force to the fluid in the fluid space, causing a change in the flow state of the fluid in the fluid space, and the fluid with the changed flow state acting on the character, so that the force generated by the target character's movement ultimately acts on the character, can make the interaction between objects and characters in the fluid space closer to the real world, which is conducive to improving the game effect and game experience.
[0154] In some embodiments, in a scenario simulating the interaction between an object and a character in a fluid space, the fluid in the fluid space is set to have an initial flow state. The target character moves and applies a force to the fluid in the fluid space, causing a change in the flow state of the fluid. The fluid with the changed flow state acts on the character, so that the force generated by the target character's movement ultimately acts on the character. In this scenario, when determining the force information of the character in the fluid space based on the dynamic attribute information of the target object in the fluid space, it is necessary to consider the initial flow state of the fluid, determine the change in the flow state of the fluid caused by the movement of the target object, and then determine the force information of the character based on the changed flow state of the fluid.
[0155] Accordingly, the step of determining the force information of the character in the fluid space based on the dynamic attribute information of the target object in the fluid space includes:
[0156] Based on the dynamic attribute information of the target object and the initial flow attribute information of the second fluid in the fluid space, the target flow attribute information of the second fluid is determined;
[0157] Based on the target flow property information of the second fluid, the force information of the character is determined, wherein the force information of the character represents the force exerted on the character by the second fluid.
[0158] It should be noted that in scenarios simulating the interaction between objects and characters in a fluid space, setting the target character to move and apply force to the fluid in the fluid space, causing a change in the flow state of the fluid in the fluid space, and the fluid with the changed flow state acting on the character, so that the force generated by the target character's movement ultimately acts on the character, can make the interaction between objects and characters in the fluid space closer to the real world, which is conducive to improving the game effect and game experience.
[0159] Secondly, referring to Figure 5 This disclosure provides a control device for a role, including:
[0160] The force analysis module 101 is used to determine the force information of the character in the fluid space based on the dynamic attribute information of the target object in the fluid space, wherein the force information represents the force exerted by the target object on the character through the fluid space, and the dynamic attribute information of the target object represents the motion state of the target object.
[0161] The motion control module 102 is used to determine the target movement attribute information of the character based on the force information and the character's initial movement attribute information.
[0162] In some embodiments, the control device further includes a data acquisition module for acquiring dynamic attribute information of the target object, wherein the dynamic attribute information includes the moving speed and moving direction of the target object.
[0163] In some embodiments, the data acquisition module is used to control the target object to emit a first ray of a first preset length into the fluid space, wherein the first ray carries information characterizing the moving speed and moving direction of the target object; when the first ray contacts the target object, the moving speed and moving direction of the target object are determined based on the first ray.
[0164] In some embodiments, the data acquisition module is used to control the character to emit a second ray of a second preset length into the fluid space; when the second ray contacts the target object, it feeds back to the character the movement speed and direction of the target object.
[0165] In some embodiments, the data acquisition module is used to determine the force information of at least one component of the target object as the dynamic attribute information of the target object, wherein one component corresponds to a region in the fluid space, and the force information of the component characterizes the force applied by the target object to the region corresponding to the component.
[0166] The force analysis module is used to determine the force information based on the force information corresponding to the target area, wherein the target area is the area where the role is located in the fluid space.
[0167] In some embodiments, the force analysis module is used to control each component of the target object to emit a third ray of a third preset length into the fluid space, wherein the third ray carries force information of the corresponding component; when any of the third rays contacts the character, the force information is determined according to the force information corresponding to the target area, wherein the target area is the area corresponding to the component that emitted the third ray that contacted the character.
[0168] In some embodiments, the force analysis module is used to control the character to emit a fourth ray of a fourth preset length into the fluid space; when the fourth ray contacts the target object, the force information is determined according to the force information corresponding to the target area, wherein the target area is the area corresponding to the component contacted by the fourth ray.
[0169] In some embodiments, the data acquisition module is used to determine the force application information of each of the components based on the current animation state information of the target object.
[0170] In some embodiments, the data acquisition module is used to acquire collision boxes corresponding to each of the components, wherein the collision boxes are used to store force information of the corresponding components; and to determine the force information of each component based on each collision box.
[0171] In some embodiments, the force analysis module is used to determine the magnitude and direction of the force exerted by the target object on the character through the fluid space based on the dynamic attribute information of the target object; and to determine the delay duration of the force exerted by the target object on the character through the fluid space, wherein the delay duration characterizes the time during which the force exerted by the target object on the character through the fluid space acts on the character.
[0172] In some embodiments, the motion control module is used to determine the movement attribute information of the character after the delay time based on the magnitude and direction of the force applied to the character by the target object through the fluid space and the delay time, thereby obtaining the target movement attribute information.
[0173] In some embodiments, the force analysis module is used to determine initial force information based on the dynamic attribute information of the target object; determine an attenuation ratio based on the dynamic attribute information of the target object, the initial movement attribute information of the character, and the distance between the target object and the character, wherein the attenuation ratio characterizes the attenuation effect of the fluid space on the force; and determine the force information of the character based on the initial force information and the attenuation ratio.
[0174] In some embodiments, the dynamic attribute information of the target object includes the target object's movement speed and movement direction;
[0175] The force analysis module is used to determine the force exerted by the target object on the character through the fluid space based on the target object's moving speed and direction of movement, and to obtain the force information.
[0176] In some embodiments, the force analysis module is used to determine the flow attribute information of a first fluid in the fluid space based on the dynamic attribute information of the target object, wherein the flow attribute information of the first fluid characterizes the flow state of the first fluid; and to determine the force information of the character based on the flow attribute information of the first fluid, wherein the force information of the character characterizes the force exerted on the character by the first fluid.
[0177] In some embodiments, the force analysis module is used to determine the target flow attribute information of the second fluid based on the dynamic attribute information of the target object and the initial flow attribute information of the second fluid in the fluid space; and to determine the force information of the character based on the target flow attribute information of the second fluid, wherein the force information of the character represents the force exerted on the character by the second fluid.
[0178] Thirdly, referring to Figure 6 This disclosure provides an electronic device comprising:
[0179] One or more processors 201;
[0180] The memory 202 stores one or more programs that, when executed by one or more processors, cause the one or more processors to implement the control method for the role provided in the first aspect of the embodiments of this disclosure.
[0181] One or more I / O interfaces 203 are connected between the processor and the memory and configured to enable information exchange between the processor and the memory.
[0182] Among them, processor 201 is a device with data processing capabilities, including but not limited to central processing unit (CPU); memory 202 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), flash memory (FLASH); I / O interface (read-write interface) 203 is connected between processor 201 and memory 202, and can realize information interaction between processor 201 and memory 202, including but not limited to data bus (Bus).
[0183] In some embodiments, the processor 201, memory 202, and I / O interface 203 are interconnected via bus 204, and thus connected to other components of the computing device.
[0184] Fourthly, embodiments of this disclosure provide a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the role control method provided in the first aspect of embodiments of this disclosure.
[0185] 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.
[0186] 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 method for controlling a character, comprising: The force information of the character in the fluid space is determined based on the dynamic attribute information of the target object in the fluid space, wherein the force information represents the force exerted by the target object on the character through the fluid space, and the dynamic attribute information of the target object represents the motion state of the target object. Based on the force information and the character's initial movement attribute information, determine the character's target movement attribute information; Before the step of determining the force information of the character in the fluid space based on the dynamic attribute information of the target object in the fluid space, the control method further includes: Determine the force application information of at least one component of the target object as the dynamic attribute information of the target object, wherein one component corresponds to a region in the fluid space, and the force application information of the component characterizes the force applied by the target object to the region corresponding to the component. The steps for determining the force information of a character in the fluid space based on the dynamic attribute information of a target object in the fluid space include: The force information is determined based on the force information corresponding to the target area, wherein the target area is the area where the character is located in the fluid space.
2. The control method according to claim 1, wherein, Before the step of determining the force information of the character in the fluid space based on the dynamic attribute information of the target object in the fluid space, the control method further includes: The dynamic attribute information of the target object is obtained, wherein the dynamic attribute information includes the moving speed and moving direction of the target object.
3. The control method according to claim 2, wherein, The steps for obtaining the dynamic attribute information of the target object include: The target object is controlled to emit a first ray of a first preset length into the fluid space, wherein the first ray carries information characterizing the moving speed and moving direction of the target object; When the first ray comes into contact with the character, the movement speed and direction of the target object are determined based on the first ray.
4. The control method according to claim 2, wherein, The steps for obtaining the dynamic attribute information of the target object include: Control the character to emit a second ray of a second preset length into the fluid space; When the second ray comes into contact with the target object, it feeds back the target object's movement speed and direction to the character.
5. The control method according to claim 1, wherein, The steps for determining the force information based on the applied force information corresponding to the target area include: The target object is controlled to emit a third ray of a third predetermined length into the fluid space, wherein the third ray carries force information of the corresponding component. When any of the third rays comes into contact with the character, the force information is determined based on the force information corresponding to the target area, wherein the target area is the area corresponding to the component of the third ray that comes into contact with the character.
6. The control method according to claim 1, wherein, The steps for determining the force information based on the applied force information corresponding to the target area include: Control the character to emit a fourth ray of a fourth preset length into the fluid space; When the fourth ray comes into contact with the target object, the force information is determined according to the force information corresponding to the target area, wherein the target area is the area corresponding to the component that the fourth ray comes into contact with.
7. The control method according to any one of claims 1 to 6, wherein, The step of determining the force information of at least one component of the target object includes: Based on the current animation state information of the target object, the force application information of each component is determined.
8. The control method according to any one of claims 1 to 6, wherein, The step of determining the force information of at least one component of the target object includes: Obtain the collision box corresponding to each of the components, wherein the collision box is used to store the force information of the corresponding component; The force information of each component is determined based on each of the collision boxes.
9. The control method according to any one of claims 1 to 6, wherein, The steps for determining the force information of a character in the fluid space based on the dynamic attribute information of a target object in the fluid space include: Based on the dynamic attribute information of the target object, determine the magnitude and direction of the force exerted by the target object on the character through the fluid space; Determine the delay duration of the force exerted by the target object on the character through the fluid space, wherein the delay duration characterizes the time during which the force exerted by the target object on the character through the fluid space acts on the character.
10. The control method according to claim 9, wherein, The step of determining the target movement attribute information of the character based on the force information and the character's initial movement attribute information includes: Based on the magnitude and direction of the force exerted on the character by the target object through the fluid space and the delay duration, the movement attribute information of the character after the delay duration is determined, and the target movement attribute information is obtained.
11. The control method according to claim 9, wherein, The step of determining the force information of the character in the fluid space based on the dynamic attribute information of the target object in the fluid space also includes: The initial force information is determined based on the dynamic attribute information of the target object; Based on the dynamic attribute information of the target object, the initial movement attribute information of the character, and the distance between the target object and the character, the attenuation ratio is determined, wherein the attenuation ratio characterizes the attenuation effect of the fluid space on the force. The force information of the character is determined based on the initial force information and the attenuation ratio.
12. The control method according to any one of claims 1 to 6, wherein, The dynamic attribute information of the target object includes the target object's movement speed and movement direction; The steps for determining the force information of a character in the fluid space based on the dynamic attribute information of a target object in the fluid space include: Based on the target object's moving speed and direction, the force exerted by the target object on the character through the fluid space is determined, and the force information is obtained.
13. The control method according to any one of claims 1 to 6, wherein, The steps for determining the force information of a character in the fluid space based on the dynamic attribute information of a target object in the fluid space include: Based on the dynamic attribute information of the target object, the flow attribute information of the first fluid in the fluid space is determined, wherein the flow attribute information of the first fluid characterizes the flow state of the first fluid. Based on the flow property information of the first fluid, the force information of the character is determined, wherein the force information of the character represents the force exerted on the character by the first fluid.
14. The control method according to any one of claims 1 to 6, wherein, The steps for determining the force information of a character in the fluid space based on the dynamic attribute information of a target object in the fluid space include: Based on the dynamic attribute information of the target object and the initial flow attribute information of the second fluid in the fluid space, the target flow attribute information of the second fluid is determined; Based on the target flow property information of the second fluid, the force information of the character is determined, wherein the force information of the character represents the force exerted on the character by the second fluid.
15. A control device for a character, comprising: The force analysis module is used to determine the force information of the character in the fluid space based on the dynamic attribute information of the target object in the fluid space. The force information represents the force exerted by the target object on the character through the fluid space, and the dynamic attribute information of the target object represents the motion state of the target object. The motion control module is used to determine the target movement attribute information of the character based on the force information and the character's initial movement attribute information; Before the step of determining the force information of the character in the fluid space based on the dynamic attribute information of the target object in the fluid space, the control device is also used to: Determine the force application information of at least one component of the target object as the dynamic attribute information of the target object, wherein one component corresponds to a region in the fluid space, and the force application information of the component characterizes the force applied by the target object to the region corresponding to the component. The steps for determining the force information of a character in the fluid space based on the dynamic attribute information of a target object in the fluid space include: The force information is determined based on the force information corresponding to the target area, wherein the target area is the area where the character is located in the fluid space.
16. 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 control method for the role according to any one of claims 1 to 14.
17. A computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method for controlling a role according to any one of claims 1 to 14.