Virtual character control method, device, equipment and storage medium
By providing a graphical user interface and composite function controls on the game terminal, the predicted position and landing point are determined according to the speed of the target virtual object and the controlled virtual character, which solves the problem that players have difficulty controlling the controlled virtual character to stand in a defensive position, thereby improving the gaming experience and the success rate of defense.
Patent Information
- Application Number
- CN202111298770.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-04
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2041-11-04
AI Technical Summary
It is difficult for players to control the controlled virtual character to stand in a defensive position through a single operation, resulting in failure in stealing the ball.
A graphical user interface is provided through the terminal to display the game scene and landing controls. In response to the landing operation, the predicted position is determined based on the position and speed of the target virtual object and the controlled virtual character, and the controlled virtual character is controlled to move to the landing point. Combined with the operation of the composite function control and the joystick control, the defense of the controlled virtual character in the game scene is realized.
It improves the player's gaming experience, reduces the difficulty of defensive operations, avoids defensive errors, implements a more conservative defensive method, and can intercept passing routes or shooting routes.
Smart Images

Figure CN116059640B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of game technology, and in particular to a method, device, equipment and storage medium for controlling a virtual character. Background Art
[0002] With the development of Internet technology, games play an increasingly important role in people's lives. People usually use games for entertainment. In order to meet the needs of different audiences, there are also various types of games. For example, for football fans, they can play football games to simulate the experience of playing football by controlling a controlled virtual character in the game.
[0003] During the defensive phase of a practical ball game, players not only need to control their virtual characters to press forward and close down the ball carrier, but also need to control their virtual characters to maintain a defensive position and intercept offensive or passing routes. For example, in the prior art, players can use the "pressing" function in the game to conveniently control their virtual characters to close down and close down the ball carrier to gain possession of the ball.
[0004] However, this method of using the "pressing" function to seize the ball player makes it difficult for the player to control the controlled virtual character to stand in the defensive position through a single operation, which can easily lead to the problem of failure in the attack. Summary of the Invention
[0005] The purpose of this application is to address the deficiencies in the above-mentioned prior art and provide a method, device, equipment and storage medium for controlling a virtual character, so as to solve the problem in the prior art that it is difficult for players to control the controlled virtual character to stand in a defensive position through a single operation, which easily leads to failure in grabbing the ball.
[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of the present application are as follows:
[0007] In a first aspect, an embodiment of the present application provides a method for controlling a virtual character, wherein a terminal provides a graphical user interface, the graphical user interface displays a game scene and a positional control, the game scene including a controlled virtual character; the method comprising:
[0008] In response to a drop operation triggered by the drop control, determining a predicted position of the target virtual object based on the current position and movement speed of the target virtual object in the game scene and the current position and movement speed of the controlled virtual character; wherein the target virtual object is another virtual object in the game scene other than the target controlled virtual character;
[0009] Determining a landing point based on the predicted position and a preset reference position in the game scene;
[0010] The controlled virtual character is controlled to move toward the landing point.
[0011] Optionally, the drop control and the sprint control are combined into a composite function control; in response to the drop operation triggered by the drop control, determining the predicted position of the target virtual object according to the current position and movement speed of the target virtual object in the game scene and the current position and movement speed of the controlled virtual character, the method further includes:
[0012] In response to a pressing operation on the composite function control, the composite function control is set as a drop control.
[0013] Optionally, the graphical user interface further displays a joystick control, and the method further includes:
[0014] In response to a pressing operation on the composite function control and a dragging operation on the rocker control, setting the composite function control as a sprint control;
[0015] In response to a trigger operation on the sprint control and a drag operation on the joystick control, the controlled virtual character is controlled to perform a sprint function.
[0016] Optionally, determining the predicted position of the target virtual object according to the current position and movement speed of the target virtual object in the game scene and the current position and movement speed of the controlled virtual character includes:
[0017] determining an estimated time required for the controlled virtual character to move to the current position of the target virtual object based on the current position of the controlled virtual character, the current position of the target virtual object, and the moving speed of the controlled virtual character;
[0018] determining an effective speed according to the moving speed of the target virtual object and the preset reference position;
[0019] A predicted position of the target virtual object is determined according to the effective speed and the estimated time.
[0020] Optionally, determining the effective speed according to the moving speed of the target virtual object and the preset reference position includes:
[0021] Determining whether the velocity direction of the target virtual object and the angle between the line connecting the controlled virtual character and the preset reference position are greater than or equal to a preset angle;
[0022] If the angle is greater than or equal to the preset angle, the moving speed of the target virtual object is projected onto a perpendicular line connecting the target virtual object and the preset reference position, and the projected speed vector is determined to be the effective speed.
[0023] Optionally, the determining the effective speed according to the moving speed of the target virtual object and the preset reference position further includes:
[0024] If the included angle is smaller than the preset angle, the moving speed of the target virtual object is directly determined to be the effective speed.
[0025] Optionally, determining the estimated time required for the controlled virtual character to move to the current position of the target virtual object based on the current position of the controlled virtual character, the current position of the target virtual object, and the moving speed of the controlled virtual character includes:
[0026] determining a distance between the target virtual object and the controlled virtual character according to the current position of the controlled virtual character and the current position of the target virtual object;
[0027] The estimated time is determined according to the distance and the moving speed of the controlled virtual character.
[0028] Optionally, after determining the estimated time based on the distance and the moving speed of the controlled virtual character, the method further includes:
[0029] Determining whether the estimated time is less than or equal to a preset time threshold;
[0030] If so, determining the estimated time as the final estimated time;
[0031] If not, the preset time threshold is determined to be the final estimated time.
[0032] Optionally, controlling the controlled virtual character to move toward the landing point includes:
[0033] If the distance between the controlled virtual character and the landing point is less than a preset distance, the controlled virtual character is controlled to move toward the landing point in a marking movement manner.
[0034] Optionally, controlling the controlled virtual character to move toward the landing point includes:
[0035] If the distance between the controlled virtual character and the landing point is greater than or equal to the preset distance, the controlled virtual character is controlled to move toward the landing point at a high speed.
[0036] Optionally, determining the landing point according to the predicted position and a preset reference position in the game scene includes:
[0037] The landing point is calculated based on the distance between the predicted position and the preset reference position, and a preset ratio.
[0038] Optionally, after determining the landing point based on the predicted position and a preset reference position in the game scene, the method further includes:
[0039] Determining whether the landing point is within a preset landing distance range;
[0040] If the landing point is within the preset landing distance range, the landing point is determined to be the final landing point.
[0041] Optionally, after determining whether the landing point is within a preset landing distance range, the method further includes:
[0042] If the landing point is outside the preset landing range and close to the nearest landing point in the preset landing range, the nearest landing point is determined to be the final landing point.
[0043] Optionally, after determining whether the landing point is within a preset landing distance range, the method further includes:
[0044] If the landing point is outside the preset landing range and close to the farthest landing point of the preset landing distance, the farthest landing point is determined as the final landing point.
[0045] Optionally, before determining the predicted position of the target virtual object according to the moving speed of the target virtual object in the game scene, the method further includes:
[0046] If there is a virtual character with a ball in the game scene, the virtual character with the ball is determined as the target virtual object.
[0047] Optionally, before determining the predicted position of the target virtual object according to the moving speed of the target virtual object in the game scene, the method further includes:
[0048] If there is no virtual character with a ball in the game scene, the virtual football is determined to be the target virtual object.
[0049] In a second aspect, another embodiment of the present application provides a device for controlling a virtual character, the device comprising: a determination module, a calculation module, and a control module, wherein:
[0050] The determination module determines, in response to a drop operation triggered by the drop control, a predicted position of the target virtual object based on a current position and movement speed of the target virtual object in the game scene and a current position and movement speed of the controlled virtual character; wherein the target virtual object is another virtual object in the game scene other than the target controlled virtual character;
[0051] The calculation module is used to determine the landing point based on the predicted position and a preset reference position in the game scene;
[0052] The control module is used to control the controlled virtual character to move toward the landing point.
[0053] Optionally, the landing control and the sprint control are combined into a composite function control; the device further comprises: a trigger module for setting the composite function control as a landing control in response to a pressing operation on the composite function control.
[0054] Optionally, the graphical user interface further displays: a joystick control;
[0055] The trigger module is specifically configured to set the composite function control as a sprint control in response to a pressing operation on the composite function control and a dragging operation on the joystick control;
[0056] The control module is specifically configured to control the controlled virtual character to perform a sprint function in response to a trigger operation on the sprint control and a drag operation on the joystick control.
[0057] Optionally, the determination module is specifically used to determine the estimated time required for the controlled virtual character to move to the current position of the target virtual object based on the current position of the controlled virtual character, the current position of the target virtual object and the moving speed of the controlled virtual character; determine the effective speed based on the moving speed of the target virtual object and the preset reference position; and determine the predicted position of the target virtual object based on the effective speed and the estimated time.
[0058] Optionally, the determination module is specifically used to determine whether the speed direction of the target virtual object and the angle between the line connecting the controlled virtual character and the preset reference position is greater than or equal to a preset angle; if the angle is greater than or equal to the preset angle, the moving speed of the target virtual object is projected onto the perpendicular line connecting the target virtual object and the preset reference position, and the projected speed vector is determined to be the effective speed.
[0059] Optionally, the determining module is specifically configured to directly determine the moving speed of the target virtual object as the effective speed if the included angle is smaller than the preset angle.
[0060] Optionally, the determination module is specifically configured to determine the distance between the target virtual object and the controlled virtual character based on the current position of the controlled virtual character and the current position of the target virtual object; and determine the estimated time based on the distance and the moving speed of the controlled virtual character.
[0061] Optionally, the determination module is specifically used to determine whether the expected time is less than or equal to a preset time threshold; if so, determine the expected time as the final expected time; if not, determine the preset time threshold as the final expected time.
[0062] Optionally, the control module is specifically configured to control the controlled virtual character to move toward the landing point in a marking movement manner if the distance between the controlled virtual character and the landing point is less than a preset distance.
[0063] Optionally, the control module is specifically configured to control the controlled virtual character to move toward the landing point at high speed if the distance between the controlled virtual character and the landing point is greater than or equal to the preset distance.
[0064] Optionally, the calculation module is specifically used to calculate the landing point based on the distance between the predicted position and the preset reference position, and a preset ratio.
[0065] Optionally, the determination module is specifically used to determine whether the landing point is within a preset landing distance range; if the landing point is within the preset landing distance range, the landing point is determined to be the final landing point.
[0066] Optionally, the determination module is specifically configured to determine that if the landing point is outside the preset landing range and close to the nearest landing point in the preset landing range, the nearest landing point is determined as the final landing point.
[0067] Optionally, the determination module is specifically configured to determine that if the landing point is outside the preset landing range and close to the farthest landing point of the preset landing distance, the farthest landing point is the final landing point.
[0068] Optionally, the determining module is specifically configured to determine that if there is a virtual character with a ball in the game scene, the virtual character with the ball is the target virtual object.
[0069] Optionally, the determination module is specifically configured to determine the virtual football as the target virtual object if there is no virtual character with the ball in the game scene.
[0070] In the third aspect, another embodiment of the present application provides a control device for a virtual character, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the control device for the virtual character is running, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the steps of any method described in the first aspect above.
[0071] In a fourth aspect, another embodiment of the present application provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any method described in the first aspect are executed.
[0072] The beneficial effect of the present application is that the virtual character control method provided by the present application enables the player, when controlling the controlled virtual character, to determine the triggering landing operation according to the form in the current game scene, and then determine the predicted position of the target virtual object according to the moving speed of the target virtual object and the moving speed of the controlled virtual character, and calculate the landing point according to the predicted position and the position of the preset reference position in the game scene, and control the controlled virtual character to move to the landing point, thereby controlling the controlled virtual character to intercept the passing route or the offensive route through this relatively conservative defensive method, thereby improving the player's gaming experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0074] Figure 1 A flowchart of a method for controlling a virtual character provided in one embodiment of the present application;
[0075] Figure 2 A schematic diagram of a graphical user interface provided in one embodiment of the present application;
[0076] Figure 3 A flowchart of a method for controlling a virtual character provided in another embodiment of the present application;
[0077] Figure 4 A schematic diagram of the structure of a control device for a virtual character provided in one embodiment of the present application;
[0078] Figure 5 A schematic diagram of the structure of a control device for a virtual character provided in another embodiment of the present application;
[0079] Figure 6 A schematic diagram of the structure of a virtual character control device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0080] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments.
[0081] The components of the embodiments of the present application generally described and illustrated in the drawings herein may be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed application, but rather merely represents selected embodiments of the present application. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative effort are within the scope of protection of the present application.
[0082] In addition, the flowcharts used in this application illustrate operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowcharts may not be implemented in order, and steps that have no logical contextual relationship may be reversed or performed simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or may remove one or more operations from the flowcharts.
[0083] The following is an explanation of a virtual character control method provided in an embodiment of the present application in combination with multiple specific application examples. Figure 1 A flowchart of a method for controlling a virtual character provided in one embodiment of the present application is provided, wherein a graphical user interface is provided through a terminal, and a game scene and a position control are displayed on the graphical user interface, wherein the game scene includes a controlled virtual character; Figure 1 As shown, the method includes:
[0084] S101: In response to a drop operation triggered by a drop control, a predicted position of a target virtual object is determined according to the current position and movement speed of the target virtual object in the game scene and the current position and movement speed of the controlled virtual character.
[0085] For example, the present application can be applied to some ball sports games, such as football games, basketball games, ice hockey games, or hockey games. The specific application scenarios can be flexibly adjusted according to user needs and are not limited to the above embodiments. In the embodiments of the present application, for the convenience of unified description, the application scenario is described as a football game.
[0086] Among them, the target virtual object is other virtual objects in the game scene except the target controlled virtual character; for example, in some possible embodiments, if there is a virtual character with the ball passing the ball in the game scene, that is, there is a virtual character with the ball in the game scene, then the virtual character with the ball is determined to be the target virtual object; if the current passing mode in the game scene is without a master ball, or the virtual ball is in the process of passing the ball, that is, there is no virtual character with the ball in the game scene, then the virtual football is determined to be the target virtual object.
[0087] Still taking the above method of determining the target virtual object as an example, if there is a virtual character with a ball in the game scene, certain predictions can be made based on the movement speed of the virtual character with the ball to determine the predicted position of the virtual character with the ball; if there is no virtual character with the ball in the game scene, certain predictions can be made based on the movement speed of the controlled virtual character to determine the receiving point of the controlled virtual character as the predicted position of the target virtual object.
[0088] Figure 2 This is a schematic diagram of a graphical user interface provided in one embodiment of the present application, such as Figure 2 As shown, the graphical user interface may include, for example, a target virtual object, a virtual football, a controlled virtual character and at least one other virtual object. The lower right corner of the graphical user interface may include, for example, a plurality of functional controls, wherein the plurality of functional controls include a landing control, and the landing control may be combined with a sprint control to form a composite functional control; different triggering methods will trigger different functions of the composite functional control. For example, in an embodiment of the present application, in response to a pressing operation on the composite functional control, the composite functional control is set to a landing control.
[0089] In addition, continue as Figure 2 As shown, the graphical user interface may also display: a joystick control, the display position of which may be, for example, displayed in the lower left corner of the graphical user interface. During the game, the player may control the movement direction and distance of the controlled virtual character by operating the joystick control. In response to a press operation on the composite function control and a drag operation on the joystick control, the composite function control is set as a sprint control; in response to a trigger operation on the sprint control and a drag operation on the joystick control, the controlled virtual character is controlled to perform a sprint function. It should be understood that the above embodiments are merely illustrative, and the specific way in which the composite function control triggers different functions, as well as the functions included in the composite function control, may be flexibly adjusted according to user needs and are not limited to those given in the above embodiments.
[0090] This setting method cleverly reuses an original control, allowing two different functions to be achieved through different triggering methods for one control. This cleverly achieves the effect of reusing the original functional control while adding the landing function triggering method without adding controls, thereby increasing the utilization rate of the original functional control.
[0091] S102: Determine the landing point based on the predicted position and the preset reference position in the game scene.
[0092] Among them, the preset reference position can be, for example, the position of the virtual goal, the position of the corner flag of the stadium, or the midpoint of the baseline in the game scene, etc. It should be understood that the above embodiments are only exemplary descriptions, and the specific selection method of the preset reference position can be flexibly adjusted according to the application scenario and user needs. This application does not impose any restrictions here.
[0093] The specific method of determining the landing point may be, for example, to calculate and determine the location of the landing point based on the distance between the predicted position and the preset reference position and a preset proportional relationship.
[0094] For example, in an embodiment of the present application, the preset position is taken as the midpoint of the virtual goal as an example for explanation. For example, the landing point can be calculated based on the distance between the predicted position and the midpoint of the virtual goal, and the preset ratio; the landing point is determined based on the distance between the predicted position and the midpoint of the virtual goal, which can ensure that the controlled virtual character can block the shooting route or the passing route as much as possible.
[0095] S103: Control the controlled virtual character to move toward the landing point.
[0096] Among them, after determining the landing point, the controlled virtual character can be directly controlled to move to the landing point according to the position of the landing point, so that the controlled virtual character can perform the defensive task in a more conservative manner, thereby reducing the difficulty of the player's operation when performing the defensive task, avoiding the probability of the player's defensive operation error, and improving the player's gaming experience.
[0097] By adopting the virtual character control method provided in the present application, when a player controls a controlled virtual character, he or she can determine the triggering landing operation according to the situation in the current game scene, and then determine the predicted position of the target virtual object according to the moving speed of the target virtual object and the moving speed of the controlled virtual character, and calculate the landing point according to the predicted position and the preset reference position in the game scene, and control the controlled virtual character to move toward the landing point, thereby controlling the controlled virtual character to intercept the passing route or shooting route through this relatively conservative defensive method, thereby improving the player's gaming experience.
[0098] For example, in some possible embodiments of the present application, before determining the landing point and controlling the controlled virtual character to move toward the landing point, the distance between the current position of the controlled virtual character and the landing point may also be considered. Different distances may correspond to different movement methods. That is, before moving, the movement method is determined based on the distance between the current position of the controlled virtual character and the landing point. For example, if the distance between the controlled virtual character and the landing point is less than the preset distance, it means that the distance between the current controlled virtual character and the landing point is relatively close, and the controlled virtual character can be controlled to move toward the landing point in a defensive movement method.
[0099] Or if the distance between the controlled virtual character and the landing point is greater than or equal to the preset distance, it means that the distance between the current controlled virtual character and the landing point is far, and the controlled virtual character can be controlled to move toward the landing point at high speed; it should be understood that the above embodiment is only an exemplary description, and the setting of the specific preset distance and the setting of the movement mode can be flexibly adjusted according to user needs, and is not limited to the above embodiment.
[0100] This form of determining different movement methods based on the distance between the current position of the controlled virtual character and the landing point can allow the controlled virtual character to move in a method that suits itself when it is controlled to move to the landing point, ensuring that the controlled virtual character can exhibit different behaviors at different distances, making the game performance more delicate, thereby not only making the movement of the controlled virtual character consistent with the movement of players in real football, but also improving the player's gaming experience during the game.
[0101] In an embodiment of the present application, not only is it necessary to determine the movement mode of the controlled virtual character before controlling the controlled virtual character to move to the landing point, but the movement mode of the controlled virtual character can also be switched according to a preset distance during the process of the controlled virtual character moving to the landing point.
[0102] For example, the preset distances may include a first preset distance X1, a second preset distance X2, and a third preset distance X3. After the controlled virtual character enters the landing state, the switch between the marked movement mode and the high-speed movement mode depends on the distance between the controlled virtual character and the landing point. When the controlled virtual character enters the landing state, if the distance between the controlled virtual character and the landing point is greater than or equal to the first preset distance X1 meter, the high-speed movement mode is used; if the distance between the controlled virtual character and the landing point is less than the first preset distance X1 meter, the marked movement mode is used.
[0103] When the controlled virtual character uses the marking movement mode to land, if the distance between the controlled virtual character and the landing point is greater than or equal to the second preset distance X2 meters, the movement mode of the controlled virtual character is switched to the high-speed movement mode; when the controlled virtual character uses the high-speed movement mode to land, if the distance between the controlled virtual character and the landing point is less than the third preset distance X3 meters, the movement mode of the controlled virtual character is switched to the marking movement mode; it should be understood that the above embodiment is only an exemplary description, and the specific preset distance includes the distance threshold, and the switching of the movement mode at different distances can be flexibly adjusted according to user needs, and is not limited to the above embodiment.
[0104] Optionally, based on the above embodiment, an embodiment of the present application may further provide a method for controlling a virtual character. The following is an example of the implementation process of determining the predicted position of the target virtual object in the above method with reference to the accompanying drawings. Figure 3 A flowchart of a method for controlling a virtual character provided in another embodiment of the present application is shown as follows: Figure 3 As shown, S101 may include:
[0105] S104: Determine an estimated time required for the controlled virtual character to move to the current position of the target virtual object based on the current position of the controlled virtual character, the current position of the target virtual object, and the moving speed of the controlled virtual character.
[0106] Among them, according to the current position of the controlled virtual character and the current position of the target virtual object, the distance S0 between the controlled virtual character and the target virtual object is determined, and then according to the moving speed S0 of the controlled virtual character, the estimated time T0 for the controlled virtual character to reach the position of the target virtual object is calculated, where T0 = S0 / V0.
[0107] In some possible embodiments, the estimated time T0 cannot exceed the preset time threshold. After the estimated time is calculated, it is necessary to determine whether the estimated time is less than or equal to the preset time threshold; if so, the estimated time is determined to be the final estimated time; if not, the preset time threshold is determined to be the final estimated time, thereby ensuring that the final estimated time can be controlled within the preset time threshold and ensuring the effect of the game.
[0108] S105: Determine an effective speed according to the moving speed of the target virtual object and the position of the virtual goal.
[0109] In one embodiment of the present application, the method for determining the effective speed can be, for example: determining the speed direction of the target virtual object and whether the angle between the speed direction and the line connecting the controlled virtual character and the preset reference position is greater than or equal to a preset angle; if the angle is greater than or equal to the preset angle, projecting the moving speed of the target virtual object onto the perpendicular line connecting the target virtual object and the preset reference position, and determining the projected speed vector as the effective speed; if the angle is less than the preset angle, directly determining the moving speed of the target virtual object as the effective speed.
[0110] Among them, in the embodiments of the present application, the preset angle can be, for example, 90 degrees, and the effective speed is recorded as V1. It should be understood that the above embodiments are only exemplary descriptions, and the setting of the specific preset angle can be flexibly adjusted according to user needs and is not limited to the above embodiments.
[0111] S106: Determine a predicted position of the target virtual object according to the effective speed and the estimated time.
[0112] In some possible embodiments, for example, the distance S = T0 * V1 between the current position of the target virtual object and the predicted position of the target virtual object can be calculated based on the effective speed V1 and the estimated time T0, and then the distance S is extended along the speed direction of the effective speed of the target virtual object based on the calculated distance S0, and the extended position is determined to be the predicted position of the target virtual object.
[0113] In some possible embodiments, after determining the preset position and calculating the landing point based on the distance between the preset position and the midpoint of the goal, in order to ensure the strength of the landing, the game planner can set the farthest landing distance and the closest landing distance in advance, and determine the landing distance range of the preset landing point based on the farthest landing distance and the closest landing distance. After determining the landing point, determine whether the landing point is within the preset landing distance range, that is, determine whether the distance between the predicted position and the preset reference position is greater than or equal to the closest landing distance, and less than or equal to the farthest landing distance. If the determination result indicates that the landing point is within the preset landing distance range, then the calculated landing point is determined as the final landing point.
[0114] On the contrary, if the landing point is outside the preset landing range and is close to the nearest landing point within the preset landing range, that is, the distance between the predicted position and the preset reference position is less than the nearest landing distance, then the nearest landing point is determined as the final landing point; if the landing point is outside the preset landing range and is close to the farthest landing point within the preset landing distance, that is, the distance between the predicted position and the preset reference position is greater than the farthest landing distance, then the farthest landing point is determined as the final landing point.
[0115] In some possible embodiments, different controlled virtual characters may correspond to different preset landing ranges. For example, for some relatively rare controlled virtual characters, or controlled virtual characters of higher levels, their landing strength may be relatively high, that is, the preset landing range may be larger; for some relatively common controlled virtual characters, or controlled virtual characters of lower levels, their landing strength may be relatively low, and the preset landing range may be smaller; it should be understood that the above embodiments are only exemplary, and the relationship between the specific landing strength and the controlled virtual character can be flexibly adjusted according to user needs, and is not limited to the above embodiments.
[0116] This method of determining the landing point ensures that the landing strength can be controlled during the process of determining the landing point, preventing the landing strength from being too weak, resulting in a low defense success rate, or the landing strength from being too strong, resulting in a high defense success rate.
[0117] The virtual character control method provided by the present application includes a newly added positioning operation triggered by a composite function control. This allows novice players to implement a more conservative and error-prone defensive approach by executing the positioning defense operation when they are not proficient in defensive operations, thereby reducing the operational difficulty for novice players. Furthermore, the method provides players with additional defensive options in non-emergency situations. For example, when a target virtual object is dribbling the ball at a low speed outside the penalty area, the player can select a defender virtual character as the controlled virtual character and control the controlled virtual character to position to maintain the defensive formation. The positioning function also provides the player with a convenient way to control the controlled virtual character to block the shot. This positioning defense method, which selects a position that is easier to block a shot, makes it less likely that the target virtual object will pass by, making it almost impossible for other virtual characters in the game scene to easily break through the defense, thereby improving the player's gaming experience. Furthermore, the positioning function allows players to implement new defensive operation modes, such as first using the positioning function to perform positioning defense and then performing pressing defense, thereby reducing the player's operational requirements for the joystick control and further improving the player's gaming experience.
[0118] The following is an explanation of the control device for the virtual character provided by the present application with reference to the accompanying drawings. The control device for the virtual character can execute the above Figure 1-Figure 3 The specific implementation and beneficial effects of the control method of any virtual character are as described above and will not be repeated here.
[0119] Figure 4 This is a schematic diagram of the structure of a control device for a virtual character provided in one embodiment of the present application. Figure 4 As shown, the device includes: a determination module 201, a calculation module 202 and a control module 203, wherein:
[0120] A determination module 201 is configured to determine, in response to a drop operation triggered by the composite function control, a predicted position of a target virtual object based on a movement speed of the target virtual object and a movement speed of a controlled virtual character in the game scene;
[0121] A calculation module 202 is used to calculate a landing point based on the predicted position and a preset reference position in the game scene;
[0122] The control module 203 is used to control the controlled virtual character to move to the landing point.
[0123] Optionally, based on the above embodiment, the embodiment of the present application may further provide a control device for a virtual character, as shown below in conjunction with the accompanying drawings. Figure 3 The implementation process of the given device is described with an example. Figure 5 This is a structural diagram of a control device for a virtual character provided by another embodiment of the present application, wherein a composite function control and a sprint control are combined into a composite function control; Figure 5 As shown, the device further includes: a trigger module 204, configured to set the composite function control as a drop control in response to a pressing operation on the composite function control.
[0124] Optionally, the graphical user interface further displays: a joystick control;
[0125] The trigger module 204 is specifically configured to set the composite function control as a sprint control in response to a pressing operation on the composite function control and a dragging operation on the joystick control;
[0126] The control module 203 is specifically configured to control the controlled virtual character to execute the sprint function in response to a trigger operation on the sprint control and a drag operation on the joystick control.
[0127] Optionally, the determination module 201 is specifically used to determine the estimated time required for the controlled virtual character to move to the current position of the target virtual object based on the current position of the controlled virtual character, the current position of the target virtual object and the moving speed of the controlled virtual character; determine the effective speed based on the moving speed of the target virtual object and a preset reference position; and determine the predicted position of the target virtual object based on the effective speed and the estimated time.
[0128] Optionally, the determination module 201 is specifically used to determine whether the speed direction of the target virtual object and the angle between the speed direction and the line connecting the controlled virtual character and the preset reference position is greater than or equal to a preset angle; if the angle is greater than or equal to the preset angle, the moving speed of the target virtual object is projected onto the perpendicular line connecting the target virtual object and the preset reference position, and the projected speed vector is determined to be the effective speed.
[0129] Optionally, the determination module 201 is specifically configured to directly determine the moving speed of the target virtual object as the effective speed if the included angle is smaller than a preset angle.
[0130] Optionally, the determination module 201 is specifically configured to determine the distance between the target virtual object and the controlled virtual character according to the current position of the controlled virtual character and the current position of the target virtual object; and determine the estimated time according to the distance and the moving speed of the controlled virtual character.
[0131] Optionally, the determination module 201 is specifically used to determine whether the estimated time is less than or equal to a preset time threshold; if so, determine the estimated time as the final estimated time; if not, determine the preset time threshold as the final estimated time.
[0132] Optionally, the control module 203 is specifically configured to control the controlled virtual character to move toward the landing point in a marking movement manner if the distance between the controlled virtual character and the landing point is less than a preset distance.
[0133] Optionally, the control module 203 is specifically configured to control the controlled virtual character to move toward the landing point at a high speed if the distance between the controlled virtual character and the landing point is greater than or equal to a preset distance.
[0134] Optionally, the calculation module 202 is specifically configured to calculate the landing point based on the distance between the predicted position and the preset reference position, and a preset ratio.
[0135] Optionally, the determination module 203 is specifically used to determine whether the landing point is within a preset landing distance range; if the landing point is within the preset landing distance range, the landing point is determined to be the final landing point.
[0136] Optionally, the determination module 203 is specifically configured to determine the nearest landing point as the final landing point if the landing point is outside the preset landing range and close to the nearest landing point in the preset landing range.
[0137] Optionally, the determination module 203 is specifically configured to determine the farthest landing point as the final landing point if the landing point is outside the preset landing range and close to the farthest landing point of the preset landing distance.
[0138] Optionally, the determination module 203 is specifically configured to determine the virtual character with the ball as the target virtual object if there is a virtual character with the ball in the game scene.
[0139] Optionally, the determination module 203 is specifically configured to determine the virtual football as the target virtual object if there is no virtual character with the ball in the game scene.
[0140] The above-mentioned device is used to execute the method provided in the above-mentioned embodiment. Its implementation principle and technical effect are similar and will not be repeated here.
[0141] The above modules can be one or more integrated circuits configured to implement the above methods, such as one or more application-specific integrated circuits (ASICs), one or more microprocessors, or one or more field programmable gate arrays (FPGAs). For another example, when a module is implemented by scheduling program code through a processing element, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0142] Figure 6 This is a schematic structural diagram of a virtual character control device provided in one embodiment of the present application. The virtual character control device may be integrated into a terminal device or a chip of the terminal device.
[0143] like Figure 6 As shown, the control device of the virtual character includes: a processor 501 , a storage medium 502 and a bus 503 .
[0144] The processor 501 is used to store programs. The processor 501 calls the program stored in the storage medium 502 to execute the above Figure 1-Figure 3 The specific implementation and technical effects of the corresponding method embodiment are similar and will not be described in detail here.
[0145] Optionally, the present application also provides a program product, such as a storage medium, on which a computer program is stored, including a program that, when executed by a processor, executes an embodiment corresponding to the above method.
[0146] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0147] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0148] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0149] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: a USB flash drive, a mobile hard disk, a read-only memory (English: Read-Only Memory, abbreviated: ROM), a random access memory (English: Random Access Memory, abbreviated: RAM), a disk or an optical disk, and other media that can store program code.
Claims
1. A method for controlling a virtual character, characterized in that: Providing a graphical user interface through a terminal, wherein the graphical user interface displays a game scene and a position control, wherein the game scene includes a controlled virtual character; the method includes: In response to a drop operation triggered by the drop control, determining a predicted position of the target virtual object based on the current position and movement speed of the target virtual object in the game scene and the current position and movement speed of the controlled virtual character; wherein the target virtual object is a virtual object other than the controlled virtual character in the game scene; Determining a landing point based on the predicted position and a preset reference position in the game scene; Controlling the controlled virtual character to move toward the landing point; The drop control and the sprint control are combined into a composite function control; before determining the predicted position of the target virtual object in response to the drop operation triggered by the drop control and based on the current position and movement speed of the target virtual object in the game scene and the current position and movement speed of the controlled virtual character, the method further includes: In response to a pressing operation on the composite function control, setting the composite function control as a drop control; The graphical user interface also displays a joystick control, and the method further includes: In response to a pressing operation on the composite function control and a dragging operation on the rocker control, setting the composite function control as a sprint control; In response to a trigger operation on the sprint control and a drag operation on the joystick control, the controlled virtual character is controlled to perform a sprint function.
2. The method according to claim 1, wherein Determining the predicted position of the target virtual object according to the current position and movement speed of the target virtual object in the game scene and the current position and movement speed of the controlled virtual character includes: determining an estimated time required for the controlled virtual character to move to the current position of the target virtual object based on the current position of the controlled virtual character, the current position of the target virtual object, and the moving speed of the controlled virtual character; determining an effective speed according to the moving speed of the target virtual object and the preset reference position; A predicted position of the target virtual object is determined according to the effective speed and the estimated time.
3. The method according to claim 2, wherein The determining the effective speed according to the moving speed of the target virtual object and the preset reference position includes: Determining whether the velocity direction of the target virtual object and the angle between the line connecting the controlled virtual character and the preset reference position are greater than or equal to a preset angle; If the angle is greater than or equal to the preset angle, the moving speed of the target virtual object is projected onto a perpendicular line connecting the target virtual object and the preset reference position, and the projected speed vector is determined to be the effective speed.
4. The method according to claim 3, wherein The determining of the effective speed according to the moving speed of the target virtual object and the preset reference position further includes: If the included angle is smaller than the preset angle, the moving speed of the target virtual object is directly determined to be the effective speed.
5. The method according to claim 2, wherein The step of determining, based on the current position of the controlled virtual character, the current position of the target virtual object, and the moving speed of the controlled virtual character, an estimated time required for the controlled virtual character to move to the current position of the target virtual object comprises: determining a distance between the target virtual object and the controlled virtual character according to the current position of the controlled virtual character and the current position of the target virtual object; The estimated time is determined according to the distance and the moving speed of the controlled virtual character.
6. The method according to claim 5, wherein After determining the estimated time based on the distance and the moving speed of the controlled virtual character, the method further includes: determining whether the estimated time is less than or equal to a preset time threshold; If so, determining the estimated time as the final estimated time; If not, the preset time threshold is determined to be the final estimated time.
7. The method according to claim 1, wherein The controlling the controlled virtual character to move toward the landing point includes: If the distance between the controlled virtual character and the landing point is less than a preset distance, the controlled virtual character is controlled to move toward the landing point in a marking movement manner.
8. The method according to claim 7, wherein The controlling the controlled virtual character to move toward the landing point includes: If the distance between the controlled virtual character and the landing point is greater than or equal to the preset distance, the controlled virtual character is controlled to move toward the landing point at a high speed.
9. The method according to claim 1, wherein The step of determining the landing point according to the predicted position and a preset reference position in the game scene includes: The landing point is calculated based on the distance between the predicted position and the preset reference position, and a preset ratio.
10. The method according to claim 1, wherein After determining the landing point based on the predicted position and the preset reference position in the game scene, the method further includes: Determining whether the landing point is within a preset landing distance range; If the landing point is within the preset landing distance range, the landing point is determined to be the final landing point.
11. The method according to claim 10, wherein After determining whether the landing point is within a preset landing distance range, the method further includes: If the landing point is outside the preset landing distance range and close to the nearest landing point within the preset landing distance range, the nearest landing point is determined to be the final landing point.
12. The method according to claim 11, wherein After determining whether the landing point is within a preset landing distance range, the method further includes: If the landing point is outside the preset landing distance range and close to the farthest landing point in the preset landing distance range, the farthest landing point is determined as the final landing point.
13. The method according to any one of claims 1 to 12, wherein: Before determining the predicted position of the target virtual object according to the moving speed of the target virtual object in the game scene, the method further includes: If there is a virtual character with a ball in the game scene, the virtual character with the ball is determined as the target virtual object.
14. The method according to any one of claims 1 to 12, wherein: Before determining the predicted position of the target virtual object according to the moving speed of the target virtual object in the game scene, the method further includes: If there is no virtual character with a ball in the game scene, the virtual football is determined to be the target virtual object.
15. A control device for a virtual character, characterized in that: The device includes: a determination module, a calculation module and a control module, wherein: The determination module, in response to a drop operation triggered by a drop control, determines a predicted position of the target virtual object based on the current position and movement speed of the target virtual object in the game scene and the current position and movement speed of the controlled virtual character; wherein the target virtual object is another virtual object in the game scene other than the controlled virtual character; The calculation module is used to determine the landing point based on the predicted position and a preset reference position in the game scene; The control module is used to control the controlled virtual character to move toward the landing point; The landing control and the sprint control are combined into a composite function control; the device further comprises: a trigger module for setting the composite function control as a landing control in response to a pressing operation on the composite function control; The graphical user interface of the device also displays: a joystick control; The trigger module is further configured to set the composite function control as a sprint control in response to a pressing operation on the composite function control and a dragging operation on the joystick control; The control module is further configured to control the controlled virtual character to perform a sprint function in response to a trigger operation on the sprint control and a drag operation on the joystick control.
16. A control device for a virtual character, characterized in that: The device includes: a processor, a storage medium and a bus, the storage medium stores machine-readable instructions executable by the processor, and when the control device of the virtual character is running, the processor and the storage medium communicate through the bus, and the processor executes the machine-readable instructions to perform the method described in any one of claims 1 to 14 above.
17. A storage medium, characterized in that: The storage medium stores a computer program, which, when executed by a processor, executes the method according to any one of claims 1 to 14.
Citation Information
Patent Citations
Game device, game device control method, and information storage medium
CN101208140A