CN112370787A - Control method of virtual role, computer readable storage medium and processor - Google Patents

Control method of virtual role, computer readable storage medium and processor Download PDF

Info

Publication number
CN112370787A
CN112370787A CN202011287359.3A CN202011287359A CN112370787A CN 112370787 A CN112370787 A CN 112370787A CN 202011287359 A CN202011287359 A CN 202011287359A CN 112370787 A CN112370787 A CN 112370787A
Authority
CN
China
Prior art keywords
virtual character
flight
waypoint
determining
abnormal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011287359.3A
Other languages
Chinese (zh)
Inventor
陈鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202011287359.3A priority Critical patent/CN112370787A/en
Publication of CN112370787A publication Critical patent/CN112370787A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • A63F13/56Computing the motion of game characters with respect to other game characters, game objects or elements of the game scene, e.g. for simulating the behaviour of a group of virtual soldiers or for path finding
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • A63F13/57Simulating properties, behaviour or motion of objects in the game world, e.g. computing tyre load in a car race game
    • A63F13/577Simulating properties, behaviour or motion of objects in the game world, e.g. computing tyre load in a car race game using determination of contact between game characters or objects, e.g. to avoid collision between virtual racing cars
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/64Methods for processing data by generating or executing the game program for computing dynamical parameters of game objects, e.g. motion determination or computation of frictional forces for a virtual car

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a control method of a virtual role, a computer readable storage medium and a processor. Wherein, the method comprises the following steps: detecting whether a first flight state of the virtual character is abnormal or not in the process of controlling the virtual character to execute the flight action; when the first flight state is detected to be abnormal, determining a target waypoint based on the flight direction of the virtual character; and controlling the virtual character to stop executing the flight action and landing to the position corresponding to the target road point. The invention solves the technical problem of higher calculation cost of the obstacle avoidance control method of the virtual role in the related technology.

Description

Control method of virtual role, computer readable storage medium and processor
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a method for controlling a virtual character, a computer-readable storage medium, and a processor.
Background
For a three-dimensional game, it is a common requirement that a virtual character flies at high altitude, various components in a game scene are generally provided with collision bodies conforming to the appearances of the components, the virtual character cannot move continuously when contacting the collision bodies in the scene or flying to certain regions where the virtual character cannot walk during flying, obstacle avoidance operation needs to be performed, namely, a legal drop point is found out from any position according to a certain rule, and the virtual character is controlled to fall to the drop point. However, the obstacle avoidance scheme has a large calculation overhead, which affects the performance of the virtual character in the flight process.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a control method of a virtual character, a computer readable storage medium and a processor, which are used for at least solving the technical problem that the obstacle avoidance control method of the virtual character in the related technology has high calculation cost.
According to an aspect of the embodiments of the present invention, there is provided a method for controlling a virtual character, which is applied to a server, the method including: detecting whether a first flight state of the virtual character is abnormal or not in the process of controlling the virtual character to execute the flight action; when the first flight state is detected to be abnormal, determining a target waypoint based on the flight direction of the virtual character; and controlling the virtual character to stop executing the flight action and landing to the position corresponding to the target road point.
Optionally, determining the target waypoint based on the flight direction of the virtual character comprises: determining a first flight track of the virtual character before the first flight state is abnormal based on the flight direction; acquiring at least one preset waypoint positioned in the preset direction of the first flight track; and determining a target waypoint from at least one preset waypoint.
Optionally, in the process of detecting that the virtual character flies to the position reached at the next moment, when the virtual character collides with another collision body in the game scene, determining, based on the flight direction, that the first flight trajectory of the virtual character is before the first flight state is abnormal, where the first flight trajectory includes: acquiring a first position where the virtual character collides with a collision body; and determining the track of the virtual character flying to the first position based on the flying direction to obtain a first flying track.
Optionally, in a case where it is detected that a position reached by the virtual character when flying to the next time is located outside a boundary of the game scene, determining, based on the flying direction, that the first flying state is abnormal before the virtual character flies to the next time, where the first flying trajectory of the virtual character includes: determining a second flight trajectory of the virtual character to a position reached at the next moment based on the flight direction; acquiring a second position which is located in the boundary and is closest to the position reached at the next moment in the second flight track; and determining the track of the virtual character flying to the second position based on the flying direction to obtain a first flying track.
Optionally, when it is detected that an illegal waypoint exists at a position where the virtual character arrives at a next moment of flight, before determining that the first flight state is abnormal based on the flight direction, the first flight trajectory of the virtual character includes: and acquiring the current position of the virtual character to obtain a first flight track.
Optionally, the determining the target waypoint from the at least one preset waypoint comprises: acquiring a target preset waypoint meeting a second preset condition from at least one preset waypoint; and determining the first target preset waypoint as a target waypoint according to the sequence from the position reached at the next moment to the current position of the virtual character.
Optionally, satisfying the second preset condition includes: in the process that the virtual character lands to the position corresponding to the target preset waypoint, the virtual character does not collide with other collision bodies in the game scene, and a moving space exists around the target preset waypoint, wherein the moving space is a space allowing the virtual character to move.
Optionally, the detecting whether the first flight status of the virtual character is abnormal includes: acquiring the current position of the virtual character; determining the position of the virtual character arriving at the next moment based on the flight parameters of the virtual character; detecting whether the position reached at the next moment meets a first preset condition or not, wherein the first preset condition is used for determining that the first flight state is abnormal; and if the position reached at the next moment is detected to meet the first preset condition, determining that the first flight state is abnormal.
Optionally, detecting whether the position reached at the next time meets the first preset condition includes: detecting whether the virtual character collides with other collision bodies in the game scene in the process of flying from the current position to the position reached at the next moment; and/or detecting whether the position reached at the next moment is positioned outside the boundary of the game scene; and/or detecting whether an illegal waypoint exists at the position reached at the next moment; and if the virtual character is detected to collide with other collision bodies, or the position reached at the next moment is located outside the boundary, or an illegal waypoint exists in the position reached at the next moment, determining that the position reached at the next moment meets a first preset condition.
Optionally, the detecting whether an illegal waypoint exists in a position reached at the next time includes: acquiring a first waypoint corresponding to a current position and a second waypoint corresponding to a position reached at the next moment; determining whether the ordinate of the current position is larger than the ordinate of the first waypoint or not and whether the ordinate of the position reached at the next moment is larger than the ordinate of the second waypoint or not; if the ordinate of the current position is larger than the ordinate of the first waypoint and the ordinate of the position reached at the next moment is larger than the ordinate of the second waypoint, determining that no illegal waypoint exists in the position reached at the next moment; and if the vertical coordinate of the current position is larger than the vertical coordinate of the first waypoint and the vertical coordinate of the position reached at the next moment is smaller than the vertical coordinate of the second waypoint, determining that the position reached at the next moment has illegal waypoints.
Optionally, before controlling the virtual character to perform the flight action, the method further comprises: detecting whether a target area exists in a game scene, wherein the size of the target area is larger than a preset size, no waypoint exists in the target area, and the distance between the bottom of the target area and other positions outside the target area is larger than a preset distance; if a target area exists in the game scene, determining the flight terminal point of the virtual character based on the flight parameters of the virtual character; determining whether a flight destination is located within a target area; if the flight destination is located in the target area, determining a target waypoint based on the flight parameters; and controlling the virtual character to execute the flight action and fly to the position corresponding to the target road point.
Alternatively, if it is detected that the target area does not exist in the game scene or the flight end point is located outside the target area, the virtual character is controlled to execute the flight action.
Optionally, the method further comprises: when the virtual character is controlled to start to execute the flight action, sending a first message to the client, wherein the client is used for controlling the virtual character to start to execute the flight action after receiving the first message, and the virtual character is displayed in the client; and when the first flight state is detected to be abnormal, sending a second message to the client, wherein the client is used for controlling the virtual character to stop executing the flight action and landing to a position corresponding to the target road point when the client detects that the second flight state of the virtual character is abnormal and receives the second message.
Optionally, before the control avatar starts to perform the flight action, synchronizing the current position and the current orientation of the avatar to a client, and controlling the avatar to start to perform the flight action based on the current position and the current orientation, wherein the client is configured to control the avatar to start to perform the flight action based on the current position and the current orientation.
Optionally, the time interval of the first timer of the server is less than or equal to the time interval of the second timer of the client.
Optionally, the first message is sent at a preset time interval, wherein when the first flight status is detected to be abnormal, all the first messages currently cached are sent.
According to another aspect of the embodiments of the present invention, there is also provided a method for controlling a virtual role, which is applied to a client, the method including: detecting whether a second flight state of the virtual character is abnormal or not in the process of controlling the virtual character to execute the flight action, wherein the virtual character is displayed in the client; when the second flight state is detected to be abnormal, determining a target waypoint based on the flight direction of the virtual character; and controlling the virtual character to stop executing the flight action and landing to the position corresponding to the target road point.
Optionally, determining the target waypoint based on the flight direction of the virtual character comprises: determining a first flight track of the virtual character before the second flight state is abnormal based on the flight direction; acquiring at least one preset waypoint positioned in the preset direction of the first flight track; and determining a target waypoint from at least one preset waypoint.
Optionally, the method further comprises: when a first message sent by a server is received, controlling the virtual character to start executing the flight action, wherein the first message is sent by the server when the virtual character is controlled to start executing the flight action; and when detecting that the second flight state of the virtual character is abnormal and receiving a second message sent by the server, controlling the virtual character to stop executing the flight action and landing to a position corresponding to the target route point, wherein the second message is sent by the server when detecting that the first flight state of the virtual character is abnormal.
Optionally, in a case that the second flight status is detected to be abnormal and the second message is not received, the updating of the position of the virtual character is stopped.
Optionally, the method further comprises: receiving a first location and a first orientation of a server-synchronized virtual character; acquiring a second position and a second orientation of the virtual character; based on the position deviation between the first position and the second position, and the orientation deviation between the first orientation and the second orientation, the virtual character is controlled to start performing the flight action.
According to another aspect of the embodiments of the present invention, there is also provided a control apparatus for a virtual character, which is applied to a server, the apparatus including: the state detection module is used for detecting whether the first flight state of the virtual character is abnormal or not in the process of controlling the virtual character to execute the flight action; the waypoint determining module is used for determining a target waypoint based on the flight direction of the virtual role when the first flight state is detected to be abnormal; and the control module is used for controlling the virtual character to stop executing the flight action and landing to a position corresponding to the target road point.
According to another aspect of the embodiments of the present invention, there is also provided a control apparatus for a virtual character, which is applied to a client, the apparatus including: the state detection module is used for detecting whether the second flight state of the virtual character is abnormal or not in the process of controlling the virtual character to execute the flight action, wherein the virtual character is displayed in the client; the waypoint determining module is used for determining a target waypoint based on the flight direction of the virtual character when the second flight state is detected to be abnormal; and the control module is used for controlling the virtual character to stop executing the flight action and landing to a position corresponding to the target road point.
According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, where the computer-readable storage medium includes a stored program, and when the program runs, the apparatus on which the computer-readable storage medium is located is controlled to execute the above-mentioned control method for the virtual character.
According to another aspect of the embodiments of the present invention, there is also provided a processor, where the processor is configured to execute a program, where the program executes the control method for the virtual character.
In the embodiment of the invention, in the process of controlling the virtual character to execute the flight action, when the abnormal flight state of the virtual character is detected, the target waypoint meeting the conditions can be searched based on the flight direction of the virtual character, the position corresponding to the target waypoint is determined as the legal drop point, and the virtual character is further controlled to drop to the legal drop point, so that the purpose of avoiding obstacles by the virtual character is realized. Compared with the related art, the target waypoint is searched based on the flight direction of the virtual character, and the whole annular range around the virtual character does not need to be searched, so that the technical effect of reducing the calculation cost while ensuring that the virtual character performance conforms to the physical law is achieved, and the technical problem of higher calculation cost of the obstacle avoidance control method of the virtual character in the related art is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a flowchart of a control method of a virtual character according to an embodiment of the present invention;
FIG. 2 is a flow chart of an alternative flight status detection method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an alternative obstacle avoidance scheme based on a preferential direction according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an alternative client-server messaging in accordance with embodiments of the present invention;
fig. 5 is a flowchart of another virtual character control method according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a control device of a virtual character according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In three-dimensional games, various types of components within a game scene are typically provided with collision volumes that conform to the appearance of the components. When the virtual character contacts a collision body in a scene during flying in the three-dimensional space, the virtual character cannot move continuously, and the position of the virtual character is usually in some regions which cannot walk in the three-dimensional space, wherein whether each position in the region carries a waypoint can be used to describe whether the region is a walkable region. In addition, the legal drop point needs to satisfy three conditions: when the virtual character stays on the drop point, the collision body does not collide with other collision bodies in the game scene; a waypoint exists on the drop point; the drop point position is located within the boundary of the preset game scene.
The following two obstacle avoidance schemes can be adopted to realize the obstacle avoidance operation of the virtual role at present: the first scheme is that a walkable area is generated off line, the scheme depends on waypoints in a game scene, and when a virtual character collides with other collision bodies in the game scene, the position of the waypoint in an annular range is searched from small to large by taking the collision position as the center of a circle and the radius; the second scheme is an obstacle avoidance scheme based on road point and collision detection, the scheme still uses the collision position as the center of a circle and searches for the position of a road point in an annular range from small radius to large radius, and simultaneously detects whether the road point of a drop point exists and whether collision exists between the collision position and the drop point.
However, with the first solution, since the waypoints in the game scene are generated offline by using a route-finding algorithm according to a predetermined collision object or are preset by an artist through an editor, it cannot be guaranteed that virtual characters with other collision object sizes do not collide and intersect with other collision objects in the game scene at the waypoint position, and therefore, the solution has a problem of waypoint reliability. For the second scheme, the scheme can ensure that a legal landing point can be found in a certain procedure, but the search cost of the annular search method is high, and the obstacle avoidance requirement according to the flight direction priority in three-dimensional flight is not met.
In addition, compared with a stand-alone game which does not need to be networked and a PC game with stable network delay, a mobile phone game which is connected with a network server by a wireless connection technology is influenced by the unstable condition of the network environment, and the transmission time of a data packet through the network has larger fluctuation. Currently, a client-server (client-server) architecture is generally adopted for the handtour, and the client and the server need to maintain the same position and orientation of the virtual role. When the flying speed is high, the difference between the position calculated by the client and the position calculated by the server is large, and the smooth transition of the position of the virtual character in the client needs to be ensured in the multi-section connection jumping process. Therefore, a location synchronization scheme of the client and the server needs to be designed.
Currently, the following two location synchronization schemes can be adopted to implement location synchronization between the client and the server: the first scheme is that the client detects and synchronizes, under the scheme, position calculation, collision detection, out-of-bound judgment and the like in the flight process are all operated by the client, and when the flight state changes, the client sends the latest flight information to a server and then broadcasts the latest flight information to other clients; the second scheme is that the server and the client detect in parallel, the client determines that the scheme requires the server and the client to detect flight state changes at the same time, the final result is determined by the client, when the server detects that the virtual character collides with other collision bodies or is out of bounds, the position of the virtual character stops updating, and the virtual character broadcasts the final result to other clients after waiting for the final result of the client.
The first time perception of the flight state can be realized by adopting the first scheme, however, when a battle has a plurality of clients, the clients need to be selected according to a certain strategy to be responsible for detecting and sending the flight state to the server, and the client is unreliable due to delay fluctuation of a network layer, blocking in performance and low frame rate, and finally the server cannot receive the correct flight state to influence a game result. The second scheme is adopted to ensure the low-delay experience of the client, but the problem of an unreliable client cannot be solved, for example, the client is disconnected suddenly in the flight process, so that the server and the client cannot be normally finished and are blocked in control when the server and the client touch a collision body in a game scene.
In order to solve the above problems, embodiments of the present invention provide a scheme for collision avoidance and finding a legal drop point based on collision detection and waypoints, including time compensation, location difference delay compensation, server advance, drop point prediction, and the like, which can ensure that a virtual character flies freely, detect an obstacle and an inaccessible area in time, determine a legal drop point that can move, and determine a legal drop point with a small calculation cost while ensuring that the virtual character performance conforms to a physical law.
In addition, the embodiment of the invention also provides a server-client side parallel detection and server role position synchronization scheme, which can solve the problems of unreliable client sides, client side-server position inconsistency and client side position mutation in the related technology under the condition of ensuring low-delay game experience.
It should be noted that the two schemes do not have customization rules of game scenes and virtual characters, can be applied to different three-dimensional games, and can expand and meet the displacement requirements of other three-dimensional spaces.
In accordance with an embodiment of the present invention, there is provided a method for controlling a virtual character, it should be noted that the steps shown in the flowchart of the drawings may be executed in a computer system such as a set of computer-executable instructions, and that although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in an order different from that shown.
Alternatively, the method may be applied to a server. Specifically, the method may include an obstacle avoidance control method for the virtual character and a position synchronization method, where the obstacle avoidance control method for the virtual character may also be applied to the client, and therefore, in an embodiment applied to the client, details of the obstacle avoidance control method for the virtual character are not described, and refer to related descriptions in this embodiment.
Fig. 1 is a flowchart of a method for controlling a virtual character according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step S102, in the process of controlling the virtual character to execute the flight action, detecting whether the first flight state of the virtual character is abnormal or not.
The virtual character in the above steps may be a virtual character controlled by the user in the hand game, in the client-server architecture, the client and the server may respectively control the same virtual character, and the user may view the control result in real time in the game interaction interface of the client, that is, the client may display the virtual character.
The flying operation in the above steps may be an operation of moving in the air including jumping, for example, high-altitude jumping, parachuting, and the like.
In different three-dimensional games, a user can control a virtual character to execute different actions through operation, specifically, in a hand game, a plurality of operation controls are often displayed in a game interaction interface, and the user can trigger different operation controls through clicking and sliding modes, so that the virtual character is controlled to execute different actions.
For example, for a three-dimensional hand game with a light jump function, a skill control, a common attack control, a jump control, a rapid running control and the like can be displayed in a game interaction interface, when a user wants to show the light function of a virtual character, the user can click the jump control and press the direction control, and can click the rapid running button and click the jump control and press the direction control. It should be noted that the purpose of multi-stage jumping can be achieved by continuously clicking the jump control after landing with the light jump for the first time, and at most three-stage jumping can be performed in games.
In an optional embodiment, after receiving the action instruction of high-altitude jump flight, the server may control the virtual character to execute a flight action, that is, may calculate the position of the virtual character in each frame according to the jump-off position and the jump-off direction corresponding to the operation instruction, and control the virtual character to fly based on the position of the virtual character in each frame.
Since the client and the server can control the same virtual character respectively, in order to distinguish the control processes in the client and the server, in this embodiment, the flight state of the virtual character controlled by the server can be referred to as a first flight state, and the flight state of the virtual character controlled by the client can be referred to as a second flight state.
The abnormal flying state in the above steps may refer to other obstacles in the game scene during flying, or flying to an unmovable area, but is not limited thereto, and may also be other conditions affecting high-altitude jump flying. Because the takeoff position and the takeoff direction of the virtual character are manually operated by a user, the flight state of the virtual character can be abnormal in the flight process, and obstacle avoidance control is required.
And step S104, when the first flight state is detected to be abnormal, determining a target waypoint based on the flight direction of the virtual character.
The flight direction in the above step may be a takeoff direction of the virtual character, or may be a direction in which the virtual character is manually operated by a user during the flight process, for example, after the user manually operates the virtual character to jump forward, the user manually operates the virtual character to fly backward, at this time, the takeoff direction of the virtual character is forward, and the flight direction is backward.
Because the virtual character cannot be controlled to continue flying after the flying state of the virtual character is abnormal, a legal landing point of the virtual character needs to be determined through calculation, and the legal landing point meets the three conditions: when the virtual character stays on the drop point, the collision body does not collide with other collision bodies in the game scene; a waypoint exists on the drop point; the drop point position is located within the boundary of the preset game scene. Therefore, the legal drop point can be determined to be the existing waypoint, and the virtual character can move freely and cannot be stuck. On the basis, the purpose of searching legal drop points can be realized by searching the way of the waypoints meeting the conditions.
The target waypoint in the above step may be waypoints existing on the legal drop point determined by calculation. Since the virtual character can only land to other locations below the current location, the destination waypoint may refer to a waypoint below the virtual character.
And S106, controlling the virtual character to stop executing the flight action and landing to a position corresponding to the target road point.
The position corresponding to the target waypoint in the above steps may be a legal drop point determined by calculation.
In an optional embodiment, after the target waypoint is determined, the position of the target waypoint can be determined to be a legal drop point, the virtual character is controlled to land to the legal drop point, and the whole high-altitude jump flight process is ended.
Through the embodiment of the invention, in the process of controlling the virtual character to execute the flight action, when the abnormal flight state of the virtual character is detected, the target waypoint meeting the conditions can be searched based on the flight direction of the virtual character, the position corresponding to the target waypoint is determined as the legal landing point, and the virtual character is further controlled to land on the legal landing point, so that the purpose of avoiding obstacles of the virtual character is realized. Compared with the related art, the target waypoint is searched based on the flight direction of the virtual character, and the whole annular range around the virtual character does not need to be searched, so that the technical effect of reducing the calculation cost while ensuring that the virtual character performance conforms to the physical law is achieved, and the technical problem of higher calculation cost of the obstacle avoidance control method of the virtual character in the related art is solved.
In the above embodiment of the present invention, determining the target waypoint based on the flight direction of the virtual character includes: determining a first flight track of the virtual character before the first flight state is abnormal based on the flight direction; acquiring at least one preset waypoint positioned in the preset direction of the first flight track; and determining a target waypoint from at least one preset waypoint.
The preset waypoints in the above steps may be waypoints in a walkable area preset in a game scene, and walkable areas in different game scenes are different, for example, when there are multiple floors of a building in a game scene, each floor of the building may be used as a walkable area, and similarly, the roof or the balcony of the building may also be used as a walkable area. It should be noted that if the virtual character jumps in the walkable area on the lower floor, it cannot reach the walkable area on the upper floor through the collision body.
The virtual character flies according to the flying direction, and in the flying process, the connection lines of a plurality of positions passed by the virtual character form the flying track of the virtual character, so that the first flying track is formed by connecting a plurality of flying positions and can be regarded as a curve in the air.
The preset direction in the above step may be a lower direction of the first flight trajectory.
In an optional embodiment, before the first flight state is abnormal, the virtual character can fly normally, so that the first flight track can be determined based on the flight direction, when the first flight state is abnormal, obstacle avoidance operation needs to be performed, and waypoints below the first flight track can be screened by a method for backtracking the first flight track, so that a target waypoint is obtained.
In the above embodiment of the present invention, when the virtual character collides with another collision body in the game scene during the process of detecting that the virtual character flies to the position reached at the next moment, the first flight trajectory of the virtual character before determining that the first flight state is abnormal based on the flight direction includes: acquiring a first position where the virtual character collides with a collision body; and determining the track of the virtual character flying to the first position based on the flying direction to obtain a first flying track.
The other collision body in the above step may be a collision body of another virtual character in the game scene, or may be a collision body of a component such as a building or a tree in the game scene, which is not particularly limited in the present invention.
After the collision occurs, the virtual character cannot continuously fly, so that the legal landing point can be determined to be necessarily located before the collision occurrence time, and all waypoints located below the flight trajectory can be determined to be the preset waypoints by acquiring the flight trajectory from the current position to the first position. The flight trajectory of the virtual character is formed by splicing a plurality of line segments, and the two end points of each line segment are two calculated positions, so that the first flight trajectory can be obtained by calculating the positions, between the current position and the first position, through which all virtual characters can pass.
It should be noted that the virtual character landing is generally a vertical landing, and a waypoint located right below each flight position in the first flight trajectory may be determined as a preset waypoint based on the flight position.
In the above embodiment of the present invention, in a case where it is detected that a position reached by the virtual character when flying to the next time is located outside a boundary of a game scene, before determining that the first flight state is abnormal based on the flight direction, the first flight trajectory of the virtual character includes: determining a second flight trajectory of the virtual character to a position reached at the next moment based on the flight direction; acquiring a second position which is located in the boundary and is closest to the position reached at the next moment in the second flight track; and determining the track of the virtual character flying to the second position based on the flying direction to obtain a first flying track.
Different game scenes need to be preset with boundaries, so that the virtual characters are prevented from moving outside the game scenes and being not in accordance with logic. For example, for a three-dimensional hand game with a light jump function, since a user can control virtual characters to jump to fixed components such as buildings, trees and the like through light work, a regular rectangular boundary can be set at the edge of a game scene, the user cannot jump or move beyond the boundary through light work, and similarly to the case that a transparent cuboid is set at the edge of the game scene, all virtual characters can only move or jump inside the cuboid.
Since the virtual character cannot fly or move outside the boundary of the game scene, it can be determined that the legal drop point is necessarily located within the boundary of the game scene, and the second position in the above step may be the farthest position where the virtual character can fly, that is, the second position may be the last position in the second flight trajectory located within the boundary. And further determining all waypoints below the flight trajectory to be preset waypoints by acquiring the flight trajectory from the current position to the second position.
It should be noted that the fourth position in the second flight path can be determined by a binary search method.
In the above embodiment of the present invention, when it is detected that an illegal waypoint exists at a position where the virtual character arrives at the next moment of flying, before determining that the first flight state is abnormal based on the flight direction, the first flight trajectory of the virtual character includes: and acquiring the current position of the virtual character to obtain a first flight track.
In some game scenes, the ground may be a walkable area, that is, there is a waypoint on the ground and there is no collision volume, but since each position in the flight trajectory of the virtual character is calculated frame by frame, in the above game scenes, it may occur that the position of the virtual character in the current frame is above the ground, but the calculated position of the next frame is below the ground, so that the virtual character in the next frame is divided by the ground and does not satisfy the game logic. Therefore, the illegal waypoint in the above step may refer to a waypoint that does not satisfy the game logic.
For a position where an illegal waypoint exists, in order to ensure reasonable display of the virtual character, the waypoint directly below the current position may be directly used as the preset waypoint.
In the above embodiments of the present invention, determining the target waypoint from the at least one preset waypoint includes: acquiring a target preset waypoint meeting a second preset condition from at least one preset waypoint; and determining the first target preset waypoint as a target waypoint according to the sequence from the position reached at the next moment to the current position.
Optionally, satisfying the second preset condition may include: in the process that the virtual character lands to the target preset waypoint, the virtual character does not collide with other collision bodies in the game scene, and a moving space exists around the target preset waypoint, wherein the moving space is a space allowing the virtual character to move.
For example, in a game scenario where there are multiple floors of a building, the user may control the virtual character to jump from one floor of the building, but the virtual character cannot fall through the floor to the next floor. For example, the user may control the virtual character to jump, but the virtual character cannot fall between two immovable objects, and the virtual character is locked and immovable after falling. Therefore, whether a collision exists between each preset waypoint and the corresponding flight position can be determined through collision detection, whether a moving space exists around each preset waypoint is judged, and the preset waypoint can be determined as the target preset waypoint only if the collision does not exist between the preset waypoint and the corresponding flight position and the moving space exists around the preset waypoint.
In order to improve high-altitude jump flight, a user wants to control the virtual character to fly the farthest distance, and therefore, a first legal drop point can be searched in a way of backtracking the flight trajectory (that is, calculating from the next frame position to the front), so that the legal drop point is farthest from the jump-off position of the virtual character.
In the above embodiment of the present invention, detecting whether the first flight status of the virtual character is abnormal includes: acquiring the current position of the virtual character; determining the position of the virtual character at the next moment when the virtual character arrives at the next moment based on the flight parameters of the virtual character; detecting whether the position reached at the next moment meets a first preset condition or not, wherein the first preset condition is used for determining that the first flight state is abnormal; and if the position reached at the next moment is detected to meet the first preset condition, determining that the first flight state is abnormal.
Based on the principle of high-altitude jump, after the virtual character starts to execute the flight action, the virtual character can fly in the air for a period of time, the flight track of the virtual character is formed by splicing line segments, and the positions of the virtual character in two adjacent frames are two end points of the corresponding line segment, so that the flight track of the virtual character comprises a plurality of different flight positions. The server and the client can calculate the position of the next frame based on the current position of the virtual character in each frame in a frame-by-frame calculation mode, and update the position of the virtual character based on the position of the next frame. Therefore, the current position in the above step may be the current position of the virtual character in each frame, and the position reached at the next time may be the calculated position of the next frame. The next time may be a time corresponding to the next frame.
The first preset condition in the above step may be a flight state detection condition determined in advance based on a high altitude jump principle, and when the flight state of the virtual character satisfies the condition, it may be determined that the flight state of the virtual character is abnormal, in an embodiment of the present invention, the first preset condition may include: at the position reached by the next moment, the collision body of the virtual character collides with other collision bodies in the game scene, for example, at the position reached by the next moment, the collision body of the virtual character collides with the collision bodies of other virtual characters, or the collision body of the virtual character collides with the collision body of the outer wall of the building; the position reached at the next moment exceeds the boundary of the game scene; the waypoint corresponding to the position reached at the next time is illegal to detect, for example, the virtual character is close to the ground at the current position, and the virtual character falls into the ground at the position reached at the next time, for example, the steps of the virtual character are located below the plane where the ground is located.
It should be noted that, for the client and the server, the logic of flight state detection is completely consistent, and the difference is that the client stops the location update of the virtual character after detecting the abnormal state, and the server searches for a legal drop point to avoid the obstacle.
In the above embodiment of the present invention, detecting whether the position reached at the next time meets the first preset condition includes: detecting whether the virtual character collides with other collision bodies in the game scene in the process of flying from the current position to the position reached at the next moment; and/or detecting whether the position reached at the next moment is positioned outside the boundary of the game scene; and/or detecting whether an illegal waypoint exists at the position reached at the next moment; and if the virtual character is detected to collide with other collision bodies, or the position reached at the next moment is located outside the boundary, or an illegal waypoint exists in the position reached at the next moment, determining that the position reached at the next moment meets a first preset condition.
The scheme for detecting the collision between the collision bodies can be realized by adopting the existing scheme, the scheme is not particularly limited in the invention, and the purpose of collision detection can be achieved by judging whether the collision bodies are crossed or not.
It should be noted that the collision detection step may adjust the order between the detection conditions as needed, and may add, modify or delete the detection conditions, but is not limited thereto.
In the above embodiment of the present invention, detecting whether an illegal waypoint exists at a position reached at the next time includes: acquiring a first waypoint corresponding to a current position and a second waypoint corresponding to a position reached at the next moment; determining whether the ordinate of the current position is larger than the ordinate of the first waypoint or not and whether the ordinate of the position reached at the next moment is larger than the ordinate of the second waypoint or not; if the ordinate of the current position is larger than the ordinate of the first waypoint and the ordinate of the position reached at the next moment is larger than the ordinate of the second waypoint, determining that no illegal waypoint exists in the position reached at the next moment; and if the vertical coordinate of the current position is larger than the vertical coordinate of the first waypoint and the vertical coordinate of the position reached at the next moment is smaller than the vertical coordinate of the second waypoint, determining that the position reached at the next moment has illegal waypoints.
The first waypoint in the above steps may be a waypoint at or near the current position, and the second waypoint may be a waypoint at or near the position reached at the next time.
For example, it is still described by taking an example that there is a waypoint on the ground and there is no collision object in the game scene, if the ordinate of a position is greater than the ordinate of the corresponding waypoint, it indicates that the position is above the waypoint, that is, the position is above the ground, and at this time, the virtual character may land on the ground; if the ordinate of a location is less than the ordinate of the corresponding waypoint, it indicates that the location is below the waypoint, i.e., the location is below the ground, resulting in the location having illegal waypoints.
A preferred embodiment of the present invention will be described in detail with reference to fig. 2 and 3.
As shown in FIG. 2, within each frame, the current position and the calculated next frame position are denoted as cur _ pos and next _ pos, respectively. Whether the collision body of the virtual character collides from cur _ pos to next _ pos is detected.
If there is no collision and the next _ pos is already outside the boundary of the game scene, a binary search method is adopted to search the last position bound _ pos in the boundary in the line segment from cur _ pos to next _ pos, and then a legal drop point in the flight path from cur _ pos to bound _ pos is searched.
If the collision does not exist but the waypoint detection is illegal, the situation that the back tracing of the track and the obstacle avoidance are needed after the flight is finished is shown. In some scenes, when there is a case that there is no collision body on the ground but there is a waypoint, at this time, if it is detected that cur _ pos.y is greater than the waypoint h1 corresponding to cur _ pos, and next _ pos.y is smaller than the waypoint h2 corresponding to next _ pos, it indicates that the virtual character has sunk into the ground, and the waypoint detection is illegal.
If there is a collision, a legal drop point is found from cur _ pos to the position col _ pos where the person is located at the time of the collision.
The following description will be given by taking a flight trajectory as shown in fig. 3 as an example. From point D to point a is the flight trajectory of the virtual character in the air, and a collider is encountered near point a as determined by collision detection. At this time, the legal drop point needs to be found by backtracking from the point A to the point D. For point a, the waypoint h is larger than the y coordinate of point a due to the existence of the walkable area at its top. Therefore, it is necessary to detect a collision with a ray from the point a toward the directly lower side, and if there is a waypoint, determine whether or not there is a collision with the waypoint and whether or not there is a movement space. Just below point a in the figure is obstacle 1, thus skipping point a; for point B, point B is skipped because it is directly below the no-walk region 2 and there is no waypoint; for point C, although there is a waypoint right below the point C, the obstacles 3 and 4 are around the position corresponding to the waypoint, and the virtual character cannot move after falling, so the point C is skipped; and a waypoint exists right below the point D, the position corresponding to the waypoint has no collision with the point D, and a moving space exists around the position corresponding to the waypoint, so that the position corresponding to the waypoint can be determined to be a final legal drop point.
In the above embodiment of the present invention, before controlling the virtual character to perform the flight action, the method further includes: detecting whether a target area exists in a game scene, wherein the size of the target area is larger than a preset size, no waypoint exists in the target area, and the distance between the bottom of the target area and other positions outside the target area is larger than a preset distance; if a target area exists in the game scene, determining the flight terminal point of the virtual character based on the flight parameters of the virtual character; determining whether a flight destination is located within a target area; if the flight destination is located in the target area, determining a target waypoint based on the flight parameters; and controlling the virtual character to execute the flight action and fly to the position corresponding to the target road point.
The target area in the above steps may be an area with a large size, no waypoint, and a bottom position in the area much lower than other positions outside in the game scene, for example, the target area may be a river with a low terrain and a large width in the game scene.
It should be noted that, in the above game scenario, after the virtual character jumps from outside the target area, a long useless flight process is often performed in the area, and if the server and the client perform calculation frame by frame, a situation that a legal drop point is far away from the current position of the virtual character may occur, which results in a long performance of the virtual character and affects user experience.
For example, taking a river with a very low terrain in a game scene as an example, a user controls a virtual character to jump from a river edge to a river, if the flight position of the virtual character is determined in a frame-by-frame prediction mode, the virtual character jumps into a river and touches a river bed collision body at the river bottom, a legal landing point of a river bank needs to be determined through an obstacle avoidance scheme, at the moment, the final performance of the virtual character is that the virtual character jumps from the river edge and is pulled to the river bank after jumping into the river, and the performance is poor.
The preset size and the preset distance in the above steps may be sizes and distances set according to actual obstacle avoidance requirements, and when the size of the target area is larger than the preset size and the distance between the bottom distance and other positions is larger than the preset distance, it may be determined that the high-altitude jump flight of the virtual character may not be able to jump over the target area, and in order to avoid poor performance of the virtual character, it may be determined in advance whether the virtual character can jump over the target area before the jump starts.
The flight parameters in the above steps may be, but are not limited to, a take-off position, a take-off direction, a take-off speed, and the like of the virtual character. The position of the virtual character at each moment can be calculated through the flight parameters, so that the flight track of the virtual character is determined, and the flight end point of the virtual character can be further obtained after the flight track is determined because the flight track is usually a parabola, and the flight end point can be the flight position of the last waypoint in the flight track below the y coordinate.
Optionally, if it is detected that the target area does not exist in the game scene or the flight end point is located outside the target area, the virtual character is controlled to execute the flight action.
In an alternative embodiment, before the virtual character jumps, a flight endpoint in the flight trajectory can be calculated in advance according to the flight parameters, and if the flight endpoint is determined to be located outside the target area, the virtual character is determined to be capable of jumping over the target area, and the virtual character can be controlled to jump normally; if the flight destination is determined to be located in the target area, namely the virtual character passes through the flight destination and has no waypoint at the next frame position, the waypoint detection is judged to fail, the virtual character is determined to be incapable of jumping over the target area and to fall into the target area, at the moment, a legal landing point can be determined directly through an obstacle avoidance scheme, and the virtual character is controlled to start jumping and to fall to the legal landing point.
Through the scheme, the invention provides the obstacle avoidance scheme with the priority direction based on the waypoint judgment and the collision detection, so that the legal landing points meeting the requirements can be quickly found in the game at lower cost.
In the above embodiment of the present invention, the method further includes: when the virtual character is controlled to start to execute the flight action, sending a first message to the client, wherein the client is used for controlling the virtual character to start to execute the flight action after receiving the first message, and the virtual character is displayed in the client; and when the first flight state is detected to be abnormal, sending a second message to the client, wherein the client is used for controlling the virtual character to stop executing the flight action and landing to a position corresponding to the target road point when the client detects that the second flight state of the virtual character is abnormal and receives the second message.
The first message in the above steps may be a message that the virtual character starts jumping, that is, a flight start message; the second message may be a message that the flight status is abnormal, that is, a flight status change message. It should be noted that, in order to save the computing resources of the client, the second message may carry the server to calculate the legal drop point.
In order to solve the problem that the positions of a client and a server are inconsistent due to low reliability of the client in the related technology, the invention provides a synchronization scheme for parallel detection of the client and the server and decision making of the server. The server firstly controls the virtual character to start jumping and sends a first message to the client, the client controls the virtual character to start jumping after receiving the first message, and the server and the client perform flight state detection in parallel. When the server detects that the first flight state is abnormal, the server firstly finds a legal drop point, controls the virtual character to drop to the legal drop point and can send a second message to the client. The client can also detect that the second flight state is abnormal, at this time, the client stops updating the position of the virtual character, and after receiving the second message, the client controls the virtual character to land to a legal landing point.
It should be noted that, in the case of network stability, the message transmission time sent by the server to the client is fixed and denoted as Δ t. Meanwhile, the virtual character takes off at the same position and in the same direction, and as the data of the collision body, the road point and the boundary in the scene are completely consistent in the server and the client, the state detection results of the client and the server and the found legal landing point are completely consistent, so that when the client and the server simultaneously carry out position calculation and collision detection in the process of high-altitude jump flight, the positions of flight state changes are also completely consistent. Meanwhile, due to stable network transmission delay, the client sees the delta t moment before the virtual character hits a collision body in the game scene, and the server detects the collision and calculates the changed flight state and broadcasts the changed flight state to all the clients. When the client side collides, the second message is also received, because the client side and the server detect in parallel under the stable network environment, the delay of client side perception is not increased. As shown in fig. 4, the message transmission time of the flight start message and the flight status change message are the same, so the flight time of the character at the server and the flight time at the client are also the same.
In the case of network fluctuations, the virtual character's flight will still proceed normally, since the client is also performing location calculations. If the virtual character encounters the collision body in the game scene, the position updating is suspended. Since the probability of occurrence of the above-described situation is small, the abnormal situation can be accepted by the user.
Through the steps, the server determines the change of the flight state, so that the same game experience can be ensured for all the clients, the game fairness is ensured, and the problem of unreliable clients is solved.
In the above embodiment of the present invention, before the virtual character is controlled to start executing the flight action, the current position and the current orientation of the virtual character are synchronized to the client, and the virtual character is controlled to start executing the flight action based on the current position and the current orientation, wherein the client is configured to control the virtual character to start executing the flight action based on the current position and the current orientation.
In order to ensure that the results of the detection of the flight status between the server and the client and the detection of the position during the flight are identical, the current position and orientation of the virtual character may be synchronized by the server to the client before the virtual character is controlled to jump. The server firstly enters a flight state and starts to calculate a flight track; and after receiving the first message, the client calculates the flight position according to the same track calculation method.
In the above embodiments of the present invention, the time interval of the first timer of the server is less than or equal to the time interval of the second timer of the client.
It should be noted that the above location synchronization scheme does not consider the effect of inconsistent relative time (tick) intervals between the client and the server.
Since the frame rate of the client is usually above 30 frames, the tick interval of the server may be much larger than the tick interval of the client. Therefore, in order to ensure that the server can detect the flight state change in as short a time as possible, the trajectory calculation of the server needs to be multiplied appropriately, and the tick interval needs to be reduced.
In the above embodiment of the present invention, the first messages are sent at preset time intervals, wherein when the first flight status is detected to be abnormal, all the first messages currently cached are sent.
The preset time interval in the above step may be a fixed interval at which the server sends an RPC (Remote Procedure Call) message by default.
Since the server sends the RPC messages at regular intervals by default, this may cause the RPC message of the current frame to start to be sent only after the next frame, thereby increasing the transmission delay of each frame of RPC messages. In an alternative embodiment, all RPCs currently cached may be sent immediately after the server detects that the flight status of the virtual character is abnormal.
It should be noted that, by adopting the above-mentioned scheme, the error between the location calculations of the client and the server can be eliminated to the greatest extent, but the location difference is still unavoidable. For the high-altitude jump flight with multiple sections connected, the end point of the previous flight is the starting point of the next flight. If the position of the avatar in the client is forced to be the position of the avatar in the server at the beginning of the next flight segment, a large position difference will result within the frame, plus a sudden change in position that is visible to the naked eye will easily occur because the action is usually not adjusted much at the beginning of each segment. The embodiment of the invention adopts the position difference delay compensation strategy, when each flight begins, the position of the virtual character in the client is not set to the position of the virtual character in the server immediately, and the position difference of the virtual character in the client and the virtual character in the server is taken into account when the track of the next frame is calculated, so that the position mutation can be eliminated smoothly.
There is also provided, in accordance with an embodiment of the present invention, a method for controlling a virtual character, it being noted that the steps illustrated in the flowchart of the accompanying drawings may be performed in a computer system such as a set of computer-executable instructions, and that, although a logical order is illustrated in the flowchart, in some cases, the steps illustrated or described may be performed in an order different than here.
Alternatively, the method may be applied to a client. Specifically, the method may include an obstacle avoidance control method for the virtual character and a position synchronization method, where details of the obstacle avoidance control method for the virtual character are not repeated, and refer to related descriptions in the foregoing embodiments.
Fig. 5 is a flowchart of another control method for a virtual character according to an embodiment of the present invention, as shown in fig. 5, the method includes the following steps:
step S502, in the process of controlling the virtual character to execute the flight action, detecting whether the second flight state of the virtual character is abnormal or not, wherein the virtual character is displayed in the client;
step S504, when the second flight state is detected to be abnormal, determining a target waypoint based on the flight direction of the virtual character;
and step S506, controlling the virtual character to stop executing the flight action and landing to a position corresponding to the target road point.
In the above embodiment of the present invention, determining the target waypoint based on the flight direction of the virtual character includes: determining a first flight track of the virtual character before the second flight state is abnormal based on the flight direction; acquiring at least one preset waypoint positioned in the preset direction of the first flight track; and determining a target waypoint from at least one preset waypoint.
In the above embodiment of the present invention, when the virtual character collides with another collision body in the game scene during the process of detecting that the virtual character flies to the position reached at the next moment, the first flight trajectory of the virtual character includes, based on the flight direction, before determining that the second flight state is abnormal: acquiring a first position where the virtual character collides with a collision body; and determining the track of the virtual character flying to the first position based on the flying direction to obtain a first flying track.
In the above embodiment of the present invention, in a case where it is detected that a position reached by the virtual character when flying to the next time is located outside a boundary of the game scene, before determining that the second flight state is abnormal based on the flight direction, the first flight trajectory of the virtual character includes: determining a second flight trajectory of the virtual character to a position reached at the next moment based on the flight direction; acquiring a second position which is located in the boundary and is closest to the position reached at the next moment in the second flight track; and determining the track of the virtual character flying to the second position based on the flying direction to obtain a first flying track.
In the above embodiment of the present invention, when it is detected that an illegal waypoint exists at a position where the virtual character arrives at the next moment of flying, before determining that the second flight state is abnormal based on the flight direction, the first flight trajectory of the virtual character includes: and acquiring the current position of the virtual character to obtain a first flight track.
In the above embodiments of the present invention, determining the target waypoint from the at least one preset waypoint includes: acquiring a target preset waypoint meeting a second preset condition from at least one preset waypoint; and determining the first target preset waypoint as a target waypoint according to the sequence from the position reached at the next moment to the current position of the virtual character.
Optionally, satisfying the second preset condition includes: in the process that the virtual character lands to the position corresponding to the target preset waypoint, the virtual character does not collide with other collision bodies in the game scene, and a moving space exists around the target preset waypoint, wherein the moving space is a space allowing the virtual character to move.
In the above embodiment of the present invention, detecting whether the second flight status of the virtual character is abnormal includes: acquiring the current position of the virtual character; determining the position of the virtual character at the next moment when the virtual character arrives at the next moment based on the flight parameters of the virtual character; detecting whether the position reached at the next moment meets a first preset condition or not, wherein the first preset condition is used for determining that the second flight state is abnormal; and if the position reached at the next moment is detected to meet the first preset condition, determining that the second flight state is abnormal.
In the above embodiment of the present invention, detecting whether the position reached at the next time meets the first preset condition includes: detecting whether the virtual character collides with other collision bodies in the game scene in the process of flying from the current position to the position reached at the next moment; and/or detecting whether the position reached at the next moment is positioned outside the boundary of the game scene; and/or detecting whether an illegal waypoint exists at the position reached at the next moment; and if the virtual character is detected to collide with other collision bodies, or the position reached at the next moment is located outside the boundary, or an illegal waypoint exists in the position reached at the next moment, determining that the position reached at the next moment meets a second preset condition.
In the above embodiment of the present invention, detecting whether an illegal waypoint exists at a position reached at the next time includes: acquiring a first waypoint corresponding to a current position and a second waypoint corresponding to a position reached at the next moment; determining whether the ordinate of the current position is larger than the ordinate of the first waypoint or not and whether the ordinate of the position reached at the next moment is larger than the ordinate of the second waypoint or not; if the ordinate of the current position is larger than the ordinate of the first waypoint and the ordinate of the position reached at the next moment is larger than the ordinate of the second waypoint, determining that no illegal waypoint exists in the position reached at the next moment; and if the vertical coordinate of the current position is larger than the vertical coordinate of the first waypoint and the vertical coordinate of the position reached at the next moment is smaller than the vertical coordinate of the second waypoint, determining that the position reached at the next moment has illegal waypoints.
In the above embodiment of the present invention, the method further includes: when a first message sent by a server is received, controlling the virtual character to start executing the flight action, wherein the first message is sent by the server when the virtual character is controlled to start executing the flight action; and when detecting that the second flight state of the virtual character is abnormal and receiving a second message sent by the server, controlling the virtual character to stop executing the flight action and landing to a position corresponding to the target route point, wherein the second message is sent by the server when detecting that the first flight state of the virtual character is abnormal.
In the above embodiment of the present invention, when it is detected that the second flight status is abnormal and the second message is not received, the updating of the position of the virtual character is stopped.
In the above embodiment of the present invention, the method further includes: receiving a first location and a first orientation of a server-synchronized virtual character; acquiring a second position and a second orientation of the virtual character; based on the position deviation between the first position and the second position, and the orientation deviation between the first orientation and the second orientation, the virtual character is controlled to start performing the flight action.
The first position and the first orientation in the above steps may be a current position and a current orientation at which the virtual character is located in the server, and the second position and the second orientation may be a current position and a current orientation at which the virtual character is located in the client.
It should be noted that, by adopting the above-mentioned scheme, the error between the location calculations of the client and the server can be eliminated to the greatest extent, but the location difference is still unavoidable. For the high-altitude jump flight with multiple sections connected, the end point of the previous flight is the starting point of the next flight. If the position of the avatar in the client is forced to be the position of the avatar in the server at the beginning of the next flight segment, a large position difference will result within the frame, plus a sudden change in position that is visible to the naked eye will easily occur because the action is usually not adjusted much at the beginning of each segment. The embodiment of the invention adopts the position difference delay compensation strategy, when each flight begins, the position of the virtual character in the client is not set to the position of the virtual character in the server immediately, and the position difference of the virtual character in the client and the virtual character in the server is taken into account when the track of the next frame is calculated, so that the position mutation can be eliminated smoothly.
According to an embodiment of the present invention, there is provided a control apparatus of a virtual character, which can be applied to a server. The device can execute the control method of the virtual role in the above embodiment, and the specific implementation scheme and the application scenario are the same as those in the above embodiment, which are not described herein again.
Fig. 6 is a schematic diagram of a control apparatus of a virtual character according to an embodiment of the present invention, as shown in fig. 6, the apparatus including:
the state detection module 62 is configured to detect whether a first flight state of the virtual character is abnormal or not in a process of controlling the virtual character to execute a flight action;
a waypoint determination module 64 configured to determine a target waypoint based on the flight direction of the virtual character when it is detected that the first flight state is abnormal;
and the control module 66 is used for controlling the virtual character to stop executing the flight action and to land to the position corresponding to the target road point.
In the above embodiment of the present invention, the waypoint determination module includes: the track determining unit is used for determining a first flight track of the virtual character before the first flight state is abnormal based on the flight direction; the waypoint acquisition unit is used for acquiring at least one preset waypoint positioned in the preset direction of the first flight track; and the waypoint determining unit is used for determining the target waypoint from at least one preset waypoint.
In the above embodiment of the present invention, the trajectory determination unit is further configured to, when it is detected that the virtual character collides with another collision body in the game scene in the process of detecting that the virtual character arrives at the next arrival time, obtain a first position where the virtual character collides with the collision body, and determine, based on the flight direction, a trajectory of the virtual character that flies to the first position, so as to obtain the first flight trajectory.
In the above embodiment of the present invention, the trajectory determination unit is further configured to, when it is detected that the position where the virtual character arrives at the next moment in the flying process is located outside the boundary of the game scene, determine, based on the flying direction, a second flying trajectory of the virtual character at the position where the virtual character arrives at the next moment in the flying process, obtain a second position, located inside the boundary and closest to the position where the virtual character arrives at the next moment, and determine, based on the flying direction, a trajectory where the virtual character flies to the second position, so as to obtain the first flying trajectory.
In the above embodiment of the present invention, the trajectory determining unit is further configured to, when it is detected that an illegal waypoint exists at a position where the virtual character arrives at a next moment of flying, obtain a current position of the virtual character, and obtain the first flying trajectory.
In the above embodiment of the present invention, the waypoint determining unit is further configured to obtain a target preset waypoint that satisfies a second preset condition from among the at least one preset waypoint, and determine, according to an order from a position reached at a next time to a position where the first target preset waypoint is currently located, that the first target preset waypoint is the target waypoint.
In the above embodiment of the present invention, the state detection module includes: the first obtaining unit is used for obtaining the current position of the virtual character; a first determination unit, configured to determine, based on a flight parameter of the virtual character, a position at which the virtual character arrives at a next time that arrives at the next time; the detection unit is used for detecting whether the position reached at the next moment meets a first preset condition or not, wherein the first preset condition is used for determining that the first flight state is abnormal; and the second determining unit is used for determining that the first flight state is abnormal if the position reached at the next moment is detected to meet the first preset condition.
In the above embodiment of the present invention, the detecting unit is further configured to perform the following steps: detecting whether the virtual character collides with other collision bodies in the game scene in the process of flying from the current position to the position reached at the next moment; and/or detecting whether the position reached at the next moment is positioned outside the boundary of the game scene; and/or detecting whether an illegal waypoint exists at the position reached at the next moment; and if the virtual character is detected to collide with other collision bodies, or the position reached at the next moment is located outside the boundary, or an illegal waypoint exists in the position reached at the next moment, determining that the position reached at the next moment meets a first preset condition.
In the above embodiment of the present invention, the detecting unit is further configured to perform the following steps: acquiring a first waypoint corresponding to a current position and a second waypoint corresponding to a position reached at the next moment; determining whether the ordinate of the current position is larger than the ordinate of the first waypoint or not and whether the ordinate of the position reached at the next moment is larger than the ordinate of the second waypoint or not; if the ordinate of the current position is larger than the ordinate of the first waypoint and the ordinate of the position reached at the next moment is larger than the ordinate of the second waypoint, determining that no illegal waypoint exists in the position reached at the next moment; and if the vertical coordinate of the current position is larger than the vertical coordinate of the first waypoint and the vertical coordinate of the position reached at the next moment is smaller than the vertical coordinate of the second waypoint, determining that the position reached at the next moment has illegal waypoints.
In the above embodiment of the present invention, the apparatus further includes: the area detection module is used for detecting whether a target area exists in a game scene before the virtual character is controlled to execute the flight action, wherein the size of the target area is larger than a preset size, no waypoint exists in the target area, and the distance between the bottom of the target area and other positions outside the target area is larger than a preset distance; the terminal point determining module is used for determining the flight terminal point of the virtual character based on the flight parameters of the virtual character if the target area is detected in the game scene; a flight determination module for determining whether a flight destination is located within the target zone; the waypoint determining module is also used for determining a target waypoint based on the flight parameters if the flight terminal point is positioned in the target area; the control module is also used for controlling the virtual character to execute the flight action and fly to the position corresponding to the target road point.
In the above embodiment of the present invention, the apparatus further includes: the message sending module is used for sending a first message to the client when the virtual character is controlled to start to execute the flight action, wherein the client is used for controlling the virtual character to start to execute the flight action after receiving the first message, and the virtual character is displayed in the client; and when the first flight state is detected to be abnormal, sending a second message to the client, wherein the client is used for controlling the virtual character to stop executing the flight action and landing to a position corresponding to the target road point when the client detects that the second flight state of the virtual character is abnormal and receives the second message.
In the above embodiment of the present invention, the apparatus further includes: the synchronization module is used for synchronizing the current position and the current orientation of the virtual character to the client before controlling the virtual character to start executing the flight action; the control module is further used for controlling the virtual character to start executing the flight action based on the current position and the current orientation, wherein the client is used for controlling the virtual character to start executing the flight action based on the current position and the current orientation.
In the above embodiment of the present invention, the apparatus further includes: and the message sending module is used for sending first messages according to a preset time interval, wherein when the first flight state is detected to be abnormal, all the first messages cached currently are sent.
According to the embodiment of the invention, the invention also provides a control device of the virtual role, and the device can be applied to the client. The device can execute the control method of the virtual role in the above embodiment, and the specific implementation scheme and the application scenario are the same as those in the above embodiment, which are not described herein again.
As shown in fig. 6, the apparatus includes:
the state detection module 62 is configured to detect whether a second flight state of the virtual character is abnormal or not in a process of controlling the virtual character to execute a flight action, where the virtual character is displayed in the client;
a waypoint determining module 64, configured to determine a target waypoint based on the flight direction of the virtual character when detecting that the second flight state is abnormal, where at least one preset waypoint is located in the preset direction of the virtual character;
and the control module 66 is used for controlling the virtual character to stop executing the flight action and to land to the position corresponding to the target road point.
In the above embodiment of the present invention, the waypoint determination module includes: the track determining unit is used for determining a first flight track of the virtual character before the second flight state is abnormal based on the flight direction; the waypoint acquisition unit is used for acquiring at least one preset waypoint positioned in the preset direction of the first flight track; and the waypoint determining unit is used for determining the target waypoint from at least one preset waypoint.
In the above embodiment of the present invention, the trajectory determination unit is further configured to, when it is detected that the virtual character collides with another collision body in the game scene in the process of detecting that the virtual character arrives at the next arrival time, obtain a first position where the virtual character collides with the collision body, and determine, based on the flight direction, a trajectory of the virtual character that flies to the first position, so as to obtain the first flight trajectory.
In the above embodiment of the present invention, the trajectory determination unit is further configured to, when it is detected that the position where the virtual character arrives at the next moment in the flying process is located outside the boundary of the game scene, determine, based on the flying direction, a second flying trajectory of the virtual character at the position where the virtual character arrives at the next moment in the flying process, obtain a second position, located inside the boundary and closest to the position where the virtual character arrives at the next moment, and determine, based on the flying direction, a trajectory where the virtual character flies to the second position, so as to obtain the first flying trajectory.
In the above embodiment of the present invention, the trajectory determining unit is further configured to, when it is detected that an illegal waypoint exists at a position where the virtual character arrives at a next moment of flying, obtain a current position of the virtual character, and obtain the first flying trajectory.
In the above embodiment of the present invention, the waypoint determining unit is further configured to obtain a target preset waypoint that satisfies a second preset condition from among the at least one preset waypoint, and determine, according to an order from a position reached at a next time to a position where the first target preset waypoint is currently located, that the first target preset waypoint is the target waypoint.
In the above embodiment of the present invention, the state detection module includes: the first obtaining unit is used for obtaining the current position of the virtual character; a first determination unit, configured to determine, based on a flight parameter of the virtual character, a position at which the virtual character arrives at a next time that arrives at the next time; the detecting unit is used for detecting whether the position reached at the next moment meets a first preset condition, wherein the first preset condition is used for determining that the second flight state is abnormal; and the second determining unit is used for determining that the second flight state is abnormal if the position reached at the next moment is detected to meet the first preset condition.
In the above embodiment of the present invention, the detecting unit is further configured to perform the following steps: detecting whether the virtual character collides with other collision bodies in the game scene in the process of flying from the current position to the position reached at the next moment; and/or detecting whether the position reached at the next moment is positioned outside the boundary of the game scene; and/or detecting whether an illegal waypoint exists at the position reached at the next moment; and if the virtual character is detected to collide with other collision bodies, or the position reached at the next moment is located outside the boundary, or an illegal waypoint exists in the position reached at the next moment, determining that the position reached at the next moment meets a first preset condition.
In the above embodiment of the present invention, the detecting unit is further configured to perform the following steps: acquiring a first waypoint corresponding to a current position and a second waypoint corresponding to a position reached at the next moment; determining whether the ordinate of the current position is larger than the ordinate of the first waypoint or not and whether the ordinate of the position reached at the next moment is larger than the ordinate of the second waypoint or not; if the ordinate of the current position is larger than the ordinate of the first waypoint and the ordinate of the position reached at the next moment is larger than the ordinate of the second waypoint, determining that no illegal waypoint exists in the position reached at the next moment; and if the vertical coordinate of the current position is larger than the vertical coordinate of the first waypoint and the vertical coordinate of the position reached at the next moment is smaller than the vertical coordinate of the second waypoint, determining that the position reached at the next moment has illegal waypoints.
In the above embodiment of the present invention, the control module is further configured to control the virtual character to start to execute the flight action when the message sending module receives a first message sent by the server, where the first message is sent by the server when the control virtual character starts to execute the flight action; and when the second flight state of the virtual character is detected to be abnormal and the message sending module receives a second message sent by the server, controlling the virtual character to stop executing the flight action and landing to a position corresponding to the target route, wherein the second message is sent by the server when the first flight state of the virtual character is detected to be abnormal.
In the above embodiment of the present invention, the control module is further configured to stop updating the position of the virtual character when detecting that the second flight status is abnormal and the second message is not received.
In the above embodiment of the present invention, the apparatus further includes: the message sending module is used for receiving a first position and a first orientation of the virtual role synchronized by the server; the parameter acquisition module is used for acquiring a second position and a second orientation of the virtual character; the control module is further configured to control the virtual character to begin performing the flight action based on a positional deviation between the first position and the second position and an orientation deviation between the first orientation and the second orientation.
According to the embodiment of the present invention, a computer-readable storage medium is further provided, where the computer-readable storage medium includes a stored program, and when the program runs, the apparatus where the computer-readable storage medium is located is controlled to execute the control method for the virtual role.
According to an embodiment of the present invention, there is also provided a processor, where the processor is configured to execute a program, where the program executes the control method for the virtual character.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (25)

1. A control method of a virtual character is applied to a server, and the method comprises the following steps:
detecting whether a first flight state of a virtual character is abnormal or not in the process of controlling the virtual character to execute flight action;
when the first flight state is detected to be abnormal, determining a target waypoint based on the flight direction of the virtual character;
and controlling the virtual character to stop executing the flight action and landing to a position corresponding to the target road point.
2. The method of claim 1, wherein determining the target waypoint based on the direction of flight of the virtual character comprises:
determining a first flight trajectory of the virtual character before the first flight state is abnormal based on the flight direction;
acquiring at least one preset waypoint positioned in the preset direction of the first flight track;
and determining the target waypoint from the at least one preset waypoint.
3. The method according to claim 2, wherein in a case where the virtual character collides with other collision bodies in a game scene during the detection of the virtual character flying to a position where the virtual character arrives at the next moment, the first flight trajectory of the virtual character before the abnormality of the first flight state is determined based on the flight direction comprises:
acquiring a first position where the virtual character and the collision body collide;
and determining the track of the virtual character flying to the first position based on the flying direction to obtain the first flying track.
4. The method of claim 2, wherein in a case where it is detected that a position reached by the virtual character flying to a next moment is outside a boundary of a game scene, determining that the first flying state is abnormal before determining that the first flying state is abnormal based on the flying direction comprises:
determining a second flight trajectory of the virtual character to a position reached at the next moment based on the flight direction;
acquiring a second position, which is located in the boundary and is closest to the position reached at the next moment, in the second flight trajectory;
and determining the track of the virtual character flying to the second position based on the flying direction to obtain the first flying track.
5. The method according to claim 2, wherein in a case where it is detected that there is an illegal waypoint at a position where the virtual character arrives at a next time of flight, determining that the first flight trajectory of the virtual character before the abnormality occurs in the first flight state based on the flight direction includes:
and acquiring the current position of the virtual character to obtain the first flight track.
6. The method of any one of claims 2 to 5, wherein determining the target waypoint from the at least one preset waypoint comprises:
acquiring a target preset waypoint meeting a second preset condition from the at least one preset waypoint;
and determining a first target preset waypoint as the target waypoint according to the sequence from the position reached at the next moment to the current position of the virtual character.
7. The method of claim 6, wherein satisfying the second preset condition comprises: in the process that the virtual character lands to the position corresponding to the target preset waypoint, the virtual character does not collide with other collision bodies in the game scene, and a moving space exists around the target preset waypoint, wherein the moving space is a space allowing the virtual character to move.
8. The method of claim 1, wherein detecting whether the first flight status of the virtual character is abnormal comprises:
acquiring the current position of the virtual role;
determining the position of the virtual character arriving at the next moment based on the flight parameters of the virtual character;
detecting whether the position reached at the next moment meets a first preset condition, wherein the first preset condition is used for determining that the first flight state is abnormal;
and if the position reached at the next moment is detected to meet the first preset condition, determining that the first flight state is abnormal.
9. The method according to claim 8, wherein detecting whether the position reached at the next time satisfies a first preset condition comprises:
detecting whether the virtual character collides with other collision bodies in a game scene in the process of flying from the current position to the position reached at the next moment; and/or
Detecting whether the position reached at the next moment is positioned outside the boundary of the game scene; and/or
Detecting whether an illegal waypoint exists at the position reached at the next moment;
and if the virtual character is detected to collide with other collision bodies, or the position reached at the next moment is located outside the boundary, or the illegal waypoint exists in the position reached at the next moment, determining that the position reached at the next moment meets the first preset condition.
10. The method of claim 9, wherein detecting whether an illegal waypoint exists at the location reached at the next time comprises:
acquiring a first waypoint corresponding to the current position and a second waypoint corresponding to the position reached at the next moment;
determining whether the ordinate of the current position is larger than the ordinate of the first waypoint or not and whether the ordinate of the position reached at the next moment is larger than the ordinate of the second waypoint or not;
if the ordinate of the current position is larger than the ordinate of the first waypoint and the ordinate of the position reached at the next moment is larger than the ordinate of the second waypoint, determining that the illegal waypoint does not exist in the position reached at the next moment;
and if the vertical coordinate of the current position is larger than the vertical coordinate of the first waypoint and the vertical coordinate of the position reached at the next moment is smaller than the vertical coordinate of the second waypoint, determining that the illegal waypoint exists in the position reached at the next moment.
11. The method of claim 1, wherein prior to controlling the virtual character to perform the flight action, the method further comprises:
detecting whether a target area exists in a game scene, wherein the size of the target area is larger than a preset size, no waypoint exists in the target area, and the distance between the bottom of the target area and other positions outside the target area is larger than a preset distance;
if the target area is detected to exist in the game scene, determining the flight terminal point of the virtual character based on the flight parameters of the virtual character;
determining whether the flight destination is within the target area;
if the flight destination is located within the target area, determining the target waypoint based on the flight parameters;
and controlling the virtual character to execute the flight action and fly to the position corresponding to the target road point.
12. The method of claim 11, wherein the virtual character is controlled to perform the flight action if it is detected that the target area is not present within the game scene or the flight endpoint is outside the target area.
13. The method of claim 1, further comprising:
when the virtual character is controlled to start to execute the flight action, sending a first message to a client, wherein the client is used for controlling the virtual character to start to execute the flight action after receiving the first message, and the virtual character is displayed in the client;
and when the first flight state is detected to be abnormal, sending a second message to the client, wherein the client is used for controlling the virtual character to stop executing the flight action and landing to a position corresponding to the target road point when the client detects that the second flight state of the virtual character is abnormal and receives the second message.
14. The method of claim 13, wherein prior to controlling the virtual character to begin performing the flight action, synchronizing a current position and a current orientation of the virtual character to the client, and controlling the virtual character to begin performing the flight action based on the current position and the current orientation, wherein the client is configured to control the virtual character to begin performing the flight action based on the current position and the current orientation.
15. The method of claim 13, wherein a time interval of the first timer of the server is less than or equal to a time interval of the second timer of the client.
16. The method of claim 13, wherein the first messages are sent at preset time intervals, and wherein all first messages currently buffered are sent when an anomaly in the first flight status is detected.
17. A method for controlling a virtual character, which is applied to a client, comprises the following steps:
detecting whether a second flight state of the virtual character is abnormal or not in the process of controlling the virtual character to execute the flight action, wherein the virtual character is displayed in the client;
when the second flight state is detected to be abnormal, determining a target waypoint based on the flight direction of the virtual character;
and controlling the virtual character to stop executing the flight action and landing to a position corresponding to the target road point.
18. The method of claim 17, wherein determining the target waypoint based on the direction of flight of the virtual character comprises:
determining a first flight trajectory of the virtual character before the second flight state is abnormal based on the flight direction;
acquiring at least one preset waypoint positioned in the preset direction of the first flight track;
and determining the target waypoint from the at least one preset waypoint.
19. The method of claim 17, further comprising:
when a first message sent by a server is received, controlling the virtual character to start executing the flight action, wherein the first message is sent by the server when the server controls the virtual character to start executing the flight action;
and when the second flight state is detected to be abnormal and a second message sent by the server is received, controlling the virtual character to stop executing the flight action and land to a position corresponding to the target road point, wherein the second message is sent by the server when the first flight state of the virtual character is detected to be abnormal.
20. The method of claim 19, wherein updating the position of the virtual character is stopped if the second flight status is detected as abnormal and the second message is not received.
21. The method of claim 19, further comprising:
receiving a first position and a first orientation of the server-synchronized virtual character;
acquiring a second position and a second orientation of the virtual character;
controlling the virtual character to begin performing the flight action based on a position deviation between the first position and the second position and an orientation deviation between the first orientation and the second orientation.
22. An apparatus for controlling a virtual character, applied to a server, the apparatus comprising:
the state detection module is used for detecting whether the first flight state of the virtual character is abnormal or not in the process of controlling the virtual character to execute the flight action;
the waypoint determining module is used for determining a target waypoint based on the flight direction of the virtual role when the first flight state is detected to be abnormal;
and the control module is used for controlling the virtual character to stop executing the flight action and landing to a position corresponding to the target road point.
23. An apparatus for controlling a virtual character, applied to a client, the apparatus comprising:
the state detection module is used for detecting whether a second flight state of the virtual character is abnormal or not in the process of controlling the virtual character to execute the flight action, wherein the virtual character is displayed in the client;
the waypoint determining module is used for determining a target waypoint based on the flight direction of the virtual role when the second flight state is detected to be abnormal;
and the control module is used for controlling the virtual character to stop executing the flight action and landing to a position corresponding to the target road point.
24. A computer-readable storage medium, comprising a stored program, wherein when the program runs, the computer-readable storage medium controls a device to execute the virtual character control method according to any one of claims 1 to 21.
25. A processor, characterized in that the processor is configured to execute a program, wherein the program executes a control method of a virtual character according to any one of claims 1 to 21.
CN202011287359.3A 2020-11-17 2020-11-17 Control method of virtual role, computer readable storage medium and processor Pending CN112370787A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011287359.3A CN112370787A (en) 2020-11-17 2020-11-17 Control method of virtual role, computer readable storage medium and processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011287359.3A CN112370787A (en) 2020-11-17 2020-11-17 Control method of virtual role, computer readable storage medium and processor

Publications (1)

Publication Number Publication Date
CN112370787A true CN112370787A (en) 2021-02-19

Family

ID=74585868

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011287359.3A Pending CN112370787A (en) 2020-11-17 2020-11-17 Control method of virtual role, computer readable storage medium and processor

Country Status (1)

Country Link
CN (1) CN112370787A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113546423A (en) * 2021-07-22 2021-10-26 网易(杭州)网络有限公司 Action generation method and device, computer equipment and storage medium
CN113769406A (en) * 2021-09-18 2021-12-10 北京冰封互娱科技有限公司 Control method and device of virtual role, storage medium and electronic device
CN114879747A (en) * 2022-07-06 2022-08-09 成都行远捷科技有限公司 Landing site addressing method based on specific limiting condition
CN116688493A (en) * 2023-07-31 2023-09-05 厦门真有趣信息科技有限公司 Interactive control method for football game

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108176050A (en) * 2017-12-07 2018-06-19 北京像素软件科技股份有限公司 Method for searching and device
WO2019196568A1 (en) * 2018-04-10 2019-10-17 网易(杭州)网络有限公司 Control method and apparatus for game character, electronic device and readable medium
CN110507994A (en) * 2019-09-05 2019-11-29 腾讯科技(深圳)有限公司 Control method, apparatus, equipment and the storage medium of virtual aircraft flight
CN110568862A (en) * 2019-09-29 2019-12-13 苏州浪潮智能科技有限公司 Unmanned aerial vehicle flight path planning method and device and related equipment
CN110812844A (en) * 2019-11-06 2020-02-21 网易(杭州)网络有限公司 Path finding method in game, terminal and readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108176050A (en) * 2017-12-07 2018-06-19 北京像素软件科技股份有限公司 Method for searching and device
WO2019196568A1 (en) * 2018-04-10 2019-10-17 网易(杭州)网络有限公司 Control method and apparatus for game character, electronic device and readable medium
CN110507994A (en) * 2019-09-05 2019-11-29 腾讯科技(深圳)有限公司 Control method, apparatus, equipment and the storage medium of virtual aircraft flight
CN110568862A (en) * 2019-09-29 2019-12-13 苏州浪潮智能科技有限公司 Unmanned aerial vehicle flight path planning method and device and related equipment
CN110812844A (en) * 2019-11-06 2020-02-21 网易(杭州)网络有限公司 Path finding method in game, terminal and readable storage medium

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113546423A (en) * 2021-07-22 2021-10-26 网易(杭州)网络有限公司 Action generation method and device, computer equipment and storage medium
CN113546423B (en) * 2021-07-22 2024-04-30 网易(杭州)网络有限公司 Action generation method, device, computer equipment and storage medium
CN113769406A (en) * 2021-09-18 2021-12-10 北京冰封互娱科技有限公司 Control method and device of virtual role, storage medium and electronic device
CN114879747A (en) * 2022-07-06 2022-08-09 成都行远捷科技有限公司 Landing site addressing method based on specific limiting condition
CN114879747B (en) * 2022-07-06 2022-09-06 成都行远捷科技有限公司 Landing site addressing method based on specific limiting condition
CN116688493A (en) * 2023-07-31 2023-09-05 厦门真有趣信息科技有限公司 Interactive control method for football game
CN116688493B (en) * 2023-07-31 2023-10-24 厦门真有趣信息科技有限公司 Interactive control method for football game

Similar Documents

Publication Publication Date Title
CN112370787A (en) Control method of virtual role, computer readable storage medium and processor
CN112327914B (en) Indoor collaborative path planning method and system for high-rise fire-fighting multiple unmanned aerial vehicles
US20220161136A1 (en) Information Processing Method and Apparatus, Mobile Terminal, and Storage Medium
KR102647820B1 (en) Methods and devices for executing actions, storage media and electronic devices
TWI664836B (en) Methord, device and server for controlling route search for simulated objects
WO2019127019A9 (en) Path planning method and device for unmanned aerial vehicle, and flight management method and device
CN108513649B (en) Flight control method, flight control device, machine-readable storage medium, and flight control system
US10967250B2 (en) Information processing method and apparatus, electronic device, and storage medium
US20210362042A1 (en) In-Game Display Control Method and Apparatus, Storage Medium, Processor, and Terminal
Biomo et al. An enhanced Gauss-Markov mobility model for simulations of unmanned aerial ad hoc networks
CN109224438B (en) Method and device for controlling virtual character in game
CN108211349B (en) Information processing method in game, electronic device and storage medium
CN114815863A (en) Control method and device of unmanned aerial vehicle and method and device for prompting obstacle
US20190030432A1 (en) Controlling behavior of entities in funnel sections of a computer-represented environment
CN109901617A (en) A kind of unmanned plane during flying method, apparatus and unmanned plane
US11219833B2 (en) Information synchronization method and apparatus, and storage medium
US11633671B2 (en) Method and apparatus for dynamic management of formations in a video game
CN113101663B (en) Method, device, processing equipment and storage medium for controlling path finding of game
CN110772784B (en) Carrier control method and device, storage medium and electronic device
CN110709792A (en) Auxiliary moving method and device for mobile platform and mobile platform
CN114746822A (en) Path planning method, path planning device, path planning system, and medium
CN113680055A (en) Control method of virtual object, electronic device and readable medium
US20190317529A1 (en) Virtual force system for a drone
US11241621B2 (en) Non-transitory computer-readable medium and video game processing system
US20180280804A1 (en) Program and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination