Interactive control methods, devices and electronic devices in games
By controlling virtual objects to move within vehicles in response to touch inputs during gameplay, the system addresses the issues of low freedom of movement and high development pressure within vehicle systems, achieving free movement within vehicles and a consistent player experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NETEASE (HANGZHOU) NETWORK CO LTD
- Filing Date
- 2023-05-11
- Publication Date
- 2026-07-31
AI Technical Summary
In large-scale multiplayer online games, controlled models cannot move freely after riding in vehicles, and a dedicated control system needs to be designed for each type of vehicle, increasing development pressure and creating an imbalance in player experience.
The terminal device provides a graphical user interface that responds to touch operations to control the movement of virtual objects in the game scene and ride virtual vehicles, and allows free movement within the vehicles. The movement speed of the virtual vehicles is superimposed with the speed of the player's operation, while retaining the original control functions.
It enables controlled virtual objects to move freely within vehicles, reducing development pressure and increasing the freedom of player operation and consistency of experience.
Smart Images

Figure CN116617668B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of game interaction design technology, and in particular to an interactive control method, device and electronic device in games. Background Technology
[0002] In large-scale multiplayer online games, vehicles are typically provided as a means for players' controlled models to move quickly. In vehicle systems provided by related technologies, after a player issues a "get in" command, the controlled model is bound to a fixed position on the vehicle. Simultaneously, the camera angle and user interface change, and the operable control switches based on the bound position. The player then uses these new control to control the vehicle's forward, backward, and turning actions, rendering the controlled model itself uncontrollable. When the player issues a "get out" command, the controlled model detaches from the vehicle, and the camera angle and user interface revert to normal. However, this method has limitations. Once the controlled model is in a vehicle, it cannot maintain its original form and move freely within the vehicle; it can only execute vehicle-specific control controls, resulting in limited freedom of movement. Furthermore, this method requires designing a separate control system for each type of vehicle, increasing development complexity. Summary of the Invention
[0003] The purpose of this invention is to provide an interactive control method, device, and electronic device for games, so as to support the controlled model to move freely within the vehicle after the controlled model is riding in the vehicle, while retaining the original operation controls and reducing the development pressure.
[0004] In a first aspect, the present invention provides an interactive control method in a game, which provides a graphical user interface through a terminal device; the graphical user interface displays a portion of the game scene and interactive controls, the game scene including a controlled virtual object; the method includes: responding to a first touch operation on the interactive controls, controlling the controlled virtual object to move in the game scene and displaying a virtual vehicle in the graphical user interface; responding to the controlled virtual object moving onto the virtual vehicle, controlling the controlled virtual object to ride in the virtual vehicle and controlling the controlled virtual object to move along with the virtual vehicle; responding to the controlled virtual object riding in the virtual vehicle, responding to a second touch operation on the interactive controls, controlling the controlled virtual object to move in the virtual vehicle; wherein, the movement speed of the controlled virtual object in the virtual vehicle includes: the sum of the operation speed corresponding to the second touch operation and the movement speed of the virtual vehicle.
[0005] Secondly, the present invention provides an interactive control device for a game, which provides a graphical user interface through a terminal device; the graphical user interface displays a portion of the game scene and interactive controls, and the game scene includes a controlled virtual object; the device includes: a first movement control module, used to respond to a first touch operation on the interactive controls, control the controlled virtual object to move in the game scene, and display a virtual vehicle in the graphical user interface; a vehicle riding module, used to respond to the virtual object moving onto the virtual vehicle, control the controlled virtual object to ride the virtual vehicle, and control the controlled virtual object to move with the virtual vehicle; a second movement control module, used to respond to a second touch operation on the interactive controls when the controlled virtual object rides the virtual vehicle, control the controlled virtual object to move in the virtual vehicle; wherein, the movement speed of the controlled virtual object in the virtual vehicle includes: the sum of the operation speed corresponding to the second touch operation and the movement speed of the virtual vehicle.
[0006] Thirdly, the present invention provides an electronic device comprising a processor and a memory, the memory storing machine-executable instructions executable by the processor, the processor executing the machine-executable instructions to implement the interactive control method in the aforementioned game.
[0007] Fourthly, the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the interactive control method in the aforementioned game.
[0008] The embodiments of the present invention bring the following beneficial effects:
[0009] This invention provides an interactive control method, device, and electronic device for games. First, in response to a first touch operation on an interactive control, the controlled virtual object moves within the game scene, and a virtual vehicle is displayed in the graphical user interface. Then, in response to the virtual object moving onto the virtual vehicle, the controlled virtual object rides the virtual vehicle and moves with it. Next, in response to a second touch operation on an interactive control while the controlled virtual object is riding the virtual vehicle, the controlled virtual object moves within the virtual vehicle. The movement speed of the controlled virtual object within the virtual vehicle includes the sum of the operation speed corresponding to the second touch operation and the movement speed of the virtual vehicle. This method retains the functionality of the original controls in the interface when the controlled virtual object rides the virtual vehicle, eliminating the need to design a dedicated operating system for the virtual vehicle, thus reducing development pressure. It also allows control of the controlled virtual object's movement and interaction within the virtual vehicle using existing controls.
[0010] Other features and advantages of the invention will be set forth in the following description, or some features and advantages may be inferred from the description or determined without doubt, or may be learned by practicing the techniques described above.
[0011] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0012] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0013] Figure 1 A flowchart of an interactive control method in a game provided by an embodiment of the present invention;
[0014] Figure 2 A flowchart of another interactive control method in a game provided by an embodiment of the present invention;
[0015] Figure 3 A flowchart of another interactive control method in a game provided by an embodiment of the present invention;
[0016] Figure 4 This is a schematic diagram illustrating the movement of a virtual vehicle on a virtual track, as provided in an embodiment of the present invention.
[0017] Figure 5 A schematic diagram illustrating the optimized virtual vehicle moving on a virtual track, provided in an embodiment of the present invention;
[0018] Figure 6 This is a schematic diagram of the structure of an interactive control device in a game provided by an embodiment of the present invention;
[0019] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0021] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0022] In large-scale multiplayer online games, vehicles are typically provided as a means for players' controlled models to move quickly. In vehicle systems provided by related technologies, the operation and behavior of vehicles include: after a player issues a "get in" command, the controlled model is bound to a fixed position on the vehicle, while the camera view and user interface (UI) are changed, switching the operable control controls based on the bound position; then, the player uses the new control controls to control the vehicle's forward, backward, and turning actions, and the controlled model itself becomes uncontrollable; finally, the player issues a "get out" command, the controlled model detaches from the vehicle, and the camera view and UI are restored.
[0023] However, this method results in the controlled model being bound to a fixed position on the vehicle after it enters, unable to maintain its original form and move freely within the vehicle. It can only execute controls specifically designed for that vehicle, resulting in low freedom of movement. Furthermore, this method requires designing a separate control system for each vehicle and adjusting the handling, leading to high implementation costs and demanding requirements on the vehicle's systems. Additionally, this method results in an unbalanced player experience; for example, in car-type vehicles, the driver's seat typically offers greater operational space and decision-making power, while the passenger seat has relatively limited operational options, and the vehicle types are relatively homogenous.
[0024] To address the aforementioned issues, embodiments of the present invention provide an interactive control method, device, and electronic device for games, which can be applied to game scenarios involving vehicle riding.
[0025] In one embodiment of this disclosure, the interactive control method in a game can run on a local terminal device or a server. When the interactive control method in a game runs on a server, the method can be implemented and executed based on a cloud interactive system, wherein the cloud interactive system includes a server and a client device.
[0026] In an optional implementation, various cloud applications, such as cloud gaming, can run under the cloud interaction system. Taking cloud gaming as an example, cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming operating mode, the game program and the game screen presentation are separated. The storage and execution of the interactive control methods in the game are completed on the cloud gaming server. The client device is used for receiving and sending data and presenting the game screen. For example, the client device can be a display device with data transmission capabilities located close to the user, such as a mobile terminal, television, computer, or PDA; however, the information processing is performed by the cloud gaming server in the cloud. When playing the game, the player operates the client device to send operation commands to the cloud gaming server. The cloud gaming server runs the game according to the operation commands, encodes and compresses the game screen and other data, returns it to the client device via the network, and finally decodes and outputs the game screen through the client device.
[0027] In an optional implementation, taking a game as an example, the local terminal device stores the game program and is used to display the game screen. The local terminal device is used to interact with the player through a graphical user interface (GUI), i.e., conventionally by downloading, installing, and running the game program via an electronic device. The local terminal device can provide the GUI to the player in various ways, such as rendering it on the terminal's display screen or providing it to the player via holographic projection. For example, the local terminal device can include a display screen for displaying the GUI, which includes game screens, and a processor for running the game, generating the GUI, and controlling the display of the GUI on the display screen.
[0028] In one possible implementation, embodiments of the present invention provide an interactive control method in a game, which provides a graphical user interface (GUI) through a terminal device. The GUI displays a portion of the game scene and interactive controls, and the game scene includes controlled virtual objects; such as... Figure 1 As shown, the method includes the following specific steps:
[0029] Step S102: In response to the first touch operation on the interactive control, control the controlled virtual object to move in the game scene and display the virtual vehicle in the graphical user interface.
[0030] In practical implementation, the aforementioned interactive controls can control the movement speed and direction of the controlled virtual object. The display position and form of these interactive controls in the graphical user interface can be set according to development needs and are not specifically limited here. The first touch operation can be a click, swipe, or drag operation on the interactive control. The controlled virtual object is a virtual character in the game controlled by the player through a terminal device.
[0031] In practical applications, before the player makes their first touch operation, the game scene displayed in the graphical user interface may or may not include virtual vehicles. If there are no virtual vehicles, the first touch operation allows the player to control the movement of a virtual object within the game scene. As the controlled virtual object moves, the game scene displayed in the graphical user interface changes, thus potentially changing to a game scene that includes virtual vehicles.
[0032] The virtual vehicle mentioned above can be a car, airplane, ship, railcar, or elevator, etc., depending on the development requirements. This virtual vehicle can move automatically based on pre-packaged offline data, or it can be manually controlled by the player, depending on the development requirements.
[0033] Step S104: In response to the controlled virtual object moving onto the virtual vehicle, control the controlled virtual object to ride in the virtual vehicle and control the controlled virtual object to follow the virtual vehicle.
[0034] This invention does not require a specific control to enable virtual objects to get on and off virtual vehicles. Instead, it only requires controlling the movement of the virtual object to move onto or off the virtual vehicle. Compared to the traditional method of controlling virtual objects to get on and off virtual vehicles with a specific control, this method provides a more seamless experience. Furthermore, this invention determines whether the controlled virtual object has moved onto (or is riding in) the virtual vehicle by projecting rays at specified intervals under the feet of the controlled virtual object.
[0035] In practical implementation, when a controlled virtual object rides on a virtual vehicle, the controlled virtual object will move along with the virtual vehicle. That is, even if the controlled virtual object itself does not move, the controlled virtual object will change according to the moving position and direction of the virtual vehicle. At this time, the relative positional relationship between the controlled virtual object and the virtual vehicle remains unchanged.
[0036] Step S106: In response to the controlled virtual object riding the virtual vehicle, the controlled virtual object is controlled to move in the virtual vehicle in response to the second touch operation of the interactive control; wherein, the movement speed of the controlled virtual object in the virtual vehicle includes: the sum of the operation speed corresponding to the second touch operation and the movement speed of the virtual vehicle.
[0037] In practical implementation, when the controlled virtual object is riding in a virtual vehicle, the interactive controls that control the controlled virtual object are still displayed in the graphical user interface, and the operation method and function remain unchanged. Therefore, when the controlled virtual object is riding in a virtual vehicle, the player can still control the movement of the controlled virtual object by performing a second touch operation on the interactive controls, but at this time the controlled virtual object can only move within the virtual vehicle. Specifically, the aforementioned second touch operation can be a click operation, a swipe operation, or a drag operation on the interactive controls, etc.
[0038] In practical applications, this application achieves the movement of controlled virtual objects according to virtual vehicles by speed superposition. At the same time, the actual speed of the controlled virtual object (equivalent to the movement speed of the controlled virtual object in the virtual vehicle) is the sum of the movement speed of the virtual vehicle and the speed generated by the player's second touch operation on the interactive control. This method is highly usable and has low requirements for the physics system.
[0039] This invention provides an interactive control method for games. First, in response to a first touch operation on an interactive control, the method controls a controlled virtual object to move within the game scene and displays a virtual vehicle in the graphical user interface. Then, in response to the controlled virtual object moving onto the virtual vehicle, the method controls the controlled virtual object to ride in the virtual vehicle and move along with it. Next, in response to a second touch operation on an interactive control while the controlled virtual object is riding in the virtual vehicle, the method controls the controlled virtual object to move within the virtual vehicle. The movement speed of the controlled virtual object within the virtual vehicle includes the sum of the operation speed corresponding to the second touch operation and the movement speed of the virtual vehicle. This method retains the functionality of the original controls in the interface when the controlled virtual object is riding in the virtual vehicle, eliminating the need to design a dedicated operating system for the virtual vehicle, thus reducing development pressure. It also allows control of the controlled virtual object's movement and interaction within the virtual vehicle using existing controls.
[0040] This invention also provides another interactive control method in a game, which is implemented based on the above method embodiments. This method focuses on describing the specific process of controlling a controlled virtual object to follow a virtual vehicle (implemented through steps S206-S212 below); such as Figure 2 As shown, the method includes the following specific steps:
[0041] Step S202: In response to the first touch operation on the interactive control, control the controlled virtual object to move in the game scene and display the virtual vehicle in the graphical user interface.
[0042] In practical applications, the aforementioned virtual vehicles can drive automatically based on pre-packaged offline data, thus eliminating the need for manual control by the player. Simultaneously, while displaying the virtual vehicle in the graphical user interface, the player can also display the virtual vehicle's movement control controls. The player can manually control the virtual vehicle's movement by operating the movement control controls, or intervene in the virtual vehicle's movement during its automatic driving process by using the movement control controls.
[0043] In some embodiments, when a player manually controls the movement of a virtual vehicle, a movement control operation can be initiated to control the virtual vehicle to move within the game scene according to the movement control operation. This movement control operation can be a trigger operation on the aforementioned movement control controls, and can control the virtual vehicle's direction and speed of movement, etc.
[0044] Step S204: In response to the controlled virtual object moving onto the virtual vehicle, control the controlled virtual object to ride the virtual vehicle.
[0045] Step S206: Obtain the trajectory and attitude of the virtual vehicle in the current frame and the absolute position of the controlled virtual object in the current frame; the trajectory and attitude are used to indicate the position and orientation of the virtual vehicle in the game scene.
[0046] In practical applications, the direction in which a controlled virtual object moves varies significantly depending on its location within a virtual vehicle. This invention calculates the relative position of the controlled virtual object to the virtual vehicle using the vehicle's trajectory and attitude in the current frame, and the controlled virtual object's absolute position in the current frame. Here, the current frame refers to the game screen displayed in the graphical user interface at the current moment; the vehicle's trajectory and attitude indicate its position and orientation within the game scene; and the absolute position is the location of the controlled virtual object within the game scene in the current frame. Specifically, the game scene can be located in a world coordinate system or a custom coordinate system, depending on the development requirements.
[0047] Step S208: Determine the relative position of the controlled virtual object with respect to the controlled virtual object based on the trajectory attitude and absolute position.
[0048] In practical implementation, the relative position pos between the controlled virtual objects can be determined using the following formula. rel :
[0049] pos rel =pos p *trans t -1 ;
[0050] Where, pos pIndicates the absolute position of the controlled virtual object in the current frame; trans t Indicates the trajectory and attitude of the virtual vehicle in the current frame; [*] -1 This represents the matrix inversion operation.
[0051] Step S210: Based on the aforementioned relative position and the trajectory and attitude of the virtual vehicle in the next frame of the current frame, determine the direction in which the controlled virtual object follows the movement of the virtual vehicle.
[0052] Based on the trajectory and attitude of the virtual vehicle in the next frame and the relative position of the controlled virtual object to the virtual vehicle in the current frame, the direction in which the controlled virtual object is driven by the virtual vehicle can be obtained without the controlled virtual object itself moving. In specific implementation, the above step S210 can be achieved through the following steps 10-11:
[0053] Step 10: Multiply the relative position by the trajectory and attitude of the virtual vehicle in the next frame of the current frame to obtain the desired position of the controlled virtual object in the next frame.
[0054] Specifically, the desired position pos in the next frame, assuming the controlled virtual object itself does not move, can be obtained using the following formula. n :
[0055] pos n =pos rel *trans t2 ;
[0056] Among them, trans t2 This indicates the trajectory and attitude of the virtual vehicle in the next frame after the current frame.
[0057] Step 11: Determine the direction in which the controlled virtual object moves with the virtual vehicle based on the difference between the desired position and the relative position.
[0058] In practical implementation, the direction (dir) of the controlled virtual object following the virtual vehicle can be calculated using the following formula:
[0059] dir = (pos n -pos rel ) / ||pos n -pos rel ||;
[0060] Here, ||*|| represents the matrix modulo operation.
[0061] Step S212: Determine the speed at which the controlled virtual object follows the virtual vehicle based on the moving speed of the virtual vehicle and the direction in which the controlled virtual object follows the virtual vehicle.
[0062] The movement speed of the virtual vehicle can be obtained in real time from the game. In practical applications, multiplying the virtual vehicle's movement speed by the direction in which the controlled virtual object follows the vehicle's movement yields the superimposed speed of the virtual vehicle on the controlled virtual object. Adding this superimposed speed to the controlled virtual object's own velocity vector allows the controlled virtual object to follow the virtual vehicle's movement. Furthermore, even when the controlled virtual object itself is not moving, this superimposed speed is also the speed at which the controlled virtual object follows the virtual vehicle's movement.
[0063] Step S214: In response to the controlled virtual object riding the virtual vehicle, the controlled virtual object is controlled to move in the virtual vehicle in response to the second touch operation of the interactive control; wherein, the movement speed of the controlled virtual object in the virtual vehicle includes: the sum of the operation speed corresponding to the second touch operation and the movement speed of the virtual vehicle.
[0064] In practical implementation, the terminal device controlling the aforementioned controlled virtual object can be referred to as the game master. The game master uploads parameters such as the position, time, and speed of the controlled virtual object at a certain frequency. After receiving the corresponding broadcast packet from the game master (which includes the parameters uploaded by the game master), the game slave calculates the position of the controlled virtual object controlled by the game master on the game slave in each performance frame based on the above parameters through interpolation and prediction. However, there is a relative positional relationship between the controlled virtual object and the virtual vehicle. In the existing technology, when performing interpolation and smoothing calculations for position synchronization, the synchronization status of other entities is not considered. Therefore, from the perspective of the game slave, there will be a certain degree of relative sliding and clipping between the virtual vehicle and the controlled virtual object (that is, the virtual vehicle passes through the controlled virtual object). Because the relative positional relationship is not considered, this method is not suitable for vehicle systems that can move freely. In order to optimize the synchronization performance on the virtual vehicle, this invention adds relative position synchronization, which can jointly handle the performance problem of entities on the game slave through the original synchronization method (that is, absolute position synchronization) and the relative position synchronization method.
[0065] It's important to clarify that "game slave" and "game master" refer to the virtual objects controlled by the players. The terminal device that directly controls the controlled virtual object is the game master, while other terminal devices that do not have control but can see the controlled virtual object are game slaves. Game slaves can receive data from the game master for their own presentation. For example, if three players, a, b, and c, each control a virtual object, then for the virtual object controlled by player a, the terminal device operated by player a is the game master, while the terminal devices operated by players b and c are game slaves.
[0066] In this invention, at specified intervals, it is determined whether the controlled virtual object is riding on a virtual vehicle. If so, the absolute position information of the controlled virtual object and the relative position information between the controlled virtual object and the virtual vehicle are packaged together to obtain a first synchronization packet. This first synchronization packet is then uploaded to the game server, so that the game server sends the first synchronization packet to the slave devices (equivalent to the aforementioned game slaves) corresponding to other virtual objects in the same game as the controlled virtual object. The slave devices interpolate game frames based on the first synchronization packet to obtain the game performance of the controlled virtual object on the slave devices. If not, the absolute position information of the controlled virtual object is packaged together to obtain a second synchronization packet. This second synchronization packet is then uploaded to the game server, so that the game server sends the second synchronization packet to the slave devices. The slave devices interpolate game frames based on the second synchronization packet to obtain the game performance of the controlled virtual object on the slave devices.
[0067] In practical implementation, entities such as freely moving virtual vehicles can be referred to as the "carrier matrix." Whether a controlled virtual object is riding in a virtual vehicle is determined by casting a ray from under its feet in the game scene. When a carrier matrix exists under a controlled virtual object, the main game client simultaneously sends relative position information, the carrier matrix ID, and absolute position information to other game slaves. When no carrier matrix exists under a controlled virtual object, only the absolute position information is synchronized.
[0068] Specifically, the game uses the absolute position information pos from the client. abs1 and relative position information pos rel Interpolation and prediction are performed independently, and the relative position information is converted into absolute position information pos with the virtual vehicle as the parent object. abs2 :
[0069] pos abs2 =pos rel *trans t ;
[0070] Among them, trans t This represents the trajectory and attitude of the virtual vehicle. Ultimately, two world coordinates pos are obtained. abs1 and pos abs2 Different presentation strategies are adopted depending on the changes in the parent body:
[0071] 1) The controlled virtual object has no supporting parent body beneath it.
[0072] pos abs1 The actual location of the controlled virtual object is taken as the actual representation location, meaning that relative position synchronization is not considered at all.
[0073] 2) The controlled virtual object has a supporting matrix beneath it.
[0074] When the controlled virtual object has a stable supporting parent object beneath it, the pos will be... abs2 As the actual representation location of a controlled virtual object.
[0075] 3) The controlled virtual object is in a transitional state between a supported matrix and an unsupported matrix.
[0076] When a controlled virtual object steps onto a virtual vehicle, the synchronization packet received by the game client includes relative position information, i.e., in addition to the position... abs1 In addition, there is also POS. abs2 These are the world coordinates calculated from relative position information. pos abs1 and pos abs2 The Euclidean distance between them has some uncertainty, so directly using pos abs2 The actual position of a controlled virtual object may experience coordinate jumps. Therefore, this invention presets an f_max frame to complete the switch from absolute position information synchronization to relative position information synchronization.
[0077] In practical implementation, the controlled virtual object's game performance on the slave device is pos final It is determined by the following formula:
[0078] pos final =pos abs1 *(f_max-c) / f_max+pos abs2 *c / f_max
[0079] Where, pos abs1 This represents the absolute position information in the first synchronization packet; pos abs2 The world coordinates are calculated from the relative position information in the first synchronization packet; f_max represents the total number of frames from when the controlled virtual object switches from not riding a virtual vehicle to riding a virtual vehicle, or the total number of frames from when the controlled virtual object rides a virtual vehicle to when it stops riding a virtual vehicle; c represents the frame count. When the controlled virtual object switches from not riding a virtual vehicle to riding a virtual vehicle, c gradually increases, with a minimum value of 0 and a maximum value of f_max; when the controlled virtual object switches from riding a virtual vehicle to not riding a virtual vehicle, c gradually decreases, with a maximum value of f_max and a minimum value of 0.
[0080] Specifically, when a controlled virtual object switches from not riding a virtual vehicle to riding one, the update method for c is: c = min((c+1), f_max). This can also be understood as c gradually increasing by 1 at a rate of 1 when the controlled virtual object switches from not riding a virtual vehicle to riding one, reaching a maximum of f_max, and then c stops increasing. At this point, the controlled virtual object remains on the virtual vehicle. When a controlled virtual object switches from riding a virtual vehicle to not riding one, the update method for c is: c = max((c-1), 0); or immediately, when the controlled virtual object gets off the virtual vehicle, c gradually decreases by 1 at a rate of 1, reaching a minimum of 0. In some embodiments, c may not decrease to 0 before the controlled virtual object gets back onto the virtual vehicle, at which point c begins to gradually increase; similarly, c may not increase to f_max before the controlled virtual object gets off the virtual vehicle, at which point c begins to gradually decrease.
[0081] The interactive control method in the aforementioned game uses speed superposition to achieve the movement of controlled virtual objects following virtual vehicles. The actual speed of the controlled virtual object is the sum of the speed vector superimposed on the virtual vehicle and the speed vector caused by the player's own operation. This method has strong applicability and low requirements for the physics system. Meanwhile, traditional synchronization methods do not consider the relative positional relationship between entities. Therefore, if the virtual vehicle and the controlled virtual objects on it are synchronized independently, relative slippage can easily occur. This invention adds a relative position synchronization system that works in conjunction with traditional absolute position synchronization to ensure good synchronization performance of the controlled virtual objects during getting on and off the vehicle, as well as while on the vehicle.
[0082] This invention also provides another interactive control method in a game, which is implemented based on the above method embodiments. This method focuses on describing the specific process of automatic movement of a virtual vehicle within a game scene where a virtual track is set and the virtual vehicle moves on the virtual track; for example... Figure 3 As shown, the method includes the following specific steps:
[0083] Step S302: Based on the preset track array, determine the trajectory attitude of the virtual vehicle on the virtual track; wherein, the track array stores the trajectory attitude of each trajectory point in the virtual track; the trajectory attitude is used to indicate the position and orientation of the trajectory point; the trajectory point is a discrete point on the line in the virtual track.
[0084] The aforementioned track array is equivalent to the aforementioned offline array. This track data is used to offline store the attitude of any trajectory point on the virtual track. After encapsulating this track array, based on any travel distance from the starting point of the virtual track, the position coordinates and orientation of the trajectory point corresponding to that travel distance can be obtained from the track array. Thus, the track array can provide a data foundation for the automatic calculation of the virtual vehicle's position. In specific implementation, the running trajectory of the virtual track can be recorded through the track system, satisfying f(t) = trans, that is, the attitude trans of the corresponding trajectory point on the current trajectory is obtained through the time parameter t. Specifically, the running trajectory of the virtual vehicle running on the virtual track is complex and not suitable for dynamic calculation during runtime. Therefore, this invention uses a track array to offline store the attitude of any point on the track. However, it is very inconvenient to directly use time t to control the track train. Therefore, this invention controls the position of the virtual vehicle through displacement. Thus, the track array of this invention stores: the total number of trajectory frames f, trajectory data d, and the total length L of the virtual track. Among them, the trajectory data can be stored in an array of length L, and each element in the array stores the position and orientation of the trajectory point in that frame. If the virtual track is a circular track, then the total length of the virtual track is the total length traversed from the starting point of the track, sequentially passing through all other track points, and then returning to the starting point.
[0085] Based on the above description, step S302 can be achieved through the following steps 20-22:
[0086] Step 20: Obtain the travel distance of the virtual vehicle to its current position on the virtual track; wherein, the travel distance includes: the track length traversed by the virtual vehicle from the starting point of the virtual track to its current position.
[0087] In practice, the aforementioned current position is also the position of the virtual vehicle on the virtual track in the current frame.
[0088] Step 21: Based on the above travel distance, determine the target trajectory point corresponding to the current position in the virtual track; wherein, the virtual track consists of multiple trajectory points.
[0089] In practical applications, the travel distance is first divided by the track length to obtain the remainder. The remainder is then multiplied by the total number of frames of the trajectory points and divided by the track length to obtain the trajectory frame corresponding to the current position. The target trajectory point corresponding to the current position in the virtual track can then be obtained through the trajectory frame.
[0090] Step 22: Determine the trajectory attitude of the virtual vehicle at the current position based on the target trajectory point and the trajectory attitude corresponding to each trajectory point stored in the trajectory array.
[0091] In the implementation, if the trajectory frame corresponding to the target trajectory point is an integer, the trajectory pose corresponding to the target trajectory point can be retrieved from the orbit array as the trajectory pose of the virtual vehicle at the current position. If the trajectory frame corresponding to the target trajectory point is a decimal frame, then the trajectory pose `trans` of the virtual vehicle at the current position needs to be obtained through interpolation.
[0092] p = t - int(t)
[0093] trans=trans_b+(trans_n-trans_b)*p
[0094] Where t represents the trajectory frame corresponding to the target trajectory point, int(t) represents the trajectory frame corresponding to the integer part of t, trans_b represents the attitude of the trajectory point corresponding to the int(t) frame, and trans_n represents the attitude of the trajectory point corresponding to the int(t)+1 frame.
[0095] Step S304: Based on the trajectory attitude of the virtual vehicle on the virtual track and the preset velocity vector, control the virtual vehicle to move on the virtual track.
[0096] The aforementioned preset velocity vector is the speed of the virtual vehicle running on the virtual track, which is set in advance. The specific setting method of this preset velocity vector can be determined according to the research and development needs.
[0097] In its implementation, the aforementioned virtual vehicle (also known as a virtual train) includes at least one virtual carriage. The trajectory of the virtual vehicle is the same as that of the first virtual carriage within it, and the distance between adjacent virtual carriages along the virtual track remains constant during the vehicle's movement. Specifically, the virtual train and virtual carriages maintain a one-to-many relationship. To reduce the load on the game server, the game server controls the travel distance of the first virtual carriage (equivalent to the locomotive carriage) solely through attributes such as speed and acceleration. The client calculates the position and orientation of the first virtual carriage based on the track array. Simultaneously, to prevent error accumulation from causing changes in the relative distance between carriages, the mileage of the locomotive carriage is first updated via speed. For carriages other than the locomotive carriage, the track distance from the preceding carriage is sequentially maintained at a constant level.
[0098] In practical applications, the number of carriages, the models used for the carriages (such as the locomotive and the locomotive), the virtual train's speed and station locations, and stopping time can be modified by filling in tables. Table 1 shows the carriage resource list, which provides three carriage models and the model length for each carriage model; Table 2 shows the information corresponding to the stopping station locations; Table 3 shows the virtual train's speed, station locations, stopping time, and other attributes.
[0099] Table 1
[0100] Vehicle Number Model Resources Model length 1 Car front 1 19 2 Carriage 1 17 3 Carriage 2 17
[0101] Table 2
[0102]
[0103] Table 3
[0104] List of auxiliary carriages parking stations Parking time Maximum speed Acceleration time [1,2,2,2] [4,1,2,3] 20 7 4 [1,2,2,2] [3,4,1,2] 20 7 4 [1,2,2,2] [2,3,4,1] 20 7 4
[0105] In some embodiments, to avoid changes in the relative positions between carriages due to accumulated calculation errors, only the movement distance of the locomotive is synchronized. For carriages other than the locomotive, the travel distance of other carriages is calculated based on the premise that each carriage maintains a fixed distance from the next carriage equal to half the sum of the lengths of the current and next carriages. Assuming that the carriages are numbered 1, 2, 3...n from the locomotive, then when n>=2, the carriage displacement is calculated as follows:
[0106] dis i =(len(carriage) i-1 )+len(carriage i )) / 2
[0107] Among them, dis i len(carriage) represents the distance between the i-th car and the preceding car. i-1 ) represents the length of the (i-1)th car, len(carriage) i ) represents the length of the i-th carriage.
[0108] In practical implementation, because the virtual tracks in the game map may have many curves in both the horizontal and vertical directions, and the actual travel distance of a carriage is the distance traveled by its center, the position and orientation obtained directly from the track array are poorly represented. It can only guarantee that the center of a single carriage is on the track; the front and rear of the carriage will extend off the track when encountering sharp curves. Furthermore, the representation of connections between multiple carriages is also poor. Figure 4 The diagram shown illustrates the movement of a virtual vehicle on a virtual track. Figure 4 The two rectangles represent virtual carriages, the thick curved lines represent virtual tracks, and the circle represents the center of the virtual carriages. Figure 4 It can be seen that the head and tail of the virtual carriages are significantly offset from the virtual track, and there is obvious misalignment at the connection points between the virtual carriages.
[0109] Based on the above description, this invention optimizes the vehicle synchronization scheme, ensuring that during the movement of the virtual vehicle on the virtual track, the midpoints of the head and tail of each virtual carriage within the virtual vehicle lie on the virtual track, and the direction of the line connecting the midpoints of the head and tail of the carriage is the orientation of the virtual carriage. This guarantees better performance of the virtual carriages on curves and slopes. For example, assuming the carriage length is A and the current travel distance is S, the coordinates of the trajectory points with distances of S+A / 2 and SA / 2 are obtained from the track array, i.e., the position coordinates of the head and tail of the carriages, ensuring that the head and tail of the carriages always fall on the virtual track. The midpoint of the head and tail of the carriages is used as the carriage coordinates, and the direction of the line connecting them is used as the carriage orientation, resulting in the following... Figure 5 The provided diagram illustrates the effect of an optimized virtual vehicle moving on a virtual track.
[0110] In practical applications, multiple parking stations and key nodes are set in the trajectory points of the virtual track; among them, key nodes are used to indicate the mileage and speed information of the virtual vehicle; the mileage information may include the mileage to the next station, and the speed information includes the initial speed and acceleration of the virtual vehicle, etc. Based on this, the above step S304 can be implemented by the following steps 30-31:
[0111] Step 30: Starting from the initial station of the virtual track, based on the trajectory and attitude of the virtual vehicle on the virtual track and the mileage and speed information of the virtual vehicle indicated by the key nodes the virtual vehicle passes through, control the virtual vehicle to move to the next parking station of the initial station.
[0112] Step 31: Take the next parking station of the initial station as the new initial station, and continue to execute the steps of starting from the initial station of the virtual track, controlling the virtual vehicle to move to the next parking station of the initial station based on the trajectory attitude of the virtual vehicle on the virtual track and the mileage and speed information of the virtual vehicle indicated by the key nodes passed by the virtual vehicle, until the virtual vehicle moves to the last parking station or the initial station of the virtual track, and continues to move from the initial station.
[0113] Based on the motion patterns of the virtual train, and information such as its acceleration, deceleration, stopping station locations, and stopping times, a series of key nodes are abstracted on the virtual track. Each key node contains not only mileage information but also speed information between that key node and the next node. Therefore, starting from the initial station, the virtual train automatically accelerates, maintains a constant speed, decelerates, and stops to reach the next stopping station, continuously repeating this process on the virtual track until it reaches the last stopping station. If the virtual track is a loop track, meaning there is no final stopping station, the virtual vehicle will cycle through each stopping station on the virtual track before departing again.
[0114] Specifically, the key nodes include acceleration nodes, constant speed nodes, and deceleration nodes. An acceleration node is the first parking station location where the virtual vehicle departs on the virtual track. A constant speed node is the location on the virtual track corresponding to the first location plus the distance the virtual vehicle travels from zero to a preset maximum speed. A deceleration node is the location on the virtual track corresponding to the parking station location reached by the virtual vehicle minus the distance the virtual vehicle travels from its maximum speed to zero. The virtual vehicle moves on the virtual track by switching between acceleration nodes, constant speed nodes, and deceleration nodes. Each of these acceleration nodes, constant speed nodes, and deceleration nodes also corresponds to an initial velocity and acceleration.
[0115] Based on the above description, the physical distance of a virtual vehicle can be calculated using the following formula:
[0116] speed = speed + dt * acc (or dec)
[0117] dis = dis + speed * dt
[0118] The speed mentioned above represents the speed of the virtual vehicle; dt is a known quantity representing the switching time between adjacent frames; acc represents the acceleration corresponding to the acceleration node; dec represents the deceleration corresponding to the deceleration node; and dis represents the distance traveled by the virtual vehicle.
[0119] If the virtual track is a sequential loop structure, it's necessary to determine whether a node state switch is needed by checking if the key node has just crossed its position before and after the current game frame. Upon reaching the next node, the virtual vehicle's travel distance *m*, speed *s*, and acceleration *a* are set to the initial values for that node. Simultaneously, this application limits the maximum speed during acceleration and the minimum speed during deceleration. Considering the possibility of accumulated calculation errors, to prevent the virtual vehicle from never reaching the next station, the speed is only allowed to decrease to a fixed threshold during deceleration and stopping, and then reset to 0 upon reaching the stopping station. Similarly, a maximum speed threshold is set to prevent abnormal acceleration.
[0120] In its implementation, this invention transfers both the orientation and specific coordinates to the client for calculation. Therefore, the game server only needs to synchronize the virtual vehicle's travel distance to the client, as follows:
[0121] 1) The game server synchronizes the current location (tar_dis) with the client and notifies the client that it will arrive in t+d (tar_t) time, where t is the current time and d is a fixed value representing the delay.
[0122] 2) The client calculates the distance difference total_distance between the current mileage now_dis and the target mileage tar_dis (the game server will notify the client of the target mileage) every frame:
[0123] total_distance=tar_dis-now_dis
[0124] Then, based on the time difference between the current time now and the expected arrival time tar_t at the target mileage:
[0125] time_diff = tar_t - now
[0126] And the switching time dt of the current frame on the client side, to obtain the forward distance s of the current frame = totaldistance*dt / time_diff.
[0127] 3) When time diff <= 0, or total distance is less than the first preset distance threshold, stop moving forward. When total distance is greater than the second preset distance threshold, trigger teleportation and directly set the virtual vehicle to tar_dis. The first and second preset distance thresholds can be set according to development needs. Usually, the second preset distance threshold is set to a larger value, mainly to trigger virtual vehicle teleportation when the game lags.
[0128] The interactive control method in the aforementioned game enables virtual vehicles to automatically accelerate, decelerate, and stop along virtual tracks. It supports the movement of controlled virtual objects and allows these objects to move and interact freely within the virtual vehicle. Simultaneously, this method allows players to retain their original operational space, eliminating the need for a dedicated operating system or adjustments to the vehicle's handling. This results in relatively low implementation costs and minimal requirements for the physics system.
[0129] In addition to the above-described method embodiments, this invention also provides an interactive control device for games, which provides a graphical user interface (GUI) via a terminal device. The GUI displays a portion of the game scene and interactive controls, and the game scene includes controlled virtual objects. Figure 6 As shown, the device includes:
[0130] The first movement control module 60 is used to respond to a first touch operation on the interactive control, control the movement of the controlled virtual object in the game scene, and display the virtual vehicle in the graphical user interface.
[0131] The vehicle riding module 61 is used to control the controlled virtual object to ride in the virtual vehicle and to control the controlled virtual object to follow the virtual vehicle in response to the controlled virtual object moving onto the virtual vehicle.
[0132] The second movement control module 62 is used to control the movement of the controlled virtual object in the virtual vehicle in response to a second touch operation of the interactive control when the controlled virtual object rides the virtual vehicle; wherein, the movement speed of the controlled virtual object in the virtual vehicle includes: the sum of the operation speed corresponding to the second touch operation and the movement speed of the virtual vehicle.
[0133] The interactive control device in the aforementioned game first responds to a first touch operation on the interactive controls, controlling the movement of the controlled virtual object within the game scene and displaying a virtual vehicle in the graphical user interface; then, in response to the virtual vehicle moving onto the controlled virtual object, it controls the controlled virtual object to ride in the virtual vehicle and move along with it; finally, in response to a second touch operation on the interactive controls while the controlled virtual object is riding in the virtual vehicle, it controls the movement of the controlled virtual object within the virtual vehicle; wherein, the movement speed of the controlled virtual object within the virtual vehicle includes the sum of the operation speed corresponding to the second touch operation and the movement speed of the virtual vehicle. In this approach, when the controlled virtual object is riding in the virtual vehicle, the functionality of the original controls in the interface is retained, eliminating the need to design a dedicated operating system for the virtual vehicle, thus reducing development pressure, and allowing control of the movement and interaction of the controlled virtual object within the virtual vehicle through the existing controls.
[0134] Specifically, the vehicle riding module 61 is used to: obtain the trajectory posture of the virtual vehicle in the current frame and the absolute position of the controlled virtual object in the current frame; wherein, the trajectory posture is used to indicate the position and orientation of the virtual vehicle in the game scene; determine the relative position of the controlled virtual object based on the trajectory posture and the absolute position; determine the direction in which the controlled virtual object moves with the virtual vehicle based on the relative position and the trajectory posture of the virtual vehicle in the next frame; and determine the speed at which the controlled virtual object moves with the virtual vehicle based on the speed of the virtual vehicle and the direction in which the controlled virtual object moves with the virtual vehicle.
[0135] Furthermore, the aforementioned vehicle riding module 61 is also used to: multiply the relative position by the trajectory posture of the virtual vehicle in the next frame of the current frame to obtain the desired position of the controlled virtual object in the next frame; and determine the direction in which the controlled virtual object moves with the virtual vehicle based on the difference between the desired position and the relative position.
[0136] In its specific implementation, the game scene described above includes a virtual track on which the virtual vehicle moves. The device also includes a vehicle movement control module, used to: determine the trajectory posture of the virtual vehicle on the virtual track based on a preset track array; wherein the track array stores the trajectory posture of each trajectory point in the virtual track; the trajectory posture is used to indicate the position and orientation of the trajectory point; the trajectory point is a discrete point on the line of the virtual track; and control the virtual vehicle to move on the virtual track according to the trajectory posture of the virtual vehicle on the virtual track and a preset velocity vector.
[0137] Furthermore, the aforementioned vehicle movement control module is also used to: obtain the travel distance of the virtual vehicle to its current position on the virtual track; wherein the travel distance includes the track length traversed by the virtual vehicle from the starting point of the virtual track to its current position; determine the target trajectory point corresponding to the current position on the virtual track based on the travel distance; wherein the virtual track consists of multiple trajectory points; and determine the trajectory posture of the virtual vehicle at the current position based on the target trajectory point and the trajectory postures corresponding to each trajectory point stored in the track array.
[0138] In practical applications, the aforementioned virtual vehicle includes at least one virtual carriage; wherein, the trajectory attitude of the virtual vehicle is the trajectory attitude of the first virtual carriage in the virtual vehicle, and during the movement of the virtual vehicle, the carriage spacing between adjacent virtual carriages along the virtual track remains unchanged.
[0139] In practical implementation, as the virtual vehicle moves on the virtual track, the midpoints of the head and tail of each virtual carriage contained in the virtual vehicle are on the virtual track, and the direction of the line connecting the midpoint of the head and tail of the carriage is the orientation of the virtual carriage.
[0140] Furthermore, multiple parking stations and key nodes are set in the trajectory points of the virtual track; among them, key nodes are used to indicate the mileage and speed information of the virtual vehicle; the aforementioned vehicle control module is also used to: starting from the initial station of the virtual track, control the virtual vehicle to move to the next parking station of the initial station according to the trajectory attitude of the virtual vehicle on the virtual track and the mileage and speed information of the virtual vehicle indicated by the key nodes passed by the virtual vehicle; take the next parking station of the initial station as the new initial station, and continue to execute the steps of controlling the virtual vehicle to move to the next parking station of the initial station according to the trajectory attitude of the virtual vehicle on the virtual track and the mileage and speed information of the virtual vehicle indicated by the key nodes passed by the virtual vehicle, until the virtual vehicle moves to the last parking station or the initial station of the virtual track, and continues to move from the initial station.
[0141] In practical implementation, key nodes include acceleration nodes, constant speed nodes, and deceleration nodes. Among them, the acceleration node is the first parking station position where the virtual vehicle departs in the virtual track; the constant speed node is the first position in the virtual track plus the position corresponding to the distance the virtual vehicle travels from zero to the preset maximum speed; the deceleration node is the position of the parking station where the virtual vehicle arrives in the virtual track minus the distance the virtual vehicle travels from the maximum speed to zero. The virtual vehicle moves on the virtual track by switching between acceleration nodes, constant speed nodes, and deceleration nodes.
[0142] Furthermore, the aforementioned device also includes a data synchronization module, used to: determine at specified intervals whether the controlled virtual object is riding on a virtual vehicle; if so, package the absolute position information of the controlled virtual object and the relative position information between the controlled virtual object and the virtual vehicle to obtain a first synchronization packet, and upload the first synchronization packet to the game server, so that the game server sends the first synchronization packet to the slave devices corresponding to other virtual objects in the same game as the controlled virtual object, and the slave devices interpolate the game frames according to the first synchronization packet to obtain the game performance of the controlled virtual object on the slave device; if not, package the absolute position information of the controlled virtual object to obtain a second synchronization packet, and upload the second synchronization packet to the game server, so that the game server sends the second synchronization packet to the slave devices, and the slave devices interpolate the game frames according to the second synchronization packet to obtain the game performance of the controlled virtual object on the slave device.
[0143] In practical implementation, the aforementioned controlled virtual object's game performance on the slave device is as follows: final It is determined by the following formula:
[0144] pos final =pos abs1 *(f_max-c) / f_max+pos abs2 *c / f_max
[0145] Where, pos abs1 This represents the absolute position information in the first synchronization packet; pos abs2 The world coordinates are calculated from the relative position information in the first synchronization packet; f_max represents the total number of frames from when the controlled virtual object switches from not riding a virtual vehicle to riding a virtual vehicle, or the total number of frames from when the controlled virtual object rides a virtual vehicle to when it stops riding a virtual vehicle; c represents the frame count. When the controlled virtual object switches from not riding a virtual vehicle to riding a virtual vehicle, c gradually increases, with a minimum value of 0 and a maximum value of f_max; when the controlled virtual object switches from riding a virtual vehicle to not riding a virtual vehicle, c gradually decreases, with a maximum value of f_max and a minimum value of 0.
[0146] Furthermore, the aforementioned vehicle control module is also used to: after responding to a first touch operation on the interactive control, controlling the controlled virtual object to move in the game scene, and displaying the virtual vehicle in the graphical user interface, responding to a movement control operation on the virtual vehicle, and controlling the virtual vehicle to move in the game scene according to the movement control operation.
[0147] The interactive control device in the game provided in this embodiment of the invention has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.
[0148] This invention also provides an electronic device, such as... Figure 7 As shown, the electronic device includes a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor, which executes the machine-executable instructions to implement the interactive control method in the game described above.
[0149] Specifically, a graphical user interface (GUI) is provided via a terminal device; the GUI displays a portion of the game scene and interactive controls, and the game scene includes a controlled virtual object; the interactive control method in the game includes: responding to a first touch operation on the interactive controls, controlling the controlled virtual object to move in the game scene and displaying a virtual vehicle in the GUI; responding to the controlled virtual object moving onto the virtual vehicle, controlling the controlled virtual object to ride in the virtual vehicle and controlling the controlled virtual object to move with the virtual vehicle; responding to a second touch operation on the interactive controls when the controlled virtual object rides in the virtual vehicle, controlling the controlled virtual object to move in the virtual vehicle; wherein, the movement speed of the controlled virtual object in the virtual vehicle includes: the sum of the operation speed corresponding to the second touch operation and the movement speed of the virtual vehicle.
[0150] In the interactive control method of the above game, when the controlled virtual object rides the virtual vehicle, the functions of the original controls in the interface are retained. There is no need to design an operating system specifically for the virtual vehicle, which reduces the development pressure. The controllable virtual object can also be controlled to move and interact in the virtual vehicle through the original controls.
[0151] In an optional embodiment, the step of controlling the controlled virtual object to follow the movement of the virtual vehicle includes: obtaining the trajectory posture of the virtual vehicle in the current frame and the absolute position of the controlled virtual object in the current frame; wherein, the trajectory posture is used to indicate the position and orientation of the virtual vehicle in the game scene; determining the relative position of the controlled virtual object based on the trajectory posture and the absolute position; determining the direction in which the controlled virtual object follows the virtual vehicle based on the relative position and the trajectory posture of the virtual vehicle in the next frame; and determining the speed at which the controlled virtual object follows the virtual vehicle based on the movement speed of the virtual vehicle and the direction in which the controlled virtual object follows the virtual vehicle.
[0152] In an optional embodiment, the step of determining the direction of movement of the controlled virtual object following the virtual vehicle based on the relative position and the trajectory posture of the virtual vehicle in the next frame of the current frame includes: multiplying the relative position by the trajectory posture of the virtual vehicle in the next frame of the current frame to obtain the desired position of the controlled virtual object in the next frame; and determining the direction of movement of the controlled virtual object following the virtual vehicle based on the difference between the desired position and the relative position.
[0153] In an optional embodiment, a virtual track is provided in the game scene, and virtual vehicles move on the virtual track. The virtual vehicles move automatically in the game scene in the following way: the trajectory posture of the virtual vehicle on the virtual track is determined based on a preset track array; wherein, the track array stores the trajectory posture of each trajectory point in the virtual track; the trajectory posture is used to indicate the position and orientation of the trajectory point; the trajectory point is a discrete point on the line of the virtual track; the virtual vehicle is controlled to move on the virtual track according to the trajectory posture of the virtual vehicle on the virtual track and a preset velocity vector.
[0154] In an optional embodiment, the step of determining the trajectory attitude of the virtual vehicle on the virtual track based on a preset track array includes: obtaining the travel distance of the virtual vehicle to its current position on the virtual track; wherein the travel distance includes the track length traversed by the virtual vehicle from the starting point of the virtual track to the current position; determining the target trajectory point corresponding to the current position on the virtual track based on the travel distance; wherein the virtual track consists of multiple trajectory points; and determining the trajectory attitude of the virtual vehicle at the current position based on the target trajectory point and the trajectory attitudes corresponding to each trajectory point stored in the track array.
[0155] In an optional embodiment, the virtual vehicle includes at least one virtual carriage; wherein the trajectory attitude of the virtual vehicle is the trajectory attitude of the first virtual carriage in the virtual vehicle, and during the movement of the virtual vehicle, the carriage spacing between adjacent virtual carriages along the virtual track remains unchanged.
[0156] In an optional embodiment, as the virtual vehicle moves on the virtual track, the midpoints of the head and tail of each virtual carriage contained in the virtual vehicle are on the virtual track, and the direction of the line connecting the midpoint of the head and tail of the carriage is the orientation of the virtual carriage.
[0157] In an optional embodiment, multiple parking stations and key nodes are set in the trajectory points of the virtual track; wherein, the key nodes are used to indicate the mileage and speed information of the virtual vehicle; the above-mentioned step of controlling the virtual vehicle to move on the virtual track according to the trajectory attitude of the virtual vehicle on the virtual track and the preset speed vector includes: starting from the initial station of the virtual track, controlling the virtual vehicle to move to the next parking station of the initial station according to the trajectory attitude of the virtual vehicle on the virtual track and the mileage and speed information of the virtual vehicle indicated by the key nodes passed by the virtual vehicle; taking the next parking station of the initial station as the new initial station, continuing to execute the step of controlling the virtual vehicle to move to the next parking station of the initial station according to the trajectory attitude of the virtual vehicle on the virtual track and the mileage and speed information of the virtual vehicle indicated by the key nodes passed by the virtual vehicle, until the virtual vehicle moves to the last parking station or the initial station of the virtual track, and continues to move from the initial station.
[0158] In an optional embodiment, the aforementioned key nodes include acceleration nodes, constant speed nodes, and deceleration nodes; wherein, the acceleration node is the first position of the parking station from which the virtual vehicle departs in the virtual track; the constant speed node is the first position in the virtual track plus the position corresponding to the distance traveled by the virtual vehicle as it accelerates from zero to a preset maximum speed; the deceleration node is the position of the parking station reached by the virtual vehicle in the virtual track minus the distance traveled by the virtual vehicle as it decelerates from its maximum speed to zero; wherein, the virtual vehicle moves on the virtual track by switching between acceleration nodes, constant speed nodes, and deceleration nodes.
[0159] In an optional embodiment, the method further includes: determining at specified intervals whether the controlled virtual object is riding on a virtual vehicle; if so, packaging the absolute position information of the controlled virtual object and the relative position information between the controlled virtual object and the virtual vehicle to obtain a first synchronization packet, and uploading the first synchronization packet to the game server, so that the game server sends the first synchronization packet to the slave devices corresponding to other virtual objects in the same game as the controlled virtual object, and the slave devices interpolate the game frames according to the first synchronization packet to obtain the game performance of the controlled virtual object on the slave device; if not, packaging the absolute position information of the controlled virtual object to obtain a second synchronization packet, and uploading the second synchronization packet to the game server, so that the game server sends the second synchronization packet to the slave devices, and the slave devices interpolate the game frames according to the second synchronization packet to obtain the game performance of the controlled virtual object on the slave device.
[0160] In an optional embodiment, the game performance of the aforementioned controlled virtual object on the slave device is pos final It is determined by the following formula:
[0161] pos final =pos abs1 *(f_max-c) / f_max+pos abs2 *c / f_max
[0162] Where, pos abs1 This represents the absolute position information in the first synchronization packet; pos abs2 The world coordinates are calculated from the relative position information in the first synchronization packet; f_max represents the total number of frames from when the controlled virtual object switches from not riding a virtual vehicle to riding a virtual vehicle, or the total number of frames from when the controlled virtual object rides a virtual vehicle to when it stops riding a virtual vehicle; c represents the frame count. When the controlled virtual object switches from not riding a virtual vehicle to riding a virtual vehicle, c gradually increases, with a minimum value of 0 and a maximum value of f_max; when the controlled virtual object switches from riding a virtual vehicle to not riding a virtual vehicle, c gradually decreases, with a maximum value of f_max and a minimum value of 0.
[0163] In an optional embodiment, after the steps of responding to a first touch operation of an interactive control, controlling the controlled virtual object to move in the game scene, and displaying the virtual vehicle in the graphical user interface, the method further includes: responding to a movement control operation of the virtual vehicle, and controlling the virtual vehicle to move in the game scene according to the movement control operation.
[0164] Furthermore, Figure 7 The electronic device shown also includes a bus 102 and a communication interface 103, with the processor 101, the communication interface 103 and the memory 100 connected via the bus 102.
[0165] The memory 100 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 102 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0166] Processor 101 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 101 or by instructions in software form. Processor 101 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 100, and processor 101 reads information from memory 100 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.
[0167] This invention also provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are called and executed by a processor, they cause the processor to implement the interactive control method in the game described above. For specific implementation details, please refer to the method embodiments, which will not be repeated here.
[0168] Specifically, a graphical user interface (GUI) is provided via a terminal device; the GUI displays a portion of the game scene and interactive controls, and the game scene includes a controlled virtual object; the interactive control method in the game includes: responding to a first touch operation on the interactive controls, controlling the controlled virtual object to move in the game scene and displaying a virtual vehicle in the GUI; responding to the controlled virtual object moving onto the virtual vehicle, controlling the controlled virtual object to ride in the virtual vehicle and controlling the controlled virtual object to move with the virtual vehicle; responding to a second touch operation on the interactive controls when the controlled virtual object rides in the virtual vehicle, controlling the controlled virtual object to move in the virtual vehicle; wherein, the movement speed of the controlled virtual object in the virtual vehicle includes: the sum of the operation speed corresponding to the second touch operation and the movement speed of the virtual vehicle.
[0169] In the interactive control method of the above game, when the controlled virtual object rides the virtual vehicle, the functions of the original controls in the interface are retained. There is no need to design an operating system specifically for the virtual vehicle, which reduces the development pressure. The controllable virtual object can also be controlled to move and interact in the virtual vehicle through the original controls.
[0170] In an optional embodiment, the step of controlling the controlled virtual object to follow the movement of the virtual vehicle includes: obtaining the trajectory posture of the virtual vehicle in the current frame and the absolute position of the controlled virtual object in the current frame; wherein, the trajectory posture is used to indicate the position and orientation of the virtual vehicle in the game scene; determining the relative position of the controlled virtual object based on the trajectory posture and the absolute position; determining the direction in which the controlled virtual object follows the virtual vehicle based on the relative position and the trajectory posture of the virtual vehicle in the next frame; and determining the speed at which the controlled virtual object follows the virtual vehicle based on the movement speed of the virtual vehicle and the direction in which the controlled virtual object follows the virtual vehicle.
[0171] In an optional embodiment, the step of determining the direction of movement of the controlled virtual object following the virtual vehicle based on the relative position and the trajectory posture of the virtual vehicle in the next frame of the current frame includes: multiplying the relative position by the trajectory posture of the virtual vehicle in the next frame of the current frame to obtain the desired position of the controlled virtual object in the next frame; and determining the direction of movement of the controlled virtual object following the virtual vehicle based on the difference between the desired position and the relative position.
[0172] In an optional embodiment, a virtual track is provided in the game scene, and virtual vehicles move on the virtual track. The virtual vehicles move automatically in the game scene in the following way: the trajectory posture of the virtual vehicle on the virtual track is determined based on a preset track array; wherein, the track array stores the trajectory posture of each trajectory point in the virtual track; the trajectory posture is used to indicate the position and orientation of the trajectory point; the trajectory point is a discrete point on the line of the virtual track; the virtual vehicle is controlled to move on the virtual track according to the trajectory posture of the virtual vehicle on the virtual track and a preset velocity vector.
[0173] In an optional embodiment, the step of determining the trajectory attitude of the virtual vehicle on the virtual track based on a preset track array includes: obtaining the travel distance of the virtual vehicle to its current position on the virtual track; wherein the travel distance includes the track length traversed by the virtual vehicle from the starting point of the virtual track to the current position; determining the target trajectory point corresponding to the current position on the virtual track based on the travel distance; wherein the virtual track consists of multiple trajectory points; and determining the trajectory attitude of the virtual vehicle at the current position based on the target trajectory point and the trajectory attitudes corresponding to each trajectory point stored in the track array.
[0174] In an optional embodiment, the virtual vehicle includes at least one virtual carriage; wherein the trajectory attitude of the virtual vehicle is the trajectory attitude of the first virtual carriage in the virtual vehicle, and during the movement of the virtual vehicle, the carriage spacing between adjacent virtual carriages along the virtual track remains unchanged.
[0175] In an optional embodiment, as the virtual vehicle moves on the virtual track, the midpoints of the head and tail of each virtual carriage contained in the virtual vehicle are on the virtual track, and the direction of the line connecting the midpoint of the head and tail of the carriage is the orientation of the virtual carriage.
[0176] In an optional embodiment, multiple parking stations and key nodes are set in the trajectory points of the virtual track; wherein, the key nodes are used to indicate the mileage and speed information of the virtual vehicle; the above-mentioned step of controlling the virtual vehicle to move on the virtual track according to the trajectory attitude of the virtual vehicle on the virtual track and the preset speed vector includes: starting from the initial station of the virtual track, controlling the virtual vehicle to move to the next parking station of the initial station according to the trajectory attitude of the virtual vehicle on the virtual track and the mileage and speed information of the virtual vehicle indicated by the key nodes passed by the virtual vehicle; taking the next parking station of the initial station as the new initial station, continuing to execute the step of controlling the virtual vehicle to move to the next parking station of the initial station according to the trajectory attitude of the virtual vehicle on the virtual track and the mileage and speed information of the virtual vehicle indicated by the key nodes passed by the virtual vehicle, until the virtual vehicle moves to the last parking station or the initial station of the virtual track, and continues to move from the initial station.
[0177] In an optional embodiment, the aforementioned key nodes include acceleration nodes, constant speed nodes, and deceleration nodes; wherein, the acceleration node is the first position of the parking station from which the virtual vehicle departs in the virtual track; the constant speed node is the first position in the virtual track plus the position corresponding to the distance traveled by the virtual vehicle as it accelerates from zero to a preset maximum speed; the deceleration node is the position of the parking station reached by the virtual vehicle in the virtual track minus the distance traveled by the virtual vehicle as it decelerates from its maximum speed to zero; wherein, the virtual vehicle moves on the virtual track by switching between acceleration nodes, constant speed nodes, and deceleration nodes.
[0178] In an optional embodiment, the method further includes: determining at specified intervals whether the controlled virtual object is riding on a virtual vehicle; if so, packaging the absolute position information of the controlled virtual object and the relative position information between the controlled virtual object and the virtual vehicle to obtain a first synchronization packet, and uploading the first synchronization packet to the game server, so that the game server sends the first synchronization packet to the slave devices corresponding to other virtual objects in the same game as the controlled virtual object, and the slave devices interpolate the game frames according to the first synchronization packet to obtain the game performance of the controlled virtual object on the slave device; if not, packaging the absolute position information of the controlled virtual object to obtain a second synchronization packet, and uploading the second synchronization packet to the game server, so that the game server sends the second synchronization packet to the slave devices, and the slave devices interpolate the game frames according to the second synchronization packet to obtain the game performance of the controlled virtual object on the slave device.
[0179] In an optional embodiment, the game performance of the aforementioned controlled virtual object on the slave device is pos final It is determined by the following formula:
[0180] pos final =pos abs1 *(f_max-c) / f_max+pos abs2 *c / f_max
[0181] Where, pos abs1 This represents the absolute position information in the first synchronization packet; pos abs2 The world coordinates are calculated from the relative position information in the first synchronization packet; f_max represents the total number of frames from when the controlled virtual object switches from not riding a virtual vehicle to riding a virtual vehicle, or the total number of frames from when the controlled virtual object rides a virtual vehicle to when it stops riding a virtual vehicle; c represents the frame count. When the controlled virtual object switches from not riding a virtual vehicle to riding a virtual vehicle, c gradually increases, with a minimum value of 0 and a maximum value of f_max; when the controlled virtual object switches from riding a virtual vehicle to not riding a virtual vehicle, c gradually decreases, with a maximum value of f_max and a minimum value of 0.
[0182] In an optional embodiment, after the steps of responding to a first touch operation of an interactive control, controlling the controlled virtual object to move in the game scene, and displaying the virtual vehicle in the graphical user interface, the method further includes: responding to a movement control operation of the virtual vehicle, and controlling the virtual vehicle to move in the game scene according to the movement control operation.
[0183] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal device, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0184] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0185] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. An interactive control method in a game, characterized in that, A graphical user interface is provided through the terminal device; The graphical user interface displays a portion of the game scene and interactive controls, and the game scene includes controlled virtual objects; the method includes: In response to a first touch operation on the interactive control, the controlled virtual object is controlled to move in the game scene, and a virtual vehicle is displayed in the graphical user interface; At specified intervals, it is determined whether the controlled virtual object has moved onto the virtual vehicle. In response to the controlled virtual object moving onto the virtual vehicle, the controlled virtual object is controlled to ride on the virtual vehicle and to follow the virtual vehicle. In response to the controlled virtual object riding the virtual vehicle, the controlled virtual object is controlled to move in the virtual vehicle in response to a second touch operation of the interactive control; wherein, the moving speed of the controlled virtual object in the virtual vehicle includes: the sum of the operation speed corresponding to the second touch operation and the moving speed of the virtual vehicle.
2. The method of claim 1, wherein, The step of controlling the controlled virtual object to follow the movement of the virtual vehicle includes: The trajectory and attitude of the virtual vehicle in the current frame and the absolute position of the controlled virtual object in the current frame are obtained; wherein, the trajectory and attitude are used to indicate the position and orientation of the virtual vehicle in the game scene; The relative position of the controlled virtual object to the controlled virtual object is determined based on the trajectory posture and the absolute position; Based on the relative position and the trajectory posture of the virtual vehicle in the next frame of the current frame, the direction in which the controlled virtual object follows the movement of the virtual vehicle is determined; The speed at which the controlled virtual object follows the virtual vehicle is determined based on the moving speed of the virtual vehicle and the direction in which the controlled virtual object follows the moving virtual vehicle.
3. The method of claim 2, wherein, The step of determining the direction in which the controlled virtual object follows the virtual vehicle's movement based on the relative position and the trajectory posture of the virtual vehicle in the next frame of the current frame includes: The relative position is multiplied by the trajectory and attitude of the virtual vehicle in the next frame of the current frame to obtain the desired position of the controlled virtual object in the next frame. The direction in which the controlled virtual object moves following the virtual vehicle is determined based on the difference between the desired position and the relative position.
4. The method of claim 1, wherein, The game scene is equipped with a virtual track, and the virtual vehicle moves on the virtual track. The virtual vehicle moves automatically within the game scene in the following manner: Based on a preset track array, the trajectory posture of the virtual vehicle on the virtual track is determined; wherein, the track array stores the trajectory posture of each trajectory point in the virtual track; the trajectory posture is used to indicate the position and orientation of the trajectory point; the trajectory point is a discrete point on the line of the virtual track; The virtual vehicle is controlled to move on the virtual track based on its trajectory and attitude on the virtual track and a preset velocity vector.
5. The method of claim 4, wherein, The step of determining the trajectory attitude of the virtual vehicle on the virtual track based on a preset track array includes: Obtain the travel distance of the virtual vehicle to its current position on the virtual track; wherein, the travel distance includes: the track length traversed by the virtual vehicle from the starting point of the virtual track to the current position; Based on the travel distance, the target trajectory point corresponding to the current position in the virtual track is determined; wherein, the virtual track consists of multiple trajectory points; Based on the target trajectory point and the trajectory attitude corresponding to each trajectory point stored in the trajectory array, the trajectory attitude of the virtual vehicle at the current position is determined.
6. The method of claim 4, wherein, The virtual vehicle includes at least one virtual carriage; wherein the trajectory attitude of the virtual vehicle is the trajectory attitude of the first virtual carriage in the virtual vehicle, and during the movement of the virtual vehicle, the carriage spacing between adjacent virtual carriages in the virtual vehicle along the virtual track remains unchanged.
7. The method of claim 6, wherein, As the virtual vehicle moves on the virtual track, the midpoints of the head and tail of each virtual carriage contained in the virtual vehicle are on the virtual track, and the direction of the line connecting the midpoint of the head and tail of the carriage is the orientation of the virtual carriage.
8. The method of claim 4, wherein, Multiple parking stations and key nodes are set in the trajectory points of the virtual track; wherein, the key nodes are used to indicate the mileage and speed information of the virtual vehicle; The step of controlling the virtual vehicle to move on the virtual track based on the trajectory attitude of the virtual vehicle on the virtual track and a preset velocity vector includes: Starting from the initial station of the virtual track, based on the trajectory and attitude of the virtual vehicle on the virtual track and the mileage and speed information of the virtual vehicle indicated by the key nodes passed by the virtual vehicle, the virtual vehicle is controlled to move to the next parking station of the initial station. The next parking station of the initial station is taken as the new initial station. The process continues from the initial station of the virtual track, and the virtual vehicle is controlled to move to the next parking station of the initial station based on the trajectory attitude of the virtual vehicle on the virtual track and the mileage and speed information of the virtual vehicle indicated by the key nodes passed by the virtual vehicle. This process continues until the virtual vehicle moves to the last parking station of the virtual track or the initial station, and then continues to move from the initial station.
9. The method of claim 8, wherein, The key nodes include acceleration nodes, constant speed nodes, and deceleration nodes; wherein, the acceleration node is the first position of the parking station from which the virtual vehicle departs in the virtual track; the constant speed node is the first position in the virtual track plus the position corresponding to the distance traveled by the virtual vehicle as it accelerates from zero to a preset maximum speed; the deceleration node is the position of the parking station reached by the virtual vehicle in the virtual track minus the position corresponding to the distance traveled by the virtual vehicle as it decelerates from its maximum speed to zero; The virtual vehicle moves on the virtual track by switching between acceleration nodes, constant speed nodes, and deceleration nodes.
10. The method of claim 1, wherein, The method further includes: At specified intervals, determine whether the controlled virtual object is riding on the virtual vehicle; If so, the absolute position information of the controlled virtual object and the relative position information between the controlled virtual object and the virtual vehicle are packaged to obtain a first synchronization packet, and the first synchronization packet is uploaded to the game server so that the game server sends the first synchronization packet to the slave devices corresponding to other virtual objects in the same game as the controlled virtual object. The slave devices interpolate the game frames according to the first synchronization packet to obtain the game performance of the controlled virtual object on the slave device. If not, the absolute position information of the controlled virtual object is packaged to obtain a second synchronization packet, and the second synchronization packet is uploaded to the game server so that the game server sends the second synchronization packet to the slave device. The slave device interpolates the game frames according to the second synchronization packet to obtain the game performance of the controlled virtual object on the slave device.
11. The method of claim 10, wherein, game performance of the controlled virtual object on the slave device is determined by the following equation: in, This represents the absolute position information in the first synchronization packet; This represents the world coordinates calculated from the relative position information in the first synchronization packet; This represents the total number of frames the controlled virtual object switches from not riding the virtual vehicle to riding the virtual vehicle, or the total number of frames the controlled virtual object goes from riding the virtual vehicle to not riding the virtual vehicle. This indicates the frame count when the controlled virtual object switches from not riding the virtual vehicle to riding the virtual vehicle. It starts to gradually increase, with a minimum value of 0 and a maximum increase to... When the controlled virtual object switches from riding in the virtual vehicle to not riding in the virtual vehicle, It begins to gradually decrease, and the maximum value of c is... The value decreases to a minimum of 0.
12. The method of claim 1, wherein, After the steps of responding to a first touch operation of the interactive control, controlling the controlled virtual object to move in the game scene, and displaying the virtual vehicle in the graphical user interface, the method further includes: In response to a movement control operation on the virtual vehicle, the virtual vehicle is controlled to move within the game scene according to the movement control operation.
13. An interactive control device in a game, characterized by A graphical user interface is provided through the terminal device; The graphical user interface displays a portion of the game scene and interactive controls, and the game scene includes controlled virtual objects; the device includes: The first movement control module is used to respond to a first touch operation on the interactive control, control the controlled virtual object to move in the game scene, and display the virtual vehicle in the graphical user interface; The vehicle riding module is used to determine at specified intervals whether the controlled virtual object has moved onto the virtual vehicle, and in response to the controlled virtual object moving onto the virtual vehicle, control the controlled virtual object to ride the virtual vehicle and control the controlled virtual object to follow the virtual vehicle. The second movement control module is used to control the controlled virtual object to move in the virtual vehicle in response to a second touch operation of the interactive control when the controlled virtual object rides the virtual vehicle; wherein the movement speed of the controlled virtual object in the virtual vehicle includes the sum of the operation speed corresponding to the second touch operation and the movement speed of the virtual vehicle.
14. An electronic device, comprising: The electronic device includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the interactive control method in the game according to any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the interactive control method in the game as described in any one of claims 1 to 12.