Game data processing method and device, electronic equipment and readable storage medium
By adjusting the horizontal speed of the virtual character when jumping on the tilted ground, the jitter problem caused by the virtual character's premature contact with the ground is solved, and a more natural and realistic jumping action is achieved, improving the visual experience.
Patent Information
- Application Number
- CN202411853466.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-04-11
AI Technical Summary
In the prior art, when a virtual character performs a jumping behavior, if the jumping route is tilted on the ground, the character may contact the ground too early, causing jitters in the ground buffering action, affecting the visual effect.
By obtaining the first horizontal speed when the virtual character is in the reference position, and adjusting the first horizontal speed of the virtual character in the first position according to the tilt angle of the scene object or the ground height of the virtual character, the target horizontal speed when the virtual character comes into contact with the scene object is less than or equal to the initial horizontal speed.
It realizes more natural and real movements when the virtual character lands, reduces the jitter of the landing buffering movement, and enhances the player's visual experience.
Smart Images

Figure CN119792936A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a game data processing method, device, electronic device and computer-readable storage medium. Background Art
[0002] The virtual characters in the game can perform a variety of actions, such as using various controllers (joysticks, handles, keyboards, etc.) to manipulate the characters in the game to jump from different heights, move and fall, etc.
[0003] In the related art, the character's skeletal model can be controlled by the speed of the character when landing to make a corresponding landing buffering action to match the character's jumping behavior; the above-mentioned landing buffering action is simulated on a horizontal plane. Specifically, when the character falls on the horizontal ground, without considering gravity and elastic force, the character can be made to have a squatting landing buffering action through inertia;
[0004] However, in the above method, when there is an object with a certain inclination (such as a tilted ground) on the jumping route when the character performs a jumping behavior, the character may come into contact with the object too early. At this time, the character's landing speed has a speed component in the vertical direction. Due to the speed component in the vertical direction, the character will shake when performing the landing buffering action, and the visual effect is not good.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0006] In view of this, the present application provides a game data processing method, device, electronic device and computer-readable storage medium, which can make the landing state of the virtual character's jumping behavior more adapted to the first object, so that the virtual character's jumping behavior is more in line with the laws of physics, looks more natural and real, and enhances the player's visual experience.
[0007] In a first aspect, an embodiment of the present application provides a method for processing game data, the method comprising:
[0008] When the virtual character performs a jumping behavior, in response to the virtual character's height from the ground starting to decrease, obtaining a first horizontal speed of the virtual character when it is at a reference position, the reference position being the position when the virtual character's height from the ground starts to decrease; the height from the ground being the height difference between the virtual character and a scene object located below the virtual character;
[0009] If the virtual character at the first position does not come into contact with the scene object, adjusting the first horizontal speed of the virtual character at the first position according to the first horizontal speed of the virtual character at the reference position and the tilt angle of the scene object or the height of the virtual character from the ground, so that the target horizontal speed when the virtual character comes into contact with the scene object is less than or equal to the first horizontal speed of the virtual character at the reference position;
[0010] The first position is a position after the reference position when the virtual character does not come into contact with the scene object.
[0011] In a second aspect, an embodiment of the present application provides a game data processing device, the device comprising: an acquisition unit and an adjustment unit;
[0012] an acquisition unit, configured to acquire a first horizontal speed of the virtual character when the virtual character is located at a reference position in response to the virtual character's height from the ground starting to decrease when the virtual character performs a jumping behavior, wherein the reference position is the position when the virtual character's height from the ground starts to decrease; the height from the ground is the height difference between the virtual character and a scene object located below the virtual character;
[0013] an adjusting unit, configured to adjust the first horizontal speed of the virtual character when it is at the first position, if the virtual character at the first position is not in contact with the scene object, according to the first horizontal speed of the virtual character when it is at the reference position, and the tilt angle of the scene object or the height of the virtual character from the ground, so that a second horizontal speed when the virtual character is in contact with the scene object is less than or equal to the first horizontal speed when the virtual character is at the reference position;
[0014] The first position is the position after the height of the virtual character from the ground starts to decrease and when the virtual character does not come into contact with the scene object.
[0015] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0016] Processor; and
[0017] The memory is used to store a data processing program. After the electronic device is powered on and the program is run by the processor, the method of the first aspect is executed.
[0018] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a data processing program, which is executed by a processor to perform the method of the first aspect.
[0019] The game data processing method provided by the present application, when a virtual character performs a jumping behavior, in response to the virtual character's height from the ground starting to decrease, obtains the first horizontal speed of the virtual character when it is at a reference position, the reference position being the position when the virtual character's height from the ground starts to decrease; the height from the ground being the height difference between the virtual character and a scene object located below the virtual character; if the virtual character at the first position is not in contact with the scene object, the first horizontal speed of the virtual character at the first position is adjusted according to the first horizontal speed of the virtual character at the reference position, and the inclination angle of the scene object or the height of the virtual character from the ground, so that the target horizontal speed when the virtual character is in contact with the scene object is less than or equal to the first horizontal speed of the virtual character when it is at the reference position; wherein the first position is a position after the reference position and when the virtual character is not in contact with the scene object.
[0020] Through the above method, during the jumping behavior performed by the virtual character, starting from the time when the virtual character starts to approach the scene object below, the inclination angle of the scene object below the virtual character or the height of the virtual character from the ground can be comprehensively considered, and the first horizontal speed of the virtual character corresponding to each first position in the jumping process after the virtual character starts to approach the virtual object below and before contacting the virtual object is adjusted in real time, so that the target horizontal speed of the virtual character when contacting the scene object changes in real time, and the target horizontal speed of the virtual character when landing on the surface of the scene object is more adapted to the scene object, so that the jumping behavior of the virtual character is more in line with the laws of physics, looks more natural and real, and enhances the player's visual experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0022] Figure 1 A schematic diagram of an example of the horizontal speed of a virtual character when landing during a jumping behavior in the related art provided by an embodiment of the present application;
[0023] Figure 2 A schematic diagram of a system for implementing a game data processing method provided in an embodiment of the present application;
[0024] Figure 3 A flowchart of a method for processing game data provided by an embodiment of the present application;
[0025] Figure 4A schematic diagram of an example of a reference position and a first position provided in an embodiment of the present application;
[0026] Figure 5 A schematic diagram of an example of scene objects with different tilt angles that can be located below a virtual character provided in an embodiment of the present application;
[0027] Figure 6 A schematic diagram of an example of changes in the height above the ground when the virtual character provided in an embodiment of the present application is located at different positions;
[0028] Figure 7 Another schematic diagram of the change of the height above the ground when the virtual character provided by the embodiment of the present application is located at different positions;
[0029] Figure 8 A schematic diagram of the structure of a game data processing device provided in an embodiment of the present application;
[0030] Fig. 9 A structural block diagram of an electronic device for implementing a game data processing method is provided for an embodiment of the present application. DETAILED DESCRIPTION
[0031] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0032] It should be noted that the terms "first", "second", "third", etc. in the claims, description and drawings of the present application are used to distinguish similar objects and are not used to describe a specific order or sequence. The data used in this way are interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including", "having" and their variants are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0033] It should be understood that in the embodiments of the present application, "at least one" refers to one or more, "several" refers to one or more, and "multiple" refers to two or more. "And / or" is only a way to describe the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "Including A, B and / or C" means including any one, any two, or any three of A, B, and C.
[0034] It should be understood that in the embodiments of the present application, "B corresponding to A", "B corresponding to A", "A corresponds to B", or "B corresponds to A" means that B is associated with A, and B can be determined according to A. Determining B according to A does not mean determining B only according to A, and B can also be determined according to A and / or other information.
[0035] Before describing the implementation methods of the present application in detail, the related technologies are first further introduced.
[0036] In the related art, the character's skeletal model can be controlled by the speed of the character when landing to make a corresponding landing buffer action to match the character's jumping behavior. The landing buffer action is simulated on a horizontal plane. Specifically, when the character falls on the horizontal ground, without considering gravity and elastic force, the character can be made to have a squatting landing buffer action through inertia, such as Figure 1 As shown in (a), when the virtual character performs a jumping action on the horizontal ground and lands on the ground, without considering gravity and elastic force, the virtual character is only affected by the force applied by the player to control the horizontal movement of the virtual character at the moment of landing. Therefore, the landing speed of the virtual character is the horizontal speed of the virtual character when jumping. The landing buffering action performed by the virtual character when landing is only controlled by the inertia generated by the motion state before landing (that is, the character's body is squeezed downward), and is not affected by the horizontal speed of the virtual character when landing. If the horizontal speed of the virtual character when landing V f If it is not 0, after the virtual character performs the landing buffer action, if the player does not adjust the horizontal speed of the virtual character, the virtual character can be controlled to move at a horizontal speed V f Move forward;
[0037] However, in the above method, if the landing cushioning action simulated on the horizontal plane is applied to Figure 1When the virtual character is on the sloped ground shown in (b), that is, when the virtual character performs a jumping action, there is a sloped ground on the jumping route, and the sloped ground corresponds to an inclination angle of α. The virtual character contacts the sloped ground too early in the jumping process. In this case, when the virtual character contacts the sloped ground, without considering gravity and the elastic force of the slope, the virtual character is only subject to the force applied by the player to control the horizontal movement of the virtual character. When the virtual character falls on the sloped ground, it is squeezed by the sloped ground, and the direction of the force controlling the horizontal movement of the virtual character will become a force parallel to the sloped ground and upward, then the landing speed of the virtual character V f The direction is upward along the slope. Based on this, the landing speed V f There is a velocity component V1 in the vertical direction, which may cause the virtual character's simulated landing cushioning action on the horizontal ground to undergo an upward mutation, i.e., jitter, resulting in poor visual effects;
[0038] It should be noted that if the landing cushioning action simulated on the horizontal plane is applied to Figure 1 When the virtual character is on the sloped ground shown in (c), that is, when the virtual character performs a jumping action from a higher position on the sloped ground to a lower position, the sloped ground corresponds to an inclination angle α. When the virtual character contacts the sloped ground, without considering gravity and the elastic force of the slope, the sloped ground does not cause any squeezing of the horizontal movement of the virtual character. Therefore, the landing speed V of the virtual character can be calculated by referring to the process of simulating the landing cushioning action of the virtual character on the horizontal ground. f The velocity component V1 in the vertical direction is directly assigned to 0, so that the landing cushioning action performed by the virtual character when landing is only controlled by the inertia generated by the motion state before landing (that is, the character's body is squeezed downward), so that the virtual character's simulated landing cushioning action on the horizontal ground does not undergo sudden changes.
[0039] To sum up, in the above-mentioned related technologies, when the virtual character performs a jumping behavior and lands on a rising scene object, the speed in the horizontal direction of landing does not change with the slope of the terrain, wherein the rising scene object is a scene object that gradually rises along the jumping direction of the virtual character, resulting in a sudden change in the landing cushioning action performed by the virtual character when landing on the sloped ground, resulting in poor visual effects.
[0040] Based on the above-mentioned problems, the embodiments of the present application provide a game data processing method, device, electronic device and computer-readable storage medium.
[0041] The game data processing method provided in the embodiment of the present application can be performed by an electronic device, which can be a terminal or a server. The terminal can be a terminal device such as a smart phone, a tablet computer, or a laptop computer. The server can be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules (such as software or software modules for providing distributed services), or it can be implemented as a single software or software module, and the embodiment of the present application does not specifically limit this.
[0042] In an optional embodiment, when the game data processing method is run on a terminal device, the terminal device stores a game application and a game virtual scene. The terminal device interacts with the player through a graphical user interface. The terminal device may provide the graphical user interface to the player in a variety of ways, for example, it may be rendered and displayed on a display screen of the terminal device, or the graphical user interface may be presented through holographic projection.
[0043] In an optional embodiment, when the game data processing method is run on a server, the method can be implemented and executed based on a cloud gaming system. A cloud gaming system refers to a gaming method based on cloud computing. A cloud gaming system includes a server and a client device. The operating body of the game application and the game screen presentation body are separated, and the storage and operation of the game data processing method are completed on the server. The game screen presentation is completed on the client, and the client is mainly used for receiving and sending game data and presenting the game screen. For example, the client can be a display device with a data transmission function close to the player side, such as a mobile terminal, a TV, a computer, a handheld computer, a personal digital assistant, a head-mounted display device, etc., but the terminal device for processing game data is a server in the cloud. When playing the game, the player operates the client to send instructions to the server, and the server controls the running of the game according to the instructions, encodes and compresses the game screen and other data, and returns it to the client through the network. Finally, the client decodes and outputs the game screen.
[0044] It should be noted that in the embodiments of the present application, the execution subject of the game data processing method can be a terminal device or a server, wherein the terminal device can be a local terminal device or a client device in the aforementioned cloud game. The embodiments of the present application do not limit the type of the execution subject.
[0045] For example, in combination with the above introduction, Figure 2 A game system 1000 for implementing a game data processing method provided by an embodiment of the present application is shown. The game system 1000 may include at least one terminal 1001, at least one server 1002, at least one database 1003, and a network. The terminal 1001 held by the player can be connected to the servers of different games through the network. The terminal is any device with computing hardware that can support and execute software application tools corresponding to the game.
[0046] In the above-mentioned game system 1000, the terminal 1001 is used to install and run the game application. In some cases, the game application may not be installed in advance in the terminal 1001, and the player can directly access the game through a client such as a browser. The player uses the registered game account to log in to the game application, and can manipulate the virtual character corresponding to the game account to participate in the game. When the player logs in to the game application, the terminal 1001 will send a login request to the server 1002, and the server 1002 will verify the game account used by the player. At the same time, the server 1002 determines the game mechanism corresponding to the game account according to the login request, and the verification will return a successful login notification to the terminal 1001. In the process of the player participating in the game through the game application, the terminal 1001 and the server 1002 interact with each other, and the terminal 1001 sends various information to the server 1002. The server 1002 determines the display data of the terminal 1001 according to the stored game mechanism (such as the game data processing method provided in this application) and the received information, and sends the display data to the terminal 1001, so as to display the display data sent by the server 1002 to the player through the terminal 1001.
[0047] In possible application scenarios, different terminals 1001 may be served by different servers 1002. Therefore, in order to distinguish the servers 1002 corresponding to different game terminals 1001, the first and second methods will be used for description when involved in the embodiments of the present application. In fact, the servers 1002 corresponding to different game terminals 1001 may be the same server 1002. Therefore, without distinguishing between the first and the second, it can be understood that the terminals 1001 corresponding to the virtual characters in the same game scene are served by the same server 1002.
[0048] In addition, when the game system 1000 includes multiple terminals, multiple servers, and multiple networks, different terminals can be connected to each other through different networks and different servers. The network can be a wireless network or a wired network, such as a wireless network such as a wireless local area network (WLAN), a local area network (LAN), a cellular network, a 2G network, a 3G network, a 4G network, a 5G network, etc. In addition, different terminals can also use their own Bluetooth network or hotspot network to connect to other terminals or to servers, etc. In addition, the game system 1000 may include multiple databases, multiple databases are coupled to different servers, and game-related information can be continuously stored in the database when different players play multi-player games online.
[0049] It should be noted that Figure 2 The game system diagram shown is only an example. The game system 1000 described in the embodiment of the present application is to more clearly illustrate the technical solution of the embodiment of the present application, and does not constitute a limitation on the technical solution provided in the embodiment of the present application. A person of ordinary skill in the art can know that with the evolution of the game system and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.
[0050] It should be noted that the operations that occur in the subsequent detailed introduction of the game data processing method provided in the embodiment of the present application can all be regarded as operations performed by the player through fingers or controlling a medium such as a mouse, keyboard, or stylus. The specific medium to be used can be determined according to the type of electronic device. For example, when the electronic device is a touch screen device such as a mobile phone, a tablet computer, a game console, etc., the player can operate on the touch screen through any suitable object or accessory such as a finger or stylus. When the terminal device is a non-touch screen terminal device such as a desktop computer or a laptop computer, the player can operate through an external device such as a mouse or keyboard.
[0051] It should be noted that in the embodiments of the present application, there is no restriction on whether the terminal device providing the graphical user interface is placed horizontally or vertically, that is, there is no specific restriction on whether the virtual game is a horizontal screen game or a vertical screen game. In this embodiment, the virtual game is a horizontal screen game, and the terminal device is placed horizontally as an example to introduce the solution. However, it does not mean that the game data processing method provided in this application is not applicable to vertical screen games. The game data processing method provided in this application can be applied to horizontal screen games and vertical screen games, that is, the operation mode set in the virtual game and the corresponding game logic are consistent in horizontal screen games and vertical screen games, and there are only slight differences in the layout of the interface elements in the graphical user interface.
[0052] The technical solution of the present application is described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0053] like Figure 3 As shown, Figure 3 This is a flowchart of an example of a method for processing game data provided by an embodiment of the present application. It should be noted that the steps shown may be performed in a logical order different from that shown in the flowchart of the method. The method may include the following steps S110 to S120.
[0054] Step S110: When the virtual character performs a jumping action, in response to the virtual character's height from the ground starting to decrease, a first horizontal speed of the virtual character when it is at a reference position is obtained, where the reference position is the position when the virtual character's height from the ground starts to decrease; the height from the ground is the height difference between the virtual character and a scene object below the virtual character.
[0055] Step S120: If the virtual character at the first position is not in contact with the scene object, adjust the first horizontal speed of the virtual character at the first position according to the first horizontal speed of the virtual character at the reference position, and the inclination angle of the scene object or the height of the virtual character from the ground, so that the target horizontal speed when the virtual character is in contact with the scene object is less than or equal to the first horizontal speed of the virtual character at the reference position; wherein the first position is a position after the reference position and when the virtual character is not in contact with the scene object.
[0056] The above steps S110 to S120 are described in detail below.
[0057] With respect to the above step S110, the above virtual character may be a model controlled by the player in the game, the model may be a model used to represent the player's image or a model of a virtual object constituting a game scene, the model may be a three-dimensional virtual model or a two-dimensional virtual model, and this embodiment does not specifically limit this. The virtual object includes but is not limited to at least one of a virtual person, a virtual animal, a virtual machine, a virtual building, and a virtual plant.
[0058] The above-mentioned scene objects located below the virtual character refer to all scene objects located below the virtual character when the virtual character is performing a jumping behavior. The scene objects can be any object on which the virtual character can stand, including but not limited to: the ground (horizontal ground, sloping ground), buildings, boxes, trees, virtual vehicles, etc., without specific restrictions. It should be noted that the remaining scene objects except the ground can be fixed on the ground or located in the air area. This embodiment does not specifically limit it, as long as they are located below the virtual character. The following text introduces the scheme using the ground as a specific example of the scene object.
[0059] In this embodiment, the scene object can have a tilt angle when placed in the virtual scene of the game, that is, the angle between the surface of the scene object and the preset horizontal plane. It should be noted that, based on the jumping direction of the virtual character, the tilt angle of the scene object can include 0°, "positive angle", and "negative angle". Among them, when the tilt angle of the scene object is 0°, it means that the scene object is completely horizontal and has no tilt. For details, please refer to Figure 1 When the tilt angle of the scene object is a "positive angle", it means that the height of the scene object increases along the jumping direction of the virtual character, that is, the scene object can be regarded as an ascending scene object. For details, please refer to Figure 1 The slope ground shown in (b) in the figure; when the tilt angle of the scene object is a "negative angle", it means that the height of the scene object decreases along the jumping direction of the virtual character, that is, the scene object can be regarded as a descending scene object. For details, please refer to Figure 1 The sloped ground shown in (c) in the figure. In this embodiment, the value range of the above-mentioned "positive angle" or "negative angle" can be 0° to the maximum tilt angle of the scene object through which the virtual character can move. For example, in general, the maximum tilt angle is 45°, that is, the value range of the positive angle can be 0° to 45°, including 45°; the value range of the negative angle can be 0° to "-45°", including -45°.
[0060] Of course, the tilt angle of the scene object can also be based on a preset direction, which does not change with the change of the virtual character's jumping direction. In this case, the value range of the tilt angle of the scene object can be described as "0°~180°", where when the tilt angle of the scene object is 0°~90°, it means that the height of the scene object increases along the preset direction; when the tilt angle of the scene object is 90°~180°, it means that the height of the scene object decreases along the preset direction; where 0° and 180° both indicate that the scene object is completely horizontal. Figure 1 As shown, when the preset direction is the jumping direction of the virtual character, Figure 1The inclination angle α of the sloped ground shown in (b) may be any angle in the range of 0° to 90°; Figure 1 The inclination angle α of the sloped ground shown in (c) can be any angle in the range of 90° to 180°.
[0061] The height above the ground is the height difference between the virtual character and the scene object below the virtual character, and the height difference can be calculated by the character coordinates of the virtual character in the game scene and the object coordinates of the scene object directly below the virtual character, specifically the difference between the coordinate values used to represent the height in the character coordinates and the object coordinates; or the vertical distance between the bottom of the virtual character's bounding box and the surface of the scene object can be used as the height of the virtual character above the ground. This embodiment does not specifically limit this.
[0062] It should be noted that the heights of the virtual characters from the ground when they are located at different positions can be the same or different, and this embodiment does not specifically limit this. Figure 1 As shown in (a), when the virtual character performs a jumping behavior, there is only horizontal ground below the virtual character, so the height of the virtual character from the ground is the same when it is located at different positions; Figure 1 (b) and Figure 1 As shown in (c), when the virtual character performs a jumping behavior and there is a sloped ground with a non-zero inclination angle below the virtual character, the height of the virtual character from the ground is different when it is located at different positions.
[0063] It should be noted that, in the present embodiment, a jumping behavior may include several stages, for example, it may include a take-off stage, an ascending stage, a falling stage, a landing stage, etc. If the virtual character is controlled to rise again during the falling stage, the jumping process after the rise can be regarded as another jumping behavior.
[0064] It should be noted that in the embodiment of the present application, air resistance is not considered during the jumping process of the virtual character.
[0065] Generally speaking, when the jumping behavior performed by the virtual character is in the take-off stage, it means that the virtual character is in a take-off state, and at this time, the virtual character has not left the surface of the scene object; when the jumping behavior performed by the virtual character is in the ascent stage, it means that the virtual character is in an ascent state, and at this time, the virtual character leaves the surface of the scene object and is away from the surface of the scene object; when the jumping behavior performed by the virtual character is in the falling stage, it means that the virtual character is in a falling state, and at this time, the virtual character is close to the surface of the scene object; when the jumping behavior performed by the virtual character is in the landing stage, it means that the virtual character is in a landing state, and at this time, the virtual character is in contact with the surface of the scene object.
[0066] The height of the virtual character from the ground starts to decrease, which means that the virtual character starts to approach the scene object when performing the jumping behavior, that is, in this embodiment, when it is detected that the virtual character starts to approach the scene object during the jumping behavior, the above steps S110 to S120 are executed. It should be noted that when the inclination angle of the scene object is not 0, and the height of the scene object increases along the jumping direction of the virtual character, when the jumping behavior performed by the virtual character is in the ascending stage, if the increasing speed of the height of the scene object is greater than the ascending speed of the virtual character, the virtual character may also approach the scene object in the ascending stage. This embodiment does not limit this, and it can be judged according to the actual situation.
[0067] The above-mentioned reference position refers to the initial position when the height of the virtual character from the ground starts to decrease. For example, the height of the virtual character from the ground in the current game frame is 10 meters, the height of the virtual character from the ground in the previous game frame is 9 meters, and the height of the virtual character from the ground in the next game frame is 8 meters. Starting from the current game frame, the height of the virtual character from the ground starts to decrease. At this time, the position of the virtual character in the current game frame can be determined as the reference position.
[0068] It should be noted that, when the virtual character is performing a jumping behavior, the position or tilt angle of the scene object changes in real time. Therefore, the virtual character can approach the scene object multiple times during one jump, that is, the height of the virtual character from the ground can start to decrease multiple times. In this case, a jumping behavior performed by the virtual character can include multiple reference positions, that is, the reference position changes in real time according to the jumping state of the virtual character and the scene object. For details about this situation, please refer to the following description of Figure 7 The introduction of the specific examples provided will not be repeated here.
[0069] The first horizontal speed of the virtual character when it is at the reference position refers to the speed component in the horizontal direction of the current jumping speed when the virtual character moves to the reference position when performing the jumping behavior.
[0070] In an optional embodiment, when the virtual character in the game is set to jump at a constant speed at a default speed, that is, the virtual character maintains the default speed constant during the jumping behavior, then the first horizontal speed of the virtual character when it is at the reference position may be the default horizontal speed obtained by decomposing the default speed, and the default horizontal speed is the initial horizontal speed assigned to the virtual character when it takes off.
[0071] like Figure 4 As shown, it is assumed that the horizontal speed of the virtual character during the jump is the default speed V x0 When the virtual character at position A is given a horizontal velocity V x0, and the vertical velocity V y0 , then the virtual character is based on the horizontal speed V x0 and the vertical velocity V y0 Start the ascent phase of the jump behavior. During the ascent phase, affected by gravity, the vertical velocity V of the virtual character y0 will gradually decrease. When the virtual character jumps to position B, the vertical speed V y0 drops to 0, at which point the virtual character only has a horizontal velocity V x0 , assuming that, starting from position B, the height of the virtual character from the ground begins to decrease, that is, the virtual character begins to approach the sloped ground below, then the position B can be determined as the above-mentioned reference position, and the horizontal speed V at the position B is x0 That is, the first horizontal speed of the virtual character when it is located at the reference position.
[0072] Alternatively, in some optional embodiments, when a virtual character in a game performs a jumping behavior, the speed of the virtual character is affected by the interactive operation of the player, that is, the speed of the virtual character during the jumping process changes with the change of the interactive operation of the player. In a specific embodiment, a virtual scene of the game can be displayed through a graphical user interface, and the virtual scene includes a controlled virtual character; in response to a jumping operation for the virtual character, the virtual character is controlled to perform a jumping behavior corresponding to the jumping operation; further, the current horizontal speed input by the player when the virtual character is located at the reference position is determined as the first horizontal speed of the virtual character when the virtual character is located at the reference position.
[0073] The above-mentioned jump operation can be a trigger operation of the player on a preset jump control. The trigger operation can be a touch operation such as a press operation, a click operation, a slide operation, or a shortcut key operation, a voice command operation, etc., and there is no specific limitation.
[0074] When the virtual character is at the reference position, if the player stops triggering the jump control, the horizontal speed of the virtual character will become 0, that is, the first horizontal speed of the virtual character at the reference position is 0; and when the virtual character is at the reference position, if the player presses the jump control again, the pressing pressure is positively correlated with the first horizontal speed of the virtual character at the reference position. In this case, the first horizontal speed of the virtual character at the reference position may be the same as or different from the initial horizontal speed assigned to the virtual character when it takes off, and this embodiment does not limit this.
[0075] With respect to the above step S120, in this embodiment, the above first position is the current position of the virtual character, and the first position may be any position after the reference position and when the virtual character is not in contact with the scene object, which is determined according to the actual situation in the game and is not specifically limited in this embodiment. It is understandable that the position of the virtual character can be represented by coordinates in a coordinate system preset for the game scene, which will not be further described.
[0076] For example, Figure 4 As shown, if the virtual character approaches the scene object below from position B, then position C, position D or position E after position B can be used as the first position in sequence.
[0077] If the virtual character at the first position does not come into contact with the scene object, it means that the jumping behavior performed by the virtual character at the first position is not in the take-off stage or the landing stage, but is located in the air area in the virtual scene. When the virtual character is in the air area and the height of the virtual character from the ground begins to decrease, the subsequent step S120 is executed. In this embodiment, the detection process of whether the virtual character is in contact with the scene object is not described as a key point.
[0078] For the inclination angle and height from the ground of the above scene objects, please refer to the previous description and will not be repeated here.
[0079] It is understandable that when the virtual character begins to approach the scene object and does not contact the scene object, it can also move to multiple first positions respectively. The purpose of this step S120 is to adjust the first horizontal speed of the virtual character at each first position respectively according to the tilt angle of the scene object or the height of the virtual character from the ground during the movement, so that the target horizontal speed of the virtual character when it contacts the scene object can be changed in real time, so that it is more suitable for the scene object to be jumped to. Specifically, in this embodiment, the target horizontal speed when the virtual character contacts the scene object is less than or equal to the first horizontal speed when the virtual character is at the reference position, that is, in this embodiment, the maximum value of the target horizontal speed when the virtual character contacts the scene object is the first horizontal speed when the virtual character begins to approach the scene object.
[0080] Through the above method, during the jumping behavior performed by the virtual character, starting from the time when the virtual character starts to approach the scene object below, the inclination angle of the scene object below the virtual character or the height of the virtual character from the ground can be comprehensively considered, and the first horizontal speed of the virtual character corresponding to each first position in the jumping process after the virtual character starts to approach the virtual object below and before contacting the virtual object is adjusted in real time, so that the target horizontal speed of the virtual character when contacting the scene object changes in real time, and the target horizontal speed of the virtual character when landing on the surface of the scene object is more adapted to the scene object, so that the jumping behavior of the virtual character is more in line with the laws of physics, looks more natural and real, and enhances the player's visual experience.
[0081] It should be noted that, in the embodiments of the present application, unless otherwise specified, the speed adjustment involved in each embodiment only refers to the adjustment of the speed magnitude, and no adjustment is made to the speed direction.
[0082] Next, the game data processing method provided by this application is further described.
[0083] In some optional specific embodiments, when the virtual character is located at different positions, it can correspond to scene objects with different tilt angles; Figure 5 As shown in the figure, when the virtual character is performing a jumping behavior, when the virtual character is located above the scene object AB, the corresponding scene object has an inclination angle of 0° at this stage; when the virtual character is located above the scene object BC or above the scene object CD, the corresponding scene objects have an inclination angle that is not 0 at these two stages. That is, the inclination angle of the scene object changes in real time as the virtual character jumps.
[0084] The first position is the position of the virtual character in the current game frame; based on this, the above step S120 can be specifically implemented through the following steps S1 to S3.
[0085] Step S1: According to the first horizontal speed of the virtual character at the reference position, and the first tilt angle or the first height from the ground, the first horizontal speed of the virtual character at the first position is adjusted to obtain the second horizontal speed of the virtual character at the first position.
[0086] Step S2: Control the virtual character to move from the first position to the second position at a second horizontal speed, and determine the second horizontal speed as the first horizontal speed when the virtual character is at the second position.
[0087] Step S3: Determine the second position as the first position, and return to execute steps S1 to S3 until the virtual character at the first position comes into contact with the scene object; wherein the first inclination angle is the inclination angle of the scene object corresponding to the virtual character at the first position; and the first height above the ground is the height above the ground when the virtual character is at the first position.
[0088] The first tilt angle refers to the tilt angle of the corresponding scene object when the virtual character is at the first position. The first height above the ground refers to the height difference between the virtual character and the scene object directly below when the virtual character is at the first position.
[0089] The first horizontal speed of the virtual character at the first position refers to the original horizontal speed of the virtual character when it moves to the first position. In other words, the virtual character moves to the first position at the first horizontal speed. The second horizontal speed of the virtual character at the first position refers to the horizontal speed required for the virtual character to move from the first position to the next position of the first position.
[0090] The purpose of the above-mentioned step S1 is to limit the parameters used to adjust the first horizontal speed of the virtual character when it is at the first position, which may include: the first inclination angle of the scene object corresponding to the virtual character when it is at the first position, or the first height from the ground corresponding to the virtual character when it is at the first position; that is, the first horizontal speed of the virtual character when it is at the first position is adjusted by the first inclination angle or the first height from the ground to obtain the second horizontal speed required for the virtual character to move from the first position to the next position of the first position.
[0091] like Figure 4 As shown, as described above, assuming that, starting from position B, the height of the virtual character from the ground begins to decrease, then position B is the reference position. Based on this, assuming that the virtual character moves from position B to position C, then position C is a specific example of the first position, the inclination angle α of the scene object directly below position C is a specific example of the first inclination angle, and the height difference between the virtual character at position C and the scene object is a specific example of the first height from the ground. That is, the first horizontal speed corresponding to the virtual character at position C can be adjusted by the inclination angle α, or the height difference between the virtual character at position C and the sloped ground, to obtain the second horizontal speed corresponding to the virtual character at position C, so that the virtual character can move from position C to position D at the second horizontal speed.
[0092] For the above step S2, the above second position is the new position to which the virtual character at the first position is to move, that is, the second position is the next position of the first position. In other words, when the game scene of the current game frame is switched to the game scene of the next game frame, the virtual character should be in a new position in the game scene of the next game frame, that is, the first position and the second position are the positions of the virtual character in two adjacent frames of scene images.
[0093] The second position can be determined by the first position of the virtual character, the moving speed (the second horizontal speed and the vertical speed) and the frame duration, wherein the frame duration is the interval between two adjacent frames to be played. The calculation method of the second position is not described in detail in this embodiment. Figure 4 As shown, when the virtual character is currently located at position C, position C is the first position, and position D is a specific example of the second position, that is, the virtual character is located at position D in the game scene of the next game frame.
[0094] Determining the second horizontal speed as the first horizontal speed when the virtual character is at the second position means that after controlling the virtual character to move from the first position to the second position at the second horizontal speed, the second horizontal speed is used as the original horizontal speed when the virtual character is at the second position.
[0095] It can be understood that in this embodiment, when the virtual character moves from a first position to a second position, if the virtual character is only affected by gravity in the vertical direction, the vertical movement speed required by the virtual character can be calculated by the gravity acceleration; if the player assigns a certain vertical falling speed to the virtual character during the falling process of the virtual character, the vertical movement speed required by the virtual character can be the sum of the falling speed calculated by the gravity acceleration and the falling speed assigned by the player, which will not be described in detail; because in the embodiment of the present application, when the virtual character jumps to the surface of the scene object, the elastic force of the scene object on the virtual character is not considered. Therefore, the vertical movement speed required for the virtual character to fall from the first position to the second position is not adjusted, and the embodiment of the present application focuses on the horizontal speed of the virtual character during the movement of the virtual character.
[0096] With respect to the above step S3, determining the second position as the first position means updating the first position, that is, taking the second position as the new first position, and then the inclination angle of the corresponding scene object when the virtual character is located at the second position is taken as the new first inclination angle, the height difference between the virtual character and the corresponding scene object directly below when the virtual character is located at the second position is taken as the new first height above the ground, and the first horizontal speed corresponding to the virtual character when the virtual character is located at the second position is taken as the new first horizontal speed.
[0097] For example, Figure 4As shown, after the virtual character jumps from position C to position D at the second horizontal speed, the second horizontal speed is determined as the first horizontal speed of the virtual character at position D, and the position D is determined as the first position.
[0098] After updating the first position, the first tilt angle, and the first height from the ground, the above steps S1 to S3 are repeatedly executed until the virtual character at the first position comes into contact with the scene object; that is, when the virtual character comes into contact with the scene object, the adjustment process for the horizontal speed of the virtual character is stopped.
[0099] In this way, when the virtual character starts to approach the scene object, the horizontal speed of the virtual character at each first position can be adjusted according to the tilt angle corresponding to the virtual character at each first position, or the height above the ground corresponding to the virtual character at each first position, so that the horizontal movement speed of the virtual character at each first position tends to approach the expected horizontal speed, which is the horizontal speed that is more suitable for contact with the scene object. In this way, no matter at which stage of the jumping process the virtual character contacts the scene object, it lands at a more matching horizontal speed, so that the landing stage in the virtual character's jumping behavior is more in line with the laws of physics, looks more natural and real, and enhances the player's visual experience.
[0100] In some optional embodiments, the above step S1 can be specifically implemented through the following steps S10 to S11.
[0101] Step S10: determining a predicted horizontal speed of the virtual character at the first position to jump to the surface of the scene object according to a first horizontal speed of the virtual character at the reference position and a first tilt angle or a first height above the ground.
[0102] Step S11: adjusting the first horizontal speed of the virtual character when it is at the first position according to the predicted horizontal speed, so as to obtain the second horizontal speed of the virtual character when it is at the first position.
[0103] In this optional embodiment, the predicted horizontal speed refers to the expected landing horizontal speed of the virtual character at the first position when jumping to the surface of the scene object, or it can be understood as the "optimal" landing horizontal speed corresponding to the virtual character at the current position.
[0104] Furthermore, based on the predicted horizontal speed, it can be inferred that when the virtual character is to move from the first position, a second horizontal speed is required so that when the virtual character moves from the first position to the second position, the horizontal movement speed of the virtual character tends to approach the "optimal" landing horizontal speed.
[0105] That is, in this embodiment, the predicted horizontal speed corresponding to the virtual character at each first position is used as the target guide for the horizontal speed of the virtual character during the jumping process, and the second horizontal speed corresponding to each first position before the virtual character lands is reversed, which can ensure that the virtual character reaches the expected horizontal speed when it finally lands, so that the jumping behavior of the virtual character conforms to the laws of physics.
[0106] In an optional specific embodiment, the above step S10 can be implemented by the following step S101 and step S102a, or step S101 and step S102b.
[0107] Step S101: determining a second height above the ground when the virtual character is located at a third position in a previous game frame of the current game frame.
[0108] Step S102a: when the first height above the ground is less than the second height above the ground, determining a predicted horizontal speed according to a first horizontal speed of the virtual character when the virtual character is located at a reference position and a first tilt angle.
[0109] Step S102b: when the first height above the ground is greater than or equal to the second height above the ground, determining a predicted horizontal speed according to the first horizontal speed of the virtual character when it is located at the reference position and the first height above the ground.
[0110] As described above, in the embodiment of the present application, the first position is the position of the virtual character in the current game frame, the second position is the position of the virtual character in the next game frame of the current game frame, and the third position in the above step S101 is the position of the virtual character in the previous game frame of the current game frame. Then, in the embodiment of the present application, after the height of the virtual character from the ground begins to decrease, the change rate of the height from the ground between two adjacent frames is determined, and the change rate of the height from the ground can be determined by the height difference between the first height from the ground corresponding to the current game frame and the second height from the ground corresponding to the previous game frame of the current game frame.
[0111] When the first height above the ground is less than the second height above the ground, the change rate of the height above the ground is less than 0, indicating that the height above the ground of the virtual character has a tendency to gradually decrease, that is, the virtual character is gradually approaching the scene object; at this time, the predicted horizontal speed of the virtual character to jump to the surface of the scene object is determined according to the first horizontal speed and the first inclination angle when the virtual character is at the reference position. That is, when the virtual character has a tendency to approach the scene object, only the influence of the inclination angle of the scene object corresponding to the virtual character at the first position on the landing horizontal speed of the virtual character is considered.
[0112] When the first height above the ground is greater than or equal to the second height above the ground, the change rate of the height above the ground is greater than or equal to 0, indicating that the height above the ground of the virtual character has a tendency to gradually increase, that is, the virtual character gradually moves away from the scene object; at this time, the predicted horizontal speed of the virtual character to jump to the surface of the scene object is determined according to the first horizontal speed when the virtual character is at the reference position and the first height above the ground when the virtual character is at the first position. That is, when the virtual character has a tendency to move away from the scene object, only the influence of the first height above the ground when the virtual character is currently at the first position on the landing horizontal speed of the virtual character is considered.
[0113] like Figure 6 As shown, Figure 6 A schematic diagram of the change rate of the height above the ground of a virtual character is provided. Figure 6 In the specific example shown, it is assumed that the virtual character is currently at position C, and the virtual character was at position B in the previous game frame of the current game frame. The first height above the ground when the virtual character is currently at position C is 10 meters (that is, the height difference between the virtual character at position C and the scene object directly below position C is 10 meters), and the second height above the ground when the virtual character is at position B is 12 meters. The virtual character starts to approach the scene object below from position B. At this time, position B can be used as a reference position, and the corresponding height change rate when the virtual character is at position C is less than 0.
[0114] When the virtual character moves from position C to position D, the first height above the ground corresponding to the virtual character at position D is 8 meters, the second height above the ground corresponding to the virtual character at position C is 10 meters, and the change rate of the virtual character's height above the ground is also less than 0. Figure 6 In the virtual scene shown, at each position (such as position C and position D) after the virtual character is located at position B until it falls on the surface of the scene object, the rate of change of the virtual character's height above the ground is less than 0. In this stage, the predicted horizontal speed corresponding to the virtual character at each position can be calculated only by the inclination angle α of the scene object, and the first horizontal speed at each position can be adjusted according to the predicted horizontal speed corresponding to each position.
[0115] like Figure 7 As shown, Figure 7 Another example of a change diagram of the rate of change of the height above the ground of a virtual character is provided. Figure 7In the specific example shown, the inclination angle of the virtual scene in which the virtual character performs a jumping behavior includes an inclination angle α1 and an inclination angle α2. The inclination angle α1 and the inclination angle α2 may be the same or different, and there is no restriction on this. In the virtual scene, assuming that the virtual character starts to jump at position A on the scene object with an inclination angle of α1, and when it moves to position C, the first height above the ground corresponding to the virtual character is 25 meters, and at the previous position B of the current position C, the second height above the ground corresponding to the virtual character is 28 meters, then the rate of change of the height above the ground of the virtual character at position C is less than 0, and the virtual character starts to approach the scene object from position B, then position B is a specific example of the reference position described above, and the current position C is a specific example of the first position described above, and when calculating the predicted horizontal speed corresponding to the virtual character at position C, it can be determined according to the inclination angle α1 of the scene object corresponding to the virtual character at position C.
[0116] When the virtual character moves from position C to position D, the inclination angle of the scene object corresponding to the virtual character at position D switches from inclination angle α1 to inclination angle α2, and the first height above the ground corresponding to the virtual character at position D is 58 meters, and the second height above the ground at the virtual character at position C is 25 meters. At this time, the rate of change of the height above the ground at the virtual character at position D is greater than 0. It can be considered that the virtual character gradually approaches the scene object and then starts to move away from the scene object. At this time, the predicted horizontal speed of the virtual character at the first position D can be determined in combination with the first height above the ground of the virtual character at the first position D.
[0117] Furthermore, when the virtual character moves from position D to the positions after position D (such as position E and position F), the virtual character is readjusted from the state of initially moving away from the scene object to the state of initially approaching the scene object, that is, starting from position D, the height of the virtual character above the ground begins to decrease again. At this time, the reference position described above is updated from position B to position D until it falls on the scene object. In this case, the height above the ground between the virtual character and the scene object gradually decreases. Therefore, after position D, the inclination angle α2 of the scene object can be used to determine the predicted horizontal speed corresponding to the virtual character at each position until the virtual character comes into contact with the scene object.
[0118] In some optional embodiments, the above step S102a can be specifically performed by the following steps S102a-1
[0119] ~Step S102a-2 is implemented.
[0120] Step S102a-1: Determine a simulation angle corresponding to the scene object at the first position according to the first tilt angle.
[0121] Step S102a-2: Determine a predicted horizontal speed according to the first horizontal speed of the virtual character when it is located at the reference position and the simulation angle; the predicted horizontal speed is negatively correlated with the simulation angle.
[0122] The simulation angle is the angle value used when simulating the predicted horizontal speed of the virtual character to jump to the surface of the scene object with different inclination angles.
[0123] In an optional specific embodiment, when the first tilt angle is within a preset first angle range, the first tilt angle is determined as a simulation angle; when the first tilt angle is within a preset second angle range, the first preset angle is determined as a simulation angle.
[0124] Among them, the first angle range is the angle range composed of the 0° and the value range of the "positive angle" described above; the second angle range is the value range of the "negative angle" described above. That is, when the virtual character approaches the scene object when performing a jumping behavior, the real inclination angle of the scene object is used as the simulation angle to participate in the calculation of the predicted horizontal speed; and when the virtual character moves away from the scene object when performing a jumping behavior, the first preset angle is determined as the simulation angle corresponding to the scene object to participate in the calculation of the predicted horizontal speed. Optionally, the first preset angle can be 0° or other angle values, which is set according to actual conditions and is not specifically limited in this embodiment.
[0125] It can be understood that when the height of the scene object gradually increases along the jumping direction of the virtual character, the greater the inclination of the scene object, the smaller the horizontal speed of the virtual character falling on the surface of the scene object should be. In this way, the component of the horizontal speed in the vertical direction of the virtual character when falling on the surface of the scene object with a larger simulation angle can be reduced to avoid the sudden change of the landing cushioning action caused by the speed component.
[0126] Based on this, in this embodiment, the predicted horizontal speed is negatively correlated with the simulation angle, and when the first tilt angle is within the first angle range, it means that the virtual character jumps on the scene object with increasing height along the jumping direction of the virtual character, and the simulation angle is the first tilt angle at this time. Therefore, when the first tilt angle is within the first angle range, the predicted horizontal speed is negatively correlated with the first tilt angle. The larger the simulation angle of the scene object corresponding to the virtual character at the first position is, the smaller the predicted horizontal speed is, and thus the target horizontal speed when the virtual character contacts the scene object is smaller; in this way, the target horizontal speed when the virtual character contacts the scene object with a larger tilt angle can be made smaller in the vertical direction;
[0127] When the first inclination angle is within the second angle range, it means that the virtual character is jumping on a horizontal scene object with an inclination angle of 0° or a scene object with a decreasing height along the jumping direction of the virtual character. At this time, the virtual character is expected to contact the scene object at a larger horizontal speed. In this case, the simulation angle is set to a fixed first preset angle, and the corresponding predicted horizontal speed at each position is the same, which will not affect the landing horizontal speed of the virtual character when it contacts the scene object. In this way, the jumping behavior performed by the virtual character is more in line with the laws of physics, and the details of the jumping behavior performed by the virtual character are improved.
[0128] In some optional embodiments, the above step S102a-2 can be specifically implemented through the following steps A1 to A3.
[0129] Step A1: Determine a first ratio between a simulation angle and a second preset angle; the simulation angle is less than or equal to the second preset angle, and the second preset angle is greater than the first preset angle.
[0130] Step A2: adjusting the first horizontal speed of the virtual character when it is located at the reference position according to the first ratio to obtain an adjusted first horizontal speed.
[0131] Step A3: determining a predicted horizontal speed according to the first horizontal speed of the virtual character when it is located at the reference position and the adjusted first horizontal speed.
[0132] The purpose of steps A1 to A3 is to determine the current predicted horizontal speed of the virtual character by the ratio of the simulation angle corresponding to the scene object at the first position to the maximum inclination angle after the virtual character gradually approaches the scene object from the reference position, so that the predicted horizontal speed is negatively correlated with the simulation angle.
[0133] In this embodiment, the second preset angle is the maximum tilt angle of an object through which a virtual character pre-designed for a virtual game can move; for example, the second preset angle may be 45°, which is not specifically limited in this embodiment.
[0134] In an optional specific embodiment, in the above step A2, "adjusting the first horizontal speed of the virtual character when it is at the reference position according to the first ratio to obtain the adjusted first horizontal speed" can specifically be determining the product of the first ratio and the first horizontal speed as the adjusted first horizontal speed.
[0135] In an optional specific embodiment, the above step A3 may be implemented by determining the difference between the first horizontal speed and the adjusted first horizontal speed as the predicted horizontal speed of the first object surface corresponding to the first position to be jumped by the virtual character.
[0136] That is, in this embodiment, the simulation angle corresponding to the first object can be determined by the following formula (1).
[0137]
[0138] Among them, α is the simulation angle corresponding to the scene object when the virtual character is in the first position; β is the actual tilt angle of the scene object when the virtual character is in the first position, and β is not equal to 0. 0° is a specific example of the first preset angle described above. That is, as shown in formula (1), when the actual tilt angle β of the scene object is within the first angle range, the actual tilt angle β of the scene object is determined as the simulation angle, and participates in the subsequent calculation of the predicted horizontal speed; and when the actual tilt angle β of the scene object is within the second angle range, the first preset angle 0° is determined as the simulation angle, and participates in the subsequent calculation of the predicted horizontal speed. Based on the above formula (1), in this embodiment, the predicted horizontal speed of the virtual character at the first position to jump to the surface of the scene object when the rate of change of the height above the ground of the virtual character is less than 0 can be determined by the following formula (2).
[0139]
[0140] Among them, v t v is the predicted horizontal speed of the virtual character at the first position to jump to the surface of the scene object; s is the first horizontal speed of the virtual character when it is at the reference position; α is the simulation angle corresponding to the scene object when the virtual character is at the first position; θ is the second preset angle mentioned above.
[0141] As shown in formula (1), when the virtual character is at the first position, the larger the simulation angle α corresponding to the corresponding scene object is, the predicted horizontal speed v t When the virtual character is at the first position, the smaller the simulation angle α of the corresponding scene object is, the predicted horizontal speed v t In other words, in this embodiment, when the rate of change of the height of the virtual character from the ground is less than 0, the predicted horizontal speed of the virtual character is negatively correlated with the simulated angle of the scene object corresponding to the virtual character when the virtual character is at the first position. The maximum value of the simulated angle α corresponding to the scene object corresponding to the virtual character when the virtual character is at the first position is the second preset angle θ.
[0142] In some optional embodiments, the above step S102b can be specifically implemented through the following steps B1 to B2.
[0143] Step B1: Obtaining a third height above the ground when the virtual character is located at a reference position.
[0144] Step B2: determining a predicted horizontal speed according to the third height above the ground, the first height above the ground, and the first horizontal speed of the virtual character when the virtual character is located at the reference position.
[0145] The third height from the ground is the height difference between the virtual character and the scene object directly below when the virtual character is located at the reference position.
[0146] The purpose of steps B1 to B2 is to determine the predicted horizontal speed corresponding to the virtual character's first position by using the first height above the ground corresponding to the virtual character when it is at the first position and the third height above the ground when the virtual character starts to approach the object while performing a jumping behavior, when the virtual character starts to approach the corresponding object from the reference position and then starts to move away from the object, so as to associate the predicted horizontal speed with the height above the ground of the virtual character and increase the realism of the virtual character's jumping behavior.
[0147] In some specific embodiments, the above step B2 can be implemented through the following steps B20 to B21a, or steps B20 to B21b.
[0148] Step B20: Determine a second ratio between the first height above the ground and the third height above the ground.
[0149] Step B21a: When the second ratio is less than a preset value, the product of the second ratio and the first horizontal speed of the virtual character when the virtual character is located at the reference position is determined as the predicted horizontal speed.
[0150] Step B21b: When the second ratio is greater than a preset value, the first horizontal speed of the virtual character when it is located at the reference position is determined as the predicted horizontal speed.
[0151] As described above, the first height above the ground is the height above the ground when the virtual character is located at the first position, and the third height above the ground is the height above the ground when the virtual character is located at the reference position, which will not be described in detail.
[0152] That is, when the virtual character starts to approach the corresponding object and then starts to move away from the object during the jumping behavior, the purpose of the above step B21a is to determine the current corresponding predicted horizontal speed of the virtual character according to the ratio of the height above the ground when the virtual character is at the first position to the height above the ground when the virtual character is at the reference position if it is detected that the height above the ground when the virtual character is at the first position is less than the height above the ground when the virtual character is at the reference position; that is, when the virtual character is expected to move away from the scene object and the first height above the ground when the virtual character is at the first position is less than the third height above the ground, the predicted horizontal speed is positively correlated with the first height above the ground. That is, the higher the first height above the ground when the virtual character is at the first position, the greater the predicted horizontal speed corresponding to the virtual character at the first position; when the first height above the ground when the virtual character is at the first position is lower, the predicted horizontal speed corresponding to the virtual character at the first position is lower, so that the jumping behavior of the virtual character conforms to the physical phenomenon in the real world that the higher the height, the faster the landing speed.
[0153] The purpose of the above step B21b is that if it is detected that the height of the virtual character from the ground at the first position is equal to or greater than the height of the virtual character from the ground at the reference position, the first horizontal speed of the virtual character at the reference position is determined as the predicted horizontal speed, that is, when the virtual character is far away from the scene object, the maximum horizontal speed of the virtual character when in contact with the scene object is expected to be the first horizontal speed of the virtual character when at the reference position, that is, the maximum landing horizontal speed of the virtual character when in contact with the scene object is limited.
[0154] That is, in this embodiment, the predicted horizontal speed of the virtual character jumping to the surface of the scene object when the virtual character approaches the scene object and moves away from the scene object again when performing the jumping behavior can be determined specifically by the following formula (3).
[0155]
[0156] Among them, h c is the first height above the ground when the virtual character is currently at the first position; h s is the third height above the ground corresponding to the virtual character at the reference position, 1 is a preset value, and min() is a function for obtaining the minimum value of the parameters. The remaining same or similar parameters can refer to the description of formula (1) or formula (2) above, which will not be repeated here.
[0157] That is, in combination with the above steps B20, B21a and B21b, when the first height above the ground h c Less than the third ground clearance h s, it indicates that the virtual character has a tendency to continuously approach the scene object from the reference position to the current first position, and the height above the ground is smaller than when it starts to approach the scene object. At this time, the predicted horizontal speed corresponding to the virtual character is positively correlated with the current first height above the ground, that is, the greater the current first height above the ground of the virtual character, the greater the current predicted horizontal speed corresponding to the virtual character. When the current first height above the ground of the virtual character is smaller, the current predicted horizontal speed corresponding to the virtual character is smaller. That is, the closer the virtual character is to the scene object, the smaller the jumping horizontal speed of the virtual character is expected to be, so as to reduce the horizontal speed of the virtual character when it lands on the surface of the scene object, thereby reducing the impact of the virtual character landing on the object to avoid the virtual character from performing a landing buffering action.
[0158] When the first ground clearance h c Greater than or equal to the third ground clearance h s , it means that the virtual character first approaches the scene object from the reference position and then starts to move away from the scene object, and it is expected that the virtual character moves at the first horizontal speed corresponding to the virtual character at the reference position in the process of moving away from the scene object.
[0159] In combination with the above embodiments, after calculating the predicted horizontal speed corresponding to the virtual character at the first position, in some optional embodiments, the above step S11 "adjusting the first horizontal speed of the virtual character when it is at the first position according to the predicted horizontal speed to obtain the second horizontal speed of the virtual character when it is at the first position" can be specifically implemented through the following steps C1 to C3.
[0160] Step C1: determining a first weight value corresponding to a first horizontal speed when the virtual character is at a first position, and a second weight value corresponding to a predicted horizontal speed; the second weight value is negatively correlated with the first weight value.
[0161] Step C2: performing weighted sum processing on the first horizontal speed and the predicted horizontal speed of the virtual character when the virtual character is located at the first position according to the first weight value and the second weight value to obtain a weighted result.
[0162] Step C3: Determine the weighted result as the second horizontal speed of the virtual character when it is located at the first position.
[0163] That is, in the embodiment of the present application, weights are assigned to the first horizontal speed and the predicted horizontal speed of the virtual character when it is at the first position, so that the second horizontal speed of the virtual character when it is at the first position has a tendency to smoothly transition from the first horizontal speed when it is at the first position to the predicted horizontal speed, so that the virtual character has a tendency to jump to the surface of the scene object at the predicted horizontal speed.
[0164] That is, the second horizontal speed of the virtual character at the first position is within the speed range determined by the predicted horizontal speed when the virtual character is at the first position and the first horizontal speed when the virtual character is at the first position. Specifically, when the first horizontal speed when the virtual character is at the first position is greater than the predicted horizontal speed when the virtual character is at the first position, the calculated second horizontal speed has a tendency to decrease from the first horizontal speed to the predicted horizontal speed; when the first horizontal speed when the virtual character is at the first position is equal to the predicted horizontal speed when the virtual character is at the first position, the calculated second horizontal speed is equal to the first horizontal speed when the virtual character is at the first position; when the first horizontal speed when the virtual character is at the first position is less than the predicted horizontal speed when the virtual character is at the first position, the calculated second horizontal speed has a tendency to increase from the first horizontal speed to the predicted horizontal speed.
[0165] In a specific embodiment, the third height above the ground when the virtual character is located at the reference position can be obtained; and then the second weight value and the first weight value are determined based on the third height above the ground and the first height above the ground. Specifically, the second ratio between the first height above the ground and the third height above the ground is determined; when the second ratio is less than or equal to a preset value, the second ratio is determined as the first weight value; when the second ratio is greater than a preset value, the preset value is determined as the first weight value. Further, the second weight value is determined based on the first weight value. In this embodiment, the sum of the second weight value and the first weight value is 1.
[0166] Among them, the preset value can be 1 as introduced above. At this time, when the first height above the ground is greater than the third height above the ground, that is, the second ratio is greater than 1, it means that the virtual character is currently in the stage of approaching the object and then moving away from the scene object again. At this time, the preset value 1 can be used as the first weight.
[0167] That is, in this embodiment, the target horizontal speed of the virtual character when it is at the first position can be determined specifically by the following formula (4).
[0168]
[0169] Among them, v f is the second horizontal speed corresponding to the virtual character being at the first position; v c is the first horizontal speed of the virtual character when it is at the first position; 1 is the above-mentioned preset value.
[0170] Next, combine Figure 7 And a specific example is given to describe in detail the method for processing game data provided by this application.
[0171] like Figure 7As shown, assuming that α1=30°, α2=15°, the maximum inclination angle of the scene object that the virtual character can move through θ=45°, the virtual character starts jumping from position A with a default horizontal speed of 15m / s, and the first horizontal speed of the virtual character when jumping to position B is the default horizontal speed.
[0172] Based on this, when the virtual character jumps from position B to position C at a speed of 15m / s, the corresponding height above the ground when the virtual character is at position C is 25 meters, and the height above the ground when the virtual character is at position B is 28 meters. The rate of change of the height above the ground when the virtual character is at position C is less than 0, that is, the height above the ground of the virtual character during the jumping process starts to decrease from position B. Then, position B can be determined as the reference position, and each position after position B can be determined as the first position in sequence. For example, position C where the virtual character is currently located is a specific example of the first position described above.
[0173] When the virtual character is located at the first position C, a first horizontal speed v of the virtual character at the first position C is detected. c =15m / s, first ground clearance h c = 25 meters, the third ground height h of the virtual character at the reference position B s = 28 meters; in addition, the virtual character is located at the first position C corresponding to the scene object with an inclination angle of α1 = 30°, and the position before the first position C is the reference position B, so the second height from the ground is the third height from the ground h s =28 m;
[0174] Based on the above specific example, the inclination angle of the scene object corresponding to the virtual character at the first position is α1=30°, and the height of the scene object gradually increases along the jumping direction of the virtual character. Therefore, when the virtual character is at the first position C, the simulation angle of the scene object corresponding to the virtual character is α=30°. c =25 meters less than the second ground clearance h s = 28 meters, at this time, v s =15m / s, α=α1=30°, θ=45° Substituting into the above formula (2), the predicted horizontal speed v corresponding to the virtual character at the first position C is calculated t About 5 m / s, that is, it means that the virtual character is expected to eventually contact the scene object at a horizontal speed of 5 m / s;
[0175] The predicted horizontal speed v corresponding to the virtual character being located at the first position C is calculated. t =5m / s, then the v t =5m / s,h c =25 m, v c=15m / s,h s = 28 meters, etc. Substituting into the above formula (4), the second horizontal speed v of the virtual character at position C can be calculated. f1 is about 13.9 m / s, that is, the virtual character can be controlled to move from position C to position D at a horizontal speed of 13.9 m / s. It can be seen that the target horizontal speed v when the virtual character moves from position C to position D f1 With a first horizontal velocity v c =15m / s predicted horizontal velocity v t =5m / s, a gradual transition trend.
[0176] When the virtual character moves to position D, position D is determined as the first position, the inclination angle of the scene object corresponding to the virtual character at the first position D is α2=15°, and the first horizontal speed v of the virtual character at the first position D is c =v f1 =13.9m / s, first ground clearance h c =58 meters; in addition, the previous position of the virtual character at the first position D is position C, and the second height above the ground of the virtual character at position C is 25 meters.
[0177] Based on the above specific example, the first ground clearance h c =58 meters is greater than the second ground clearance of 25 meters. At this time, v s =15m / s,h c =58 m, h s = 28 meters and substituted into the above formula (3) to calculate the predicted horizontal speed v corresponding to the virtual character at the first position D. t =15m / s, that is, it is expected that the virtual character will eventually contact the scene object below at a horizontal speed of 15m / s;
[0178] The predicted horizontal speed v corresponding to the virtual character being located at the first position D is calculated. t =15m / s, then the v t =15m / s,h c =58 m, v c =13.9m / s,h s = 28 meters, etc. Substituting into the above formula (4), the second horizontal speed v of the virtual character at position D can be calculated. f2 =13.9 m / s; that is, the virtual character can be controlled to move from position D to position E at a horizontal speed of 13.9 m / s. It can be seen that the second horizontal speed v of the virtual character when moving from position D to position E f2 With a first horizontal velocity v c =13.9m / s predicted horizontal velocity vt =15m / s, a gradual transition trend.
[0179] When the virtual character moves to position E, position E is determined as the first position, the inclination angle of the scene object corresponding to the virtual character at the first position E is α2=15°, and the first horizontal speed v of the virtual character at the first position E is c =v f2 =13.9m / s, first ground clearance h c =56 meters; in addition, the previous position of the virtual character at the first position E is position D, and the second height above the ground of the virtual character at position D is 58 meters.
[0180] Based on the above specific example, the first ground clearance h c =56 meters is less than the second height above the ground of 58 meters, then it is expected that the virtual character will start to decelerate again at this time. Based on this, the position E can be determined as the reference position for the next deceleration cycle. The first horizontal speed v of the virtual character at the reference position E is s =13.9m / s; Based on this, v s =13.9m / s, α=α2=15°, θ=45° are substituted into the above formula (2) to calculate the predicted horizontal speed v corresponding to the virtual character at the first position E. t It is about 9.27 m / s, that is, it means that the virtual character is expected to eventually contact the scene object below at a horizontal speed of 9.27 m / s;
[0181] The predicted horizontal speed v corresponding to the virtual character being located at the first position E is calculated. t =9.27m / s, then t =9.27m / s,h c =56 m, v c =13.9m / s,h s =58 meters, etc. Substituting into the above formula (4), the second horizontal speed v of the virtual character at position E can be calculated. f3 =13.74m / s,
[0182] That is, the virtual character can be controlled to move from position E to position F at a horizontal speed of 13.74 m / s. It can be seen that the second horizontal speed v of the virtual character when moving from position E to position F is f3 With a first horizontal velocity v c =13.9m / s predicted horizontal velocity v t =9.27m / s, a gradual transition trend.
[0183] When the virtual character does not come into contact with the scene object, the target horizontal speed of the virtual character at each first position is repeatedly calculated using the above formula (2) or formula (3) and formula (4) until the virtual character comes into contact with the scene object.
[0184] In some optional embodiments, the game data processing method provided in the present application may further include the following step S130.
[0185] Step S130: If the virtual character at the first position comes into contact with the scene object, the first horizontal speed of the virtual character at the first position is determined as the target horizontal speed, and the virtual character is controlled to perform a target landing action matching the target horizontal speed.
[0186] That is, after the virtual character starts to approach the scene object, if the virtual character located at the first position comes into contact with the first object corresponding to the first position, that is, the jumping behavior performed by the virtual character enters the landing stage, the first horizontal speed of the virtual character when it is located at the first position can be determined as the target horizontal speed when the virtual character comes into contact with the scene object, and the virtual character can be further controlled to perform a target landing action that matches the target horizontal speed.
[0187] The above-mentioned target landing action is a buffering action performed by a pre-designed virtual character when it performs a jumping behavior and lands on the surface of an object. The target landing action can control the movement of the virtual character's skeleton based on the inertia generated by the motion state of the virtual character before the contact with the object surface and the force applied to the virtual character when the virtual character lands, thereby driving the virtual character to perform the action. For example, in this embodiment, without considering the elasticity of the object surface, when the virtual character falls on the surface of a scene object, the inertia generated by the motion state of the virtual character before the contact with the surface of the scene object and the horizontal speed of the virtual character when it lands on the surface of the scene object can be used to control the movement of the virtual character's skeleton and drive the virtual character to perform the target landing action.
[0188] In an optional specific embodiment, "controlling the virtual character to perform a target landing action that matches the target horizontal speed" in the above step S130 can be specifically implemented in the following way: obtaining the third height above the ground when the virtual character is at the reference position; controlling the virtual character to perform a target landing action that matches the third height above the ground and matches the target horizontal speed.
[0189] It should be noted that, in the embodiment of the present application, when the virtual character jumps to the surface of the scene object whose inclination angle is not 0, the direction of the target horizontal speed corresponding to the virtual character is parallel to the surface of the scene object, rather than parallel to the preset plane.
[0190] As described above, in this embodiment, different landing actions can be generated for different target horizontal speeds when the virtual character comes into contact with the scene object, and the corresponding heights from the ground when starting to approach the scene object, so that the landing action and jumping behavior of the virtual character when coming into contact with the object are more adapted.
[0191] For example, Table 1 provides examples of target landing actions when the virtual character is in the landing state.
[0192] Table 1 Examples of target landing actions when the virtual character is in the landing state
[0193]
[0194] As shown in Table 1, when the virtual character comes into contact with the scene object, the landing cushioning action that the virtual character can execute matches the third height above the ground when the virtual character is at the reference position; when the third height above the ground is greater than the preset height above the ground, that is, the third height above the ground is relatively high, the landing cushioning action that the virtual character can execute is a heavy cushioning action, that is, the skeleton of the virtual character is greatly affected by inertia, and the virtual character can be driven to execute a landing action with a larger range of motion, for example, the virtual character squats with a larger amplitude; when the third height above the ground is less than the preset height above the ground, that is, the third height above the ground is relatively low, the landing cushioning action that the virtual character can execute is a light cushioning action, that is, the skeleton of the virtual character is less affected by inertia, and the virtual character can be driven to execute a landing action with a smaller range of motion, for example, the virtual character squats with a smaller amplitude.
[0195] Based on this, if the virtual character at the first position comes into contact with the scene object, the third height from the ground is relatively high and the current target horizontal speed of the virtual character is 0, then the target landing action that the virtual character can execute is an in-situ heavy-buffered landing action; if the third height from the ground is relatively high and the current target horizontal speed of the virtual character is a horizontal speed that can control the virtual character to run, then the target landing action that the virtual character can execute is a running heavy-buffered landing action; if the third height from the ground is relatively high and the current target horizontal speed of the virtual character is a horizontal speed that can control the virtual character to sprint, then the target landing action that the virtual character can execute is a sprinting heavy-buffered landing action; if the third height from the ground is relatively low and the current target horizontal speed of the virtual character is 0, then the target landing action that the virtual character can execute is an in-situ light-buffered landing action; if the third height from the ground is relatively low and the current target horizontal speed of the virtual character is a horizontal speed that can control the virtual character to run, then the target landing action that the virtual character can execute is a running light-buffered landing action; if the third height from the ground is relatively low and the current target horizontal speed of the virtual character is a horizontal speed that can control the virtual character to sprint, then the target landing action that the virtual character can execute is a sprinting light-buffered landing action.
[0196] It should be noted that the horizontal speed of controlling the virtual character to sprint is greater than the horizontal speed of controlling the virtual character to run, and greater than the horizontal speed of the virtual character to stay still.
[0197] So far, the method provided in this embodiment has been explained. Through the above method, during the jumping behavior performed by the virtual character, starting from the time when the virtual character starts to approach the scene object below, the inclination angle of the scene object below the virtual character or the height of the virtual character from the ground can be comprehensively considered, and the first horizontal speed of the virtual character corresponding to each first position in the jumping process after the virtual character starts to approach the virtual object below and before contacting the virtual object is adjusted in real time, so that the target horizontal speed of the virtual character when contacting the scene object changes in real time, and the target horizontal speed of the virtual character when it falls on the surface of the scene object is more adapted to the scene object, so that the jumping behavior of the virtual character is more in line with the laws of physics, looks more natural and real, and enhances the player's visual experience.
[0198] In addition, when the virtual character comes into contact with the scene object at different third heights from the ground and at different target horizontal speeds, the corresponding landing cushioning action can be matched, making the animation performance of the virtual character when performing the jumping behavior more delicate, thereby enriching the overall details of the jumping behavior and enhancing the realism.
[0199] It can be understood that the above is similar to Figures 1 to 7 The size, appearance, layout, display text and other information of each element in the schematic diagram are exemplary and are not intended to limit the actual graphical user interface.
[0200] It should be noted that in each drawing, the same pattern represents the same element. Therefore, each pattern is labeled when it first appears, and when it appears in subsequent drawings, although it is not labeled, the description in the previous drawings can be referred to.
[0201] Corresponding to the game data processing method provided in the embodiment of the present application, the embodiment of the present application also provides a game data processing device 2000, such as Figure 8 As shown, the device 2000 includes: an acquisition unit 2001 and an adjustment unit 2002;
[0202] The acquisition unit 2001 is used for acquiring a first horizontal speed of the virtual character when it is located at a reference position in response to the virtual character's height from the ground starting to decrease when the virtual character performs a jumping behavior, wherein the reference position is the position when the virtual character's height from the ground starts to decrease; the height from the ground is the height difference between the virtual character and a scene object located below the virtual character;
[0203] The adjustment unit 2002 is used to adjust the first horizontal speed of the virtual character when it is at the first position, if the virtual character at the first position is not in contact with the scene object, according to the first horizontal speed of the virtual character when it is at the reference position, and the inclination angle of the scene object or the height of the virtual character above the ground, so that the second horizontal speed of the virtual character when it is in contact with the scene object is less than or equal to the first horizontal speed of the virtual character when it is at the reference position; wherein the first position is any position after the height of the virtual character above the ground begins to decrease and when the virtual character is not in contact with the scene object.
[0204] Optionally, when the virtual character is located at different positions, the corresponding scene objects have different tilt angles; the first position is the position of the virtual character in the current game frame;
[0205] The adjustment unit 2002 is specifically used to execute the following steps S1 to S3:
[0206] Step S1: adjusting the first horizontal speed of the virtual character when it is at the first position according to the first horizontal speed of the virtual character when it is at the reference position, and the first tilt angle or the first height above the ground, to obtain a second horizontal speed of the virtual character when it is at the first position;
[0207] Step S2: controlling the virtual character to move from the first position to the second position at a second horizontal speed, and determining the second horizontal speed as the first horizontal speed when the virtual character is at the second position;
[0208] Step S3: determining the second position as the first position, and returning to execute steps S1 to S3 until the virtual character at the first position comes into contact with the scene object;
[0209] The first inclination angle is the inclination angle of the scene object corresponding to the first position; and the first height from the ground is the height from the ground when the virtual character is located at the first position.
[0210] Optionally, the above device 2000 may further include a control unit 2003;
[0211] The control unit 2003 is used to determine the first horizontal speed of the virtual character at the first position as the target horizontal speed if the virtual character at the first position contacts the scene object, and control the virtual character to perform a target landing action matching the target horizontal speed.
[0212] Optionally, the control unit 2003 is specifically configured to obtain a third height above the ground when the virtual character is located at the reference position; and control the virtual character to perform a target landing action that matches the third height above the ground and matches the target horizontal speed.
[0213] Optionally, the adjustment unit 2002 is specifically used to determine the predicted horizontal speed of the virtual character at the first position to jump to the surface of the scene object based on the first horizontal speed of the virtual character at the reference position, and the first inclination angle or the first height from the ground; and adjust the first horizontal speed of the virtual character at the first position based on the predicted horizontal speed to obtain the second horizontal speed of the virtual character at the first position.
[0214] Optionally, the adjustment unit 2002 is further specifically used to determine a second height above the ground when the virtual character is located at a third position in a previous game frame of the current game frame; when the first height above the ground is less than the second height above the ground, the predicted horizontal speed is determined based on the first horizontal speed of the virtual character when it is located at a reference position, and the first inclination angle; when the first height above the ground is greater than or equal to the second height above the ground, the predicted horizontal speed is determined based on the first horizontal speed of the virtual character when it is located at the reference position, and the first height above the ground.
[0215] Optionally, the adjustment unit 2002 is further specifically used to determine a simulation angle corresponding to the scene object at the first position based on the first tilt angle; determine a predicted horizontal speed based on the first horizontal speed of the virtual character when it is located at the reference position, and the simulation angle; the predicted horizontal speed is negatively correlated with the simulation angle.
[0216] Optionally, the adjustment unit 2002 is further specifically configured to determine the first tilt angle as a simulation angle when the first tilt angle is within a preset first angle range; and determine the first preset angle as a simulation angle when the first tilt angle is within a preset second angle range.
[0217] Optionally, the adjustment unit 2002 is further specifically used to determine a first ratio between a simulation angle and a second preset angle; the simulation angle is less than or equal to the second preset angle, and the second preset angle is greater than the first preset angle; the first horizontal speed of the virtual character when it is at a reference position is adjusted according to the first ratio to obtain an adjusted first horizontal speed; and the predicted horizontal speed is determined according to the first horizontal speed of the virtual character when it is at the reference position and the adjusted first horizontal speed.
[0218] Optionally, the adjusting unit 2002 is further specifically configured to determine the product of the first ratio and the first horizontal speed of the virtual character when the virtual character is located at the reference position as the adjusted first horizontal speed.
[0219] Optionally, the adjusting unit 2002 is further specifically configured to determine a difference between the first horizontal speed when the virtual character is located at the reference position and the adjusted first horizontal speed as the predicted horizontal speed.
[0220] Optionally, the adjustment unit 2002 is further specifically configured to obtain a third height above the ground when the virtual character is located at the reference position; and determine a predicted horizontal speed according to the third height above the ground, the first height above the ground, and the first horizontal speed of the virtual character when the virtual character is located at the reference position.
[0221] Optionally, the adjustment unit 2002 is further specifically used to determine a second ratio between the first height above the ground and the third height above the ground; when the second ratio is less than a preset value, the product of the second ratio and the first horizontal speed of the virtual character when it is at the reference position is determined as the predicted horizontal speed; when the second ratio is greater than a preset value, the first horizontal speed of the virtual character when it is at the reference position is determined as the predicted horizontal speed.
[0222] Optionally, the adjustment unit 2002 is further specifically used to determine a first weight value corresponding to a first horizontal speed when the virtual character is at the first position, and a second weight value corresponding to the predicted horizontal speed; the second weight value is negatively correlated with the first weight value; based on the first weight value and the second weight value, a weighted summation process is performed on the first horizontal speed when the virtual character is at the first position and the predicted horizontal speed to obtain a weighted result; and the weighted result is determined as the second horizontal speed when the virtual character is at the first position.
[0223] Optionally, the adjustment unit 2002 is further specifically configured to obtain a third height above the ground when the virtual character is located at the reference position; and determine the second weight value and the first weight value according to the third height above the ground and the first height above the ground.
[0224] Optionally, the adjustment unit 2002 is further specifically used to determine a second ratio between the first height above the ground and the third height above the ground; when the second ratio is less than or equal to a preset value, the second ratio is determined as the first weight value; when the second ratio is greater than a preset value, the preset value is determined as the first weight value.
[0225] Optionally, the adjustment unit 2002 is further specifically configured to determine a second weight value according to the first weight value, and the sum of the second weight value and the first weight value is 1.
[0226] Corresponding to a method for processing game data provided in an embodiment of the present application, an electronic device 3000 for processing game data is also provided in an embodiment of the present application, such as Fig. 9 As shown, the electronic device 3000 includes: a processor 3001; and a memory 3002, which is used to store a program of the game data processing method. After the device is powered on and the program of the game data processing method is run by the processor, any method embodiment of the game data processing method described above can be executed. For example, the following steps can be executed:
[0227] When the virtual character performs a jumping behavior, in response to the virtual character's height from the ground starting to decrease, obtaining a first horizontal speed of the virtual character when it is at a reference position, the reference position being the position when the virtual character's height from the ground starts to decrease; the height from the ground being the height difference between the virtual character and a scene object located below the virtual character;
[0228] If the virtual character at the first position does not come into contact with the scene object, adjusting the first horizontal speed of the virtual character at each first position according to the first horizontal speed of the virtual character at the reference position and the tilt angle of the scene object or the height of the virtual character from the ground, so that the target horizontal speed when the virtual character comes into contact with the scene object is less than or equal to the first horizontal speed of the virtual character at the reference position;
[0229] The first position is a position after the reference position when the virtual character does not come into contact with the scene object.
[0230] Corresponding to the game data processing method provided in the embodiment of the present application, the embodiment of the present application further provides a computer-readable storage medium storing a program of the game data processing method. The program is run by a processor and can execute any method embodiment of the above-mentioned game data processing method. For example, the following steps can be executed:
[0231] When the virtual character performs a jumping behavior, in response to the virtual character's height from the ground starting to decrease, obtaining a first horizontal speed of the virtual character when it is at a reference position, the reference position being the position when the virtual character's height from the ground starts to decrease; the height from the ground being the height difference between the virtual character and a scene object located below the virtual character;
[0232] If the virtual character at the first position does not come into contact with the scene object, adjusting the first horizontal speed of the virtual character at each first position according to the first horizontal speed of the virtual character at the reference position and the tilt angle of the scene object or the height of the virtual character from the ground, so that the target horizontal speed when the virtual character comes into contact with the scene object is less than or equal to the first horizontal speed of the virtual character at the reference position;
[0233] The first position is a position after the reference position when the virtual character does not come into contact with the scene object.
[0234] It should be noted that for the detailed description of the device, electronic device and computer-readable storage medium provided in the embodiments of the present application, reference can be made to the relevant description of the game data processing method embodiment provided in the embodiments of the present application, which will not be repeated here.
[0235] Although the present application is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present application. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.
[0236] In a typical configuration, an electronic device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0237] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0238] 1. Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable operations, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined in this article, computer-readable media does not include non-transitory media such as modulated data signals and carrier waves.
[0239] 2. Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0240] Although the present application is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present application. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.
Claims
1. A method for processing game data, characterized in that: The method comprises: When the virtual character performs a jumping behavior, in response to the virtual character's height from the ground starting to decrease, obtaining a first horizontal speed of the virtual character when it is at a reference position, the reference position being the position when the virtual character's height from the ground starts to decrease; the height from the ground being the height difference between the virtual character and a scene object located below the virtual character; If the virtual character at the first position does not come into contact with the scene object, adjusting the first horizontal speed of the virtual character at each first position according to the first horizontal speed of the virtual character at the reference position and the tilt angle of the scene object or the height of the virtual character from the ground, so that the target horizontal speed when the virtual character comes into contact with the scene object is less than or equal to the first horizontal speed of the virtual character at the reference position; The first position is a position after the reference position when the virtual character does not come into contact with the scene object.
2. The method according to claim 1, characterized in that When the virtual character is located at different positions, the scene objects have different corresponding tilt angles; the first position is the position of the virtual character in the current game frame; The adjusting the first horizontal speed of the virtual character when it is at the first position according to the first horizontal speed of the virtual character when it is at the reference position and the inclination angle of the scene object or the height of the virtual character from the ground comprises: Step S1: adjusting the first horizontal speed of the virtual character when it is at the first position according to the first horizontal speed of the virtual character when it is at the reference position, and the first tilt angle or the first height above the ground, to obtain a second horizontal speed of the virtual character when it is at the first position; Step S2: controlling the virtual character to move from the first position to the second position at the second horizontal speed, and determining the second horizontal speed as the first horizontal speed when the virtual character is at the second position; Step S3: determining the second position as the first position, and returning to execute steps S1 to S3 until the virtual character at the first position comes into contact with the scene object; The first tilt angle is the tilt angle of the scene object corresponding to the first position; and the first height above the ground is the height above the ground when the virtual character is located at the first position.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: If the virtual character at the first position comes into contact with the scene object, a first horizontal speed of the virtual character at the first position is determined as the target horizontal speed, and the virtual character is controlled to perform a target landing action matching the target horizontal speed.
4. The method according to claim 3, characterized in that The controlling the virtual character to perform a target landing action matching the target horizontal speed includes: Acquire a third height above the ground when the virtual character is located at the reference position; The virtual character is controlled to perform a target landing action that matches the third height above the ground and matches the target horizontal speed.
5. The method according to claim 2, characterized in that: The step of adjusting the first horizontal speed of the virtual character when it is at the first position according to the first horizontal speed of the virtual character when it is at the reference position, and the first tilt angle or the first height above the ground to obtain the second horizontal speed of the virtual character when it is at the first position comprises: Determine a predicted horizontal speed of the virtual character at the first position to jump to the surface of the scene object according to a first horizontal speed of the virtual character at the reference position, and a first tilt angle or the first height above the ground; According to the predicted horizontal speed, a first horizontal speed of the virtual character when it is located at the first position is adjusted to obtain a second horizontal speed of the virtual character when it is located at the first position.
6. The method according to claim 5, characterized in that The step of determining the predicted horizontal speed of the virtual character at the first position to jump to the surface of the scene object according to the first horizontal speed of the virtual character at the reference position and the first tilt angle or the first height above the ground comprises: Determine a second height above the ground when the virtual character is located at a third position in a previous game frame of the current game frame; When the first height above the ground is less than the second height above the ground, determining the predicted horizontal speed according to a first horizontal speed of the virtual character when the virtual character is located at the reference position and the first tilt angle; When the first height above the ground is greater than or equal to the second height above the ground, the predicted horizontal speed is determined according to a first horizontal speed of the virtual character when it is located at the reference position and the first height above the ground.
7. The method according to claim 6, characterized in that The step of determining the predicted horizontal speed according to the first horizontal speed of the virtual character when the virtual character is located at the reference position and the first tilt angle comprises: Determining a simulation angle corresponding to the scene object at the first position according to the first tilt angle; The predicted horizontal speed is determined according to the first horizontal speed of the virtual character when it is located at the reference position and the simulation angle; the predicted horizontal speed is negatively correlated with the simulation angle.
8. The method according to claim 7, characterized in that The determining, according to the first tilt angle, a simulation angle corresponding to the scene object at the first position includes: When the first tilt angle is within a preset first angle range, determining the first tilt angle as the simulation angle; When the first tilt angle is within a preset second angle range, the first preset angle is determined as the simulation angle.
9. The method according to claim 7, characterized in that: The step of determining the predicted horizontal speed according to the first horizontal speed of the virtual character when the virtual character is located at the reference position and the simulation angle comprises: Determine a first ratio between the simulation angle and a second preset angle; the simulation angle is less than or equal to the second preset angle, and the second preset angle is greater than the first preset angle; adjusting a first horizontal speed of the virtual character when the virtual character is located at the reference position according to the first ratio to obtain an adjusted first horizontal speed; The predicted horizontal speed is determined according to the first horizontal speed of the virtual character when it is located at the reference position and the adjusted first horizontal speed.
10. The method according to claim 9, characterized in that The step of adjusting the first horizontal speed of the virtual character when the virtual character is located at the reference position according to the first ratio to obtain the adjusted first horizontal speed includes: The product of the first ratio and the first horizontal speed of the virtual character when the virtual character is located at the reference position is determined as the adjusted first horizontal speed.
11. The method according to claim 9, characterized in that The step of determining the predicted horizontal speed according to the first horizontal speed of the virtual character when the virtual character is located at the reference position and the adjusted first horizontal speed comprises: The difference between the first horizontal speed when the virtual character is located at the reference position and the adjusted first horizontal speed is determined as the predicted horizontal speed.
12. The method according to claim 6, characterized in that The step of determining the predicted horizontal speed according to the first horizontal speed of the virtual character when the virtual character is located at the reference position and the first height above the ground comprises: Acquire a third height above the ground when the virtual character is located at the reference position; The predicted horizontal speed is determined according to the third height above the ground, the first height above the ground, and a first horizontal speed of the virtual character when the virtual character is located at the reference position.
13. The method according to claim 12, characterized in that The step of determining the predicted horizontal speed according to the third height above the ground, the first height above the ground, and a first horizontal speed of the virtual character when the virtual character is located at the reference position includes: determining a second ratio between the first height above the ground and the third height above the ground; When the second ratio is less than a preset value, determining the product of the second ratio and the first horizontal speed of the virtual character when the virtual character is located at the reference position as the predicted horizontal speed; When the second ratio is greater than the preset value, the first horizontal speed of the virtual character when it is located at the reference position is determined as the predicted horizontal speed.
14. The method according to claim 5, characterized in that The step of adjusting the first horizontal speed of the virtual character when it is at the first position according to the predicted horizontal speed to obtain the second horizontal speed of the virtual character when it is at the first position includes: Determine a first weight value corresponding to a first horizontal speed when the virtual character is located at the first position, and a second weight value corresponding to the predicted horizontal speed; the second weight value is negatively correlated with the first weight value; performing a weighted summation process on a first horizontal speed and a predicted horizontal speed of the virtual character when the virtual character is located at the first position according to the first weight value and the second weight value to obtain a weighted result; The weighted result is determined as a second horizontal speed of the virtual character when the virtual character is located at the first position.
15. The method according to claim 14, characterized in that The determining of a first weight value corresponding to a first horizontal speed when the virtual character is located at the first position and a second weight value corresponding to the predicted horizontal speed include: Acquire a third height above the ground when the virtual character is located at the reference position; The second weight value and the first weight value are determined according to the third height above the ground and the first height above the ground.
16. The method according to claim 15, characterized in that The step of determining the second weight value according to the third height above the ground and the first height above the ground comprises: determining a second ratio between the first height above the ground and the third height above the ground; When the second ratio is less than or equal to a preset value, determining the second ratio as the first weight value; When the second ratio is greater than the preset value, the preset value is determined as the first weight value.
17. The method according to claim 16, characterized in that The step of determining the second weight value comprises: The second weight value is determined according to the first weight value, and the sum of the second weight value and the first weight value is 1.
18. A game data processing device, characterized in that: The device comprises: an acquisition unit and an adjustment unit; The acquisition unit is used for acquiring a first horizontal speed of the virtual character when it is located at a reference position in response to the virtual character's height from the ground starting to decrease when the virtual character performs a jumping behavior, wherein the reference position is the position of the virtual character when the height from the ground starts to decrease; the height from the ground is the height difference between the virtual character and a scene object located below the virtual character; The adjustment unit is configured to adjust the first horizontal speed of the virtual character when it is at the first position, if the virtual character at the first position is not in contact with the scene object, according to the first horizontal speed of the virtual character when it is at the reference position, and the inclination angle of the scene object or the height of the virtual character from the ground, so that the second horizontal speed of the virtual character when it is in contact with the scene object is less than or equal to the first horizontal speed of the virtual character when it is at the reference position; The first position is any position after the height of the virtual character from the ground starts to decrease and when the virtual character does not come into contact with the scene object.
19. An electronic device, characterized in that: include: processor; as well as The memory is used to store a data processing program. After the electronic device is powered on and the program is run by the processor, the method according to any one of claims 1 to 17 is executed.
20. A computer-readable storage medium, characterized in that: A data processing program is stored, and the program is run by a processor to execute the method according to any one of claims 1 to 17.