CN113521742A - Virtual object moving method, device and storage medium - Google Patents

Virtual object moving method, device and storage medium Download PDF

Info

Publication number
CN113521742A
CN113521742A CN202110567367.1A CN202110567367A CN113521742A CN 113521742 A CN113521742 A CN 113521742A CN 202110567367 A CN202110567367 A CN 202110567367A CN 113521742 A CN113521742 A CN 113521742A
Authority
CN
China
Prior art keywords
virtual object
station
target
circle
virtual
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
CN202110567367.1A
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.)
Guangzhou Jianyue Information Technology Co ltd
Original Assignee
Guangzhou Jianyue Information Technology 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 Guangzhou Jianyue Information Technology Co ltd filed Critical Guangzhou Jianyue Information Technology Co ltd
Priority to CN202110567367.1A priority Critical patent/CN113521742A/en
Publication of CN113521742A publication Critical patent/CN113521742A/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/80Special adaptations for executing a specific game genre or game mode
    • A63F13/822Strategy games; Role-playing games
    • 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/65Methods for processing data by generating or executing the game program for computing the condition of a game character
    • 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/80Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game specially adapted for executing a specific type of game
    • A63F2300/807Role playing or strategy games

Abstract

The embodiment of the application provides a method and equipment for moving a virtual object and a storage medium. In the moving method of the virtual object, a station point can be associated with a first virtual object in a virtual scene, and if a second virtual object linked with the first virtual object exists in the virtual scene, a target position of the first virtual object can be determined when the first virtual object moves, and the station point associated with the first virtual object can be determined according to the target position. From the associated site locations, a destination site location for the second virtual object may be determined and movement of the second virtual object to the destination site location controlled. In the embodiment, the station point associated with the first virtual object is determined according to the moving target position of the first virtual object, and the associated station point can be used for quickly determining the target position of the second virtual object linked with the first virtual object, so that the complexity of position calculation of the linked virtual object is greatly reduced, and the efficiency of linkage control of the virtual objects is improved.

Description

Virtual object moving method, device and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, a device, and a storage medium for moving a virtual object.
Background
In a large-scale Game, a non-round Game, and a MMORPG (Massive Multiplayer Online Role Playing Game), an NPC (non-player character) is generally provided to assist in implementing Game strategy.
When the NPC moves in the game, the positions of the NPCs after moving are the same or similar, and therefore the NPC models are overlapped. Therefore, a solution is yet to be proposed.
Disclosure of Invention
Aspects of the present disclosure provide a method, apparatus, and storage medium for moving a virtual object to efficiently determine a position of an interlocked virtual object.
The embodiment of the application provides a method for moving a virtual pair, which comprises the following steps: moving a first virtual object in a virtual scene to a target position in the virtual scene in response to a movement instruction for the first virtual object; determining a station position point associated with the first virtual object according to the target position; determining station points meeting a first set condition from the associated station points as target station points of a second virtual object; the second virtual object has a linkage relationship with the first virtual object; and controlling the second virtual object to move towards the target site.
An embodiment of the present application further provides a server, including: a memory and a processor; the memory is to store one or more computer instructions; the processor is to execute the one or more computer instructions to: the steps in the method provided by the embodiments of the present application are performed.
Embodiments of the present application further provide a computer-readable storage medium storing a computer program, where the computer program can implement the steps in the method provided in the embodiments of the present application when executed by a processor.
In the moving method of the virtual object provided in the embodiment of the application, the station point may be associated with a first virtual object in a virtual scene, and if a second virtual object linked with the first virtual object exists in the virtual scene, the target position of the first virtual object may be determined when the first virtual object moves, and the station point associated with the first virtual object may be determined according to the target position. From the associated site locations, a destination site location for the second virtual object may be determined and movement of the second virtual object to the destination site location controlled. In the embodiment, the station point associated with the first virtual object is determined according to the moving target position of the first virtual object, and the associated station point can be used for quickly determining the target position of the second virtual object linked with the first virtual object, so that the complexity of position calculation of the linked virtual object is greatly reduced, and the efficiency of linkage control of the virtual objects is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a block diagram illustrating a virtual object processing system according to an exemplary embodiment of the present disclosure;
FIG. 2a is a schematic diagram of a station circle provided in an exemplary embodiment of the present application;
FIG. 2b is a schematic diagram of a station circle provided in another exemplary embodiment of the present application;
FIG. 2c is a schematic diagram of a principal of a game and a standing position of a pet in the game according to an exemplary embodiment of the present application;
fig. 3 is a flowchart illustrating a method for moving a virtual object according to an exemplary embodiment of the present application;
fig. 4 is a schematic structural diagram of a server according to an exemplary embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, 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 application.
In geodetic games, non-round games, and MMORPGs, NPCs are typically provided to assist in implementing game strategies. When the NPC moves in the game, the positions of the NPC after moving can be overlapped, and then a plurality of NPC models are overlapped.
At present, a mode for solving the NPC model overlapping has higher computational complexity, and the control efficiency of the NPC is not easy to be improved.
In view of the above technical problem, in some embodiments of the present application, a solution is provided, and the technical solutions provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Fig. 1 is a schematic structural diagram of a virtual object processing system according to an exemplary embodiment of the present application, and as shown in fig. 1, the virtual object processing system 100 includes a terminal device 10 and a server 20.
The terminal device 10 is a device capable of presenting a virtual field to a user, interacting with the user, and having a communication function. The implementation form of the terminal device 10 may be different in different application scenarios. For example, in some scenarios, the terminal device 10 may appear as a user-side cell phone, a tablet computer, a computer device, a VR (Virtual Reality) device, and so on.
In the virtual object processing system 100, the server 20 is a device capable of providing data support, computing functions, and communication functions. In some embodiments, the server 20 may be implemented as a conventional server, a cloud host, a virtual center, or the like, which is not limited in this embodiment. The server device mainly includes a processor, a hard disk, a memory, a system bus, and the like, and is similar to a general computer architecture, and is not described in detail.
In the present embodiment, the terminal device 10 is mainly used for running a specific application (for example, a game application), or a browser (accessible to a web game), through which a user can access a virtual resource provided by the access server 20, the virtual resource provides a virtual scene that can be perceived by the user, the virtual scene generally includes a virtual character, and the user can interact with or control the virtual character in the virtual scene through the terminal device 10. For example, when the virtual resource provided by the server 20 is a virtual game resource, the user can control a game character to run, jump, attack, and the like through a game control provided by the terminal device 10. When the virtual resource provided by the server 20 is a VR resource, the user may interact with a virtual character in a VR scene through the intelligent wearable device provided by the terminal device 10.
In some scenarios, a user may control movement of virtual objects in a virtual scene through terminal device 10. The virtual object may be a game character in a virtual scene or an object in the virtual scene, which is not limited in this embodiment. In the virtual scene, there is another virtual object having an interlocking relationship with the virtual object controlled to move by the user. The linkage relationship comprises linkage relationship related to fighting behaviors, for example, in a game scene, characters participating in fighting need to move to the vicinity of a game main role to form a surround for the game main role, or attack and damage the game main role, and the like; the linkage relationship may also include linkage relationships for non-combat activities, such as, for example, in a game scenario, where the NPC needs to move along with the game character, where the virtual ride of the pet character and the game hero needs to move according to the game hero, and so on.
In the following embodiments, for convenience of description and distinction, a virtual object that actively moves under the control of a user or a setting program in a virtual scene is described as a first virtual object, and a virtual object that passively moves in an interlocking relationship with the first virtual object is described as a second virtual object. In the virtual scene, the number of the second virtual objects may be one or more, and the embodiment is not limited.
When the terminal device 10 is implemented in a different manner, the manner in which the user controls the movement of the first virtual object is also different. For example, when the terminal device 10 is implemented as a device including a display component, the display component may include a touch screen, and the terminal device 10 may display a control having a mobile function through the display component. The user can trigger the control through the touch screen to control the first virtual object to move. For example, when a gaming peripheral (e.g., a gamepad) is connected to the terminal device 10, the user may control the first virtual object to move through physical keys on the gaming peripheral. For another example, when the terminal device 10 is implemented as a smart wearable device, the user may control the first virtual object to move through gestures.
After receiving the moving operation initiated for the first virtual object, the terminal device 10 may send a moving instruction for the first virtual object to the server 20. After receiving the moving instruction, the server 20 may move the first virtual object to a target position in the virtual scene.
Wherein the target position can be determined according to the operation of the user. When the user controls the movement of the first virtual object through the terminal device 10, the movement direction, the movement distance, and the like of the first virtual object may be input through a touch key, a peripheral device, or a motion sensing device provided through the terminal device 10. For example, the user may press a "forward" control displayed on the terminal device 10 for a long time, control the first virtual object to move forward, and turn over the terminal device 10, so that a device such as a gyroscope on the terminal device 10 detects the moving direction of the first virtual object. When the terminal device 10 transmits a movement command for the first virtual object to the server 20, information such as a movement direction and a movement distance may be carried in the movement command. Further, the server 20 may determine a target position of the first virtual object in the virtual scene and move the first virtual object to the target position.
In the present embodiment, the server 20 may set a plurality of site sites in the virtual scene in advance. The station point refers to a position point for a virtual object to stand in a virtual scene. The station point associated with the first virtual object refers to a position point for placing another virtual object linked to the first virtual object.
When the second virtual object is interlocked with the first virtual object, the second virtual object needs to move to a specific position in the virtual scene as the first virtual object moves. Thus, to facilitate placement of other virtual objects that move with the first virtual object, server 20 may determine a station location associated with the first virtual object based on the target location of the first virtual object to facilitate repositioning of the second virtual object.
After determining the station locations associated with the first virtual object, a station location satisfying the first setting condition may be determined from among the associated station locations as a station location of the second virtual object. Wherein, the first setting condition may be: the station location is in an empty state, the station location is on a certain position (front, back, left, right, etc.) of the virtual object, the distance between the station location and the first virtual object is less than a set threshold, the rendering cost corresponding to the station location is small, and the like, which includes but is not limited to this embodiment.
After the target site of the second virtual object is determined, the second virtual object can be controlled to move to the target site. Further, on the terminal device 10 side, a virtual scene in which the second virtual object moves following the first virtual object may be presented.
In the virtual object processing system 100, in order to implement the above-mentioned data interaction process between the terminal device 10 and the server 20, the terminal device 10 and the server 20 may establish a communication connection, and a specific communication connection manner may depend on an actual application scenario.
In some exemplary embodiments, the terminal device 10 and the server 20 may communicate with each other in a wired communication manner or a wireless communication manner. The WIreless communication mode includes short-distance communication modes such as bluetooth, ZigBee, infrared, WiFi (WIreless-Fidelity), long-distance WIreless communication modes such as LORA, and WIreless communication mode based on a mobile network. When the mobile network is connected through communication, the network format of the mobile network may be any one of 2G (gsm), 2.5G (gprs), 3G (WCDMA, TD-SCDMA, CDMA2000, UTMS), 4G (LTE), 4G + (LTE +), 5G, WiMax, and the like.
In this embodiment, the station location may be associated with a first virtual object in a virtual scene, and if a second virtual object linked with the first virtual object exists in the virtual scene, a target position of the first virtual object may be determined when the first virtual object moves, and the station location associated with the first virtual object may be determined according to the target position. From the associated site locations, a destination site location for the second virtual object may be determined and movement of the second virtual object to the destination site location controlled. In the embodiment, the station point associated with the first virtual object is determined according to the moving target position of the first virtual object, and the associated station point can be used for quickly determining the target position of the second virtual object linked with the first virtual object, so that the complexity of position calculation of the linked virtual object is greatly reduced, and the efficiency of linkage control of the virtual objects is improved.
In the above embodiment, after the first virtual object moves, the server 20 may determine the station location associated with the first virtual object according to the target location of the first virtual object moving. Wherein, determining the associated station location according to the target location may include: moving an original site of the first virtual object, so that the position of the original site is updated along with the movement of the first virtual object; or, associating a new station location for the first virtual object according to the target location of the moved virtual object, which is not limited in this embodiment. As will be further exemplified below.
In some alternative embodiments, server 20 may associate a new site for the first virtual object based on the moved target location of the virtual object. In this embodiment, a large number of station positions may be preset in the virtual map corresponding to the virtual scene in advance. Different site locations may be associated with the first virtual object when the first virtual object is located at different positions in the virtual map. For example, when the first virtual object is located at position a on the virtual map, a station point located near (within a set distance range from) position a on the virtual map may be used as the station point associated with the first virtual object. When the first virtual object moves from the position a to the position B on the virtual map, the station point located near the position B (within the set distance range) on the virtual map may be used as a new station point associated with the first virtual object, which is not described again.
In other alternative embodiments, the server 20 may update the position of the station point originally associated with the first virtual object according to the moved target position of the virtual object, so as to obtain an updated station point.
Alternatively, in this embodiment, the server 20 may set an associated site for the first virtual object in advance, and the site may be used for placing other virtual objects linked with the first virtual object in the virtual scene. For example, the first virtual object associates site 1, site 2, site 3, site 4, …, site 10, etc.
Wherein, a relatively fixed offset can be set between the station site associated with the first virtual object and the first virtual object. The offset includes a direction of the station location relative to the first virtual object and a distance in the direction. In some embodiments, the direction and distance may be represented in a vector representation, and further, the offset may be referred to as an offset vector. The offset of the site location with respect to the first virtual object may be stored in correspondence with information of the first virtual object for querying.
The relative position between the station location associated with the first virtual object and the first virtual object is relatively fixed, and when the first virtual object moves, the station location associated with the first virtual object moves accordingly. Based on this, after determining the moved target position of the first virtual object, the server 20 may perform offset processing on the target position according to the offset of the station point associated with the first virtual object, so as to obtain the current position of the station point associated with the first virtual object.
And the offset processing comprises direction offset and position offset. After the offset processing, the position of the station position associated with the first virtual object in the virtual scene changes along with the change of the first virtual object, and the relative position between the first station position and the first virtual object can be ensured to have relative invariance.
In such an embodiment, the offset of the station site associated with the first virtual object relative to the first virtual object is known. After the first virtual object moves to the target position, the target position is subjected to offset processing based on the known offset, and the position of the station point associated with the first virtual object can be quickly updated. Furthermore, when a second virtual object linked with the first virtual object exists in the virtual scene, the target station point of the second virtual object can be quickly determined from the updated station points, and the second virtual object is controlled to move to the target station point. The method for updating the station point only depends on the target position of the first virtual object and the preset offset of the station point, has low calculation complexity, can quickly realize linkage of the virtual object, and is favorable for improving the processing efficiency of a virtual object processing system and the rendering speed of a virtual scene.
The above embodiment describes an alternative embodiment in which the server 20 may set several associated site sites for the first virtual object in advance, and the alternative setting of the site sites will be further exemplified below.
In some alternative embodiments, the server 20 may set a plurality of station positions on the periphery of the first virtual object in a randomly generated manner, and record the relative position relationship, i.e., offset, between the randomly generated station positions and the first virtual object. After the first virtual object moves, the randomly generated station point may be updated according to the target position of the first virtual object and the offset of the station point, so as to maintain a relatively fixed positional relationship between the randomly generated station point and the first virtual object.
In other alternative embodiments, the server 20 may determine at least one station circle on the periphery of the first virtual object, and may set station points on the at least one station circle according to the set station point distribution rule, to obtain the station points associated with the first virtual object.
And the distance between each station circle and the first virtual object is a fixed distance, namely the relative position of each station circle and the first virtual object is relatively fixed and does not change along with the movement of the first virtual object.
The shape of each station circle may be regular (e.g., circular, oval, or square), or irregular (e.g., star), and the embodiment is not limited.
Alternatively, the at least one station circle may not be centered on the first virtual object, as shown in fig. 2a, the arc length of each station circle located at the front side (front side) of the first virtual object is smaller than the distance between the first virtual object, and the arc length of each station circle located at the back side (back side) of the first virtual object is larger than the distance between the first virtual object. The arrangement of the station circle can form a screen effect that a plurality of other virtual objects follow behind the first virtual object.
Optionally, the at least one station circle may be centered on the first virtual object to facilitate forming a picture effect in which a plurality of other virtual objects surround the first virtual object in a scattered manner. To further facilitate the calculation, the at least one station circle may be implemented as: and a plurality of concentric circular station circles taking the position of the first virtual object as the center of a circle.
As shown in fig. 2b, a plane coordinate system X0Y with the first virtual object as the origin may be constructed, and when constructing the station circle, n station circles may be preset with the (0,0) point as the center and R1, R2, R3, … …, and Rn as the radii, respectively, where n is a positive integer.
Next, station points may be respectively set on at least one station circle according to a set station point distribution rule, so as to obtain station points associated with the first virtual object. The station locations may be equally divided equidistantly or randomly distributed, or different numbers of station locations may be arranged in different directions, which includes but is not limited to this embodiment.
Optionally, when a plurality of concentric circular station circles are arranged on the periphery of the first virtual object, the number of station points arranged on any station circle in the plurality of concentric circular station circles has a positive correlation with the radius of the station circle. For example, when a plurality of station circles are arranged from small to large in radius, a station points may be arranged on the 1 st circle with the smallest radius, and the number Cn of station points on the nth station circle is a + (n-1) b when b points are added every 1 circle outwards.
Alternatively, the station sites on each station circle may be equally spaced. When the station points on the n concentric circular station circles are equally spaced, the coordinates (Xni, Yni) of the ith station point on the nth station circle can be calculated by the following formula:
Xni=Rn*cos(2*π/Cn*(0.5*(2*i-1)))
Yni=Rn*sin(2*π/Cn*(0.5*(2*i-1)))
the calculated coordinates of the station point may be saved as an offset of the station point with respect to the first virtual object, and are not described again.
On the basis of the above embodiment, when determining a target station location satisfying the first setting condition from the station locations associated with the first virtual object, the server 20 may first determine a target station location circle from the at least one station location circle, wherein the distance from the target station location circle to the moved first virtual object is smaller than the working distance of the second virtual object.
And the working distance of the second virtual object is related to the identity or the function of the second virtual object in the virtual scene.
In some embodiments, when the second virtual object is implemented as a non-player character (NPC) in the virtual game, if the identity of the second virtual object is to follow the NPC, the working distance of the second virtual object may be implemented as: a following distance to follow the NPC; if the identity of the second virtual object is the pursuit NPC, the second virtual object working distance may be implemented as an attack distance of pursuit NPC. Wherein, the pursuit means that after the NPC selects an attack target, the NPC needs to move to a position which is proper to the target, and releases the attack skill. Follow means that the NPC needs to move with the target within a certain range around the target.
The server 20 may allocate a corresponding AI (Artificial Intelligence) module to each NPC, where the AI module includes game logic for controlling the NPC to perform actions such as moving, fighting, speaking, and the like. After the AI module determines the identity function of the NPC in the game, the operation distance corresponding to the NPC, such as a following distance or an attack distance, can be determined. When the attack skills are different, the attack distance can be corresponding to different attack distances, and the detailed description is omitted.
In other embodiments, the second virtual object is implemented as a player-controllable character in the virtual game, such as a player's virtual pet, virtual prop, or the like. In this embodiment, the player user may preset the working distance of the second virtual object, such as a pet following distance, through the terminal device, which is not described in detail.
The determination of the target station circle will be exemplified below with reference to specific examples.
For example, 10 station circles are associated with a certain main character in the game, and the radii of the 10 station circles are 1 meter, 2 meters, 3 meters, 4 meters, 5 meters, 6 meters, 7 meters, 8 meters, 9 meters and 10 meters, respectively. The attack distance of the attack skill of a certain NPC with the pursuit function is 8.5 meters, and when the NPC releases the attack skill, the distance between the NPC and the principal is less than 8.5 meters to ensure that the principal is within the attack range of the NPC. In this case, for the NPC, the target site circle may be a site circle with a radius of 1 meter, 2 meters, 3 meters, 4 meters, 5 meters, 6 meters, 7 meters, 8 meters, respectively.
In some cases, to improve the moving efficiency, when determining the target station circle from the plurality of station circles, a maximum station circle having a radius smaller than the working distance of the second virtual object may be selected. For example, in accordance with the above example, a station circle with a radius of 8 meters may be selected as the target station circle, so as to reduce the moving distance of the NPC and improve the moving efficiency.
In some embodiments, server 20 may record the status information for each site location as it is recorded. That is, if the site is not used, it is recorded as empty. If the station is used, recording the use state and recording the user.
Based on this, after determining the destination station circle, the server 20 may select a station point in an empty state from station points set on the destination station circle as a destination station point.
Alternatively, when the target station location is selected from the target station location circle, a connecting line between the second virtual object and the moved first virtual object may be drawn. Next, the server 20 may calculate intersections of the connection line and the target station circle, and select, from the target station circle, a station point whose distance from the intersection satisfies a second setting condition as a candidate station point. Wherein, the second setting condition may include: the distance from the intersection point is smaller than a certain threshold, and is the first station point in the clockwise direction of the intersection point or the first station point in the counterclockwise direction of the intersection point, which is not described in detail in this embodiment. After the candidate station point is determined, the station point in the idle state is searched on the target station position circle by taking the candidate station point as a starting point to serve as the target station point.
When searching for a station location in an idle state, it may first determine whether the state of the candidate station location is in an idle state, and if so, take the candidate station location as the target station location. If not, judging whether the state of a first station point positioned on the circle of the target station point in the counterclockwise direction of the candidate station point is in an idle state or not, and if so, taking the first station point in the counterclockwise direction as the target station point; if not, judging whether the state of the first station point positioned on the target station position circle in the clockwise direction of the candidate station point is in an idle state, and if so, taking the first station point in the counterclockwise direction as the target station point; if not, whether the state of a second station point positioned on the circle of the target station point in the counterclockwise direction of the candidate station point is in an idle state or not can be judged, and the process is analogized and is not repeated. The following will be further explained with reference to the accompanying drawings.
As shown in fig. 2b, assuming that the target station circle is a station circle with a radius R3, after drawing a connecting line L between the NPC and the target character, an intersection point of the connecting line L and the target station circle is P. At this time, a station position P0 closest to the intersection point P may be selected from the station positions on the destination station circle. Next, it can first be determined whether station P0 is in an idle state, and if so, station P0 is regarded as the target station; if P0 is not in the idle state, it can be determined whether the state of the first site P1 on the left side of P0 (left side facing the target role) is in the idle state. If P1 is in the empty state, taking station position P1 as the target station position; if P1 is not in the idle state, it can be determined whether the state of the first site P2 on the right side of P0 (the right side facing the target role) is in the idle state. If the status of station P2 is empty, then station P2 is regarded as the target station; if P2 is not in the idle state, it can be determined whether the state of the second station P3 on the left side of P0 (left side facing the target role) is in the idle state until the station in the control state is found, which is not described again.
It should be noted that, when a station position in an empty state is not searched from the target station position circle, the intersection point may be used as the station position to avoid position collision with other virtual objects existing on the station position circle.
It is further noted that the above operations of updating the site associated with the first virtual object and selecting a new site for the second virtual object may be performed by a site calculation module in the server 20. When the second virtual object is associated with the AI module, the AI module may call the station calculation module to obtain a new station, and call the moving module in the server 20 to move the second virtual object to the target station, which is not described again.
Fig. 2c illustrates the distribution of the station positions when the virtual objects are linked, taking a specific game scene as an example. In the illustration of fig. 2c, the lead of the game walks on a small path, the lead comprising a plurality of pet-following birds, i.e. a plurality of pet birds that can move following the lead. Before the movement of the main character, a plurality of pets surround the main character according to the set standing point distribution principle. When the main character moves, the station point related to the main character changes, and the pets can move to the changed station point, so that the game effect that the pets follow the periphery of the main character and cannot be overlapped with each other along with the movement of the main character is formed.
In the virtual object processing system 100 described in the above embodiment, the process of determining the station location associated with the virtual object is implemented by the server side. The implementation mode is more suitable for scenes of web games or terminal games, and the server can issue the site to the game terminal after calculating the site.
Of course, in addition to the embodiments described in the foregoing embodiments, when the present scheme is applied to a terminal game scene, the determination operation of the station site associated with the virtual object may be performed by the terminal device side. That is, after the user downloads and installs a game program (an online game or an offline game) on the terminal device, when the game program runs, the terminal device may respond to a moving instruction for a first virtual object in a virtual scene, move the first virtual object to a target position in the virtual scene, determine a station point associated with the first virtual object according to the target position, and select a station point satisfying a first setting condition from the determined station points as a target station point of a second virtual object; the second virtual object and the first virtual object have a linkage relation; after the target station location is determined, the terminal device can control the second virtual object to move to the target station location. In the embodiment, the terminal equipment can realize the determination operation of the station position, reduce the dependence on the server, facilitate the improvement of the response speed of the game and ensure the smooth running of the game.
It is worth to be noted that the scheme can also be applied to the scene of the cloud game. The cloud game is based on a cloud computing technology, the game runs on a remote server, terminal clients do not need to download and install, terminal configuration does not need to be considered, and various types of games can be experienced through a network. In a cloud game scene, a server at the cloud end can run a game program, when the game program runs, the cloud server can respond to a moving instruction aiming at a first virtual object in a virtual scene, move the first virtual object to a target position in the virtual scene, determine station points associated with the first virtual object according to the target position, and select the station points meeting a first set condition from the determined station points to serve as target station points of a second virtual object; the second virtual object and the first virtual object have a linkage relation; after the target station location is determined, the terminal device may control the second virtual object to move to the target station location, which is not described again.
In addition to the processing system of the virtual object provided in the foregoing embodiments, the present application also provides a method for moving the virtual object, which will be exemplarily described below with reference to the accompanying drawings.
Fig. 3 is a flowchart illustrating a method for moving a virtual object according to an exemplary embodiment of the present application, where the method, when executed on a server side, may include the steps shown in fig. 3:
step 301, in response to a moving instruction for a first virtual object in a virtual scene, moving the first virtual object to a target position in the virtual scene.
Step 302, determining a station point associated with the first virtual object according to the target position.
Step 302, determining station positions meeting a first set condition from the associated station positions as target station positions of a second virtual object; the second virtual object has an interlocking relationship with the first virtual object.
And 302, controlling the second virtual object to move to the target station position.
The execution main body of the embodiment may be a terminal device running a game program, and may also be a game server including a conventional server, a cloud host, and the like.
In some exemplary embodiments, one way to determine a station location associated with the first virtual object based on the target location includes: acquiring offset of a station position point preset for the first virtual object relative to the first virtual object; and carrying out offset processing on the target position according to the offset of the preset station point to obtain the station point associated with the first virtual object.
In some exemplary embodiments, before obtaining an offset of a station location preset for the first virtual object with respect to the first virtual object, the method further includes: presetting at least one station circle at the periphery of the first virtual object; and respectively setting station points on the at least one station circle according to a set station point distribution rule to obtain the station points associated with the first virtual object.
In some exemplary embodiments, the at least one station circle comprises: and the plurality of concentric circular station rings take the position of the first virtual object as the center of a circle.
In some exemplary embodiments, the number of station sites disposed on any one of the plurality of concentric circular station circles is positively correlated with the radius of the station circle.
In some exemplary embodiments, determining, as the target site of the second virtual object, a site that satisfies a first set condition from among the associated sites may include: determining a target station circle from the at least one station circle, wherein the distance from the target station circle to the moved first virtual object is smaller than the working distance of the second virtual object; and selecting the station site in an empty state from the station sites arranged on the target station site circle as the target station site.
In some exemplary embodiments, the second virtual object includes: a non-player character in a virtual game; the working distance of the second virtual object comprises: a following distance of the second virtual object, or an attack distance of the second virtual object.
In some exemplary embodiments, selecting a station site in an empty state from station sites provided on the destination station site circle may include, as one of the destination station sites: drawing a connecting line between the second virtual object and the moved first virtual object; calculating the intersection point of the connecting line and the target station circle; selecting station points with the distance between the station points and the intersection points meeting a second set condition from the target station circle as candidate station points; and searching the station position in the vacant state on the target station position circle by taking the candidate station position as a starting point to serve as the target station position.
In this embodiment, the station point may be associated with a first virtual object in a virtual scene, and if a second virtual object linked with the first virtual object exists in the virtual scene, a target position of the first virtual object may be determined when the first virtual object moves, and the station point associated with the first virtual object may be determined according to the target position. From the associated site locations, a destination site location for the second virtual object may be determined and movement of the second virtual object to the destination site location controlled. In the embodiment, the station point associated with the first virtual object is determined according to the moving target position of the first virtual object, and the associated station point can be used for quickly determining the target position of the second virtual object linked with the first virtual object, so that the complexity of position calculation of the linked virtual object is greatly reduced, and the efficiency of linkage control of the virtual objects is improved.
It should be noted that the execution subjects of the steps of the methods provided in the above embodiments may be the same device, or different devices may be used as the execution subjects of the methods. For example, the execution subjects of steps 301 to 304 may be device a; for another example, the execution subject of steps 301 and 302 may be device a, and the execution subject of step 303 may be device B; and so on.
In addition, in some of the flows described in the above embodiments and the drawings, a plurality of operations are included in a specific order, but it should be clearly understood that the operations may be executed out of the order presented herein or in parallel, and the sequence numbers of the operations, such as 301, 302, etc., are merely used for distinguishing different operations, and the sequence numbers do not represent any execution order per se. Additionally, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel.
It should be noted that, the descriptions of "first", "second", etc. in this document are used for distinguishing different messages, devices, modules, etc., and do not represent a sequential order, nor limit the types of "first" and "second" to be different.
Fig. 4 illustrates a schematic structural diagram of a server provided in an exemplary embodiment of the present application, where the server is suitable for the virtual object processing system provided in the foregoing embodiment. As shown in fig. 4, the server includes: memory 401, processor 402, and communications component 403.
The memory 401 is used for storing computer programs and may be configured to store other various data to support operations on the server. Examples of such data include instructions for any application or method operating on the server, contact data, phonebook data, messages, pictures, videos, and so forth.
The memory may be implemented, among other things, by any type of volatile or non-volatile memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
A processor 402, coupled to the memory 401, for executing the computer program in the memory 401 for: receiving, by the communication component 403, a movement instruction for a first virtual object in a virtual scene; moving a first virtual object in a virtual scene to a target position in the virtual scene in response to a movement instruction for the first virtual object; determining a station position point associated with the first virtual object according to the target position; determining station points meeting a first set condition from the associated station points as target station points of a second virtual object; the second virtual object has a linkage relationship with the first virtual object; and controlling the second virtual object to move towards the target site.
In some exemplary embodiments, the processor 402, when determining the station location associated with the first virtual object according to the target location, is specifically configured to: acquiring offset of a station position point preset for the first virtual object relative to the first virtual object; and carrying out offset processing on the target position according to the offset of the preset station point to obtain the station point associated with the first virtual object.
In some exemplary embodiments, before the processor 402 obtains the offset of the station location preset for the first virtual object relative to the first virtual object, it is further configured to: presetting at least one station circle at the periphery of the first virtual object; and respectively setting station points on the at least one station circle according to a set station point distribution rule to obtain the station points associated with the first virtual object.
In some exemplary embodiments, the at least one station circle comprises: and the plurality of concentric circular station rings take the position of the first virtual object as the center of a circle.
In some exemplary embodiments, the number of station sites disposed on any one of the plurality of concentric circular station circles is positively correlated with the radius of the station circle.
In some exemplary embodiments, the processor 402 determines, from the associated station locations, a station location satisfying a first setting condition as a target station location of the second virtual object, and is specifically configured to: determining a target station circle from the at least one station circle, wherein the distance from the target station circle to the moved first virtual object is smaller than the working distance of the second virtual object; and selecting the station site in an empty state from the station sites arranged on the target station site circle as the target station site.
In some exemplary embodiments, the second virtual object includes: a non-player character in a virtual game; the working distance of the second virtual object comprises: a following distance of the second virtual object, or an attack distance of the second virtual object.
In some exemplary embodiments, the processor 402 selects a station location in an empty state from station locations set on the destination station location circle, as the destination station location, specifically configured to: drawing a connecting line between the second virtual object and the moved first virtual object; calculating the intersection point of the connecting line and the target station circle; selecting station points with the distance between the station points and the intersection points meeting a second set condition from the target station circle as candidate station points; and searching the station position in the vacant state on the target station position circle by taking the candidate station position as a starting point to serve as the target station position.
Further, as shown in fig. 4, the server further includes: power components 404, and the like. Only some of the components are schematically shown in fig. 4, and it is not meant that the server includes only the components shown in fig. 4.
Wherein the communication component 403 is configured to facilitate communication between the device in which the communication component is located and other devices in a wired or wireless manner. The device in which the communication component is located may access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, or 5G, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component may be implemented based on Near Field Communication (NFC) technology, Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
The power supply component 404 is used to provide power to various components of the device in which the power supply component is located. The power components may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device in which the power component is located.
In this embodiment, the station point may be associated with a first virtual object in a virtual scene, and if a second virtual object linked with the first virtual object exists in the virtual scene, a target position of the first virtual object may be determined when the first virtual object moves, and the station point associated with the first virtual object may be determined according to the target position. From the associated site locations, a destination site location for the second virtual object may be determined and movement of the second virtual object to the destination site location controlled. In the embodiment, the station point associated with the first virtual object is determined according to the moving target position of the first virtual object, and the associated station point can be used for quickly determining the target position of the second virtual object linked with the first virtual object, so that the complexity of position calculation of the linked virtual object is greatly reduced, and the efficiency of linkage control of the virtual objects is improved.
Accordingly, the present application further provides a computer-readable storage medium storing a computer program, where the computer program can implement the steps that can be executed by the server in the foregoing method embodiments when executed.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A method for moving a virtual object, comprising:
moving a first virtual object in a virtual scene to a target position in the virtual scene in response to a movement instruction for the first virtual object;
determining a station position point associated with the first virtual object according to the target position;
determining station points meeting a first set condition from the associated station points as target station points of a second virtual object; the second virtual object has a linkage relationship with the first virtual object;
and controlling the second virtual object to move towards the target site.
2. The method of claim 1, wherein determining a station location associated with the first virtual object based on the target location comprises:
acquiring offset of a station position point preset for the first virtual object relative to the first virtual object;
and carrying out offset processing on the target position according to the offset of the preset station point to obtain the station point associated with the first virtual object.
3. The method according to claim 2, wherein before obtaining an offset of a station location preset for the first virtual object with respect to the first virtual object, further comprising:
presetting at least one station circle at the periphery of the first virtual object;
and respectively setting station points on the at least one station circle according to a set station point distribution rule to obtain the station points associated with the first virtual object.
4. The method of claim 3, wherein the at least one station circle comprises: and the plurality of concentric circular station rings take the position of the first virtual object as the center of a circle.
5. The method of claim 4, wherein the number of station sites disposed on any one of the plurality of concentric circular station circles is positively correlated with the radius of the station circle.
6. The method according to claim 3, wherein determining, as a target site of the second virtual object, a site satisfying a first set condition from among the associated sites comprises:
determining a target station circle from the at least one station circle, wherein the distance from the target station circle to the moved first virtual object is smaller than the working distance of the second virtual object;
and selecting the station site in an empty state from the station sites arranged on the target station site circle as the target station site.
7. The method of claim 6, wherein the second virtual object comprises: a non-player character in a virtual game; the working distance of the second virtual object comprises: a following distance of the second virtual object, or an attack distance of the second virtual object.
8. The method of claim 6, wherein selecting a station site in an empty state from among station sites provided on the destination station site circle as the destination station site comprises:
drawing a connecting line between the second virtual object and the moved first virtual object;
calculating the intersection point of the connecting line and the target station circle;
selecting station points with the distance between the station points and the intersection points meeting a second set condition from the target station circle as candidate station points;
and searching the station position in the vacant state on the target station position circle by taking the candidate station position as a starting point to serve as the target station position.
9. A server, comprising: a memory and a processor;
the memory is to store one or more computer instructions;
the processor is to execute the one or more computer instructions to: performing the steps of the method of any one of claims 1-8.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, is adapted to carry out the steps of the method of any one of claims 1 to 8.
CN202110567367.1A 2021-05-24 2021-05-24 Virtual object moving method, device and storage medium Pending CN113521742A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110567367.1A CN113521742A (en) 2021-05-24 2021-05-24 Virtual object moving method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110567367.1A CN113521742A (en) 2021-05-24 2021-05-24 Virtual object moving method, device and storage medium

Publications (1)

Publication Number Publication Date
CN113521742A true CN113521742A (en) 2021-10-22

Family

ID=78094717

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110567367.1A Pending CN113521742A (en) 2021-05-24 2021-05-24 Virtual object moving method, device and storage medium

Country Status (1)

Country Link
CN (1) CN113521742A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115814404A (en) * 2022-09-14 2023-03-21 广州三七极耀网络科技有限公司 Method, device, equipment and medium for controlling movement of virtual object
WO2023169199A1 (en) * 2022-03-07 2023-09-14 北京字跳网络技术有限公司 Method and apparatus for controlling virtual object, and computer device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107042018A (en) * 2016-02-05 2017-08-15 腾讯科技(深圳)有限公司 The locus of control object determines method and apparatus
CN111318017A (en) * 2020-02-29 2020-06-23 深圳市腾讯信息技术有限公司 Virtual object control method, device, computer readable storage medium and equipment
CN111481932A (en) * 2020-04-15 2020-08-04 腾讯科技(深圳)有限公司 Virtual object control method, device, equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107042018A (en) * 2016-02-05 2017-08-15 腾讯科技(深圳)有限公司 The locus of control object determines method and apparatus
CN111318017A (en) * 2020-02-29 2020-06-23 深圳市腾讯信息技术有限公司 Virtual object control method, device, computer readable storage medium and equipment
CN111481932A (en) * 2020-04-15 2020-08-04 腾讯科技(深圳)有限公司 Virtual object control method, device, equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023169199A1 (en) * 2022-03-07 2023-09-14 北京字跳网络技术有限公司 Method and apparatus for controlling virtual object, and computer device and storage medium
CN115814404A (en) * 2022-09-14 2023-03-21 广州三七极耀网络科技有限公司 Method, device, equipment and medium for controlling movement of virtual object
CN115814404B (en) * 2022-09-14 2023-08-11 广州三七极耀网络科技有限公司 Method, device, equipment and medium for controlling movement of virtual object

Similar Documents

Publication Publication Date Title
US10857462B2 (en) Virtual character controlling method and apparatus, electronic device, and storage medium
AU2021250929B2 (en) Virtual object control method and apparatus, device, and storage medium
CN109925720B (en) Information processing method and device
CN111905370B (en) Method and device for controlling virtual character in game, electronic equipment and storage medium
WO2022247592A1 (en) Virtual prop switching method and apparatus, terminal, and storage medium
CN108211349B (en) Information processing method in game, electronic device and storage medium
US10946282B2 (en) Control object spatial location determining method and apparatus
CN113521742A (en) Virtual object moving method, device and storage medium
US11931653B2 (en) Virtual object control method and apparatus, terminal, and storage medium
CN112044074A (en) Method, device, storage medium and computer equipment for seeking path to non-player character
CN112090078B (en) Game character movement control method, device, equipment and medium
CN114344903A (en) Method, terminal and storage medium for controlling virtual object to pick up virtual item
CN111589135A (en) Virtual object control method, device, terminal and storage medium
CN112190930B (en) Game role control method and device
CN110743161B (en) Virtual object control method, device, terminal and storage medium
WO2024027165A1 (en) Information interaction method and apparatus, and electronic device and storage medium
US20230086441A1 (en) Method and apparatus for displaying picture in virtual scene, device, storage medium, and program product
CN114885199B (en) Real-time interaction method, device, electronic equipment, storage medium and system
CN114307150B (en) Method, device, equipment, medium and program product for interaction between virtual objects
CN113941152A (en) Virtual object control method and device, electronic equipment and storage medium
CN113134236A (en) Game role control method and device, storage medium and electronic equipment
US20200086206A1 (en) Information processing device, information processing method and computer program
WO2024037156A1 (en) Virtual consumable requesting and discarding method and apparatus, terminal, and storage medium
CN113082713B (en) Game control method and device and electronic equipment
WO2023226569A9 (en) Message processing method and apparatus in virtual scenario, and electronic device, computer-readable storage medium and computer program product

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20211022