Game role control method and device, server and computer readable storage medium
By smoothing the action model data and position information of the game characters on the game server, the problem of delay and unnaturalness of the game characters during movement and attack is solved, and the game's fluency and playability are improved.
Patent Information
- Application Number
- CN202411924031.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-25
AI Technical Summary
Game characters may experience delays, lags or unnaturalness when moving and attacking, reducing the smoothness of player operations and the playability of the game.
By obtaining the status of the game character on the game server, smoothing the action model data and position information, generating the smoothed action model data and position information at the next moment, and sending it to the client, so that the client can control the game character to release skills and move based on these data.
It improves the movement fluency of the game characters, enhances the smoothness of player operations and the playability of the game, and ensures that the movements of the characters release skills when they move are more natural and coherent.
Smart Images

Figure CN119701356A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of game technology, and in particular to a game character control method, device, server and computer-readable storage medium. Background Art
[0002] In modern video games, the movement and attacking actions of characters are the core part of player interaction. The smoothness and responsiveness of these actions directly affect the player's immersion and the overall quality of the game. However, the actions of game characters may be delayed, stuck or unnatural when executed, especially when the game characters are moving and attacking at the same time, which will reduce the smoothness of player operations and the playability of the game. Summary of the invention
[0003] The object of the present invention is to provide a game character control method, device, server and computer-readable storage medium to solve the problem of reducing the smoothness of player operation and the playability of the game.
[0004] In a first aspect, the present invention provides a game character control method, which is applied to a server, wherein the server is communicatively connected with a client, and the method comprises:
[0005] Obtaining the status of the game character from the client;
[0006] When the game character is in a combat state and a moving state at the same time, the action model data of the game character is smoothed, and the current position information of the game character is smoothed to obtain the position information that the game character needs to reach at the next moment, and the smoothed action model data and the position information to be reached at the next moment are sent to the client, so that the client can control the game character to release skills according to the smoothed action model data, and control the movement of the game character according to the position information to be reached at the next moment.
[0007] In an optional embodiment, the method further comprises:
[0008] When the game character is in the combat state and not in the moving state, the action model data is smoothed, and the smoothed action model data is sent to the client, so that the client controls the game character to release skills according to the smoothed action model data;
[0009] When the game character is in the moving state and not in the combat state, the current position information is smoothed to obtain the position information that the game character needs to reach at the next moment, and the position information that needs to be reached at the next moment is sent to the client, so that the client can control the movement of the game character according to the position information that needs to be reached at the next moment.
[0010] In an optional implementation, the smoothing of the action model data of the game character includes:
[0011] According to the skill release instruction sent by the client, the action model data is acquired; the action model data includes position information of a plurality of vertices;
[0012] Calculate the normal vector of each vertex according to the position information of each vertex;
[0013] Obtaining a smoothing weight of each vertex according to a normal vector of each vertex and normal vectors of adjacent vertices of the vertex;
[0014] Obtaining new position information of each vertex according to the smoothing weight of each vertex and the position information of adjacent vertices of the vertex;
[0015] The new position information of all the vertices is added to the motion model data.
[0016] In an optional implementation, calculating the normal vector of each vertex according to the position information of each vertex includes:
[0017] According to the position information of any three vertices, calculate the normal vectors of the plane where the three vertices are located;
[0018] For each vertex, calculate the sum of the normal vectors of each plane where the vertex is located to obtain an accumulated normal vector;
[0019] The accumulated normal vectors are normalized to obtain a normal vector of each vertex.
[0020] In an optional implementation, the smoothing process on the current position information of the game character to obtain the position information that the game character needs to reach at the next moment includes:
[0021] Obtaining the current position information of the game character;
[0022] According to the moving speed and moving time of the game character, an interpolation parameter is obtained; the moving speed is obtained according to the moving control instruction sent by the client; the moving time is the time difference between the time when the moving control instruction is received and the current time;
[0023] The position information that the game character needs to reach at the next moment is obtained according to the interpolation parameter, the current position information and the target position information that the game character needs to reach, until the game character reaches the target position information; the target position information is obtained according to the movement control instruction.
[0024] In an optional implementation manner, before obtaining the state of the game character from the client, the method further includes:
[0025] When receiving the movement control instruction sent by the client and the game character is in the combat state, generating a non-interruption skill release instruction;
[0026] The non-interrupted skill release instruction is sent to the client, so that the client controls the movement of the game character while controlling the game character to release skills, and sets the state of the game character to the movement state.
[0027] In a second aspect, the present invention provides a game character control device, which is applied to a server, wherein the server is communicatively connected with a client, and the device comprises:
[0028] A status acquisition module, used to acquire the status of the game character from the client;
[0029] A smoothing processing module is used to smooth the action model data of the game character and smooth the current position information of the game character when the game character is in a combat state and a moving state at the same time, to obtain the position information that the game character needs to reach at the next moment, and to send the smoothed action model data and the position information that needs to be reached at the next moment to the client, so that the client can control the game character to release skills according to the smoothed action model data, and control the movement of the game character according to the position information that needs to be reached at the next moment.
[0030] In an optional embodiment, the smoothing processing module is further used to smooth the action model data when the game character is in the combat state and not in the moving state, and send the smoothed action model data to the client, so that the client controls the game character to release skills according to the smoothed action model data;
[0031] The smoothing processing module is also used to smooth the current position information when the game character is in the moving state and not in the combat state, to obtain the position information that the game character needs to reach at the next moment, and send the position information that needs to be reached at the next moment to the client, so that the client can control the movement of the game character according to the position information that needs to be reached at the next moment.
[0032] In a third aspect, the present invention provides a server, comprising a processor and a memory, wherein the memory stores a computer program executable by the processor, and the computer program executable by the processor is used to implement the game character control method described in any of the aforementioned embodiments.
[0033] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements a game character control method as described in any one of the aforementioned embodiments.
[0034] The game character control method, device, server and computer-readable storage medium provided by the embodiment of the present invention include: obtaining the state of the game character from the client, and when the game character is in a combat state and a moving state at the same time, smoothing the action model data of the game character, and smoothing the current position information of the game character to obtain the position information that the game character needs to reach at the next moment, and sending the smoothed action model data and the position information that needs to be reached at the next moment to the client, so that the client controls the game character to release skills according to the smoothed action model data, and controls the movement of the game character according to the position information that needs to be reached at the next moment. By smoothing the action model data and the position information at the same time, it is ensured that the action of the character releasing skills when moving is smoother, thereby improving the fluency of the player's operation and the playability of the game. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0036] Figure 1 A schematic diagram showing an application environment of the game character control method provided by an embodiment of the present invention is shown;
[0037] Figure 2 A schematic diagram of a process flow of a game character control method provided by an embodiment of the present invention is shown;
[0038] Figure 3 Another schematic flow chart of a game character control method provided by an embodiment of the present invention is shown;
[0039] Figure 4 Another schematic flow chart of a game character control method provided by an embodiment of the present invention is shown;
[0040] Figure 5 Another schematic flow chart of a game character control method provided by an embodiment of the present invention is shown;
[0041] Figure 6 Another schematic flow chart of a game character control method provided by an embodiment of the present invention is shown;
[0042] Figure 7 A module block diagram of a game character control device provided by an embodiment of the present invention is shown;
[0043] Figure 8 A block diagram of a server provided by an embodiment of the present invention is shown.
[0044] Icon: 100 - server; 110 - memory; 120 - processor; 130 - communication module; 200 - client; 300 - game character control device; 310 - state acquisition module; 320 - smoothing processing module. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0046] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0048] See also Figure 1 , Figure 1 A schematic diagram of an application environment of the game character control method provided by an embodiment of the present invention is shown. The server 100 and the client 200 are located in a network, and the server 100 can communicate with the client 200 to realize data interaction between the server 100 and the client 200. As a way, the server 100 and the client 200 can be connected via WIFI, ZigBee, 2G / 3G / 4G / 5G, which is not limited here.
[0049] The client 200 is deployed with a game program, and the client 200 can run the game program. Among them, the game program can include MMORPG (Massive Multiplayer Online Role Playing Game) games, ARPG (Action Role Playing) games, etc., which are not limited here.
[0050] See also Figure 2 , Figure 2 A schematic diagram of a process flow of a game character control method provided by an embodiment of the present invention is shown. The game character control method can be applied to a server. The specific process of this embodiment is described below using a server as an example. Figure 2 The process shown is described in detail, and the game character control method may specifically include the following steps:
[0051] Step 130: Obtain the status of the game character from the client.
[0052] The state of the game character may include a combat state and a moving state, etc., which are not limited here. When the game character is in a combat state, it indicates that the game character is in a combat. When the game character is in a moving state, it indicates that the game character is moving from one position to another.
[0053] In some embodiments, the client monitors and records the status of the game characters in the running game, and stores the status of the game characters. The client can store the identification information of the game characters and the status corresponding to each identification information in the memory or in a local database.
[0054] In some implementations, the client may generate status update information when the status of the game character changes, and send the status update information to the server. The server may obtain the identification information of the game character based on the status update information, and obtain the status of the game character from the client based on the identification information.
[0055] Step 140A: When the game character is in a combat state and a moving state at the same time, the action model data of the game character is smoothed, and the current position information of the game character is smoothed to obtain the position information that the game character needs to reach at the next moment, and the smoothed action model data and the position information to be reached at the next moment are sent to the client, so that the client can control the game character to release skills according to the smoothed action model data, and control the movement of the game character according to the position information to be reached at the next moment.
[0056] The action model data is a data set that describes the details of each action and its changes when the game character releases a skill. The action model data includes the key parameters of the multidimensional model of the game character in the entire process from preparing the action to executing the action and then recovering the action.
[0057] The game character control method provided by the embodiment of the present invention obtains the state of the game character from the client, and when the game character is in a combat state and a moving state at the same time, the action model data of the game character is smoothed, and the current position information of the game character is smoothed to obtain the position information that the game character needs to reach at the next moment, and the smoothed action model data and the position information that needs to be reached at the next moment are sent to the client, so that the client controls the game character to release skills according to the smoothed action model data, and controls the movement of the game character according to the position information that needs to be reached at the next moment. By smoothing the action model data and the position information at the same time, it is ensured that the action of the character releasing skills when moving is smoother, thereby improving the fluency of the player's operation and the playability of the game.
[0058] In order to control the movement of the game character without interrupting the release of skills, such as Figure 3 As shown, before step 110, the following steps are specifically included:
[0059] Step 110: When a movement control instruction sent by the client is received and the game character is in a combat state, a non-interruption skill release instruction is generated.
[0060] The movement control instruction may include instruction type, identification information of the game character, target position information, movement speed, etc., which are not limited here.
[0061] In some embodiments, the server can analyze the movement control instruction, determine the type of the instruction, and obtain the identification information, target position information, and movement speed of the game character. The server can obtain the status of the game character from the client based on the identification information of the game character. If the game character is in a combat state, the server generates an uninterrupted skill release instruction.
[0062] Step 120: Send the non-interrupted skill release instruction to the client, so that the client can control the movement of the game character while controlling the game character to release the skill, and set the state of the game character to the moving state.
[0063] It is understandable that players can continue to control the movement of the game character while releasing skills, which makes the game process smoother and more natural, and improves the player's freedom of operation. It also allows players to move flexibly in battle, increasing tactical possibilities, such as releasing skills while moving, or avoiding enemy attacks while releasing skills, thereby improving the strategy and challenge of the game.
[0064] In order to enhance the smoothness of the game character's actions in different states, when the character is only in combat or only in movement, the action model data or current position information is smoothed, such as Figure 4 As shown, the game character control method specifically also includes the following steps:
[0065] Step 140B: When the game character is in combat and not in motion, the action model data is smoothed and the smoothed action model data is sent to the client so that the client can control the game character to release skills according to the smoothed action model data.
[0066] Step 140C: When the game character is in a moving state and not in a combat state, the current position information is smoothed and the smoothed current position information is sent to the client so that the client can control the movement of the game character according to the smoothed current position information.
[0067] like Figure 5 As shown, in the above step 140A and step 140B, the specific steps of smoothing the motion model data are as follows:
[0068] Step 210: Acquire action model data according to the skill release instruction sent by the client.
[0069] The action model data includes position information of multiple vertices, and the skill release instruction includes identification information of the game character and identification information of the skill.
[0070] In some embodiments, the server stores action model data corresponding to the identification information of each skill. When a player selects a skill on the client and triggers the release, the client generates a skill release instruction, which includes the identification information of the skill. The client sends the skill release instruction to the server. The server can parse the skill release instruction, obtain the identification information of the skill, and obtain the action model data corresponding to the identification information.
[0071] Step 220: Calculate the normal vector of each vertex according to the position information of each vertex.
[0072] In some embodiments, the server can calculate the normal vectors of the planes where the three vertices are located based on the position information of any three vertices, calculate the sum of the normal vectors of the planes where the vertex is located for each vertex, obtain the accumulated normal vector, normalize the accumulated normal vector, and obtain the normal vector of each vertex.
[0073] In some implementations, the server may obtain the normal vector of the plane where the three vertices are located by calculating the cross product of the vectors of the two edges including the vertex.
[0074] For example, the procedure for obtaining the normal vector of the plane where three vertices are located by calculating the cross product of the vectors of the two edges including the vertex is as follows:
[0075] vec3 calculateNormal(const Vertex&v1,const Vertex&v2,const Vertex&v3){
[0076] glm::vec3 edge1 = v2.position-v1.position; / / edge1 is the first edge consisting of the first vertex and the second vertex;
[0077] glm::vec3 edge2 = v3.position-v1.position; / / edge1 is the second edge formed by the first vertex and the third vertex;
[0078] return glm::normalize(glm::cross(edge1,edge2)); / / Calculate the cross product of the first and second edges.
[0079] For example, to calculate the sum of the normal vectors of each plane where the vertex is located and obtain the accumulated normal vector, the procedure is as follows:
[0080] for(const auto&tri:triangles){
[0081] glm::vec3 normal=calculateNormal(vertices[tri.indices[0]],
[0082] vertices[tri.indices[1]],vertices[tri.indices[2]]); / / Find the normal vector of each plane where the vertex is located
[0083]
[0084] Step 230: Obtain a smoothing weight of each vertex according to the normal vector of each vertex and the normal vectors of the vertex's adjacent vertices.
[0085] In some implementations, the server may calculate the cosine value of the angle between the edge formed by the vertex and its adjacent vertices and the normal vector of the vertex, and determine the cosine value as the normal vector of the vertex.
[0086] Step 240: Obtain new position information of each vertex according to the smoothing weight of each vertex and the position information of the adjacent vertices of the vertex.
[0087] In some implementations, the server may calculate the new position information of each vertex according to the following formula:
[0088] V′ i =w i ×V i +∑ j∈N(i) w j ×V j
[0089] Among them, V′ i represents the new position information of the i-th vertex, w i represents the smoothing weight of the i-th vertex, w j represents the smoothing weight of the jth adjacent vertex of the i-th vertex, V j represents the position information of the jth adjacent vertex of the i-th vertex, and N(i) represents the set of adjacent vertices of the i-th vertex.
[0090] Step 250: Add the new position information of all vertices to the motion model data.
[0091] In some implementations, the server may iterate the process of smoothing the motion model data multiple times, and update the position information of each vertex in the motion model data after each iteration until a desired smoothing effect is achieved or a preset number of iterations is reached.
[0092] In some embodiments, the server can add the new position information of all vertices to the action model data to form a smoothed new action model data. The server can send the new action model data to the client, and the client can control the game character to release skills according to the new action model data.
[0093] like Figure 6 As shown, in the above step 140A and step 140C, the specific steps of smoothing the motion model data are as follows:
[0094] Step 310: Obtain the current position information of the game character.
[0095] In some implementations, the server maintains location information corresponding to the identification information of each game character. The server can obtain the identification information of the game character according to the movement control instruction sent by the client, and obtain the current location information of the game character according to the identification information.
[0096] Step 320: Obtain interpolation parameters according to the moving speed and moving time of the game character.
[0097] The moving speed is obtained according to the moving control instruction sent by the client; the moving time is the time difference between the time when the moving control instruction is received and the current time.
[0098] In some embodiments, the interpolation parameter is equal to the product of the movement speed and the movement time, and the range of the interpolation parameter is [0, 1]. It can be understood that the movement time is the time difference between the time when the movement control instruction is received and the current time. As time goes by, the movement time will continue to change, and accordingly, the interpolation parameter will also change accordingly. This process will continue until the interpolation parameter reaches its maximum value of 1, indicating that the movement process of the game character is completed.
[0099] In some implementations, the server may ensure that the value of the interpolation parameter is within the range of [0, 1] by using the Mathf.Clamp01 function.
[0100] Step 330: According to the interpolation parameters, the current position information and the target position information that the game character needs to reach, the position information that the game character needs to reach at the next moment is obtained until the game character reaches the target position information.
[0101] The target location information is obtained according to the mobile control instruction.
[0102] For example, based on the interpolation parameters, the current position information, and the target position information that the game character needs to reach, the procedure for obtaining the position information that the game character needs to reach at the next moment is as follows:
[0103] public class:MonoBehaviour
[0104] {
[0105] public Transform target; / / target location information
[0106] public float speed = 5.0f; / / moving speed
[0107] void Update()
[0108] {
[0109] float t = Time.deltaTime * speed; / / Calculate the interpolation parameter (t), according to the movement time (Time.deltaTime) change
[0110] t = Mathf.Clamp01(t); / / Ensure the interpolation parameter (t) is between 0 and 1
[0111] transform.position=Vector3.Lerp(transform.position,target.position,t);
[0112] / / Perform linear interpolation to obtain the position information that the game character needs to reach at the next moment.
[0113] In order to prevent players from using skills frequently, which causes greater pressure on the server to transmit information, a corresponding cooldown time can be configured for each skill in the server, thereby avoiding network delays caused by players using skills frequently, which causes greater pressure on the server to transmit information, thereby improving the smoothness of player operations.
[0114] In order to improve the player's experience of releasing skills while moving, players can customize the combination of game characters. For example, skills A, B, and C can be combined into a set of combined skills for game character A. Players can have more time to operate the movement or prepare to release the next skill, and the diversity of combat strategies can be increased.
[0115] Specifically, the server can store the combination skills of each game character. The combination skills are configured with a trigger order. The combination skills take effect when the player does not actively release the skills. That is, when the player does not actively release the skills, the electronic device obtains the action model data of the skills from the server in sequence, and releases the skills in sequence according to the trigger order. However, at this time, the priority of the player's manual release of skills is higher than the skills in the automatic skill bar (combination skills). This can not only ensure the player's operational freedom, but also maintain the continuity and fluency of the battle.
[0116] In order to execute the corresponding steps in the above embodiments and various possible methods, a method for implementing a game character control device is provided below. Figure 7 , is a functional module diagram of a game character control device provided by an embodiment of the present invention. It should be noted that the basic principle and technical effects of the game character control device provided by this embodiment are the same as those of the above embodiments. For the sake of brief description, for the parts not mentioned in this embodiment, reference can be made to the corresponding contents in the above embodiments. The game character control device 300 includes: a state acquisition module 310 and a smoothing processing module 320, wherein:
[0117] The status acquisition module 310 is used to acquire the status of the game character from the client;
[0118] The smoothing processing module 320 is used to smooth the action model data of the game character when the game character is in a combat state and a moving state at the same time, and to smooth the current position information of the game character to obtain the position information that the game character needs to reach at the next moment, and send the smoothed action model data and the position information to be reached at the next moment to the client, so that the client can control the game character to release skills according to the smoothed action model data, and control the movement of the game character according to the position information to be reached at the next moment.
[0119] Optionally, the smoothing processing module 320 is further used to perform smoothing processing on the action model data when the game character is in a combat state and not in a moving state, and send the smoothed action model data to the client, so that the client controls the game character to release skills according to the smoothed action model data;
[0120] The smoothing processing module 320 is also specifically used to smooth the current position information when the game character is in a moving state and not in a combat state, to obtain the position information that the game character needs to reach at the next moment, and to send the position information to be reached at the next moment to the client, so that the client can control the movement of the game character according to the position information to be reached at the next moment.
[0121] Optionally, the smoothing processing module 320 is also specifically used to obtain action model data according to the skill release instruction sent by the client; the action model data includes position information of multiple vertices; based on the position information of each vertex, the normal vector of each vertex is calculated; based on the normal vector of each vertex and the normal vectors of the vertex's adjacent vertices, the smoothing weight of each vertex is obtained; based on the smoothing weight of each vertex and the position information of the vertex's adjacent vertices, the new position information of each vertex is obtained; and the new position information of all vertices is added to the action model data.
[0122] Optionally, the smoothing processing module 320 is also specifically used to calculate the normal vectors of the planes where the three vertices are located based on the position information of any three vertices; for each vertex, calculate the sum of the normal vectors of the planes where the vertex is located to obtain the accumulated normal vector; normalize the accumulated normal vector to obtain the normal vector of each vertex.
[0123] Optionally, the smoothing processing module 320 is also specifically used to obtain the current position information of the game character; obtain interpolation parameters according to the movement speed and movement time of the game character; the movement speed is obtained according to the movement control instruction sent by the client; the movement time is the time difference between the time when the movement control instruction is received and the current time; according to the interpolation parameters, the current position information and the target position information that the game character needs to reach, obtain the position information that the game character needs to reach at the next moment, until the game character reaches the target position information; the target position information is obtained according to the movement control instruction.
[0124] Optionally, the game character control device 300 further includes: a non-interruption skill release instruction generation module, wherein:
[0125] The non-interrupted skill release instruction generation module is used to generate a non-interrupted skill release instruction before obtaining the status of the game character from the client, when the movement control instruction sent by the client is received and the game character is in a combat state; the non-interrupted skill release instruction is sent to the client so that the client can control the movement of the game character while controlling the game character to release skills, and set the status of the game character to a moving state.
[0126] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0127] In several embodiments provided by the present invention, the coupling between modules may be electrical, mechanical or other forms of coupling.
[0128] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of software functional modules.
[0129] Please refer to Figure 8, is a block diagram of a server 100 provided in an embodiment of the present invention. The server 100 includes a memory 110, a processor 120, and a communication module 130. The memory 110, the processor 120, and the communication module 130 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
[0130] The memory 110 is used to store programs or data. The memory 110 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc.
[0131] The processor 120 is used to read / write data or programs stored in the memory and execute corresponding functions. For example, when the computer program stored in the memory 110 is executed by the processor 120, the game character control method disclosed in the above embodiments can be implemented.
[0132] The communication module 130 is used to establish a communication connection between the server 100 and the client through the network, and to send and receive data through the network.
[0133] It should be understood that Figure 8 The structure shown is only a schematic diagram of the server structure. The server may also include Figure 8 More or fewer components may be shown. Figure 8 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0134] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer program can be executed by a processor, the game character control method described in the above method embodiment is implemented.
[0135] The computer-readable storage medium may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer-readable storage medium includes a non-transitory computer-readable storage medium. The computer-readable storage medium has storage space for program codes that execute any of the method steps in the above method. These program codes can be read from or written to one or more computer program products. The program code can be compressed, for example, in an appropriate form.
[0136] In several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and a module, a program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0137] If the function is implemented in the form of a software function module 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 invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. 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, etc. Various media that can store program codes.
[0138] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A game character control method, characterized in that: Applied to a server, the server being in communication connection with a client, the method comprising: Obtaining the status of the game character from the client; When the game character is in a combat state and a moving state at the same time, the action model data of the game character is smoothed, and the current position information of the game character is smoothed to obtain the position information that the game character needs to reach at the next moment, and the smoothed action model data and the position information to be reached at the next moment are sent to the client, so that the client can control the game character to release skills according to the smoothed action model data, and control the movement of the game character according to the position information to be reached at the next moment.
2. The method according to claim 1, characterized in that The method further comprises: When the game character is in the combat state and not in the moving state, the action model data is smoothed, and the smoothed action model data is sent to the client, so that the client controls the game character to release skills according to the smoothed action model data; When the game character is in the moving state and not in the combat state, the current position information is smoothed to obtain the position information that the game character needs to reach at the next moment, and the position information that needs to be reached at the next moment is sent to the client, so that the client can control the movement of the game character according to the position information that needs to be reached at the next moment.
3. The method according to claim 1 or 2, characterized in that: The smoothing of the action model data of the game character comprises: According to the skill release instruction sent by the client, the action model data is acquired; the action model data includes position information of a plurality of vertices; Calculate the normal vector of each vertex according to the position information of each vertex; Obtaining a smoothing weight of each vertex according to a normal vector of each vertex and normal vectors of adjacent vertices of the vertex; Obtaining new position information of each vertex according to the smoothing weight of each vertex and the position information of adjacent vertices of the vertex; The new position information of all the vertices is added to the motion model data.
4. The method according to claim 3, characterized in that Calculating the normal vector of each vertex according to the position information of each vertex includes: According to the position information of any three vertices, calculate the normal vectors of the plane where the three vertices are located; For each vertex, calculate the sum of the normal vectors of each plane where the vertex is located to obtain an accumulated normal vector; The accumulated normal vectors are normalized to obtain a normal vector of each vertex.
5. The method according to claim 1 or 2, characterized in that: The smoothing process of the current position information of the game character to obtain the position information that the game character needs to reach at the next moment includes: Obtaining the current position information of the game character; According to the moving speed and moving time of the game character, an interpolation parameter is obtained; the moving speed is obtained according to the moving control instruction sent by the client; the moving time is the time difference between the time when the moving control instruction is received and the current time; The position information that the game character needs to reach at the next moment is obtained according to the interpolation parameter, the current position information and the target position information that the game character needs to reach, until the game character reaches the target position information; the target position information is obtained according to the movement control instruction.
6. The method according to claim 1, characterized in that Before obtaining the state of the game character from the client, the method further includes: When receiving the movement control instruction sent by the client and the game character is in the combat state, generating a non-interruption skill release instruction; The non-interrupted skill release instruction is sent to the client, so that the client controls the movement of the game character while controlling the game character to release skills, and sets the state of the game character to the movement state.
7. A game character control device, characterized in that: Applied to a server, the server is connected to a client for communication, and the device comprises: A status acquisition module, used to acquire the status of the game character from the client; A smoothing processing module is used to smooth the action model data of the game character and smooth the current position information of the game character when the game character is in a combat state and a moving state at the same time, to obtain the position information that the game character needs to reach at the next moment, and to send the smoothed action model data and the position information that needs to be reached at the next moment to the client, so that the client can control the game character to release skills according to the smoothed action model data, and control the movement of the game character according to the position information that needs to be reached at the next moment.
8. The device according to claim 7, characterized in that The smoothing processing module is also used to smooth the action model data when the game character is in the combat state and not in the moving state, and send the smoothed action model data to the client, so that the client controls the game character to release skills according to the smoothed action model data; The smoothing processing module is also used to smooth the current position information when the game character is in the moving state and not in the combat state, to obtain the position information that the game character needs to reach at the next moment, and send the position information that needs to be reached at the next moment to the client, so that the client can control the movement of the game character according to the position information that needs to be reached at the next moment.
9. A server, characterized in that: It comprises a processor and a memory, wherein the memory stores a computer program executable by the processor, and the computer program executable by the processor is used to implement the game character control method described in any one of claims 1-6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the game character control method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Implementation method of skinned skeletal animation
CN104021584A
Game role control method, device and system, and game client
CN107835148A
Virtual character position synchronization method and device, medium and electronic equipment
CN111659120A
Virtual character control method and device, computing equipment and storage medium
CN112619148A
Motion data processing method and device, product, equipment and medium
CN116977511A