Method, device and electronic device for controlling movement in games
By responding to the contact between virtual characters and scene objects in the game, determining friction-related parameters and calculating friction, the problem of the virtual characters having a single movement effect in different surface material scene areas is solved, achieving more detailed interactive behavior and cost-reduced effects.
Patent Information
- Application Number
- CN202411525566.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-04-04
AI Technical Summary
In the game, virtual characters move in scene areas with different surface materials with a single effect, and the prior art requires manual editing of multiple small triggers, resulting in high labor costs and maintenance costs.
By responding to the contact between the virtual character and the scene object, friction-related parameters are determined, friction-related, and the movement state of the virtual character is controlled based on the friction, to achieve more detailed interactive behavior.
It enriches the mobile status expression of the game characters, reduces labor costs and the cost of post-adjustment and maintenance.
Smart Images

Figure CN119746412A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of game technology, and in particular to a method, device and electronic device for controlling movement in a game. Background Art
[0002] In the game, in order to simulate the effect of virtual characters moving in scene areas with different surface materials, corresponding triggers (trigger boxes) are generally placed in different areas. When the player controls the virtual character to touch or enter the corresponding area, it will directly affect the player's animation behavior. For example, the character will walk slower in a scene area with a rough surface, or fall more easily in a scene area with a smooth surface. The interactive behavior between the virtual character and the surface of the scene area is regional. Usually, only one parameter can be set in most of each area, resulting in a relatively simple behavior of the virtual character in the scene area. If more detailed interactive behavior is required, the area needs to be divided into smaller triggers. However, setting the trigger area requires manual editing by the level planner. In a more complex environment, dividing a single area into a large number of small trigger points has high labor costs, and the cost of later adjustment and maintenance is high. Summary of the invention
[0003] In view of this, the purpose of the present disclosure is to provide a method, device and electronic device for controlling movement in a game, so as to enrich the expression of the movement status of a game character and reduce the manpower cost at the same time.
[0004] In a first aspect, an embodiment of the present disclosure provides a method for controlling movement in a game, the method comprising: determining friction-related parameters in response to contact between a virtual character and a scene object in a virtual scene; wherein the friction-related parameters include at least one of the following: a friction parameter of a first surface portion of the surface of the virtual character that contacts the scene object, a friction parameter of a second surface portion of the surface of the scene object that contacts the virtual character, and a relative motion parameter between the virtual character and the scene object; based on the friction-related parameters, determining the friction force between the virtual character and the scene object; based on the friction force, determining the moving state of the virtual character, and controlling the virtual character to produce relative motion with the scene object in the moving state.
[0005] In a second aspect, an embodiment of the present disclosure provides a mobile control device in a game, the device comprising: a friction-related parameter determination module, for determining friction-related parameters in response to contact between a virtual character and a scene object in a virtual scene; wherein the friction-related parameters include at least one of the following: a friction parameter of a first surface portion of the surface of the virtual character that contacts the scene object, a friction parameter of a second surface portion of the surface of the scene object that contacts the virtual character, and a relative motion parameter between the virtual character and the scene object; a friction force determination module, for determining the friction force between the virtual character and the scene object based on the friction-related parameters; and a mobile control module, for determining a moving state of the virtual character based on the friction force, and controlling the virtual character to produce relative motion with the scene object in the moving state.
[0006] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the above-mentioned movement control method in the game.
[0007] In a fourth aspect, an embodiment of the present invention provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned movement control method in the game.
[0008] The embodiments of the present invention bring the following beneficial effects:
[0009] The above-mentioned method, device and electronic device for controlling movement in a game determine friction-related parameters in response to the virtual character contacting a scene object in a virtual scene; determine the friction between the virtual character and the scene object based on the friction-related parameters; determine the movement state of the virtual character based on the friction, and control the virtual character to produce relative movement with the scene object in the movement state. In this method, it is only necessary to set different friction parameters on the surface of the virtual object, so that different virtual objects can produce different frictions when in relative movement, and then set different movement states of the virtual character based on different frictions, which enriches the expression of the movement state of the game character and reduces the labor cost at the same time.
[0010] Other features and advantages of the present disclosure will be described in the following description, and partly become apparent from the description, or understood by practicing the present disclosure. The purpose and other advantages of the present disclosure are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0011] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0013] Figure 1 A flow chart of a method for controlling movement in a game provided by an embodiment of the present disclosure;
[0014] Figure 2 A schematic diagram of a normal line of an object surface provided in an embodiment of the present disclosure;
[0015] Figure 3 A schematic diagram of another normal line of an object surface provided in an embodiment of the present disclosure;
[0016] Figure 4 A schematic diagram of another normal line of an object surface provided in an embodiment of the present disclosure;
[0017] Figure 5 A schematic diagram of a foot friction mesh provided in an embodiment of the present disclosure;
[0018] Figure 6 A schematic diagram of a normal angle provided in an embodiment of the present disclosure;
[0019] Figure 7 A schematic diagram of the structure of a mobile control device in a game provided by an embodiment of the present disclosure;
[0020] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0022] In the game, virtual characters will encounter surfaces of various materials, and interactions with objects on different surfaces, such as walking or climbing on them, will require different interactive responses.
[0023] Generally, some trigger boxes are placed in different areas. When the player character (actor) touches or enters the corresponding area, it will directly affect the character's animation behavior, such as walking slower or falling more easily in interactive behaviors. However, this kind of interactive behavior is regional, that is, each area can only set one parameter. If more detailed interactive behavior is required, the area needs to be divided into smaller trigger boxes.
[0024] In the related art, it is usually necessary to manually set different action logic trigger areas in the game level to affect the animation logic of the player character or non-player character (NPC). Or at the beginning of certain special action triggers, it is detected whether the player is equipped with special props and skills, so as to select the corresponding action response. However, setting the trigger area requires manual editing by the level planner. In a more complex environment, a single area may be divided into a large number of small trigger points, which increases the cost of later adjustment and maintenance; special skills and equipment will also affect the behavior logic, and the final character's action logic will become more complicated.
[0025] Based on this, the embodiments of the present disclosure provide a method, device and electronic device for controlling movement in a game, and the technology can be applied to the movement control process of a game character.
[0026] In one embodiment of the present invention, the mobile control method in the game can be run on a local terminal device or a server. When the mobile control method in the game is run on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.
[0027] In an optional implementation, various cloud applications can be run under the cloud interaction system, such as cloud games. Taking cloud games as an example, cloud games refer to a game mode based on cloud computing. In the operation mode of cloud games, the operating body of the game program and the main body of the game screen presentation are separated. The storage and operation of the mobile control method in the game are completed on the cloud game server. The role of the client device is used for receiving and sending data and presenting the game screen. For example, the client device can be a display device with data transmission function close to the user side, such as a mobile terminal, a TV, a computer, a handheld computer, etc.; but the cloud game server in the cloud is used for information processing. When playing the game, the user operates the client device to send an operation instruction to the cloud game server. The cloud game server runs the game according to the operation instruction, encodes and compresses the game screen and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the game screen.
[0028] In an optional embodiment, taking a game as an example, a local terminal device stores a game program and is used to present a game screen. The local terminal device is used to interact with the user through a graphical user interface, that is, the game program is downloaded and installed by an electronic device and run conventionally. The local terminal device may provide the graphical user interface to the user in a variety of ways, for example, it may be rendered and displayed on a display screen of the terminal, or provided to the user through a holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen is used to present a graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate a graphical user interface, and control the display of the graphical user interface on the display screen.
[0029] See also Figure 1 First, a method for controlling movement in a game provided by an embodiment of the present invention is introduced. The method comprises the following steps:
[0030] Step S102, in response to the virtual character contacting a scene object in the virtual scene, determining friction-related parameters; wherein the friction-related parameters include at least one of the following: a friction parameter of a first surface portion of the surface of the virtual character that contacts the scene object, a friction parameter of a second surface portion of the surface of the scene object that contacts the virtual character, and a relative motion parameter between the virtual character and the scene object.
[0031] The above virtual character can be a controlled virtual character controlled by a player, or a virtual character controlled by a game system, without limitation. The above virtual character can refer to a virtual character with a certain set attribute in the game, or any character in the game, without limitation.
[0032] The above-mentioned scene object can be an object representing terrain in a virtual scene, such as a "mountain", "plain", etc., or a building object or other object, which is not limited here. The scene object can be fixed in the virtual scene, or can move in the virtual scene according to certain rules. For example, when the scene object represents a Ferris wheel, the scene object needs to rotate around a preset axis.
[0033] When a virtual character contacts a scene object, it is actually part of the surface of the virtual character that contacts part of the surface of the scene object. For the sake of convenience, the surface part of the virtual character that contacts the virtual object is called the "first surface part", and the surface part of the scene object that contacts the virtual character is called the "second surface part". The surface parts of the virtual character that contact the scene object can be multiple, that is, multiple discontinuous surface parts. For example, the hand surface and the foot surface of the virtual character are both in contact with the scene object, and they contact different surface parts of the scene object.
[0034] Friction parameters are usually pre-set for the surfaces of virtual characters and scene objects. Generally speaking, the magnitude of friction is related to the pressure between the contact parts and the roughness of the contact parts. The pressure between the contact parts is usually related to the gravity of the virtual character itself and the relative movement trend between the virtual character and the scene objects. The friction parameters of the first surface part of the virtual character can be used to indicate the gravity of the virtual character that needs to be borne when the first surface part contacts other surfaces, the roughness of the surface part, etc. The friction parameters of the second surface part of the scene object can be used to indicate the roughness of the surface part and the pressure that may be generated when the second surface part contacts other surface parts. It is also possible to set only the friction parameters related to pressure for the virtual character or scene object, or only the friction parameters related to roughness for the virtual character or scene object, for subsequent calculation of friction. There is no limitation here.
[0035] When setting, you can set corresponding friction parameters for the surface parts of the virtual character and scene objects that may come into contact with other surfaces. For example, the feet, hands, back, and buttocks of the virtual character can be set with corresponding friction parameters. Different surface parts can usually be set with different friction parameters to represent the pressure and roughness that may be generated by the surface parts when in contact. For example, a scene object is used to represent a certain terrain. The friction parameter representing the roughness of the sandy part of the terrain is set to a larger value, and the friction parameter representing the roughness of the marble part of the terrain is set to a smaller value.
[0036] Friction will only be generated between the virtual character and the scene object after they have relative motion or a tendency to relative motion. The above relative motion parameters may include one or both of the relative motion direction and the relative motion speed. The relative motion parameters usually need to be determined based on the relative positions of the virtual character and the scene object at different times. Therefore, it is necessary to obtain the relative positions of the two at different times, and then calculate the relative motion speed based on the speed calculation formula, or determine the relative motion direction based on the order in which the relative positions are generated.
[0037] Step S104: determining the friction between the virtual character and the scene object based on the friction-related parameters.
[0038] After determining the friction-related parameters, it is necessary to calculate the friction between the virtual character and the scene object based on the friction-related parameters. In real life, the calculation formula for friction is f=μN, where f represents the magnitude of friction, μ represents the friction coefficient, and N represents the normal pressure. In a virtual scene, the formula can be deformed according to needs. It is worth noting that the normal pressure is required in the calculation formula, and the normal pressure is not exactly the same as the gravity of the virtual character and the pressure of the surface contact of the scene object.
[0039] The friction calculation method can also be set based on demand, for example, setting both the virtual character and the scene object to generate a certain friction, and the friction is established under certain contact conditions. For example, the gravity of the virtual character is the positive pressure that causes friction. In a virtual scene, the direction of the gravity of the surface or the pressure generated can be represented by the normal of the surface. When the gravity of the virtual character is the positive pressure that causes friction, the directions of the normals of the surfaces on which the virtual character and the scene object are in contact are usually opposite. When the directions of the normals of the two are at other angles, it usually causes a change in friction. Specifically, weights can be introduced to calculate the friction between the virtual character and the scene object in the current situation based on the pre-set friction. The above weights are usually calculated based on the angle between the directions of the normals of the two. For example, the cosine value of the normal angle can be taken as the weight.
[0040] In the process of calculating friction, relative motion parameters can also be taken into account. It can be preset that the greater the relative motion speed, the smaller the weight. It can also be set that the greater the angle between the relative motion direction and the two normal directions, the greater the weight, etc. The specific settings can be made according to needs and are not limited here.
[0041] Step S106, determining the moving state of the virtual character based on the friction force, and controlling the virtual character to generate relative motion with the scene object in the moving state.
[0042] The above-mentioned moving state may include sliding, difficult movement or normal movement, etc. Multiple friction thresholds may be set in advance for the virtual character. The friction range determined by two adjacent friction thresholds corresponds to a moving state. For example, when the friction is less than a certain friction threshold, the moving state of the virtual character is determined to be sliding, and the character falls randomly; when the friction is greater than a certain friction threshold, the virtual character is determined to be walking with difficulty. After the moving state of the virtual character is determined, the virtual character may be controlled to generate relative motion with the scene object in the moving state, thereby generating corresponding game behaviors.
[0043] The above-mentioned method for controlling movement in a game determines friction-related parameters in response to the virtual character contacting a scene object in a virtual scene; determines the friction between the virtual character and the scene object based on the friction-related parameters; determines the movement state of the virtual character based on the friction, and controls the virtual character to produce relative movement with the scene object in the movement state. In this method, only different friction parameters need to be set on the surface of the virtual object, so that different virtual objects can produce different frictions when in relative movement, and then set different movement states of the virtual character based on different frictions, which enriches the expression of the movement state of the game character and reduces the labor cost at the same time.
[0044] The following embodiments provide a specific method for determining friction-related parameters in response to a virtual character contacting a scene object in a virtual scene.
[0045] In practical applications, the friction-related parameters may include relative motion parameters between the virtual character and the scene object. The relative motion parameters may include the relative motion direction and may also include the relative motion speed. When determining the relative motion direction, in response to the virtual character contacting the scene object in the virtual scene, it is necessary to determine the initial contact position between the virtual character and the scene object; when the virtual character and the scene object move relative to each other, it is necessary to determine the current contact position between the virtual character and the scene object, and further determine the relative motion direction between the virtual character and the scene object based on the initial contact position and the current contact position. Specifically, the direction from the initial contact position to the current contact position may be determined as the relative motion direction, or the direction from the current contact position to the initial contact position may be determined as the relative motion direction, and there is no limitation here.
[0046] In practical applications, the above-mentioned friction-related parameters may include the friction parameters of the first surface portion of the surface of the virtual character that contacts the scene object. At least one character state may be pre-set for the virtual character. Each character state corresponds to a preset friction parameter, and the friction parameters corresponding to different character states are usually different. For example, the friction parameters corresponding to a character wearing a magic cloak and not wearing a magic cloak are different. When the virtual character contacts the scene object in the virtual scene, the current character state of the virtual character is determined, and then the first friction parameter corresponding to the current character state is determined as the friction parameter of the first surface portion. In the same character state, the friction parameters of different surface portions may be the same or different, and are not limited here.
[0047] In practical applications, the above-mentioned friction-related parameters may include the friction parameters of the second surface portion of the surface of the scene object that is in contact with the virtual character. At least one object state, usually multiple, may be set in advance for the scene object. Each object state corresponds to a preset friction parameter. For example, the friction parameter of the scene object in a dry state is usually greater than the friction parameter of the scene object in a rainy state. When the virtual character contacts the scene object in the virtual scene, it is necessary to determine the current object state of the scene object, and determine the second friction parameter corresponding to the current object state as the friction parameter of the second surface portion. In the same object state, the friction parameters of different surface portions may be the same or different, and are not limited here.
[0048] The following embodiment provides a specific method for determining the friction between a virtual character and a scene object based on friction-related parameters.
[0049] After determining the friction parameters of the first surface portion of the surface of the virtual character that contacts the scene object, the friction parameters of the second surface portion of the surface of the scene object that contacts the virtual character, and the relative motion parameters between the virtual character and the scene object, it is first necessary to determine the initial friction force based on the friction parameters of the first surface portion and the friction parameters of the second surface portion. The initial friction force is usually obtained by adding the friction parameters of the first surface portion and the friction parameters of the second surface portion. Then, based on the initial friction force and the relative motion parameters between the virtual character and the scene object, the friction force between the virtual character and the scene object is determined.
[0050] When the scene object has a roughness parameter, the friction parameter of the second surface portion can be updated based on the roughness parameter corresponding to the second surface portion. When the friction parameters of the surfaces are the same, the corresponding roughness parameters are different, and the friction forces generated are usually different. After the friction parameters are updated, the initial friction force can be determined based on the friction parameters of the first surface portion and the updated friction parameters of the second surface portion.
[0051] The above-mentioned relative motion parameters usually include the relative motion direction. As mentioned above, when the first surface portion has a corresponding first additional mesh model, each vertex on the model has a normal parameter. In a specific implementation, the model portion corresponding to the first surface portion and the surface portion related to the first surface portion can be copied to generate a first additional mesh model. The above-mentioned surface portion related to the first surface portion is usually connected to the first surface portion, and may also be in contact with the scene object, such as the surface portion related to the sole of the foot and the heel. When the copied model portion has a large number of faces, a low-precision model corresponding to the model portion can be generated as the first additional mesh model. The number of faces of the low-precision model is lower than that of the original model, but the shape is similar. The direction of the normal of the vertex of the first additional mesh model can be set according to demand, and the normal direction is usually used to determine the current friction state weight in combination with the normal direction of the scene object.
[0052] Similarly, when the second surface portion has a corresponding second additional mesh model, the vertices on the model have normal parameters. Similar to the first additional mesh model, the second additional mesh model can be generated by copying the model portion corresponding to the second surface portion and the surface portion related to the second surface portion, or the second additional mesh model is a low-precision model corresponding to the model portion of the second surface portion and the surface portion related to the second surface portion.
[0053] The friction state weight can be determined based on the normal parameters of the vertices in the first additional mesh model, the normal parameters of the vertices in the second additional mesh model, and the relative motion parameters between the virtual character and the scene object. Then, the initial friction force is multiplied by the friction state weight to obtain the friction force between the virtual character and the scene object.
[0054] The above-mentioned normal parameters include the normal direction; the relative motion parameters include the relative motion direction. When determining the friction state weight, first determine the vertex closest to the center of the first surface part in the first additional mesh model as the first target vertex, and determine the vertex closest to the center of the second surface part in the second additional mesh model as the second target vertex. Then determine the angle between the first normal direction of the first target vertex and the second normal direction of the second target vertex. Further based on the angle, the relative position between the first normal direction and the relative motion direction, and the relative position between the second normal direction and the relative motion direction, determine the friction state weight. For example, the cosine value of the angle can be calculated first, and then when the first normal direction and the second normal direction are on both sides of the relative motion direction, the multiplication result of the cosine value multiplied by 2 is determined as the friction state weight; when the first normal direction and the second normal direction are on the same side of the relative motion direction, the cosine value is directly used as the friction state weight. It can be set specifically according to needs and is not limited here.
[0055] The disclosed embodiment also provides another method for controlling movement in a game. Figure 1 This method implements the global contact surface friction calculation method of the character, specifically using the value of the object surface normal information and the contact part of the character to calculate the friction.
[0056] While obtaining the normal information of the object surface, you can also overlay the material's modified properties on the normal, such as the bump information of the soil surface, the normal detail information of different areas on the tile, and the roughness information of the material map, to better simulate the performance of friction.
[0057] The hands and feet of the player character (equivalent to the above-mentioned "virtual character") can be set with different friction coefficients respectively (the hand and foot normal information can also be used directly). This makes it easy to set the animation blueprint states in different posture states, such as simple walking state, climbing state using both hands and feet, etc.
[0058] This method introduces the definition and setting of normals on scene object meshes, and can superimpose the normal map and roughness map information on material properties to obtain the final friction coefficient on the object. The corresponding friction coefficient is set at the part where the character contacts the object (equivalent to the above-mentioned "scene object") (hands, feet or the whole body, etc.), so as to calculate the final friction result obtained when the player contacts the scene object, and obtain the corresponding animation action state, such as normal, sliding, falling, etc.
[0059] This method is implemented in the following way:
[0060] 1 Calculate or set the normal direction angle or value information on the scene object mesh.
[0061] 2. Calculate the normal in the object material information and superimpose the corresponding roughness map information weight.
[0062] 3. Set the friction coefficient at the required parts of the character and calculate the friction results after these parts come into contact with the scene objects.
[0063] 4 The animation action state of the player character is achieved through friction.
[0064] Specifically, we first need to calculate the friction parameters of the scene objects. By default, the normal information of the mesh surface of the object is perpendicular to the surface and has the same length.
[0065] This method requires modifying the normal angle to different degrees and adding a strength value to define the friction properties of the object. Figure 2 shown.
[0066] Since normal information is also useful for other links, the changes to normal attributes at this stage will be copied to a new mesh model (also called "mesh", equivalent to the "second additional mesh model" mentioned above), which is used alone to store and calculate all friction-related information. When encountering high poly objects, you can use the object's lod1 mesh for processing.
[0067] Then we need to calculate the effect of the object material on the normal (friction): the normal map in the object material will modify the object surface twice. In the engine editor state, first bake the normal map information onto the friction mesh to obtain the calculated new normal strength and angle information, such as Figure 3 shown.
[0068] At the same time, the roughness of the object material also affects the friction performance of the object surface. Since the roughness map is just a black and white weight range map, it will only affect the strength value of the normal. Figure 4 shown.
[0069] In the roughness map, the value 0 (black) represents a smooth area, and the value 1 (white) represents a rough area. Since a fully reflective surface does not mean no friction in the real world, the roughness [0,1] interval needs to be mapped to the [1,2] interval in the actual processing process. The friction value obtained in the previous step can be multiplied by the roughness weight value. In the end, a slightly rough metal surface should be presented in the game.
[0070] It is also necessary to set the friction properties of the character's contact parts according to the game requirements, such as setting the friction mesh of the hand or foot contact parts (equivalent to the above-mentioned "first additional mesh model"), such as Figure 5 shown.
[0071] You can set up several sets of friction mesh according to different situations, such as using a smaller mesh in the rain, increasing friction after wearing special gloves, etc.
[0072] Furthermore, it is necessary to calculate the friction between the scene mesh object and the player character. In practical applications, the friction when the normal direction of the scene object and the character contact part is completely opposite (180°) can be defined as the standard friction, without any weight addition. When the character contact part moves, the position from the initial point of the movement to the current state is the positive quadrant, and the other interval is the negative quadrant, such as Figure 6 As shown in the figure, the character's feet enter from point O on the right side of the screen and move to point P on the left side of the screen. The left side is set to be the negative direction of the normal, and a coordinate system is established with point P. The right side is the positive quadrant and the left side is the negative quadrant.
[0073] Calculate the normal angle of the mesh vertex closest to the vertex of the object that the character is touching. If the two normal angles are in the positive quadrant, that is, the angle is less than 90 degrees, the friction weight is in the interval [1,2]. When the normal angle is 90°, the weight is 2, and when the normal angle is 180°, the weight is 1. If the two normal angles are in the negative quadrant, the friction weight interval is [0,1]. When the angle is 90°, the weight is 0, and when the normal angle is 180°, the weight is 1. Figure 6 As shown, α represents an angle less than 90 degrees, and β represents an angle greater than 90 degrees.
[0074] So the final friction value calculation formula is:
[0075] Friction = (character contact object friction + object friction * roughness weight) * friction state weight
[0076] Game action planners can customize the friction definition interval. For example, if the friction is less than a certain threshold, the sliding action will be used, and if it is less than a certain extreme value, the character will fall.
[0077] This method has the following advantages:
[0078] 1. Convenience: Since objects naturally have different normal information, they can naturally provide basic friction parameters. After superimposing the information on the material, the friction properties of the object can be more accurately represented, and the friction properties can also be manually modified. There is no need to set the trigger range separately for different areas and objects.
[0079] 2. Efficiency: The friction properties of objects can be baked and recorded in the editor stage of the engine, and the result values can be directly calculated in the runtime stage to avoid performance waste caused by multiple calculations.
[0080] 3 Universality: The calculation method provided by this method can be used in different game engines and DCC animation special effects production software.
[0081] For the above method embodiments, see Figure 7 A mobile control device in a game is shown.
[0082] The device includes:
[0083] The friction-related parameter determination module 702 is used to determine the friction-related parameters in response to the virtual character contacting the scene object in the virtual scene; wherein the friction-related parameters include at least one of the following: a friction parameter of a first surface portion of the surface of the virtual character contacting the scene object, a friction parameter of a second surface portion of the surface of the scene object contacting the virtual character, and a relative motion parameter between the virtual character and the scene object;
[0084] The friction force determination module 704 is used to determine the friction force between the virtual character and the scene object based on the friction related parameters;
[0085] The movement control module 706 is used to determine the movement state of the virtual character based on the friction force, and control the virtual character to generate relative motion with the scene object in the movement state.
[0086] The mobile control device in the above-mentioned game determines friction-related parameters in response to the virtual character contacting the scene object in the virtual scene; determines the friction between the virtual character and the scene object based on the friction-related parameters; determines the movement state of the virtual character based on the friction, and controls the virtual character to produce relative motion with the scene object in the movement state. In this method, it is only necessary to set different friction parameters on the surface of the virtual object, so that different virtual objects can produce different frictions when in relative motion, and then set different movement states of the virtual character based on different frictions, which enriches the expression form of the movement state of the game character and reduces the labor cost at the same time.
[0087] The above-mentioned friction-related parameters include: relative motion parameters between the virtual character and the scene object; the relative motion parameters include the relative motion direction; the friction-related parameter determination module is also used to: determine the initial contact position of the virtual character and the scene object in response to the virtual character contacting the scene object in the virtual scene; determine the current contact position between the virtual character and the scene object in response to the relative movement between the virtual character and the scene object; determine the relative motion direction between the virtual character and the scene object based on the initial contact position and the current contact position.
[0088] The above-mentioned friction-related parameters include friction parameters of a first surface portion of the surface of the virtual character that is in contact with a scene object; the virtual character has at least one preset character state; each character state corresponds to a preset friction parameter; the friction-related parameter determination module is also used to: determine the current character state of the virtual character in response to the virtual character contacting a scene object in a virtual scene; and determine the first friction parameter corresponding to the current character state as the friction parameter of the first surface portion.
[0089] The above-mentioned friction-related parameters include friction parameters of a second surface portion of the surface of the scene object that is in contact with the virtual character; the scene object has at least one preset object state; each object state corresponds to a preset friction parameter; the friction-related parameter determination module is also used to: determine the current object state of the scene object in response to the virtual character contacting the scene object in the virtual scene; and determine the second friction parameter corresponding to the current object state as the friction parameter of the second surface portion.
[0090] The above-mentioned friction-related parameters include: friction parameters of a first surface portion of the surface of the virtual character that contacts the scene object, friction parameters of a second surface portion of the surface of the scene object that contacts the virtual character, and relative motion parameters between the virtual character and the scene object; the friction force determination module is used to: determine the initial friction force based on the friction parameters of the first surface portion and the friction parameters of the second surface portion; determine the friction force between the virtual character and the scene object based on the initial friction force and the relative motion parameters between the virtual character and the scene object.
[0091] The friction force determination module is used to: update the friction parameter of the second surface portion based on the roughness parameter corresponding to the second surface portion; and determine the initial friction force based on the friction parameter of the first surface portion and the updated friction parameter of the second surface portion.
[0092] The above-mentioned relative motion parameters include the relative motion direction; the first surface part has a corresponding first additional mesh model; the first additional mesh model is composed of multiple vertices; the vertices have normal parameters; the second surface part has a corresponding second additional mesh model; the second additional mesh model is composed of multiple vertices; the vertices have normal parameters; the friction force determination module is used to: determine the friction state weight based on the normal parameters of the vertices in the first additional mesh model, the normal parameters of the vertices in the second additional mesh model and the relative motion parameters between the virtual character and the scene object; multiply the initial friction force by the friction state weight to obtain the friction between the virtual character and the scene object.
[0093] The above-mentioned normal parameters include the normal direction; the relative motion parameters include the relative motion direction; the friction force determination module is used to: determine the vertex in the first additional mesh model that is closest to the center of the first surface part as the first target vertex; determine the vertex in the second additional mesh model that is closest to the center of the second surface part as the second target vertex; determine the angle between the first normal direction of the first target vertex and the second normal direction of the second target vertex; determine the friction state weight based on the angle, the relative position between the first normal direction and the relative motion direction, and the relative position between the second normal direction and the relative motion direction.
[0094] The above-mentioned first additional mesh model is generated by copying the model part corresponding to the first surface part and the surface part related to the first surface part, or the first additional mesh model is a low-precision model corresponding to the model part of the first surface part and the surface part related to the first surface part; the second additional mesh model is generated by copying the model part corresponding to the second surface part and the surface part related to the second surface part, or the second additional mesh model is a low-precision model corresponding to the model part of the second surface part and the surface part related to the second surface part.
[0095] This embodiment also provides an electronic device, including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the movement control method in the above game, for example:
[0096] In response to the virtual character contacting a scene object in a virtual scene, friction related parameters are determined; wherein the friction related parameters include at least one of the following: a friction parameter of a first surface portion of the virtual character's surface that contacts the scene object, a friction parameter of a second surface portion of the scene object's surface that contacts the virtual character, and a relative motion parameter between the virtual character and the scene object; based on the friction related parameters, the friction force between the virtual character and the scene object is determined; based on the friction force, the moving state of the virtual character is determined, and the virtual character is controlled to generate relative motion with the scene object in the moving state.
[0097] In the above method, it is only necessary to set different friction parameters on the surface of the virtual object, so that different virtual objects can generate different friction forces when they move relative to each other, and then set different movement states of the virtual characters based on different friction forces, thereby enriching the expression of the movement state of the game characters and reducing labor costs.
[0098] Optionally, the above-mentioned friction-related parameters include: relative motion parameters between the virtual character and the scene object; the relative motion parameters include relative motion direction; in response to the virtual character contacting the scene object in the virtual scene, the steps of determining the friction-related parameters include: in response to the virtual character contacting the scene object in the virtual scene, determining the initial contact position of the virtual character and the scene object; in response to the virtual character and the scene object moving relative to each other, determining the current contact position between the virtual character and the scene object; based on the initial contact position and the current contact position, determining the relative motion direction between the virtual character and the scene object.
[0099] Optionally, the friction-related parameters include friction parameters of a first surface portion of the surface of the virtual character that is in contact with a scene object; the virtual character has at least one preset character state; each character state corresponds to a preset friction parameter; in response to the virtual character contacting a scene object in a virtual scene, the step of determining the friction-related parameters includes: determining a current character state of the virtual character in response to the virtual character contacting a scene object in the virtual scene; and determining a first friction parameter corresponding to the current character state as the friction parameter of the first surface portion.
[0100] Optionally, the friction-related parameters include friction parameters of a second surface portion of the surface of the scene object that is in contact with the virtual character; the scene object has at least one preset object state; each object state corresponds to a preset friction parameter; in response to the virtual character contacting the scene object in the virtual scene, the step of determining the friction-related parameters includes: in response to the virtual character contacting the scene object in the virtual scene, determining the current object state of the scene object; determining the second friction parameter corresponding to the current object state as the friction parameter of the second surface portion.
[0101] Optionally, the friction-related parameters include: friction parameters of a first surface portion of the virtual character's surface in contact with the scene object, friction parameters of a second surface portion of the scene object's surface in contact with the virtual character, and relative motion parameters between the virtual character and the scene object; the step of determining the friction force between the virtual character and the scene object based on the friction-related parameters includes: determining an initial friction force based on the friction parameters of the first surface portion and the friction parameters of the second surface portion; determining the friction force between the virtual character and the scene object based on the initial friction force and the relative motion parameters between the virtual character and the scene object.
[0102] Optionally, the step of determining the initial friction force based on the friction parameters of the first surface portion and the friction parameters of the second surface portion includes: updating the friction parameters of the second surface portion based on the roughness parameters corresponding to the second surface portion; and determining the initial friction force based on the friction parameters of the first surface portion and the updated friction parameters of the second surface portion.
[0103] Optionally, the above-mentioned relative motion parameters include relative motion direction; the first surface portion has a corresponding first additional mesh model; the first additional mesh model is composed of multiple vertices; the vertices have normal parameters; the second surface portion has a corresponding second additional mesh model; the second additional mesh model is composed of multiple vertices; the vertices have normal parameters; based on the initial friction force and the relative motion parameters between the virtual character and the scene object, the step of determining the friction between the virtual character and the scene object includes: determining the friction state weight based on the normal parameters of the vertices in the first additional mesh model, the normal parameters of the vertices in the second additional mesh model and the relative motion parameters between the virtual character and the scene object; multiplying the initial friction force by the friction state weight to obtain the friction between the virtual character and the scene object.
[0104] Optionally, the above-mentioned normal parameters include normal directions; the relative motion parameters include relative motion directions; based on the normal parameters of vertices in the first additional mesh model, the normal parameters of vertices in the second additional mesh model and the relative motion parameters between the virtual character and the scene object, the step of determining the friction state weight includes: determining the vertex in the first additional mesh model that is closest to the center of the first surface part as the first target vertex; determining the vertex in the second additional mesh model that is closest to the center of the second surface part as the second target vertex; determining the angle between the first normal direction of the first target vertex and the second normal direction of the second target vertex; determining the friction state weight based on the angle, the relative position between the first normal direction and the relative motion direction, and the relative position between the second normal direction and the relative motion direction.
[0105] Optionally, the first additional mesh model is generated by copying the model portion corresponding to the first surface portion and the surface portion related to the first surface portion, or the first additional mesh model is a low-precision model corresponding to the model portion of the first surface portion and the surface portion related to the first surface portion; the second additional mesh model is generated by copying the model portion corresponding to the second surface portion and the surface portion related to the second surface portion, or the second additional mesh model is a low-precision model corresponding to the model portion of the second surface portion and the surface portion related to the second surface portion.
[0106] See also Figure 8 As shown, the electronic device includes a processor 100 and a memory 101, wherein the memory 101 stores machine executable instructions that can be executed by the processor 100, and the processor 100 executes the machine executable instructions to implement the movement control method in the above-mentioned game.
[0107] Further, Figure 8The electronic device shown further includes a bus 102 and a communication interface 103 , and the processor 100 , the communication interface 103 and the memory 101 are connected via the bus 102 .
[0108] The memory 101 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 102 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0109] The processor 100 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 100. The above processor 100 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 101, and the processor 100 reads the information in the memory 101 and completes the steps of the method of the above embodiment in combination with its hardware.
[0110] This embodiment also provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the movement control method in the above game.
[0111] The embodiments of the present disclosure provide a method, device and electronic device for controlling movement in a game, including a computer-readable storage medium storing program codes, wherein the program codes include instructions that can be used to execute the methods described in the foregoing method embodiments, for example:
[0112] In response to the virtual character contacting a scene object in a virtual scene, friction related parameters are determined; wherein the friction related parameters include at least one of the following: a friction parameter of a first surface portion of the virtual character's surface that contacts the scene object, a friction parameter of a second surface portion of the scene object's surface that contacts the virtual character, and a relative motion parameter between the virtual character and the scene object; based on the friction related parameters, the friction force between the virtual character and the scene object is determined; based on the friction force, the moving state of the virtual character is determined, and the virtual character is controlled to generate relative motion with the scene object in the moving state.
[0113] In the above method, it is only necessary to set different friction parameters on the surface of the virtual object, so that different virtual objects can generate different friction forces when they move relative to each other, and then set different movement states of the virtual characters based on different friction forces, thereby enriching the expression of the movement state of the game characters and reducing labor costs.
[0114] Optionally, the above-mentioned friction-related parameters include: relative motion parameters between the virtual character and the scene object; the relative motion parameters include relative motion direction; in response to the virtual character contacting the scene object in the virtual scene, the steps of determining the friction-related parameters include: in response to the virtual character contacting the scene object in the virtual scene, determining the initial contact position of the virtual character and the scene object; in response to the virtual character and the scene object moving relative to each other, determining the current contact position between the virtual character and the scene object; based on the initial contact position and the current contact position, determining the relative motion direction between the virtual character and the scene object.
[0115] Optionally, the friction-related parameters include friction parameters of a first surface portion of the surface of the virtual character that is in contact with a scene object; the virtual character has at least one preset character state; each character state corresponds to a preset friction parameter; in response to the virtual character contacting a scene object in a virtual scene, the step of determining the friction-related parameters includes: determining a current character state of the virtual character in response to the virtual character contacting a scene object in the virtual scene; and determining a first friction parameter corresponding to the current character state as the friction parameter of the first surface portion.
[0116] Optionally, the friction-related parameters include friction parameters of a second surface portion of the surface of the scene object that is in contact with the virtual character; the scene object has at least one preset object state; each object state corresponds to a preset friction parameter; in response to the virtual character contacting the scene object in the virtual scene, the step of determining the friction-related parameters includes: in response to the virtual character contacting the scene object in the virtual scene, determining the current object state of the scene object; determining the second friction parameter corresponding to the current object state as the friction parameter of the second surface portion.
[0117] Optionally, the friction-related parameters include: friction parameters of a first surface portion of the virtual character's surface in contact with the scene object, friction parameters of a second surface portion of the scene object's surface in contact with the virtual character, and relative motion parameters between the virtual character and the scene object; the step of determining the friction force between the virtual character and the scene object based on the friction-related parameters includes: determining an initial friction force based on the friction parameters of the first surface portion and the friction parameters of the second surface portion; determining the friction force between the virtual character and the scene object based on the initial friction force and the relative motion parameters between the virtual character and the scene object.
[0118] Optionally, the step of determining the initial friction force based on the friction parameters of the first surface portion and the friction parameters of the second surface portion includes: updating the friction parameters of the second surface portion based on the roughness parameters corresponding to the second surface portion; and determining the initial friction force based on the friction parameters of the first surface portion and the updated friction parameters of the second surface portion.
[0119] Optionally, the above-mentioned relative motion parameters include relative motion direction; the first surface portion has a corresponding first additional mesh model; the first additional mesh model is composed of multiple vertices; the vertices have normal parameters; the second surface portion has a corresponding second additional mesh model; the second additional mesh model is composed of multiple vertices; the vertices have normal parameters; based on the initial friction force and the relative motion parameters between the virtual character and the scene object, the step of determining the friction between the virtual character and the scene object includes: determining the friction state weight based on the normal parameters of the vertices in the first additional mesh model, the normal parameters of the vertices in the second additional mesh model and the relative motion parameters between the virtual character and the scene object; multiplying the initial friction force by the friction state weight to obtain the friction between the virtual character and the scene object.
[0120] Optionally, the above-mentioned normal parameters include normal directions; the relative motion parameters include relative motion directions; based on the normal parameters of vertices in the first additional mesh model, the normal parameters of vertices in the second additional mesh model and the relative motion parameters between the virtual character and the scene object, the step of determining the friction state weight includes: determining the vertex in the first additional mesh model that is closest to the center of the first surface part as the first target vertex; determining the vertex in the second additional mesh model that is closest to the center of the second surface part as the second target vertex; determining the angle between the first normal direction of the first target vertex and the second normal direction of the second target vertex; determining the friction state weight based on the angle, the relative position between the first normal direction and the relative motion direction, and the relative position between the second normal direction and the relative motion direction.
[0121] Optionally, the first additional mesh model is generated by copying the model portion corresponding to the first surface portion and the surface portion related to the first surface portion, or the first additional mesh model is a low-precision model corresponding to the model portion of the first surface portion and the surface portion related to the first surface portion; the second additional mesh model is generated by copying the model portion corresponding to the second surface portion and the surface portion related to the second surface portion, or the second additional mesh model is a low-precision model corresponding to the model portion of the second surface portion and the surface portion related to the second surface portion.
[0122] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0123] In addition, in the description of the embodiments of the present disclosure, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present disclosure can be understood according to specific circumstances.
[0124] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0125] In the description of the present disclosure, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present disclosure and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present disclosure. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0126] Finally, it should be noted that the above embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above embodiments, those skilled in the art should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A method for controlling movement in a game, characterized in that: The method comprises: determining friction-related parameters in response to the virtual character contacting a scene object in the virtual scene; The friction-related parameters include at least one of the following: a friction parameter of a first surface portion of the surface of the virtual character in contact with the scene object, a friction parameter of a second surface portion of the surface of the scene object in contact with the virtual character, and a relative motion parameter between the virtual character and the scene object; Determining the friction force between the virtual character and the scene object based on the friction-related parameter; Based on the friction force, the moving state of the virtual character is determined, and the virtual character is controlled to generate relative motion with the scene object in the moving state.
2. The method according to claim 1, characterized in that The friction related parameters include: relative motion parameters between the virtual character and the scene object; the relative motion parameters include relative motion direction; In response to the virtual character contacting a scene object in the virtual scene, the step of determining friction-related parameters comprises: In response to the virtual character contacting a scene object in the virtual scene, determining an initial contact position between the virtual character and the scene object; In response to the virtual character and the scene object moving relative to each other, determining a current contact position between the virtual character and the scene object; Based on the initial contact position and the current contact position, a relative movement direction between the virtual character and the scene object is determined.
3. The method according to claim 1, characterized in that The friction-related parameters include friction parameters of a first surface portion of the surface of the virtual character that contacts the scene object; the virtual character has at least one preset character state; Each character state corresponds to a preset friction parameter; In response to the virtual character contacting a scene object in the virtual scene, the step of determining friction-related parameters comprises: In response to the virtual character contacting a scene object in the virtual scene, determining a current character state of the virtual character; A first friction parameter corresponding to the current character state is determined as the friction parameter of the first surface portion.
4. The method according to claim 1, characterized in that: The friction-related parameters include friction parameters of a second surface portion of the surface of the scene object that contacts the virtual character; the scene object has at least one preset object state; each object state corresponds to a preset friction parameter; In response to the virtual character contacting a scene object in the virtual scene, the step of determining friction-related parameters comprises: In response to the virtual character contacting a scene object in the virtual scene, determining a current object state of the scene object; A second friction parameter corresponding to the current object state is determined as the friction parameter of the second surface portion.
5. The method according to claim 1, characterized in that The friction-related parameters include: a friction parameter of a first surface portion of the surface of the virtual character in contact with the scene object, a friction parameter of a second surface portion of the surface of the scene object in contact with the virtual character, and a relative motion parameter between the virtual character and the scene object; The step of determining the friction between the virtual character and the scene object based on the friction-related parameter comprises: determining an initial friction force based on a friction parameter of the first surface portion and a friction parameter of the second surface portion; The friction force between the virtual character and the scene object is determined based on the initial friction force and the relative motion parameter between the virtual character and the scene object.
6. The method according to claim 5, characterized in that The step of determining an initial friction force based on the friction parameter of the first surface portion and the friction parameter of the second surface portion comprises: updating a friction parameter of the second surface portion based on a roughness parameter corresponding to the second surface portion; An initial friction force is determined based on the friction parameter of the first surface portion and the updated friction parameter of the second surface portion.
7. The method according to claim 5, characterized in that The first surface portion has a corresponding first additional mesh model; the first additional mesh model is composed of a plurality of vertices; the vertices have normal parameters; the second surface portion has a corresponding second additional mesh model; the second additional mesh model is composed of a plurality of vertices; the vertices have normal parameters; The step of determining the friction between the virtual character and the scene object based on the initial friction and the relative motion parameter between the virtual character and the scene object comprises: Determining a friction state weight based on normal parameters of vertices in the first additional mesh model, normal parameters of vertices in the second additional mesh model, and relative motion parameters between the virtual character and the scene object; The initial friction force is multiplied by the friction state weight to obtain the friction force between the virtual character and the scene object.
8. The method according to claim 7, characterized in that The normal line parameter includes the normal line direction; the relative motion parameter includes the relative motion direction; The step of determining the friction state weight based on the normal parameters of the vertices in the first additional mesh model, the normal parameters of the vertices in the second additional mesh model, and the relative motion parameters between the virtual character and the scene object comprises: determining a vertex in the first additional mesh model that is closest to the center of the first surface portion as a first target vertex; determining a vertex in the second additional mesh model that is closest to the center of the second surface portion as a second target vertex; Determine an angle between a first normal direction of the first target vertex and a second normal direction of the second target vertex; A friction state weight is determined based on the angle, a relative position between the first normal direction and the relative motion direction, and a relative position between the second normal direction and the relative motion direction.
9. The method according to claim 7, characterized in that: The first additional mesh model is generated by copying a model portion corresponding to the first surface portion and a surface portion related to the first surface portion, or the first additional mesh model is a low-precision model corresponding to a model portion of the first surface portion and a surface portion related to the first surface portion; The second additional mesh model is generated by copying the model portion corresponding to the second surface portion and the surface portion related to the second surface portion, or the second additional mesh model is a low-precision model corresponding to the model portion of the second surface portion and the surface portion related to the second surface portion.
10. A mobile control device in a game, characterized in that: The device comprises: a friction-related parameter determination module, for determining friction-related parameters in response to the virtual character contacting a scene object in the virtual scene; The friction-related parameters include at least one of the following: a friction parameter of a first surface portion of the surface of the virtual character in contact with the scene object, a friction parameter of a second surface portion of the surface of the scene object in contact with the virtual character, and a relative motion parameter between the virtual character and the scene object; A friction force determination module, used to determine the friction force between the virtual character and the scene object based on the friction related parameters; The movement control module is used to determine the movement state of the virtual character based on the friction force, and control the virtual character to generate relative movement with the scene object in the movement state.
11. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the movement control method in the game according to any one of claims 1-9.
12. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the movement control method in the game described in any one of claims 1-9.