Virtual object control method and device, equipment, medium and program product

By establishing a loading interactive relationship in a virtual scene and using local navigation maps and relative coordinates to control virtual objects, the problem of high computing overhead for collision detection between virtual characters and loading elements is solved, and a more efficient virtual object movement and synchronization effect is achieved.

CN120298634APending Publication Date: 2025-07-11TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410035390.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-09
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

In a virtual scene, the overhead of collision detection between virtual characters and mounted elements is too high by constructing an octree, resulting in excessive burden on computer equipment and difficult to support real-time movement.

Method used

By establishing the loading interaction between the virtual object and the mounted element, obtain the local navigation map of the mounted element, use the local navigation map and relative coordinates to control the movement of the virtual object, reduce the calculation overhead, and ensure that the virtual object moves synchronously with the mounted element.

Benefits of technology

It reduces computing resource consumption, improves the smoothness and synchronization of virtual objects moving on the surface of the mounted elements, and reduces the problem of positional out-of-synchronization between the server and the terminal.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120298634A_ABST
    Figure CN120298634A_ABST
Patent Text Reader

Abstract

The invention discloses a virtual object control method and device, equipment, a medium and a program product, and relates to the technical field of computers, and the method comprises the following steps: displaying a first carrying element and a first virtual object in a virtual scene, the first carrying element being composed of a plurality of voxel blocks; receiving a carrying control operation for the first virtual object; under the condition that a carrying interaction relationship exists between the first virtual object and the first carrying element, acquiring a local navigation map corresponding to the first carrying element; and in response to a received first movement control operation for the first virtual object, acquiring a relative coordinate between the first virtual object and the first carrying element based on the local navigation map, and controlling the first virtual object based on the relative coordinate. The virtual object can be controlled based on the relative coordinate between the virtual object and the carrying element, and the calculation consumption is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the field of computer technology, and in particular, to a method, apparatus, device, medium, and program product for controlling virtual objects. Background Art

[0002] A voxel is the smallest unit of three-dimensional space segmentation, used to describe three-dimensional solid objects. In some applications based on virtual scenes, virtual elements in the virtual scene can be composed of multiple voxels, and expressing virtual elements through multiple voxels is called collision, such as virtual vehicles, virtual buildings, the ground of virtual scenes, etc.

[0003] In applications with voxel collision as the background, generally, by constructing the collision of virtual elements, the height at which a virtual character can walk during movement is provided based on the height data of each voxel, so that the virtual character moves along the surface of the virtual element. In related technologies, octrees are constructed to achieve low-frequency dynamic collisions.

[0004] However, during the process of a virtual object moving in real time following a virtual element, if an octree is constructed for collision in each frame, the computational cost is too high, imposing a burden on computer devices. Summary of the Invention

[0005] Embodiments of the present application provide a method, apparatus, device, medium, and program product for controlling virtual objects, which can control virtual objects based on the relative coordinates between the virtual objects and the carrying elements, reducing computational consumption. The technical solution is as follows:

[0006] On the one hand, a method for controlling a virtual object is provided, and the method includes:

[0007] Display a first carrying element and a first virtual object in a virtual scene, where the first carrying element is composed of multiple voxel blocks;

[0008] Receive a carrying control operation for the first virtual object, where the carrying control operation is used to control the first virtual object to form a carrying interaction relationship with the first carrying element;

[0009] When there is the carrying interaction relationship between the first virtual object and the first carrying element, obtain a local navigation map corresponding to the first carrying element, where the local navigation map is a map coordinate system constructed based on the voxel block data of the first carrying element;

[0010] In response to receiving a first movement control operation for the first virtual object, obtain the relative coordinates between the first virtual object and the first carrying element based on the local navigation map, and control the first virtual object based on the relative coordinates.

[0011] On the other hand, a control device for virtual objects is provided, and the device includes:

[0012] A display module for displaying a first carrying element and a first virtual object in a virtual scene, where the first carrying element is composed of a plurality of voxel blocks;

[0013] A control module for receiving a carrying control operation for the first virtual object, where the carrying control operation is used to control the first virtual object to form a carrying interaction relationship with the first carrying element;

[0014] An acquisition module for acquiring a local navigation map corresponding to the first carrying element when there is the carrying interaction relationship between the first virtual object and the first carrying element, where the local navigation map is a map coordinate system constructed based on the voxel block data of the first carrying element;

[0015] The acquisition module is further configured to, in response to receiving a first movement control operation for the first virtual object, acquire a relative coordinate between the first virtual object and the first carrying element based on the local navigation map, and control the first virtual object based on the relative coordinate.

[0016] On the other hand, a computer device is provided, where the computer device includes a processor and a memory, and at least one instruction, at least one program, a code set or an instruction set is stored in the memory, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the control method for virtual objects as described in any one of the embodiments of the present application above.

[0017] On the other hand, a computer-readable storage medium is provided, and at least one instruction, at least one program, a code set or an instruction set is stored in the storage medium, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the control method for virtual objects as described in any one of the embodiments of the present application above.

[0018] On the other hand, a computer program product or a computer program is provided, and the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the control method for virtual objects as described in any one of the above embodiments.

[0019] The beneficial effects brought by the technical solutions provided in the embodiments of the present application at least include:

[0020] By establishing the mounting interaction relationship between the virtual object and the mounted element, the virtual object can obtain the local navigation map of the mounted element. The local navigation map provides the movable height and path for the movement of the virtual character on the mounted element, enabling the virtual character to move on the mounted element while conforming to the surface of the mounted element. Compared with the method of constructing the collision of the mounted element for each frame to determine the movable height of the mounted element, it can reduce the computational overhead and save computing resources. Based on the local navigation map, the relative coordinates between the virtual object and the mounted element are determined, and the virtual object is controlled through the relative coordinates, which can keep the relative positions of the virtual object and the mounted element consistent. When the mounted element moves, the virtual object and the mounted element move synchronously. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0022] Figure 1 It is a schematic diagram of a server-side three-dimensional engine architecture based on voxel collision provided by an exemplary embodiment of the present application;

[0023] Figure 2 It is a schematic diagram of multi-layer collision provided by an exemplary embodiment of the present application;

[0024] Figure 3 It is a structural block diagram of an electronic device provided by an exemplary embodiment of the present application;

[0025] Figure 4 It is a structural block diagram of a computer system provided by an exemplary embodiment of the present application;

[0026] Figure 5 It is a flowchart of a control method for a virtual object provided by an exemplary embodiment of the present application;

[0027] Figure 6 It is a schematic diagram of the corresponding relationship between the mounted element and its own collision provided by an exemplary embodiment of the present application;

[0028] Figure 7 It is a schematic diagram of a first trigger area provided by an exemplary embodiment of the present application;

[0029] Figure 8 It is a schematic diagram of the structure for realizing the movement of the collision position provided by an exemplary embodiment of the present application;

[0030] Figure 9It is a flowchart of a method for a first carrying element provided by an exemplary embodiment of the present application to carry a first virtual object and move it;

[0031] Figure 10 It is a schematic diagram of inertia during the movement of a first virtual character following a first carrying element provided by an exemplary embodiment of the present application;

[0032] Figure 11 It is a schematic diagram of inertia during the movement of a first virtual character following a first carrying element provided by another exemplary embodiment of the present application;

[0033] Figure 12 It is a flowchart of a method for determining the carrying interaction relationship of a first virtual object provided by an exemplary embodiment of the present application;

[0034] Figure 13 It is a schematic diagram of the management process of static optimization provided by an exemplary embodiment of the present application;

[0035] Figure 14 It is a structural block diagram of a control device for a virtual object provided by an exemplary embodiment of the present application;

[0036] Figure 15 It is a structural block diagram of a control device for a virtual object provided by another exemplary embodiment of the present application;

[0037] Figure 16 It is a structural block diagram of a computer device provided by an exemplary embodiment of the present application. Detailed implementation manners

[0038] To make the objectives, technical solutions, and advantages of the present application clearer, the following will further describe the embodiments of the present application in detail with reference to the accompanying drawings.

[0039] Here, the exemplary embodiments will be described in detail, and the examples are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0040] The terms used in the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. The singular forms of "a", "the", and "said" used in the present application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

[0041] It should be noted that the information involved in this application (including but not limited to virtual objects, mounting elements, local navigation maps of mounting elements, etc. in the virtual scene), data (including but not limited to voxel data of mounting elements, moving height and moving path indicated by the local navigation map, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0042] It should be understood that although the terms first, second, etc. may be used in this application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this application, the first parameter may also be referred to as the second parameter, and similarly, the second parameter may also be referred to as the first parameter. Depending on the context, the word "if" as used herein may be interpreted as "when" or "while" or "in response to a determination".

[0043] First, a brief introduction to the nouns involved in the embodiments of this application:

[0044] Voxel (Volum Pixel, Voxel): The concept of voxel is derived from the smallest unit pixel in two-dimensional space. Pixel is used to describe two-dimensional images and is the smallest unit in two-dimensional space. While voxel can be used to describe three-dimensional solid objects and is the smallest unit in three-dimensional space segmentation.

[0045] In some applications based on virtual scenes, virtual elements in the virtual scene can be composed of multiple voxels. Expressing a virtual element through multiple voxels is called collision. Each virtual element can have its own corresponding collision, and the collisions of virtual elements have the same shape as the virtual elements themselves.

[0046] The implementation of the voxel collision method is usually simpler than physical collision simulation. In the voxel collision method, it only needs to check whether the voxels are in the same space to determine whether a collision occurs. While in physical collision simulation, it may be necessary to calculate complex physical properties such as the shape, speed, rotation of the object.

[0047] Collision can describe the shape, height, etc. of virtual elements. In applications based on virtual scenes, if a virtual character expects to move on a virtual element, a feasible walking height can be provided for the virtual character during movement by constructing a collision, so that the virtual character can move along the surface of the virtual element.

[0048] Navigation Mesh (NavMesh): It is a data structure used to describe the walkable surfaces in the game world and allows finding paths from one walkable position to another in the game world. This data structure is automatically built or baked from the level geometry. NavMesh is a pathfinding system through which simple pathfinding can be made. For example, an effect can be made where clicking on a certain position makes the character automatically avoid obstacles and walk to the target point, or an enemy AI (Artificial Intelligence) can be made so that the enemy AI can avoid obstacles through the NavMesh and pursue our units. Even portals, starting and landing points for jumps can be set in the NavMesh, allowing these effects to also participate in the pathfinding calculation and successfully calculating shortcuts for navigation.

[0049] Octree: An octree is a space partitioning data structure used for efficient storage and query of objects in three-dimensional space. It is an extension of the binary tree, dividing the three-dimensional space into eight equally sized sub-cubes (eight child nodes), and each child node can be further divided into eight child nodes, and so on. Octrees have wide applications in many fields, especially in computer graphics, collision detection, and spatial indexing. It can effectively manage objects in three-dimensional space, improving query efficiency and space utilization. In voxel-based game applications, collisions can be constructed through octrees to achieve low-frequency dynamic collision management.

[0050] In game applications or some virtual-scene-based applications, players can usually control virtual characters in the virtual scene to move and interact with each other. The virtual scene also includes vehicle elements, such as movable virtual vehicles, virtual buildings, etc. Players can also control the virtual characters to form vehicle interaction relationships with the vehicle elements in the virtual scene, enabling the virtual characters to move together with the vehicle elements or move on the surface of the vehicle elements.

[0051] In some three-dimensional virtual-scene-based applications, there are a large number of virtual characters, and the server must calculate the positions and states of all virtual characters in the virtual scene almost in real time. Therefore, the application can choose to discretely describe the three-dimensional virtual scene in units of voxels. Voxels themselves are normalized and do not require floating-point operations, avoiding the bottleneck of the server's CPU (Central Processing Unit) floating-point operation ability. By reasonably setting the precision range (the size of the Voxel), the server's calculation frequency can be greatly reduced, the calculation pressure can be reduced, and good C / S synchronization (client and server synchronization) can be maintained at the same time.

[0052] Schematic, such as Figure 1 shown Figure 1 is a schematic diagram of a server-side three-dimensional engine architecture based on voxel collision.

[0053] The three-dimensional scene engine data management module 101 provides the following basic functions: collision verification, scene data access, scene data management, motion calculation engine, layer (Layer patch) data management, dynamic occlusion data management, Grid mask (a data enhancement method) data management, Voxel data management, etc., and provides services to the upper layer. The movement module 102 provides the following movement models: walking, light kung fu, dragging, etc. The business logic layer 103 is responsible for the top-level logic of players, NPCs (Non-Player Characters), etc. in the game, including: AI movement, player movement, skill displacement, etc.

[0054] The elements carried in the virtual scene described by voxels are called collisions. By constructing the collisions of the carried elements, based on the height data of each voxel, the height at which a virtual character can walk during movement is provided, enabling the virtual character to move along the surface of the vehicle element. In related technologies, low-frequency dynamic collisions are achieved by constructing an octree. When a virtual character enters a vehicle element, it moves along the surface of the vehicle element based on the walkable height provided by the collision.

[0055] To cooperate with the server, the terminal selects the same multi-layer Voxel collision as the server. Taking virtual buildings as an example, a virtual character can jump onto the roof of a virtual building or enter the room of a virtual building.

[0056] Schematic, such as Figure 2 shown Figure 2 is a schematic diagram of a multi-layer collision.

[0057] Figure 2 contains two layers of collisions, both of which are used to represent virtual buildings in the virtual scene. Among them, the 0th layer of collision 201 represents the room of the virtual building that a virtual character can enter, and the 1st layer of collision 202 is above the 0th layer of collision 201, representing the roof of the virtual building that a virtual character can jump onto.

[0058] However, when a virtual character is on a vehicle element that is in a moving state, if the terminal reconstructs the octree every frame to obtain the collision of the vehicle element, the overhead is huge. Therefore, the collision of the vehicle element cannot support real-time movement.

[0059] In an application with voxel collision as the background, how to save computing resources while ensuring that a virtual character moves along the surface of a vehicle element is an urgent problem to be solved.

[0060] The present application provides a method for controlling a virtual character, which can save computing resources while enabling the virtual character to move along the surface of a vehicle element in a game application with voxel collision as the background.

[0061] By detecting the carrying interaction relationship between the virtual object and the carrying element through the trigger area on the carrying element, when a collision occurs between the trigger area and the virtual object, a carrying interaction relationship between the virtual object and the carrying element is established, and it is possible to determine in real time whether the virtual object enters the carrying element, reducing the computational complexity of the server and the terminal.

[0062] When a carrying interaction relationship is established between the virtual object and the carrying element, a local navigation map of the carrying element can be obtained based on the voxel collision of the carrying element. The local navigation map provides the movable height and path for the virtual character to move on the carrying element. When the virtual character is located on the carrying element, the virtual object is controlled through the relative coordinates between the virtual character and the carrying element, so that the virtual character fits the surface of the carrying element when moving on the carrying element. Moreover, relying on the relative coordinates to control the virtual character can keep the relative positions of the virtual object and the carrying element consistent, solving the problem of possible screen asynchronization between the server and the terminal due to different refresh frequencies. When the carrying element moves, the virtual object and the carrying element move synchronously. Compared with the method of constructing the collision of the carrying element for each frame to determine the movable height of the carrying element, the computational overhead can be reduced and computing resources can be saved.

[0063] The terminal in the present application can be a desktop computer, a laptop computer, a mobile phone, a tablet computer, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III) player, an MP4 (Moving Picture Experts Group Audio Layer IV) player, and so on. An application program that supports a virtual scene is installed and run on the terminal, such as an application program that supports a three-dimensional virtual scene. The application program can be any one of a virtual reality application program, a three-dimensional map program, a simulation game (SLG), and a multiplayer online battle arena game (MOBA). Optionally, the application program can be a stand-alone version of the application program, such as a stand-alone three-dimensional game program, or a network online version of the application program.

[0064] Figure 3The block diagram of an electronic device provided by an exemplary embodiment of the present application is shown. The electronic device 300 includes: an operating system 320 and an application program 322.

[0065] The operating system 320 is basic software that provides secure access to computer hardware for the application program 322.

[0066] The application program 322 is an application program that supports virtual scenarios. Optionally, the application program 322 is an application program that supports three-dimensional virtual scenarios. The application program 322 can be any one of a virtual reality application program, a three-dimensional map program, a TPS game (Third-Person Shooter), an FPS game (First-Person Shooter), a MOBA game, and an SLG game. The application program 322 can be a stand-alone version of the application program, such as a stand-alone three-dimensional game program, or a network online version of the application program.

[0067] Figure 4 The block diagram of a computer system provided by an exemplary embodiment of the present application is shown. The computer system 400 includes: a first device 420, a server 440, and a second device 460.

[0068] The first device 420 installs and runs an application program that supports virtual scenarios. The application program can be any one of a virtual reality application program, a three-dimensional map program, a TPS game, an FPS game, a MOBA game, and an SLG game. The first device 420 is a device used by a first user. The first user uses the first device 420 to control a main control virtual object located in the virtual scenario to perform activities, and the activities include but are not limited to at least one of adjusting body posture, walking, running, and jumping attacks. Schematically, the main control virtual object is a main control virtual character, such as a simulated character or an anime character.

[0069] The first device 420 is connected to the server 440 through a wireless network or a wired network.

[0070] The server 440 includes at least one of a server, multiple servers, a cloud computing platform, and a virtualization center. The server 440 is used to provide background services for the application program that supports three-dimensional virtual scenarios. Optionally, the server 440 undertakes the main computing work, and the first device 420 and the second device 460 undertake the secondary computing work; or, the server 440 undertakes the secondary computing work, and the first device 420 and the second device 460 undertake the main computing work; or, the server 440, the first device 420, and the second device 460 adopt a distributed computing architecture for collaborative computing.

[0071] The second device 460 is installed with and runs an application that supports virtual scenarios. The application can be any one of a virtual reality application, a 3D map program, a first-person shooter (FPS) game, a multiplayer online battle arena (MOBA) game, or a strategy (SLG) game. The second device 460 is a device used by a second user. The second user uses the second device 460 to control other virtual objects located in the virtual scenario to perform activities, which include but are not limited to at least one of adjusting body posture, walking, running, and jumping attacks. Schematically, the other virtual objects are other virtual characters, such as simulated human characters or anime characters.

[0072] Optionally, the master virtual character and other virtual characters are in the same virtual scenario. Optionally, the master virtual character and other virtual characters can belong to the same team, the same organization, have a friendship relationship, or have temporary communication permissions. Optionally, the master virtual character and other virtual characters can also belong to different teams, different organizations, or two groups with hostility.

[0073] Optionally, the applications installed on the first device 420 and the second device 460 are the same, or the applications installed on the two devices are of the same type but on different control system platforms. The first device 420 can generally refer to one of multiple devices, and the second device 460 can generally refer to one of multiple devices. This embodiment only uses the first device 420 and the second device 460 as examples for illustration. The device types of the first device 420 and the second device 460 can be the same or different. The following embodiments use a desktop computer as an example for illustration.

[0074] Those skilled in the art can know that the number of the above devices can be more or less. For example, the above devices can be only one, or there can be dozens or hundreds of the above devices, or even more. The embodiments of the present application do not limit the number and device types of the devices.

[0075] It should be noted that the above-mentioned server 440 can be implemented as a physical server or a cloud server in the cloud. Among them, cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or a local area network to realize data calculation, storage, processing, and sharing. Cloud technology is the general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, be used on demand, and is flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites, and more portal websites. With the highly developed application of the Internet industry, in the future, each item may have its own identification mark and needs to be transmitted to the background system for logical processing. Data at different levels will be processed separately, and various types of industry data require a powerful system backup support, which can only be achieved through cloud computing. Optionally, when the server 440 is implemented as a cloud server, the program corresponding to the above virtual scenario can be a cloud game.

[0076] In some embodiments, the method provided in the embodiments of the present application can be applied to a cloud game scenario, so as to complete the calculation of data logic during the game process through a cloud server, and the terminal is responsible for the display of the game interface.

[0077] Optionally, the above-mentioned server 440 can also be implemented as a node in a blockchain system.

[0078] Combined with the above noun introduction and application scenarios, the control method of the virtual object provided in the present application is described. This method can be executed by a server or a terminal, or jointly executed by a server and a terminal. In the embodiments of the present application, this method is described by taking the execution by the terminal as an example, as Figure 5 shown, Figure 5 is a flowchart of the control method of the virtual object provided by an exemplary embodiment of the present application. The method includes the following steps.

[0079] Step 510, display the first carrying element and the first virtual object in the virtual scene.

[0080] Among them, the first carrying element is composed of multiple voxel blocks.

[0081] In order to realize the voxelization of the carrying element in the virtual scene, the model of the carrying element is composed of multiple voxel blocks, and the voxel block is a three-dimensional small cube with the same specification as the voxel.

[0082] When constructing the model of the carrying element, the above-mentioned voxel-close method is adopted, which is convenient for generating collisions of the carrying element in the virtual scene and other elements that require collision construction.

[0083] Among them, the first mounting element is one of the mounting elements in the virtual scene.

[0084] Among them, each mounting element in the virtual scene is configured with an exclusive collision detection mechanism.

[0085] Optionally, the collision descriptions of the mounting elements can be divided into the following two types: (1) Simple cube shapes. For example, when the mounting element is a stone slab or an elevator, its appearance is a simple three-dimensional object such as a cuboid or a cube. (2) Complex collisions based on voxel files. For example, when the mounting element is an airship, a ship, or furniture, its appearance is more complex and has more height details.

[0086] For the second type of collision, the voxel file of the mounting element can be generated by the shooting collision method. The voxel file contains multi-level descriptions detailed to one grid per 0.5 meters. The voxel file contains information on all voxels that make up the collision of the mounting element. Among them, each voxel corresponds to coordinate information and height information, and these information are used to describe the surface height of the mounting element, providing a walkable height and path for virtual objects to move on the surface of the mounting element.

[0087] Obtain a target image for generating a collision. The target image includes a picture of the mounting element in the virtual scene. Obtain the height data and direction information corresponding to the mounting element in the target image, and process the height data and direction information to generate voxel data corresponding to the mounting element. This voxel data set is a collision file.

[0088] Optionally, the first mounting element is an airship, and virtual objects in the virtual scene can move by taking the first mounting element.

[0089] In some embodiments, in order to accelerate the calculation of voxelization, the processing power of the GPU (Graphics Processing Unit) can be utilized, and a pre-written Shader program is used. This Shader program encodes the height data and direction information of the mounting element into a preset structured buffer, and further processes these data to generate voxel data.

[0090] Schematically, as Figure 6 shown, Figure 6 is a schematic diagram of the correspondence between a mounting element and its own collision.

[0091] There are 4 carrier elements in the virtual scene 600: carrier element A610, carrier element B620, carrier element C630, and carrier element D640. Voxelization is performed on the carrier elements to obtain 4 corresponding collisions: the first collision 611 of carrier element A610, the second collision 621 of carrier element B620, the third collision 631 of carrier element C630, and the fourth collision 641 of carrier element D640. The carrier element has the same collision shape as its corresponding one and is in the same position in the virtual scene.

[0092] Step 520, receive the carrier control operation for the first virtual object.

[0093] Among them, the carrier control operation is used to control the first virtual object to form a carrier interaction relationship with the first carrier element.

[0094] Optionally, taking the first carrier element as an airship as an example, the carrier control operation includes but is not limited to the following methods.

[0095] 1. Display the target virtual control corresponding to the first carrier element, and receive the trigger operation for the target virtual control. The target virtual control is used to implement the carrier interaction relationship between the first virtual object and the first carrier element.

[0096] Exemplarily, when the distance between the first virtual object and the first carrier element meets the preset trigger requirement, the target virtual control is displayed. The preset trigger requirement is that the distance between the first virtual object and the first carrier element does not reach 10 unit distances, where the unit distance can be arbitrary.

[0097] It should be noted that the position of the target virtual control on the display interface can be arbitrary, including but not limited to: (1) at a specified position on the surface of the first carrier element, such as the floor of a ship; (2) at a specified position on the display interface, such as the upper left corner of the display interface; (3) a virtual control that moves with the first carrier element. During the movement of the first carrier element, the relative position between the virtual control and the first carrier element remains unchanged.

[0098] Among them, by triggering the target virtual control to construct the carrier interaction relationship between the first virtual object and the first carrier element, the operation is simple and fast, and the efficiency of forming the carrier interaction relationship can be improved. Taking the preset distance as the requirement for triggering the target virtual control can provide a prompt when the player controls the first virtual object to move. When the first virtual object approaches the first carrier element, in addition to directly controlling the first virtual object to move, the first virtual object can also be carried by the first carrier element and move with the first carrier element, improving the diversity of operation methods.

[0099] 2. Receive a movement control operation for the first virtual object, which is used to control the first virtual object to move onto the first carrying element.

[0100] Exemplarily, the carrying control operation is a drag control operation, which is used to drag the first virtual object onto the first carrying element. When the first virtual object is located on the first carrying element, it indicates that a carrying interaction relationship is formed between the first virtual object and the first carrying element.

[0101] In some embodiments, in order to determine in real time whether the first virtual object enters the first carrying element or is located on the surface of the first carrying element, the first carrying element includes at least one trigger, and the shape of the trigger includes but is not limited to a cube, a sphere, a cylinder, and a horizontally placed cylinder, etc.

[0102] It should be noted that the number of triggers included in each carrying element can be arbitrary, and the shape of each trigger can be arbitrary. This embodiment does not limit this.

[0103] Among them, each trigger corresponds to its own trigger area. When the virtual object is located within the trigger area, it indicates that the virtual object is located on the carrying element.

[0104] Exemplarily, taking the first carrying element including one trigger as an example for illustration, this trigger corresponds to one trigger area.

[0105] Optionally, the first carrying element includes a first trigger area, which is used to detect the situation where a carrying interaction relationship is formed between the first carrying element and the virtual object.

[0106] The terminal will detect in each frame whether the first virtual object enters the trigger area of the first carrying element. Once it is detected that the first virtual object enters the trigger area of the first carrying element, the terminal will send a verification request to the server. After receiving the verification request, the server will perform corresponding verification on the situation where the first virtual object enters the first carrying element.

[0107] Optionally, when there is a collision between the first virtual object and the first trigger area, it is determined that a carrying interaction relationship is formed between the first virtual object and the first carrying element.

[0108] Schematically, as Figure 7 shown, Figure 7 is a schematic diagram of a first trigger area.

[0109] The first carrying element 700 is a ship. There are multiple triggers on the first carrying element 700. Taking the first trigger 701 as an example, the first trigger 701 corresponds to a first trigger area 702. When the first virtual object 710 enters the first carrying element 700, the relative position between the first virtual object 710 and the first trigger area 702 is as Figure 7 shown.

[0110] The first trigger area 702 and the trigger areas corresponding to other triggers will detect in real time whether there is a collision with the first virtual object 710. If there is a trigger area on the first carrying element 700 that collides with the first virtual object 710, a carrying interaction relationship is formed between the first virtual object 710 and the first carrying element 700.

[0111] Among them, the method of controlling the first virtual object to move onto the first carrying element through movement control operations to form a carrying interaction relationship can improve the flexibility of the player to control the first virtual object.

[0112] By setting a trigger on the first carrying element as the first trigger area, the first trigger area can detect the collision with the first virtual object, and determine whether to form a carrying interaction relationship according to the collision result, which can simplify the judgment process. The shape and size of the first trigger area are editable, which can enrich the diversity of the picture.

[0113] Step 530, when there is a carrying interaction relationship between the first virtual object and the first carrying element, obtain the local navigation map corresponding to the first carrying element.

[0114] Among them, the local navigation map (Navimap) is a map coordinate system constructed based on the voxel block data of the first carrying element, and the local navigation map is used to indicate the movement height and movement path when the first virtual object moves on the first carrying element.

[0115] That is, after voxelizing the first carrying element, the collision of the first carrying element is obtained, and the local navigation map is generated based on the voxel block data corresponding to the collision.

[0116] Optionally, taking the center of the first carrying element as the coordinate origin of the local navigation map, the local navigation map includes the coordinates and their own height data corresponding to each voxel in this map coordinate system respectively.

[0117] For example, the coordinate of voxel A in the local navigation map is (2, 3, 4), and the unit of each dimension coordinate is a voxel. The height of voxel A is (1.5, 2), and the unit is meters. Each voxel block is a cube with a side length of 0.5 meters. Then (1.5, 2) means that the bottom end of this voxel A has a height of 1.5 meters in the vertical direction, and the top end of this voxel A has a height of 2 meters in the vertical direction.

[0118] It is worth noting that the local navigation map of the first mounted element is similar to the navigation map of the virtual scene, and both are used to provide virtual objects with walkable heights, perform ray detection and other functions. The method of generating the local navigation map can be arbitrary, and the data of each voxel contained in the local navigation map is determined by the shape of the first mounted element. The above example is only used for example. The local navigation map can provide players with the movable height and movement path of virtual objects in any way, and the size of each voxel and the arrangement of voxels can be arbitrary, which is not limited in this embodiment.

[0119] Step 540 , in response to receiving a first movement control operation for the first virtual object, obtaining relative coordinates between the first virtual object and the first mounted element based on the local navigation map, and controlling the first virtual object based on the relative coordinates.

[0120] In applications based on virtual scenes, the focus of the terminal and the server is different. In order to improve the picture performance, the terminal needs to refresh every frame. For applications with voxel collision at the bottom layer, the collision itself cannot be moved every frame. Unlike the terminal, the refresh frequency at the server level is relatively low. For example, the refresh frequency used by the server is 500ms / time, which can support the movement and refresh of the collision position to a certain extent.

[0121] Indicatively, Figure 8 As shown, Figure 8 It is a schematic diagram of a structure for realizing the movement of collision position.

[0122] In the application, each plane has its own map instance 801 (Map Instance), in which different behaviors performed at the same time point (including behaviors generated by virtual elements and virtual objects contained in the virtual scene) are archived separately, resulting in multiple planes.

[0123] In the map instance 801, the collision index (Map id) is stored, such as dyn cls0, dyn cls1, etc. Among them, the address of the collision instance is stored in mid, and invalid mid means that it has not been filled yet. Since each carrying element is an NPC instance 802 (NPC Instance), each NPC instance 802 contains its own information, such as NPC id, which indicates the ID (Identification) of the NPC instance 802. Among them, the NPC instance 802 is also bound to a collision instance 803 (Collision Instance) related information, such as cls id, which indicates the ID of the collision instance 803.

[0124] When the real-time position (rt_pos) of the NPC instance 802 changes, the actual position (cls_pos) of the collision instance 803 is synchronously modified according to cls_mid.

[0125] That is, when the collision follows the movement of the carrying element, the position of the collision is consistent with the position of the carrying element in the virtual scene.

[0126] The server side stores collision-related indexes in the map instance 801. When the position of the carrying element is refreshed, the position of the collision will be synchronously changed, realizing the movement of the collision.

[0127] In order for the terminal to realize the function of the carrying element carrying the virtual object to move, the state of the virtual object is divided into two types: "forming a carrying interaction relationship with the carrying element" and "not forming a carrying interaction relationship with the carrying element".

[0128] In the case where the virtual object does not form a carrying interaction relationship with the carrying element, the virtual object moves based on the collision in the virtual scene using the scene coordinates in the virtual scene. Among them, the collision in the virtual scene is used to provide information such as the feasible walking height and path for the virtual object when moving in the virtual scene, so that the virtual object can walk along the terrain surface of the virtual scene.

[0129] In the case where the virtual object forms a carrying interaction relationship with the carrying element, the virtual object moves based on the collision of the carrying element using the relative coordinates on the carrying element. Among them, the collision of the carrying element is used to provide information such as the feasible walking height and path for the virtual object when moving on the carrying element, so that the virtual object can walk along the surface of the carrying element, making the performance of the virtual object on the carrying element smoother and avoiding problems such as jitter, pulling, and sliding.

[0130] Optionally, obtain the first scene coordinates of the local navigation map in the virtual scene, where the first scene coordinates are coordinates determined based on the scene coordinate system in the virtual scene.

[0131] Exemplarily, the origin of the local navigation map is the center of the first carrying element. The scene coordinates of the first carrying element are determined based on the scene coordinate system. Since there is a corresponding relationship between the local navigation map and the first carrying element, the first scene coordinates of the local navigation map in the virtual scene can be determined based on the scene coordinates of the first carrying element.

[0132] Obtain the second scene coordinates of the first virtual object in the virtual scene. Among them, the first virtual object can be regarded as a moving unit point in the virtual scene, and the second scene coordinates of the moving unit point are determined based on the scene coordinate system.

[0133] Based on the offset relationship between the first scene coordinates and the second scene coordinates, obtain the relative coordinates between the first virtual object and the first carrying element.

[0134] Exemplarily, the position of the origin (0, 0, 0) of the local navigation map in the scene coordinate system is (4, 3, 1), and the position of the first virtual object in the scene coordinate system is (2, 2, 1). Then the relative coordinates between the first virtual object and the carrying element are (2 - 4, 2 - 3, 1 - 1) = (-2, -1, 0).

[0135] It should be noted that the method for obtaining the relative coordinates between the first virtual object and the carrying element can be arbitrary. The above method of determining the relative coordinates based on the origin coordinates of the local navigation map is only for illustration. The coordinates of the first virtual object, the first carrying element, and the local navigation map determined based on the scene coordinate system can be arbitrary, and the dimensions of the scene coordinate system and the local navigation map (map coordinate system) can be arbitrary.

[0136] In response to receiving a first movement control operation for the first virtual object, obtain relative coordinate change data corresponding to the first movement control operation. The relative coordinate change data is used to characterize the movement change of the first virtual object on the first carrying element under the control of the first movement control operation.

[0137] Optionally, the first movement control operation indicates the end position when the first virtual object moves. The local navigation map plans a target path for the first virtual object to move based on the end position indicated by the first movement control operation, and determines the relative coordinate change data based on this target path.

[0138] Among them, the relative coordinate change data includes the coordinate change of each movement when the first virtual object moves from the current position to the end position.

[0139] Exemplarily, the relative coordinates of the current position of the first virtual object are (1, 1, 1), and the end position indicated by the first movement control operation is (4, 2, 1). Then the relative coordinate change data is as follows.

[0140] For the first movement, the relative coordinates change from (1, 1, 1) to (2, 1, 1);

[0141] For the second movement, the relative coordinates change from (2, 1, 1) to (3, 1, 1);

[0142] For the third movement, the relative coordinates change from (3, 1, 1) to (4, 1, 1);

[0143] For the fourth movement, the relative coordinates change from (4, 1, 1) to (4, 2, 1).

[0144] The relative coordinates between the first virtual object and the first mounted element are updated based on the relative coordinate change data.

[0145] Among them, when a carrying interaction relationship is formed between the first virtual object and the first carrying element, the first virtual object is controlled using relative coordinates, which can solve the problem that the position of the first virtual object on the first carrying element cannot be synchronized due to different refresh frequencies between the server and the terminal, thereby improving the presentation effect of the picture.

[0146] The local navigation map itself has a path-finding function. The target path planned based on the first mobile control operation can reflect the surface height change of the first carrying element. Therefore, the relative coordinate change data of the first virtual object when moving on the surface of the first carrying element is further determined according to the target path, which can improve the efficiency of the first virtual object's movement process.

[0147] In some embodiments, in response to receiving a first movement control operation for a first virtual object, a voxel block movement unit corresponding to the first movement control operation is obtained as relative coordinate change data, and the voxel block movement unit is used to characterize the number of voxel blocks moved by the first virtual object on the first carrying element under the control of the first movement control operation.

[0148] Exemplarily, all voxel blocks constituting the first carrying element are sorted, and each voxel block has a unique identification number. The voxel block movement unit indicated by the first movement control operation is 5, that is, the first virtual object needs to pass through 5 voxel blocks when moving on the first carrying element.

[0149] Exemplarily, the first carrying element is composed of 100 voxel blocks, which are numbered from 1 to 100, and the voxel blocks indicated by the first movement control operation correspond to the numbers 5, 7, 11, 22, and 30, respectively.

[0150] Then the first virtual object is controlled to pass through voxel block No. 5, voxel block No. 7, voxel block No. 11, voxel block No. 22, and voxel block No. 30. Each voxel block corresponds to its own coordinates on the local navigation map, and the relative coordinates between the first virtual object and the first carrying element are updated based on the coordinates of voxel block No. 5, voxel block No. 7, voxel block No. 11, voxel block No. 22, and voxel block No. 30.

[0151] By marking the voxel blocks and using them as the basic unit for each movement of the first virtual object, the method for determining the movement process of the first virtual object can simplify the process of calculating the change of relative coordinates. Each voxel block has its own height data, and can also reflect the surface height and terrain information of the first carrying element, thereby improving the accuracy of the first carrying element, so that the first virtual object is more closely attached to the surface of the first carrying element when moving.

[0152] In summary, the method provided by this application enables a virtual object to obtain a local navigation map of a carrying element by establishing a carrying interaction relationship between the virtual object and the carrying element. The local navigation map provides a movable height and path for the movement of a virtual character on the carrying element, enabling the virtual character to conform to the surface of the carrying element when moving on the carrying element. Compared with the method of constructing the collision of the carrying element frame by frame to determine the movable height of the carrying element, it can reduce the computational overhead and save computing resources. By determining the relative coordinates between the virtual object and the carrying element based on the local navigation map and controlling the virtual object through the relative coordinates, the relative positions of the virtual object and the carrying element can be kept consistent. When the carrying element moves, the virtual object and the carrying element move synchronously.

[0153] The method provided in this embodiment realizes the process of the first virtual object moving on the surface of the first carrying element by receiving a movement control operation on the first virtual object and obtaining relative coordinate change data to update the relative coordinates of the first virtual object in real time.

[0154] The method provided in this embodiment can realize the movement of the first virtual object on the surface of the first carrying element based on voxels by receiving a movement control operation on the first virtual object, obtaining voxel block movement units, and updating the relative coordinates of the first virtual object in real time, improving the movement efficiency of the first virtual object.

[0155] The method provided in this embodiment can determine whether a carrying interaction relationship is formed between the first virtual object and the first carrying element by the collision between the first trigger area on the first carrying element and the first virtual object, improving the accuracy of determining the carrying interaction relationship.

[0156] The first carrying element can remain stationary or move in the virtual scene. When the first carrying element moves in the virtual scene, if a carrying interaction relationship is formed between the first virtual object and the first carrying element, the first carrying element will carry the first virtual object to move synchronously during the movement. Figure 9 FIG. is a flowchart of a method for the first carrying element carrying the first virtual object to move provided by an exemplary embodiment of this application, including the following steps.

[0157] Step 910, display the first carrying element and the first virtual object in the virtual scene.

[0158] Among them, the first carrying element is composed of multiple voxel blocks.

[0159] Optionally, the first carrying element is an airship, and the virtual object in the virtual scene can ride on the first carrying element to move.

[0160] Step 920: Receive the carrying control operation for the first virtual object.

[0161] Among them, the carrying control operation is used to control the first virtual object and the first carrying element to form a carrying interaction relationship.

[0162] Optionally, taking the first carrying element as an airship as an example, the carrying control operation includes but is not limited to the following methods.

[0163] 1. Display the target virtual control corresponding to the first carrying element, and receive the trigger operation for the target virtual control. The target virtual control is used to implement the carrying interaction relationship between the first virtual object and the first carrying element.

[0164] 2. Receive the carrying control operation for the first virtual object. The carrying control operation is used to control the first virtual object to move onto the first carrying element.

[0165] Optionally, the first carrying element includes a first trigger area, and the first trigger area is used to detect the situation where a carrying interaction relationship is formed between the first carrying element and the virtual object.

[0166] In the case where there is a collision between the first virtual object and the first trigger area, it is determined that a carrying interaction relationship is formed between the first virtual object and the first carrying element.

[0167] Step 930: When there is a carrying interaction relationship between the first virtual object and the first carrying element, obtain the local navigation map corresponding to the first carrying element.

[0168] Among them, the local navigation map (Navimap) is a map coordinate system constructed based on the voxel data of the first carrying element. The local navigation map is used to indicate the moving height and moving path of the first virtual object when moving on the first carrying element.

[0169] Optionally, taking the center of the first carrying element as the coordinate origin of the local navigation map, the local navigation map includes the coordinates corresponding to each voxel on the map coordinate system and its own height data.

[0170] The local navigation map of the first carrying element is similar to the navigation map of the virtual scene, and both are used to provide functions such as the feasible walking height for the virtual object and ray detection.

[0171] Step 940: In response to receiving the first movement control operation for the first virtual object, obtain the relative coordinates between the first virtual object and the first carrying element based on the local navigation map, and control the first virtual object based on the relative coordinates.

[0172] Optionally, obtain the first scene coordinate of the local navigation map in the virtual scene, where the first scene coordinate is a coordinate determined based on the scene coordinate system in the virtual scene.

[0173] Exemplarily, the origin of the local navigation map is the center of the first mounting element. Determine the scene coordinate of the first mounting element based on the scene coordinate system. Since there is a corresponding relationship between the local navigation map and the first mounting element, the first scene coordinate of the local navigation map in the virtual scene can be determined based on the scene coordinate of the first mounting element.

[0174] Obtain the second scene coordinate of the first virtual object in the virtual scene. Here, the first virtual object can be regarded as a moving unit point in the virtual scene, and the second scene coordinate of this moving unit point is determined based on the scene coordinate system.

[0175] Based on the offset relationship between the first scene coordinate and the second scene coordinate, obtain the relative coordinate between the first virtual object and the mounting element.

[0176] Optionally, the first movement control operation is a jump control operation, and the jump control operation is used to instruct to control the first virtual object to jump in a specified direction.

[0177] In response to receiving the jump control operation for the first virtual object, obtain the relative coordinate between the first virtual object and the first mounting element based on the local navigation map.

[0178] Determine the target position of the first virtual object on the first mounting element based on the jump direction and jump distance indicated by the jump control operation; update the relative coordinate based on the mapping relationship between the local navigation map and the target position.

[0179] Exemplarily, the relative coordinate of the current position of the first virtual object is (1, 1, 1), the jump direction indicated by the jump control operation is the first direction, and the jump distance is 5 unit distances. Then the relative coordinate of the target position on the local navigation map is (6, 1, 1). Then, update the relative coordinate of the first virtual object from (1, 1, 1) to (6, 1, 1).

[0180] Perform jump control on the first virtual object based on the updated relative coordinate.

[0181] Step 950, receive the second movement control operation for the first mounting element.

[0182] The second movement control operation is used to control the first mounting element to move in the virtual scene. During the movement of the first mounting element, the relative coordinate between the first virtual character and the first mounting element remains unchanged.

[0183] That is, when the first virtual character moves following the first carrying element, it has inertia.

[0184] Optionally, when the first carrying element carries the first virtual object for synchronous movement, it includes but is not limited to the following two cases.

[0185] 1. The first carrying element moves, and the first virtual object makes an additional movement in the moving direction of the first carrying element. At this time, the relative coordinates of the first virtual object with respect to the first carrying element change.

[0186] Exemplarily, the first carrying element moves 100 unit distances in the first direction relative to the virtual scene, and the first virtual object moves 10 unit distances in the first direction relative to the first carrying element. Then, the first virtual object moves 100 + 10 = 110 unit distances in the first direction relative to the virtual scene.

[0187] Schematically, as Figure 10 shown, Figure 10 is a schematic diagram of the inertia during the process of a first virtual character moving following the first carrying element.

[0188] The first virtual object 1010 moves along the moving direction of the first carrying element 1000, and its moving trajectory 1020 indicates that the first virtual object 1010 moves from the current position to the end position. The relative coordinates of the first virtual object with respect to the first carrying element change in the moving direction of the first carrying element 1000.

[0189] In some embodiments, the moving directions of the first virtual object and the first carrying element are not exactly the same. The situation where the relative coordinates change is determined according to the included angle between the moving directions of the first virtual object and the first carrying element.

[0190] 2. The first carrying element moves, and the first virtual object does not make an additional movement in the moving direction on the first carrying element. At this time, the relative coordinates of the first virtual object with respect to the first carrying element remain unchanged in the moving direction on the first carrying element.

[0191] Exemplarily, the first carrying element moves 100 unit distances in the first direction relative to the virtual scene, and the first virtual object is stationary relative to the first carrying element. Then, the first virtual object also moves 100 unit distances in the first direction relative to the virtual scene.

[0192] Exemplarily, a jump control operation for a first virtual object is received, where the jump control operation is a standing jump operation. The first carrier element moves 100 unit distances in the horizontal direction. After the jump control operation controls the first virtual object to jump in the vertical direction (the Z-axis direction in the XYZ coordinate axes), the first virtual object also moves 100 unit distances in the first direction relative to the virtual scene.

[0193] Exemplarily, a jump control operation for a first virtual object is received, where the jump control operation is a standing jump operation. The first carrier element moves 100 unit distances in the X-axis direction in the XYZ coordinate axes. After the jump control operation controls the first virtual object to move 10 unit distances in the Y-axis direction in the XYZ coordinate axes, the first virtual object also moves 100 unit distances in the X-axis direction in the XYZ coordinate axes and 10 unit distances in the Y-axis direction in the XYZ coordinate axes relative to the virtual scene.

[0194] Before and after the first virtual object jumps, the relative coordinates of the first virtual object relative to the first carrier element remain unchanged in the first direction.

[0195] Schematically, as Figure 11 shown, Figure 11 is an inertia schematic diagram during the process of another first virtual character following the movement of the first carrier element.

[0196] The first virtual object 1110 moves in a direction perpendicular to the movement direction of the first carrier element 1100, and its movement trajectory 1120 represents the first virtual object 1110 moving from the current position to the end position. The relative coordinates of the first virtual object relative to the first carrier element do not change in the movement direction of the first carrier element 1100, but change in the movement direction perpendicular to the movement direction of the first carrier element 1100.

[0197] When the inertia of the first virtual object is retained when the first virtual object follows the movement of the first carrier element, the performance effect of the picture can be improved, making the picture more realistic when the first virtual object moves, and improving the experience of the player when controlling the first virtual object or the first carrier element.

[0198] Due to the difference in the update frequencies of the server and the terminal, where the terminal is updated per frame while the server is updated every 500 ms, this results in a significant difference in the position of the first carried element between the server and the terminal. If the first virtual object on the first carried element still interacts with the server with respect to the scene coordinates of the virtual scene, the position information of both parties may be seriously inconsistent, thus frequently triggering the dragging behavior. Therefore, to alleviate this problem, when a carried interaction relationship is formed between the first virtual object and the first carried element, the relative coordinates of the first virtual object with respect to the first carried element are used to control the first virtual object. Based on the position of the first carried element and the position offset of the first virtual character, both the server and the terminal can calculate the current position of the first virtual object, thereby reducing the error.

[0199] Optionally, the following processes need to be implemented: (1) The terminal supports updating the position with relative coordinates: Introduce three new fields and a virtual object manager for the carried element, including: the ParentPlayer field (virtual object), the RelativePos field (relative coordinates), and the RelativeRotation field (rotation). (2) Extend the movement packets between the server and the terminal to support relative coordinates, including: walking movement packets, light kung fu path packets, dragging packets, etc. (3) Update of the terminal state machine: In addition to the original state machine states, introduce several states related to relative movement, such as IdleOnMoveStation (stationary), WalkOnMoveStation (walking), and FlyOnMoveStation (light kung fu). In some embodiments, when there is a need for virtual combat of the virtual object, the combat mechanism of the virtual object also supports updating with relative coordinates.

[0200] In summary, the method provided by this application, by establishing a carried interaction relationship between the virtual object and the carried element, enables the virtual object to obtain the local navigation map of the carried element. The local navigation map provides the movable height and path for the virtual character to move on the carried element, enabling the virtual character to conform to the surface of the carried element when moving on the carried element. Compared with the method of constructing the collision of the carried element per frame to determine the movable height of the carried element, it can reduce the calculation overhead and save computing resources. Determining the relative coordinates between the virtual object and the carried element based on the local navigation map and controlling the virtual object through the relative coordinates can keep the relative positions of the virtual object and the carried element consistent, and when the carried element moves, enable the virtual object and the carried element to move synchronously.

[0201] The method provided in this embodiment determines the relative coordinates between the first virtual object and the first carrying element based on the offset relationship between the first scene coordinates of the local navigation map and the second scene coordinates of the first virtual object. When a carrying interaction relationship is formed between the first virtual object and the first carrying element, if the first carrying element moves in the virtual scene, the relative coordinates can solve the problem that the position of the first virtual object on the first carrying element cannot be synchronously moved due to different refresh frequencies between the server and the terminal.

[0202] The above embodiment is described by taking the case where there is one first carrying element and one first virtual object in the virtual scene as an example. In some embodiments, there are multiple carrying elements in the virtual scene, and the first virtual object can form a carrying interaction relationship with any one of the carrying elements. Since the position of the first virtual object changes in real time during the movement process, the carrying interaction relationship between the first virtual object and the carrying element may also change accordingly. Different carrying interaction relationships will affect the type of coordinates used when the first virtual object moves.

[0203] When the first virtual object is located on a certain carrying element, the first virtual object moves using relative coordinates with respect to the carrying element; when the first virtual object is located on the ground of the virtual scene, the first virtual object moves using scene coordinates with respect to the virtual scene; when the first virtual object is in the air, the first virtual object continues to use the coordinates within the historical time period for movement.

[0204] Optionally, the virtual scene further includes at least one second carrying element, and the at least one second carrying element includes at least one second trigger area. Figure 12 It is a flowchart of a method for determining the carrying interaction relationship of the first virtual object provided by an exemplary embodiment of the present application, including the following steps.

[0205] Step 1210, determine the situation where a carrying interaction relationship is formed between the first virtual object and the first trigger area.

[0206] When a collision occurs between the first virtual object and the first trigger area, it is determined that a carrying interaction relationship is formed between the first virtual object and the first carrying element. When no collision occurs between the first virtual object and the first trigger area, step 1220 is executed.

[0207] Step 1220, in the case where there is no collision between the first virtual object and the first trigger area, determine the situation where the first virtual object collides with the ground of the virtual scene, and determine the situation where the first virtual object collides with at least one second trigger area, to obtain a collision result.

[0208] Optionally, in addition to the first carrying element, there is also a second carrying element in the virtual scene. The types of the second carrying element and the first carrying element may be the same or different.

[0209] Among them, there may be at least one second trigger area on the second carrying element. In this embodiment, an example in which there is one second trigger area on the second carrying element is used for illustration.

[0210] Step 1230, determine the carrying interaction relationship formed between the first virtual object and at least one second carrying element or the ground of the virtual scene based on the collision result.

[0211] The collision results include the following situations.

[0212] (1) When the collision result indicates that the first virtual object collides with at least one second trigger area, determine that a carrying interaction relationship is formed between the first virtual object and at least one second carrying element;

[0213] (2) When the collision result indicates that the first virtual object collides with the ground of the virtual scene, determine that a carrying interaction relationship is formed between the first virtual object and the virtual scene;

[0214] (3) When the collision result indicates that the first virtual object does not collide with the ground of the virtual scene and at least one second trigger area, determine that a carrying interaction relationship is formed between the first virtual object and the target carrying element, where the target carrying element includes one of the first carrying element, at least one second carrying element, and the ground of the virtual scene, and the target trigger area of the target carrying element is the area that most recently collided with the first virtual object.

[0215] For the third type of collision result above, this indicates that the first virtual object is performing operations such as jumping in the current frame, and the first virtual object is in mid-air. When the first virtual object moves following the target carrying element and performs a jumping action, it will temporarily leave the target trigger area of the target carrying element. At this time, if it is directly determined that the carrying interaction relationship between the first virtual object and the target carrying element is lost, it may cause the first virtual object to lose the inertia during the movement, making the position of the first virtual object stay in place, resulting in an error.

[0216] Therefore, if the current frame indicates that the first virtual object is in the air, the carrying relationship between the first virtual object and any carrying element or the ground of the virtual object is not judged, and the first virtual object can continue to use the carrying relationship in the historical time period.

[0217] For example, if the first virtual object in the current frame is in the air and there is a carrying interaction relationship between the first virtual object in the previous frame and the first carrying element, then there is still a carrying interaction relationship between the first virtual object in the current frame and the first carrying element, and the first virtual object has the speed and inertia when the first carrying element moves.

[0218] Determining whether to judge the carrying relationship according to the situation that the first virtual object is in the air in each frame can avoid the situation of position deviation caused by the sudden loss of inertia of the first virtual object, and improve the authenticity and accuracy of the picture.

[0219] Among them, the execution order of the above steps 1210 to 1230 can be arbitrary, and the content of steps 1210 to 1230 is carried out in each frame. That is, in each frame, it is necessary to judge the collision situation between the first virtual object and all trigger areas and the ground of the virtual scene.

[0220] In some embodiments, there are multiple virtual objects and multiple carrying elements in the virtual scene. Then, in each frame, it is necessary to determine the collision situation between each virtual object and each carrying element and the ground of the virtual scene respectively. Therefore, the calculation process has a large overhead.

[0221] The carrying element is not always in a moving state. For example, when the carrying element is a vehicle controlled by a certain player, if the player does not operate the carrying element, the carrying element is in a stationary state. Another example is that the trigger mechanism type of carrying element in the virtual scene is in a stationary state in the non-trigger state (most of the time). In these cases, static optimization can be performed on the stationary carrying element. That is, when the stationary duration of the carrying element reaches a preset duration, the carrying element is staticized. At this time, the low-frequency dynamic collision management method managed by the octree is used to perform collision management on the carrying element, and the collision detection calculation between the trigger area of the carrying element and the virtual object in each frame, and the intersection calculation between the local navigation map of the carrying element are removed. When the staticized carrying element starts to move, the corresponding collision of the carrying element is removed from the octree, and at the same time, the collision detection calculation between the trigger area of the carrying element and the virtual object in each frame, and the intersection calculation between the local navigation map of the carrying element are restored.

[0222] Schematically, as Figure 13 shown, Figure 13 is a schematic diagram of the management process of static optimization.

[0223] When the player or application 1310 does not operate on the mounted element 1320, after the mounted element 1320 remains stationary for a preset duration, the mounted element manager 1330 staticizes the mounted element 1320, adds the mounted element 1320 to the octree collision structure 1340 for low-frequency dynamic collision management, and eliminates the collision calculation between the trigger area of the mounted element 1320 and the virtual object per frame, as well as the intersection calculation between the local navigation map of the mounted element 1320 and the virtual object.

[0224] When the player or application 1310 operates on the mounted element 1320, the mounted element 1320 starts to move. The mounted element manager 1330 removes the mounted element 1320 from the octree collision structure 1340, and resumes the collision calculation between the trigger area of the mounted element 1320 and the virtual object per frame, as well as the intersection calculation between the local navigation map of the mounted element 1320 and the virtual object.

[0225] In summary, the method provided in this application, by establishing a mounted interaction relationship between the virtual object and the mounted element, enables the virtual object to obtain the local navigation map of the mounted element. The local navigation map provides the movable height and path for the virtual character to move on the mounted element, so that the virtual character adheres to the surface of the mounted element when moving on the mounted element. Compared with the method of constructing the collision of the mounted element per frame to determine the movable height of the mounted element, it can reduce the calculation overhead and save computing resources. Based on the local navigation map, the relative coordinates between the virtual object and the mounted element are determined, and the virtual object is controlled through the relative coordinates, which can keep the relative position of the virtual object and the mounted element consistent. When the mounted element moves, the virtual object and the mounted element move synchronously.

[0226] The method provided in this embodiment, by respectively performing collision detection on the trigger areas of the virtual object and different mounted elements and the ground of the virtual scene, and determining the mounted interaction relationship in which the virtual object exists according to the collision results, and determining the coordinate type used when controlling the virtual object, can enable the virtual object to maintain inertia and avoid the position error caused by the virtual object losing inertia after briefly leaving the trigger area.

[0227] The method provided in this embodiment, through static optimization processing of the mounted element, uses a low-frequency octree structure to manage the collision of the mounted element when the mounted element is in a stationary state, and resumes per-frame collision detection and intersection calculation when the mounted element is in a moving state, can save calculation overhead and improve the performance of the terminal device while ensuring the interaction effect between the virtual object and the mounted element.

[0228] Figure 14 is a structural block diagram of a control device for a virtual object provided by an exemplary embodiment of this application, as Figure 14As shown, the device includes the following parts.

[0229] A display module 1410 for displaying a first carrying element and a first virtual object in a virtual scene, where the first carrying element is composed of a plurality of voxel blocks;

[0230] A control module 1420 for receiving a carrying control operation for the first virtual object, where the carrying control operation is used to control the first virtual object to form a carrying interaction relationship with the first carrying element;

[0231] An acquisition module 1430 for acquiring a local navigation map corresponding to the first carrying element when there is the carrying interaction relationship between the first virtual object and the first carrying element, where the local navigation map is a map coordinate system constructed based on the voxel block data of the first carrying element;

[0232] The acquisition module 1430 is further configured to, in response to receiving a first movement control operation for the first virtual object, acquire a relative coordinate between the first virtual object and the first carrying element based on the local navigation map, and control the first virtual object based on the relative coordinate.

[0233] In an optional embodiment, the acquisition module 1430 is further configured to, in response to receiving a first movement control operation for the first virtual object, acquire relative coordinate change data corresponding to the first movement control operation, where the relative coordinate change data is used to characterize the movement change of the first virtual object on the first carrying element under the control of the first movement control operation; update the relative coordinate between the first virtual object and the first carrying element based on the relative coordinate change data.

[0234] In an optional embodiment, the acquisition module 1430 is further configured to, in response to receiving a first movement control operation for the first virtual object, acquire the number of voxel block movement units corresponding to the first movement control operation as the relative coordinate change data, where the voxel block movement unit is used to characterize the number of voxel blocks passed by the first virtual object moving on the first carrying element under the control of the first movement control operation.

[0235] In an optional embodiment, the acquisition module 1430 is further configured to acquire a first scene coordinate of the local navigation map in the virtual scene, where the first scene coordinate is a coordinate determined based on a scene coordinate system in the virtual scene; acquire a second scene coordinate of the first virtual object in the virtual scene; and acquire the relative coordinate between the first virtual object and the first carrying element based on the offset relationship between the first scene coordinate and the second scene coordinate.

[0236] In an alternative embodiment, the first carrying element includes a first trigger area for detecting a situation where the carrying interaction relationship is formed between the first carrying element and the virtual object;

[0237] Before the obtaining module 1430, as Figure 15 shown, the apparatus further includes:

[0238] A determination module 1440, configured to determine that the carrying interaction relationship is formed between the first virtual object and the first carrying element when there is a collision between the first virtual object and the first trigger area.

[0239] In an alternative embodiment, the virtual scene further includes at least one second carrying element, and the at least one second carrying element includes at least one second trigger area;

[0240] The determination module 1440 is further configured to determine, when there is no collision between the first virtual object and the first trigger area, a situation where the first virtual object collides with the ground of the virtual scene, and a situation where the first virtual object collides with the at least one second trigger area, to obtain a collision result; and determine the carrying interaction relationship formed between the first virtual object and the at least one second carrying element or the ground of the virtual scene based on the collision result.

[0241] In an alternative embodiment, the determination module 1440 is further configured to determine that the carrying interaction relationship is formed between the first virtual object and the at least one second carrying element when the collision result indicates that the first virtual object collides with the at least one second trigger area; or determine that the carrying interaction relationship is formed between the first virtual object and the virtual scene when the collision result indicates that the first virtual object collides with the ground of the virtual scene; or determine that the carrying interaction relationship is formed between the first virtual object and a target carrying element when the collision result indicates that the first virtual object does not collide with the ground of the virtual scene or the at least one second trigger area, where the target carrying element includes one of the first carrying element, the at least one second carrying element, and the ground of the virtual scene, and the target trigger area of the target carrying element is the area that has most recently collided with the first virtual object.

[0242] In an alternative embodiment, the control module 1420 is further configured to receive a second movement control operation for the first mounted element, where the second movement control operation is used to control the first mounted element to move in the virtual scene. During the movement of the first mounted element, the relative coordinates between the first virtual character and the first mounted element remain unchanged.

[0243] In an alternative embodiment, the first movement control operation is a jump control operation;

[0244] The obtaining module 1430 is further configured to, in response to receiving the jump control operation for the first virtual object, obtain the relative coordinates between the first virtual object and the first mounted element based on the local navigation map; determine the target position of the first virtual object on the first mounted element based on the jump direction and jump distance indicated by the jump control operation; update the relative coordinates based on the mapping relationship between the local navigation map and the target position; and perform jump control on the first virtual object based on the updated relative coordinates.

[0245] In summary, the device provided in this application establishes a mounting interaction relationship between the virtual object and the mounted element, enabling the virtual object to obtain the local navigation map of the mounted element. The local navigation map provides a movable height and path for the virtual character to move on the mounted element. When the virtual character moves on the mounted element, it conforms to the surface of the mounted element. Compared with the method of constructing the collision of the mounted element for each frame to determine the movable height of the mounted element, it can reduce the calculation overhead and save computing resources. By determining the relative coordinates between the virtual object and the mounted element based on the local navigation map and controlling the virtual object through the relative coordinates, the relative position between the virtual object and the mounted element can be kept consistent. When the mounted element moves, the virtual object and the mounted element move synchronously.

[0246] It should be noted that: for the control device of the virtual object provided in the above embodiment, only the above division of each functional module is used for illustration. In practical applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the control device of the virtual object provided in the above embodiment and the embodiment of the control method of the virtual object belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0247] Figure 16The block diagram of a computer device 1600 provided by an exemplary embodiment of the present application is shown. The computer device 1600 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV) player, a laptop computer or a desktop computer. The computer device 1600 may also be referred to by other names such as a user device, a portable terminal, a laptop terminal, a desktop terminal, etc.

[0248] Generally, the computer device 1600 includes: a processor 1601 and a memory 1602.

[0249] The processor 1601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1601 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), PLA (Programmable Logic Array). The processor 1601 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1601 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1601 may also include an AI (Artificial Intelligence) processor, and the AI processor is used to process computational operations related to machine learning.

[0250] The memory 1602 may include one or more computer-readable storage media, and the computer-readable storage media may be non-transitory. The memory 1602 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices, flash storage devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1602 is used to store at least one instruction, and the at least one instruction is used to be executed by the processor 1601 to implement the control method of the virtual object provided by the method embodiment of the present application.

[0251] In some embodiments, the computer device 1600 further includes other components, which can be understood by those skilled in the art that Figure 16 the structure shown in does not constitute a limitation on the computer device 1600, and it may include more or fewer components than shown in the figure, or combine some components, or adopt different component arrangements.

[0252] Optionally, the computer-readable storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), solid state drives (SSD, Solid State Drives), or optical discs, etc. Among them, the random access memory may include resistive random access memory (ReRAM, Resistance RandomAccess Memory) and dynamic random access memory (DRAM, Dynamic Random Access Memory). The serial numbers of the embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.

[0253] The embodiments of the present application further provide a computer device, which includes a processor and a memory. At least one instruction, at least one program, a code set, or an instruction set is stored in the memory. The at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the control method of the virtual object as described in any one of the above embodiments of the present application.

[0254] The embodiments of the present application further provide a computer-readable storage medium, in which at least one instruction, at least one program, a code set, or an instruction set is stored. The at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the control method of the virtual object as described in any one of the above embodiments of the present application.

[0255] The embodiments of the present application further provide a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the control method of the virtual object as described in any one of the above embodiments.

[0256] Those of ordinary skill in the art can understand that all or part of the steps to implement the above embodiments can be completed by hardware, or can be completed by instructing relevant hardware through a program. The program can be stored in a computer-readable storage medium. The above-mentioned storage medium can be a read-only memory, a disk, an optical disc, etc.

[0257] The above are only alternative embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application.

Claims

1. A control method for a virtual object, characterized in that, The method includes: Displaying a first carrying element and a first virtual object in a virtual scene, where the first carrying element is composed of multiple voxel blocks; Receiving a carrying control operation for the first virtual object, where the carrying control operation is used to control the first virtual object to form a carrying interaction relationship with the first carrying element; When there is the carrying interaction relationship between the first virtual object and the first carrying element, obtaining a local navigation map corresponding to the first carrying element, where the local navigation map is a map coordinate system constructed based on the voxel block data of the first carrying element; In response to receiving a first movement control operation for the first virtual object, obtaining the relative coordinates between the first virtual object and the first carrying element based on the local navigation map, and controlling the first virtual object based on the relative coordinates.

2. The method according to claim 1, wherein The step of, in response to receiving a first movement control operation for the first virtual object, obtaining the relative coordinates between the first virtual object and the first carrying element based on the local navigation map includes: In response to receiving a first movement control operation for the first virtual object, obtaining relative coordinate change data corresponding to the first movement control operation, where the relative coordinate change data is used to characterize the movement change of the first virtual object on the first carrying element under the control of the first movement control operation; Updating the relative coordinates between the first virtual object and the first carrying element based on the relative coordinate change data.

3. The method according to claim 2, wherein The step of, in response to receiving a first movement control operation for the first virtual object, obtaining the relative coordinate change data corresponding to the first movement control operation includes: In response to receiving a first movement control operation for the first virtual object, obtaining the voxel block movement unit corresponding to the first movement control operation as the relative coordinate change data, where the voxel block movement unit is used to characterize the number of voxel blocks passed by the first virtual object moving on the first carrying element under the control of the first movement control operation.

4. The method according to any one of claims 1 to 3, characterized in that Before the step of, in response to receiving a first movement control operation for the first virtual object, obtaining the relative coordinates between the first virtual object and the first carrying element based on the local navigation map, it further includes: Obtaining a first scene coordinate of the local navigation map in the virtual scene, where the first scene coordinate is a coordinate determined based on the scene coordinate system in the virtual scene; Obtaining a second scene coordinate of the first virtual object in the virtual scene; Obtaining the relative coordinates between the first virtual object and the first carrying element based on the offset relationship between the first scene coordinate and the second scene coordinate.

5. The method according to any one of claims 1 to 3, characterized in that The first carrying element includes a first trigger area, where the first trigger area is used to detect the situation where the first carrying element forms the carrying interaction relationship with a virtual object; Before the step of, when there is the carrying interaction relationship between the first virtual object and the first carrying element, obtaining the local navigation map corresponding to the first carrying element, it further includes: When there is a collision between the first virtual object and the first trigger area, it is determined that the carrying interaction relationship is formed between the first virtual object and the first carrying element.

6. The method according to claim 5, wherein The virtual scene further includes at least one second carrying element, and the at least one second carrying element includes at least one second trigger area; The method further includes: When there is no collision between the first virtual object and the first trigger area, it is determined whether there is a collision between the first virtual object and the ground of the virtual scene, and it is determined whether there is a collision between the first virtual object and the at least one second trigger area, and a collision result is obtained; Based on the collision result, it is determined that the carrying interaction relationship is formed between the first virtual object and the at least one second carrying element or the ground of the virtual scene.

7. The method according to claim 6, wherein The determining the carrying interaction relationship formed between the first virtual object and the at least one second carrying element or the ground of the virtual scene based on the collision result includes: When the collision result indicates that there is a collision between the first virtual object and the at least one second trigger area, it is determined that the carrying interaction relationship is formed between the first virtual object and the at least one second carrying element; Or, When the collision result indicates that there is a collision between the first virtual object and the ground of the virtual scene, it is determined that the carrying interaction relationship is formed between the first virtual object and the virtual scene; Or, When the collision result indicates that there is no collision between the first virtual object and the ground of the virtual scene and the at least one second trigger area, it is determined that the carrying interaction relationship is formed between the first virtual object and the target carrying element, where the target carrying element includes one of the first carrying element, the at least one second carrying element, and the ground of the virtual scene, and the target trigger area of the target carrying element is the area that has most recently collided with the first virtual object.

8. The method according to any one of claims 1 to 3, characterized in that The method further includes: Receiving a second movement control operation for the first carrying element, where the second movement control operation is used to control the movement of the first carrying element in the virtual scene, and during the movement of the first carrying element, the relative coordinates between the first virtual character and the first carrying element remain unchanged.

9. The method according to any one of claims 1 to 3, characterized in that The first movement control operation is a jump control operation; The responding to receiving the first movement control operation for the first virtual object, obtaining the relative coordinates between the first virtual object and the first carrying element based on the local navigation map, and controlling the first virtual object based on the relative coordinates includes: Responding to receiving the jump control operation for the first virtual object, and obtaining the relative coordinates between the first virtual object and the first carrying element based on the local navigation map; Determining the target position of the first virtual object on the first carrying element based on the jump direction and jump distance indicated by the jump control operation; Update the relative coordinates based on the mapping relationship between the local navigation map and the target position; Perform jump control on the first virtual object based on the updated relative coordinates.

10. A control device for a virtual object, characterized in that, The device includes: A display module for displaying a first carrying element and a first virtual object in a virtual scene, the first carrying element being composed of a plurality of voxel blocks; A control module for receiving a carrying control operation for the first virtual object, the carrying control operation being used to control the first virtual object to form a carrying interaction relationship with the first carrying element; An acquisition module for acquiring a local navigation map corresponding to the first carrying element when there is the carrying interaction relationship between the first virtual object and the first carrying element, the local navigation map being a map coordinate system constructed based on the voxel block data of the first carrying element; The acquisition module is further configured to, in response to receiving a first movement control operation for the first virtual object, acquire the relative coordinates between the first virtual object and the first carrying element based on the local navigation map, and control the first virtual object based on the relative coordinates.

11. A computer device, characterized in that, The computer device includes a processor and a memory, and at least one program is stored in the memory, and the at least one program is loaded and executed by the processor to implement the control method of the virtual object according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, At least one program is stored in the storage medium, and the at least one program is loaded and executed by a processor to implement the control method of the virtual object according to any one of claims 1 to 9.

13. A computer program product, characterized in that, Including a computer program, which implements the control method of the virtual object according to any one of claims 1 to 9 when executed by a processor.