CN111054074B - Method and device for moving virtual object in game and electronic equipment - Google Patents

Method and device for moving virtual object in game and electronic equipment Download PDF

Info

Publication number
CN111054074B
CN111054074B CN201911390109.XA CN201911390109A CN111054074B CN 111054074 B CN111054074 B CN 111054074B CN 201911390109 A CN201911390109 A CN 201911390109A CN 111054074 B CN111054074 B CN 111054074B
Authority
CN
China
Prior art keywords
target
track
virtual object
scene model
model
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.)
Active
Application number
CN201911390109.XA
Other languages
Chinese (zh)
Other versions
CN111054074A (en
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 CN201911390109.XA priority Critical patent/CN111054074B/en
Publication of CN111054074A publication Critical patent/CN111054074A/en
Application granted granted Critical
Publication of CN111054074B publication Critical patent/CN111054074B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

Landscapes

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

Abstract

The invention provides a method, a device and electronic equipment for moving a virtual object in a game, which relate to the technical field of information interaction, and the method comprises the following steps: controlling a target virtual object to move in a game scene in response to a movement control operation that acts on the target virtual object in the game scene; responding to the collision of the target virtual object with the target scene model in the moving process, and loading a track file corresponding to a collision body of the target scene model; and controlling the target virtual object to move along the track matched with the collision body according to the track file. According to the method, the device and the electronic equipment for moving the virtual object in the game, provided by the invention, when the target virtual object is controlled to move along the track, the target virtual object can move along the established track, so that the moving position of the target virtual object is more accurate, meanwhile, no further participation of a programmer is required in a subsequent scene, certain labor cost is reduced, and the use flexibility is improved.

Description

Method and device for moving virtual object in game and electronic equipment
Technical Field
The invention relates to the technical field of information interaction, in particular to a method and a device for moving a virtual object in a game and electronic equipment.
Background
In many game environment designs, it is desirable that the game model moves along a predetermined route or adheres to another model, while allowing for manipulation and control by the player himself. Generally, such a design has great variability and high flexibility, and in the prior art, a plurality of movable positions are calculated in real time according to collision volume information or path finding data of a scene, so as to control the movement of a game model, or the game model is moved according to a predetermined track by using an animation technology.
However, these methods are mostly suitable for designing a scene with a relatively simple design, and a calculation error is easily generated for a complex scene, and may even run against the original design, so that it is difficult to perform an accurate change according to real-time input data of a user, and flexibility is reduced.
Disclosure of Invention
In view of the above, the present invention provides a method, an apparatus, and an electronic device for moving a virtual object in a game, so as to alleviate the technical problem of a calculation error occurring in the control of a game model in a complex scene.
In a first aspect, an embodiment of the present invention provides a method for moving a virtual object in a game, where the method includes: controlling a target virtual object to move in the game scene in response to a movement control operation that acts on the target virtual object in the game scene; responding to the collision of the target virtual object with the target scene model in the moving process, and loading a track file corresponding to a collision body of the target scene model, wherein the track file at least comprises a track matched with the collision body of the target scene model; and controlling the target virtual object to move along the track matched with the collision body according to the track file.
In a preferred embodiment, the method further comprises: responding to the collision of the target virtual object with the current scene model in the moving process, and acquiring the identifier of the current scene model; and if the identifier of the current scene model comprises a preset target field, determining that the current scene model is a target scene model, and determining that the target virtual object collides with the target scene model.
In a preferred embodiment, the step of loading a trajectory file corresponding to a collision volume of the target scene model includes: searching a track file corresponding to a collision body of the target scene model in a track file library according to a pre-established mapping relation between the model identification and the track file; and loading the searched track file into the target scene model.
In a preferred embodiment, the identifying of the target scene model includes: a target field, a function type, and a trajectory type; the target field is used for identifying the model type of the target scene model, the function type is used for identifying the game function corresponding to the target scene model, and the track type is used for identifying retrieval information of a track file corresponding to the target scene model.
In a preferred embodiment, the step of controlling the target virtual object to move along the trajectory matching the collision volume according to the trajectory file includes: acquiring a target position corresponding to the current movement control operation; the target location is mapped onto a trajectory contained in the trajectory file to control movement of the target virtual object along a trajectory matching the collision volume.
In a preferred embodiment, the step of mapping the target position onto the track included in the track file includes: inputting the target position into a pre-established calculation processor, and calculating the position of the target position on the track through the calculation processor so as to map the target position on the track contained in the track file.
In a preferred embodiment, the step of mapping the target position onto the track included in the track file includes: calculating the projection of the target position on the track; mapping the target position to a track contained in a track file according to the projection; wherein the projection is the point on the trajectory closest to the target position.
In a preferred embodiment, the step of mapping the target position onto the track included in the track file according to the projection position includes: and obtaining a displacement matrix corresponding to the target scene model, calculating track points of the target position on the track according to the displacement matrix and the projection, and mapping the target position to the track points.
In a preferred embodiment, the target scene model is at least one of the following models: tree model, bridge model, cableway model or steel wire model.
In a preferred embodiment, the movement control operation acting on the target virtual object in the game scene is an operation of controlling the movement of the target virtual object through a rocker; or, the movement control operation is an operation of controlling the movement of the target virtual object through the touch control.
In a second aspect, an embodiment of the present invention further provides an apparatus for moving a virtual object in a game, where the apparatus includes: the control module is used for responding to the movement control operation of a target virtual object in a game scene and controlling the target virtual object to move in the game scene; the loading module is used for responding to the collision of the target virtual object with the target scene model in the moving process, and loading a track file corresponding to a collision body of the target scene model, wherein the track file at least comprises a track matched with the collision body of the target scene model; and the moving module is used for controlling the target virtual object to move along the track matched with the collision body according to the track file.
In a third aspect, an embodiment of the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method according to the first aspect when executing the computer program.
In a fourth aspect, the embodiments of the present invention further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program performs the steps of the method in the first aspect.
The embodiment of the invention has the following beneficial effects:
the method, the device and the electronic equipment for moving the virtual object in the game provided by the embodiment of the invention can respond to the movement control operation of the target virtual object acting in the game scene, control the target virtual object to move in the game scene, and can load the track file corresponding to the collision body of the target scene model when the target virtual object collides with the target scene model in the moving process, and control the target virtual object to move along the track matched with the collision body according to the track file.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a method for moving a virtual object in a game according to an embodiment of the present invention;
fig. 2 is a schematic model diagram of a target scene model according to an embodiment of the present invention;
fig. 3 is a schematic track diagram of a target scene model according to an embodiment of the present invention;
FIG. 4 is a flow chart of another method for moving a virtual object in a game according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a track provided by an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of a mobile device for moving a virtual object in a game according to an embodiment of the present invention;
FIG. 7 is a schematic structural diagram of a mobile device for moving virtual objects in a game according to another embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
In the prior art, when a virtual object is controlled to move in a game scene, a model is generally controlled by calculating a movable position in real time according to collision volume information or path finding data of the scene. If the game scene design is simpler, the design is biased to be mainly one-sided, and in the game environment with less crossed models, the method can obtain better effect, but for a slightly complex game scene, under the condition of more dynamic objects, the requirement is difficult to meet, the calculation is easy to generate errors, and even the method can be against the original design purpose.
In addition, although the conventional method of moving a virtual object along a predetermined trajectory by using animation technology is also used, it is not flexible because animation is edited by an art designer in advance, and thus it is difficult to accurately change the virtual object according to real-time input data of a user in a game, although it is possible to solve problems such as calculation errors in the conventional method.
Based on this, the method, the device and the electronic device for moving the virtual object in the game provided by the embodiment of the invention can effectively alleviate the technical problem.
To facilitate understanding of the present embodiment, a detailed description will be given first of all of a method for moving a virtual object in a game disclosed in the present embodiment.
In a possible implementation manner, an embodiment of the present invention provides a method for moving a virtual object in a game, in which a graphical user interface is obtained by executing a software application and rendering on a display of a terminal, content displayed by the graphical user interface includes a part of a game scene, a target virtual object in the game scene and a target scene model, the target scene model is configured with a collision volume that fits an outer shape of the target scene model and a trajectory that matches the collision volume, and the trajectory is stored in a trajectory file.
Specifically, as shown in fig. 1, a flow chart of a method for moving a virtual object in a game includes the following steps:
step S102, responding to the movement control operation of the target virtual object in the game scene, and controlling the target virtual object to move in the game scene;
specifically, the movement control operation is generally an operation of performing movement control on the target virtual object, which is input by a user, and the movement control operation acting on the target virtual object is generally an operation of controlling the movement of the target virtual object by a joystick; or, the movement control operation is an operation of controlling the movement of the target virtual object through the touch control.
Specifically, if the game is controlled by a rocker, the user can control the target virtual object to move in the game scene through the rocker; or, if the game is a game supporting touch screen control, the user may control movement of the target virtual object in the game scene through the touch control, which may be specifically set according to an actual use situation, which is not limited in the embodiment of the present invention.
Step S104, responding to the collision of the target virtual object with the target scene model in the moving process, and loading a track file corresponding to a collision body of the target scene model, wherein the track file at least comprises a track matched with the collision body of the target scene model;
step S106, controlling the target virtual object to move along the track matched with the collision body according to the track file.
Specifically, when a user controls a target virtual object to move in a complex game scene, for a game developer, the most basic problem to be solved is that when the target virtual object collides with a target scene model in the moving process, the model is seriously interspersed, and through the process of loading a track file corresponding to a collision body of the target scene model in the collision in step S104, the target virtual object can be moved along a track matched with the collision body based on the track file, so that the phenomenon that the model is seriously interspersed can be effectively avoided. On this basis, when some target virtual objects operated by the user need to move on some special problems, such as climbing trees, sliding cables, walking wires, and the like, for these more complicated moving requirements, the process of the above steps S102 to S106 provided by the embodiment of the present invention can be utilized to implement.
Therefore, the method for moving a virtual object in a game according to the embodiments of the present invention can control a target virtual object to move in a game scene in response to a movement control operation performed on the target virtual object in the game scene, and when the target virtual object collides with a target scene model during movement, can load a trajectory file corresponding to a collision body of the target scene model, and control the target virtual object to move along a trajectory matching the collision body according to the trajectory file.
In practical use, the target scene model is at least one of the following models: tree model, bridge model, cableway model or steel wire model.
In a specific implementation, the target scene model is usually pre-created according to actual game requirements, and in order to enable the target scene model to perform interaction of physical attributes according to the game requirements, the collision body conforming to the outer shape of the target scene model and the track matching with the collision body are pre-created, where the track is usually a track conforming to the outer shape of the target scene model, so that the virtual object can move along the outer shape of the target scene model through the track under the control of the user during the game, for example, the track corresponding to the tree model can make the target virtual object move along the track, and the rendered picture is that the virtual object moves along the surface of the tree model.
For convenience of understanding, fig. 2 shows a model diagram of an object scene model, where fig. 2 illustrates a tree model, and the object scene models are generally prepared in advance by an art engineer and generate corresponding tracks for the object scene model, and specifically, the track diagram of the object scene model shown in fig. 3 illustrates the tracks corresponding to the tree model, and the track is named Dummy001 and is stored in a corresponding track file.
In actual use, for a complex game scene, a plurality of scene models are generally included, but each scene model does not have a track matched with a collision body, so in order to distinguish whether the scene model where a target virtual object collides in the moving process is a target scene model configured with a track, usually, in the model making process, a special identifier is used for distinguishing so as to determine whether the target virtual object collides with the target scene model in the moving process, and then a corresponding track file is loaded.
Specifically, when the target virtual object moves in the game scene, the target virtual object may be responded to collide with the current scene model in the moving process, and the identifier of the current scene model is obtained; and if the identifier of the current scene model contains a preset target field, determining that the current scene model is the target scene model, and determining that the target virtual object collides with the target scene model.
The preset target field target contained in the identifier of the scene model can be used for establishing a mapping relation with the corresponding track file, so that the track file can be found according to the target field and loaded after the current scene model is determined to be the target scene model and the target virtual object collides with the target scene model. Therefore, the identification of the current scene model is mostly embodied by the name of the scene model, such as the name of the tree model in fig. 2, and based on this, on the basis of fig. 1, fig. 4 shows a flowchart of another method for moving a virtual object in a game, as shown in fig. 4, which includes the following steps:
step S202, responding to the movement control operation of the target virtual object in the game scene, and controlling the target virtual object to move in the game scene;
step S204, in response to the target virtual object colliding with the target scene model in the moving process, searching a track file corresponding to a collision body of the target scene model in a track file library according to a pre-established mapping relation between a model identification and the track file;
specifically, the identification of the target scene model typically includes: a target field, a function type, and a trajectory type; the target field is used for identifying the model type of the target scene model, the function type is used for identifying the game function corresponding to the target scene model, and the track type is used for identifying retrieval information of the track file corresponding to the target scene model.
The model name of the target scene model is taken as an example for explanation, and for the model name containing the preset target field, the naming generally follows the following rules:
target field _ function type _ track type.
Taking the tree model shown in fig. 2 as an example for explanation, the waveform _ tree _ kushu shown in fig. 2 is a name of the tree model, and generally takes the target field as a fixed beginning, that is, the waveform as the target field, and this naming manner is generally agreed with the art engineer so that, when configuring the trace in the later period, the trace corresponding to the naming of the target field, such as the waveform, beginning is configured.
In the name shown in fig. 2, the tree field corresponds to the function type, which is related to the game logic requirement. The kushu field corresponds to a track type, and the file name of a general track file is as follows:
rope _ [ track type ]. Trk;
then, for the target scene model with the model file name of rope _ tree _ kushu, the track file corresponding to the target scene model is rope _ kushu.trk, and in fig. 3, the track named Dummy001 is stored in the track file. In specific use, the target scene model can be directly mapped to the corresponding track file according to the model name of the target scene model, so that the track file is loaded and used.
In the track file library, track files of a plurality of target scene models are stored according to the mapping relationship between the model identifier (model name) and the track file, so that after it is determined that the target virtual object collides with the target scene model in the moving process, the track file corresponding to the collision body of the target scene model can be found through the step S204.
Step S206, loading the searched track file into a target scene model;
similarly, taking the tree models shown in fig. 2 and 3 as examples, in the above tree models, a tree climbing function is generally designed for the target virtual object in the game, and only when the target virtual object jumps up and floats in the air, the user controlling the movement of the target virtual object is considered to have the intention of climbing the tree. At this time, as long as the target virtual object is still in the air, it will be detected in real time whether the target virtual object collides with a specially named tree model. If the obstacle is found, such as the tree model described above, the obstacle is captured immediately, and then the track file is searched, and the searched track file is loaded onto the tree model, and then the following processes of steps S208 to S210 are continuously performed to control the target virtual object to move along the track in the track file.
Step S208, acquiring a target position corresponding to the current movement control operation;
the target position is generally a desired position for controlling the target virtual object to move, that is, a desired movement position of a next frame of the target virtual character, and is generally a target position corresponding to a movement control operation input by a user through a joystick or a touch control.
Step S210, mapping the target position onto the trajectory contained in the trajectory file to control the target virtual object to move along the trajectory matching the collision volume.
In actual use, the process of mapping the target position onto the trajectory contained in the trajectory file may be executed by a pre-created computation processor, so that after being loaded into the trajectory file, the next process is hosted by the computation processor.
Specifically, the target position may be input to a pre-established calculation processor, by which the position of the target position on the trajectory is calculated to map the target position onto the trajectory contained in the trajectory file.
Further, the step of mapping the target position onto the track contained in the track file comprises the following processes:
(1) Calculating the projection of the target position on the track, wherein the projection is the point on the track closest to the target position;
(2) Mapping the target position to a track contained in a track file according to the projection;
specifically, after the projection is calculated, a displacement matrix corresponding to the target scene model needs to be further acquired, track points of the target position on the track are calculated according to the displacement matrix and the projection, and then the target position is mapped to the track points.
For the sake of understanding, fig. 5 shows a schematic diagram of a track, wherein, assuming that O is the current position of the target virtual object, the target position given by the direction of movement controlled by the joystick is P, and then the target position is projected to a point P1 on the track through P, where P1 is the final track movement position, i.e., the track point. In fact, P1 is the point where P is the shortest distance to the track. The algorithm for calculating point P1 is described below:
in general, a trajectory is described by a series of coordinate points, and therefore, the trajectory can be represented as an array TK consisting of a plurality of three-dimensional vectors representing positions:
TK=[p0,p1,p2…,pn];
wherein p 0-pn are n three-dimensional vectors in the array TK;
at this time, the problem of finding the shortest distance point P1 from the point P outside the track to the TK can be converted into finding the vector V from P to two adjacent points k Thus, the trajectory TK can also be represented as:
TK={0<k≤N|V k =p k -p k-1 },k<n。
the process of calculating the P1 from the point P outside the trajectory to the point P with the shortest distance on the trajectory TK is actually a continuous iterative process in terms of program processing, and specifically, can be implemented according to the following iterative algorithm:
(1) Traversing a segment vector on the TK, wherein the current vector is V k
(2) Calculating a projection Qk from P to Vk, wherein if Qk is on Vk, the shortest DISTANCE from P to Vk is Dk = DISTANCE (P-Qk), and P1' = Qk;
(3) If Qk is not on Vk, calculating the distances from P to both ends pk and P (k-1) of Vk, and taking the minimum distance as: dmin = MIN (DISTANCE (P-pk), DISTANCE (P-pk-1)), noting that the corresponding position is: p1';
(4) Comparing the magnitudes of Dk and Dmin, if Dk < Dmin, then P1= P1';
(5) And (2), performing (3) and (4) in a circulating manner, wherein the finally obtained point P1 is the projection of the target position on the track.
Further, regarding the target position as P and the track point P1, in practical applications, coordinate transformation is also required according to a displacement matrix, where the displacement matrix is also generally called a world coordinate matrix of the target scene model and is expressed by M, that is, M is a world transformation matrix of the target scene model. Two quantities can be obtained from M: a translation vector VT and a rotation matrix R. For the target position P, there are:
P=(P-VT)*R;
so that the local coordinates of P with respect to the trajectory can be obtained. For the trace point P1, there are:
P1=P1*R -1 + VT; this translates P1 into world coordinates in the game.
By the above-mentioned manner of mapping the target position onto the trajectory included in the trajectory file, when the control target virtual object moves along the tree model, the final moving effect is not affected even if the trunk bends.
Therefore, the target virtual object collides with the target scene model in the moving process, the track file is searched and loaded according to the mapping relation between the model identification and the track file, and the target position is mapped to the track contained in the track file so as to control the process that the target virtual object moves along the track matched with the collision body, so that the moving position can be more accurate, the target virtual object is not interfered by a complex physical environment, and the target virtual object is more freely designed. Meanwhile, after a manufactured target scene model is designed and standardized, because the track files are configured, the subsequent scene layout content does not need the participation of programmers, and the planning and scene designer can complete the rest work according to own ideas, thereby liberating the productivity of the programmers.
On the basis of the foregoing embodiment, an embodiment of the present invention further provides a device for moving a virtual object in a game, where a graphical user interface is obtained by executing a software application and rendering the software application on a display of a terminal, where the content displayed on the graphical user interface includes a part of a game scene, a target virtual object in the game scene and a target scene model, the target scene model is configured with a collision volume conforming to an outer shape of the target scene model and a trajectory matching the collision volume, and the trajectory is stored in a trajectory file, such as a schematic structural diagram of a device for moving a virtual object in a game shown in fig. 6, where the device includes:
a control module 60 for controlling the movement of the target virtual object in the game scene in response to a movement control operation acting on the target virtual object in the game scene;
a loading module 62, configured to load a track file corresponding to a collision volume of the target scene model in response to the target virtual object colliding with the target scene model during the moving process, where the track file at least includes a track matching the collision volume of the target scene model;
and a moving module 64 for controlling the target virtual object to move along the trajectory matched with the collision volume according to the trajectory file.
Further, on the basis of fig. 6, fig. 7 is a schematic structural diagram of another mobile device for a virtual object in a game, and in addition to the structure shown in fig. 6, the device further includes:
an obtaining module 66, configured to obtain an identifier of the current scene model in response to a collision of the target virtual object with the current scene model during the moving process;
the determining module 68 is configured to determine that the current scene model is a target scene model if the identifier of the current scene model includes a preset target field, and determine that the target virtual object collides with the target scene model.
Further, the loading module is configured to: searching a track file corresponding to a collision body of the target scene model in a track file library according to a pre-established mapping relation between the model identification and the track file; and loading the searched track file into the target scene model.
The identification of the target scene model includes: a target field, a function type, and a trajectory type; the target field is used for identifying the model type of the target scene model, the function type is used for identifying the game function corresponding to the target scene model, and the track type is used for identifying the retrieval information of the track file corresponding to the target scene model.
Further, the mobile module is configured to: acquiring a target position corresponding to the current movement control operation; the target location is mapped onto a trajectory contained in the trajectory file to control movement of the target virtual object along a trajectory matching the collision volume.
Further, the moving module is further configured to: inputting the target position into a pre-established calculation processor, and calculating the position of the target position on the track through the calculation processor so as to map the target position on the track contained in the track file.
Further, the moving module is further configured to: calculating the projection of the target position on the track; mapping the target position to a track contained in a track file according to the projection; wherein the projection is the point on the trajectory closest to the target position.
Further, the moving module is further configured to: and obtaining a displacement matrix corresponding to the target scene model, calculating track points of the target position on the track according to the displacement matrix and the projection, and mapping the target position to the track points.
The target scene model is at least one of the following models: tree models, bridge models, cableway models or wire models.
The movement control operation acting on the target virtual object in the game scene is an operation for controlling the movement of the target virtual object through a rocker; or, the movement control operation is an operation of controlling the movement of the target virtual object through the touch control.
The implementation principle and the generated technical effects of the mobile device of the virtual object in the game provided by the embodiment of the invention are the same as those of the mobile device of the virtual object in the game in the embodiment of the method for moving the virtual object in the game, and for the sake of brief description, corresponding contents in the embodiment of the device can be referred to where not mentioned in the embodiment of the device, and are not repeated herein.
The embodiment of the invention also provides electronic equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the steps of the moving method of the virtual object in the game when executing the computer program.
An embodiment of the present invention further provides a schematic structural diagram of an electronic device, as shown in fig. 8, which is the schematic structural diagram of the electronic device, where the electronic device includes a processor 81 and a memory 80, the memory 80 stores computer-executable instructions that can be executed by the processor 81, and the processor 81 executes the computer-executable instructions to implement the method for moving the virtual object in the game.
In the embodiment shown in fig. 8, the electronic device further comprises a bus 82 and a communication interface 83, wherein the processor 81, the communication interface 83 and the memory 80 are connected by the bus 82.
The Memory 80 may include a high-speed Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 83 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, etc. may be used. The bus 82 may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 82 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 8, but that does not indicate only one bus or one type of bus.
The processor 81 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 81. The Processor 81 may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory, and the processor 81 reads the information in the memory and completes the steps of the method for moving the virtual object in the game of the foregoing embodiment in combination with the hardware thereof.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program executes the steps of the method for moving the virtual object in the game.
The method, the apparatus, and the computer program product for moving a virtual object in a game provided in the embodiments of the present invention include a computer-readable storage medium storing a program code, where instructions included in the program code may be used to execute the method described in the foregoing method embodiments, and specific implementation may refer to the method embodiments, and will not be described herein again.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In addition, in the description of the embodiments of the present invention, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as being fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meaning of the above terms in the present invention can be understood in specific cases for those skilled in the art.
The functions may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. 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 removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that the following embodiments are merely illustrative of the present invention, and not restrictive, and the scope of the present invention is not limited thereto: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (12)

1. A method of moving a virtual object in a game, the method comprising:
responding to a movement control operation acted on a target virtual object in a game scene, and controlling the target virtual object to move in the game scene;
in response to the target virtual object colliding with a target scene model in the moving process, loading a track file corresponding to a collision body of the target scene model, wherein the track file at least comprises tracks matched with the collision body of the target scene model, and the tracks in the track file are tracks matched with the collision body which is in shape fit with the target scene model;
controlling the target virtual object to move along the track matched with the collision body according to the track file;
wherein the step of controlling the target virtual object to move along the trajectory matching the collision volume according to the trajectory file comprises:
acquiring a target position corresponding to the current movement control operation;
mapping the target location onto a trajectory contained in the trajectory file to control movement of the target virtual object along a trajectory matching the collision volume.
2. The method of claim 1, further comprising:
responding to the collision of the target virtual object with the current scene model in the moving process, and acquiring the identifier of the current scene model;
and if the identifier of the current scene model contains a preset target field, determining that the current scene model is the target scene model, and determining that the target virtual object collides with the target scene model.
3. The method of claim 2, wherein the step of loading a trajectory file corresponding to the collision volume of the target scene model comprises:
searching a track file corresponding to a collision body of the target scene model in a track file library according to a mapping relation between a pre-established model identifier and the track file;
and loading the searched track file into the target scene model.
4. The method of claim 3, wherein the identifying of the target scene model comprises: a target field, a function type, and a trajectory type; the target field is used for identifying the model type of the target scene model, the function type is used for identifying the game function corresponding to the target scene model, and the track type is used for identifying the retrieval information of the track file corresponding to the target scene model.
5. The method of claim 1, wherein the step of mapping the target location onto a track contained in the track file comprises:
inputting the target position into a pre-established calculation processor, and calculating the position of the target position on the track through the calculation processor so as to map the target position onto the track contained in the track file.
6. The method according to claim 1 or 5, wherein the step of mapping the target position onto a track contained in the track file comprises:
calculating a projection of the target position on the trajectory;
mapping the target position to a track contained in the track file according to the projection;
wherein the projection is a point on the trajectory closest to the target position.
7. The method of claim 6, wherein the step of mapping the target location onto a track contained in the track file according to the projection comprises:
and obtaining a displacement matrix corresponding to the target scene model, calculating track points of the target position on the track according to the displacement matrix and the projection, and mapping the target position to the track points.
8. The method of claim 1, wherein the target scene model is at least one of: tree model, bridge model, cableway model or steel wire model.
9. The method according to claim 1, wherein the movement control operation acting on the target virtual object in the game scene is an operation of controlling the movement of the target virtual object by a joystick; or, the movement control operation is an operation of controlling the target virtual object to move through a touch control.
10. An apparatus for moving a virtual object in a game, the apparatus comprising:
the control module is used for responding to the movement control operation of a target virtual object in a game scene and controlling the target virtual object to move in the game scene;
the loading module is used for responding to the collision of the target virtual object with a target scene model in the moving process and loading a track file corresponding to a collision body of the target scene model, wherein the track file at least comprises a track matched with the collision body of the target scene model, and the track in the track file is a track matched with the collision body attached to the appearance of the target scene model;
a moving module, configured to control the target virtual object to move along a trajectory matching the collision volume according to the trajectory file;
wherein the moving module is further configured to:
acquiring a target position corresponding to the current movement control operation; mapping the target location onto a trajectory contained in the trajectory file to control movement of the target virtual object along a trajectory matching the collision volume.
11. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method of any one of claims 1 to 9 when executing the computer program.
12. A computer-readable storage medium, having stored thereon a computer program for performing, when executed by a processor, the steps of the method according to any one of claims 1 to 9.
CN201911390109.XA 2019-12-27 2019-12-27 Method and device for moving virtual object in game and electronic equipment Active CN111054074B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911390109.XA CN111054074B (en) 2019-12-27 2019-12-27 Method and device for moving virtual object in game and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911390109.XA CN111054074B (en) 2019-12-27 2019-12-27 Method and device for moving virtual object in game and electronic equipment

Publications (2)

Publication Number Publication Date
CN111054074A CN111054074A (en) 2020-04-24
CN111054074B true CN111054074B (en) 2023-04-07

Family

ID=70304565

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911390109.XA Active CN111054074B (en) 2019-12-27 2019-12-27 Method and device for moving virtual object in game and electronic equipment

Country Status (1)

Country Link
CN (1) CN111054074B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112044075A (en) * 2020-09-18 2020-12-08 网易(杭州)网络有限公司 Method and device for generating motion trail
CN112494945B (en) * 2020-12-03 2024-05-10 网易(杭州)网络有限公司 Game scene conversion method and device and electronic equipment
CN112473138B (en) * 2020-12-10 2023-11-17 网易(杭州)网络有限公司 Game display control method and device, readable storage medium and electronic equipment
CN113786614B (en) * 2021-09-18 2024-03-26 上海米哈游天命科技有限公司 Object loading method and device in virtual scene
CN113821345B (en) * 2021-09-24 2023-06-30 网易(杭州)网络有限公司 Method and device for rendering moving track in game and electronic equipment
CN115501607A (en) * 2022-08-23 2022-12-23 网易(杭州)网络有限公司 Road finding graph reconstruction method and device and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107019915A (en) * 2016-02-01 2017-08-08 腾讯科技(深圳)有限公司 A kind of method, user equipment and system for determining motion track
CN108717372A (en) * 2018-05-24 2018-10-30 网易(杭州)网络有限公司 Virtual object control method and device in a kind of scene of game
CN109491586A (en) * 2018-11-14 2019-03-19 网易(杭州)网络有限公司 Virtual object control method and device, electronic equipment, storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107019915A (en) * 2016-02-01 2017-08-08 腾讯科技(深圳)有限公司 A kind of method, user equipment and system for determining motion track
CN108717372A (en) * 2018-05-24 2018-10-30 网易(杭州)网络有限公司 Virtual object control method and device in a kind of scene of game
CN109491586A (en) * 2018-11-14 2019-03-19 网易(杭州)网络有限公司 Virtual object control method and device, electronic equipment, storage medium

Also Published As

Publication number Publication date
CN111054074A (en) 2020-04-24

Similar Documents

Publication Publication Date Title
CN111054074B (en) Method and device for moving virtual object in game and electronic equipment
CN110827383B (en) Attitude simulation method and device of three-dimensional model, storage medium and electronic equipment
JP2915826B2 (en) Interference check device
CN114241100B (en) Skinning method, skinning device, skinning apparatus, skinning medium, and program product for virtual object
CN110721470B (en) Control method and device for virtual object movement behavior and electronic equipment
CN112090078A (en) Game character movement control method, device, equipment and medium
CN104941180A (en) Collision detecting method and device for 2D games
CN113144607A (en) Path finding method and device for virtual object in game and electronic equipment
CN107158701A (en) The reminding method and device of outgoing dynamics
CN113244619B (en) Data processing method, device, equipment and storage medium
CN111102980A (en) Path generation method and device and electronic equipment
CN111080755A (en) Motion calculation method and device, storage medium and electronic equipment
US10713832B2 (en) Precomputed environment semantics for contact-rich character animation
CN116484487B (en) Wallboard reinforcement method, device, equipment and storage medium
CN116764225A (en) Efficient path-finding processing method, device, equipment and medium
CN115639817A (en) Path trajectory correction method, device, equipment and medium
CN112546630B (en) Role moving method and device
CN114510053A (en) Robot planned path checking method and device, storage medium and electronic equipment
CN111429581A (en) Method and device for determining outline of game model and adding special effect of game
CN112884883B (en) Automatic generation method, terminal and storage medium of game track
CN115488535B (en) Welding gun track generation method and device for middle-group welding seam
CN116617669B (en) Collision test and detection method, device and storage medium thereof
CN114918913B (en) Collision detection method, device, computer equipment and storage medium
CN113409385B (en) Characteristic image identification and positioning method and system
CN108499109A (en) A method of it unilateral in real time can be scaled based on UE engine implementations article

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
GR01 Patent grant
GR01 Patent grant