Virtual scene screen display method, device, equipment, medium and program product

By dividing blocks in the virtual scene and loading only the target block, adjacent block and diagonal block scene information, the problems of low loading efficiency and high memory consumption in the virtual scene are solved, and the loading efficiency is improved and optimized. Resource management improves player experience.

CN114130022BActive Publication Date: 2024-11-29TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111668081.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-31
Publication Date
2024-11-29
Estimated Expiration
2041-12-31

AI Technical Summary

Technical Problem

In virtual scenes, loading scene information is inefficient and puts pressure on device performance, which consumes a lot of memory and affects player experience.

Method used

By dividing the virtual scene into multiple blocks, each block includes multiple corner areas, the target block and its adjacent and diagonal blocks are determined according to the location of the target virtual object, and only the scene information of these blocks is loaded Render the field of view and update the block set when the target virtual object moves, uninstalling block scene information that is no longer in the field of view.

Benefits of technology

While ensuring the integrity of the field of view, it reduces the memory usage in the virtual scene, improves loading efficiency, avoids the lag caused by frequent unloading caused by rapid movement, and optimizes resource management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114130022B_ABST
    Figure CN114130022B_ABST
Patent Text Reader

Abstract

The present application provides a method, device, equipment, computer-readable storage medium and computer program product for displaying a virtual scene; the method includes: obtaining a target position of a target virtual object in a virtual scene, the virtual scene is divided into a plurality of blocks, each block includes a plurality of corner areas, and the corner areas are in a one-to-one correspondence with the corners in the geometric figure corresponding to the block; determining the target block where the target virtual object is located, and the adjacent blocks adjacent to the target block; when the target virtual object is determined to be in the target corner area in the target block based on the target position, obtaining the diagonal blocks in the plurality of blocks that are in a diagonal relationship with the target corner area; loading the block scene information of the target block, the adjacent blocks and the diagonal blocks to present the field of view of the target virtual object in the virtual scene. Through the present application, while ensuring the integrity of the field of view, the memory usage in the virtual scene can be effectively reduced, and the loading efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Priority statement

[0002] This application claims priority to the patent application number 202111270295.0, the filing date of October 29, 2021, and the name of the method, device, equipment, medium and program product for displaying a virtual scene. Technical Field

[0003] The present application relates to computer technology, and in particular to a method, device, equipment, computer-readable storage medium and computer program product for displaying a virtual scene. Background Art

[0004] In virtual scenes such as game applications, when a player enters the game scene, the scene information in the scene needs to be loaded to display the player's field of view. Since a lot of scene information is involved in the virtual scene, loading all the scene information is bound to take a long time, the loading efficiency is low, and it will also bring great pressure on device performance and consume a lot of memory. Summary of the invention

[0005] The embodiments of the present application provide a method, apparatus, device, computer-readable storage medium and computer program product for displaying a virtual scene, which can effectively reduce the memory usage in the virtual scene and improve loading efficiency while ensuring the integrity of the field of view.

[0006] The technical solution of the embodiment of the present application is implemented as follows:

[0007] The present application provides a method for displaying a virtual scene, including:

[0008] Acquire a target position of a virtual object in a target virtual scene, wherein the virtual scene is divided into a plurality of blocks, each of the blocks includes a plurality of corner regions, and the corner regions are in a one-to-one correspondence with corners in a geometric figure corresponding to the block;

[0009] Determine a target block where the target virtual object is located, and adjacent blocks adjacent to the target block;

[0010] When it is determined based on the target position that the target virtual object is in a target corner area in the target block, obtaining a diagonal block in the multiple blocks that is in a diagonal relationship with the target corner area;

[0011] The block scene information of the target block, the adjacent block and the diagonal block is loaded to present a field of view picture of the target virtual object in the virtual scene.

[0012] The embodiment of the present application provides a virtual scene display device, comprising:

[0013] A first acquisition module is used to acquire a target position of a target virtual object in a virtual scene, wherein the virtual scene is divided into a plurality of blocks, each of which includes a plurality of corner regions, and the corner regions are in a one-to-one correspondence with corners in a geometric figure corresponding to the block;

[0014] A block determination module, used to determine a target block where the target virtual object is located, and adjacent blocks adjacent to the target block;

[0015] A second acquisition module, configured to acquire a diagonal block in a diagonal relationship with the target corner area among the multiple blocks when it is determined based on the target position that the target virtual object is in a target corner area in the target block;

[0016] The information loading module is used to load the block scene information of the target block, the adjacent block and the diagonal block to present the field of view picture of the target virtual object in the virtual scene.

[0017] In the above solution, the device further includes: a block division module, which is used to obtain the block size of the rectangular block when the block is a rectangular block;

[0018] The virtual scene is divided into blocks according to the block size to obtain a plurality of rectangular blocks of the same size.

[0019] In the above solution, the block division module is further used to perform scene recognition on the virtual scene when the virtual scene includes multiple scene categories, so as to determine the area corresponding to each of the scene categories;

[0020] The virtual scene is divided into blocks according to the areas corresponding to the scene categories to obtain blocks corresponding to the scene categories.

[0021] In the above scheme, the block division module is also used to divide the virtual scene into blocks according to the distribution of the multiple virtual objects when there are multiple virtual objects in the virtual scene, so as to obtain multiple corresponding blocks, so that the number of virtual objects included in each block is lower than the target number.

[0022] In the above scheme, the information loading module is further used to perform the following operations for each of the target block, the adjacent block and the diagonal block: when the block scene information of the block includes a first number of other virtual objects, and the first number exceeds a quantity threshold, filtering out a second number of other virtual objects from the first number of other virtual objects according to the interaction relationship between each of the other virtual objects and the target virtual object, or the distance between each of the other virtual objects and the target virtual object;

[0023] The block scene information including the second number of other virtual objects is loaded to present a field of view picture of the target virtual object in the virtual scene, wherein the field of view picture includes the second number of other virtual objects.

[0024] In the above solution, after loading the block scene information of the target block, the adjacent block and the diagonal block, the device further includes:

[0025] A loading and updating module is used to obtain a moving position of the target virtual object when the target virtual object moves in the virtual scene;

[0026] According to the moving position, the target block, the adjacent block and the diagonal block where the target virtual object is located are updated to obtain an updated target block, an updated adjacent block and an updated diagonal block;

[0027] The block scene information of the update target block, the update adjacent block and the update diagonal block is loaded to update the field of view picture of the target virtual object in the virtual scene.

[0028] In the above solution, the loading and updating module is further used to determine a first block set corresponding to the target position before updating, and a second block set corresponding to the moving position after updating;

[0029] The first block set includes the target block, the adjacent block and the diagonal block, and the second block set includes the updated target block, the updated adjacent block and the updated diagonal block;

[0030] When there is no intersection between the first block set and the second block set, the block scene information of the blocks in the second block set is loaded, and the block scene information of the blocks in the first block set is unloaded.

[0031] In the above solution, the loading and updating module is further used to determine the intersection blocks included in the intersection when there is an intersection between the first block set and the second block set;

[0032] Acquire a first difference block in the first block set that is different from the intersection block, and a second difference block in the second block set that is different from the intersection block;

[0033] The block scene information of the second difference block is loaded, and the block scene information of the first difference block is unloaded.

[0034] In the above solution, the loading and updating module is further used to uninstall the block scene information of the blocks in the first block set when an uninstallation condition is met, and the uninstallation condition includes at least one of the following:

[0035] The time duration of the target virtual object leaving the target position exceeds the target time duration;

[0036] The distance between the moving position and the target position exceeds a target distance.

[0037] In the above scheme, after the block scene information of the target block, the adjacent block and the diagonal block is loaded, the loading and updating module is further used to obtain the moving position of the other virtual object when the visual field of the presented virtual scene includes other virtual objects and the other virtual objects move in the virtual scene;

[0038] According to the moving positions of the other virtual objects, updating the block scene information of the target block, the adjacent blocks and the diagonal blocks;

[0039] The updated block scene information is loaded to update the field of view of the target virtual object in the virtual scene.

[0040] In the above scheme, before loading the block scene information of the target block, the adjacent block and the diagonal block, the device further includes: a scene information acquisition module, configured to perform the following operations for each of the target block, the adjacent block and the diagonal block:

[0041] Detecting an object pool for storing block scene information, and when a detection result indicates that the block scene information associated with the block exists in the object pool, extracting the block scene information associated with the block from the object pool;

[0042] When the detection result indicates that the block scene information associated with the block does not exist in the object pool, creating the block scene information associated with the block;

[0043] Adding the block and the block scene information associated with the block to a bidirectional linked list;

[0044] The bidirectional linked list is used for traversing and loading the block scene information of the target block, the adjacent block and the diagonal block.

[0045] The present application provides a terminal device, including:

[0046] A memory for storing executable instructions;

[0047] The processor is used to implement the screen display method of the virtual scene provided in the embodiment of the present application when executing the executable instructions stored in the memory.

[0048] An embodiment of the present application provides a computer-readable storage medium storing executable instructions for causing a processor to execute instructions to implement the method for displaying a virtual scene provided by the embodiment of the present application.

[0049] An embodiment of the present application provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the method for displaying a virtual scene provided in the embodiment of the present application.

[0050] The embodiments of the present application have the following beneficial effects:

[0051] According to the target position of the target virtual object in the virtual scene, the target block where the target virtual object is located and the adjacent blocks adjacent to the target block are determined; when the target virtual object is determined to be in the target corner area in the target block based on the target position, the diagonal blocks that are diagonally related to the target corner area are obtained from multiple blocks, and the block scene information of the target block, the adjacent blocks and the diagonal blocks are loaded to present the field of view of the target virtual object in the virtual scene; in this way, when loading the scene information, only the block scene information of the target block, the adjacent blocks and the diagonal blocks is loaded. Compared with loading the block scene information of all blocks, while ensuring the integrity of the field of view, it effectively reduces the memory usage in the virtual scene and improves the loading efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1A A schematic diagram of an application mode of a method for displaying a virtual scene provided in an embodiment of the present application;

[0053] Figure 1B A schematic diagram of an application mode of a method for displaying a virtual scene provided in an embodiment of the present application;

[0054] Figure 2 A schematic diagram of the structure of a terminal device 400 provided in an embodiment of the present application;

[0055] Figure 3 A schematic diagram of a flow chart of a method for displaying a virtual scene provided in an embodiment of the present application;

[0056] Figure 4 A schematic diagram of a block display provided in an embodiment of the present application;

[0057] Figure 5 A schematic diagram of the implementation structure of block loading provided in an embodiment of the present application;

[0058] Figure 6 A schematic diagram of a flow chart of a method for displaying a virtual scene provided in an embodiment of the present application;

[0059] Figure 7 A schematic diagram of the visual field display provided in an embodiment of the present application;

[0060] Figure 8 A schematic diagram of a method for processing block scene information provided in an embodiment of the present application;

[0061] Fig. 9 A schematic diagram of a method for processing block scene information provided in an embodiment of the present application;

[0062] Fig.10 A schematic diagram of an object recycling process provided in an embodiment of the present application;

[0063] Figures 11A-11B A schematic diagram for comparing the effects provided in the embodiments of the present application. DETAILED DESCRIPTION

[0064] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0065] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0066] In the following description, the terms "first\second..." are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second..." can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0067] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0068] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0069] 1) Client: an application running in the terminal to provide various services, such as a video player client, a game client, etc.

[0070] 2) In response, it is used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations executed may be in real time or have a set delay. Unless otherwise specified, there is no restriction on the order of execution of the multiple operations executed.

[0071] 3) A virtual scene is a virtual scene displayed (or provided) when an application is running on a terminal. The virtual scene can be a simulation of the real world, a semi-simulation and semi-fictitious virtual environment, or a purely fictitious virtual environment. The virtual scene can be any of a two-dimensional virtual scene, a 2.5-dimensional virtual scene, or a three-dimensional virtual scene. The embodiment of the present application does not limit the dimension of the virtual scene. For example, the virtual scene may include the sky, land, ocean, etc. The land may include environmental elements such as deserts and cities, and users can control virtual objects to move in the virtual scene.

[0072] 4) Virtual objects, images of various people and objects that can interact in a virtual scene, or movable objects in a virtual scene. The movable objects can be virtual characters, virtual animals, cartoon characters, etc., such as characters and animals displayed in a virtual scene. The virtual object can be a virtual image in the virtual scene that represents the user. A virtual scene can include multiple virtual objects, each of which has its own shape and volume in the virtual scene and occupies a part of the space in the virtual scene.

[0073] 5) Scene data, which represents feature data in a virtual scene. For example, it may include the position of a virtual object in the virtual scene, the waiting time required for configuring various functions in the virtual scene (depending on the number of times the same function can be used within a specific time), and the attribute values ​​of various states of virtual objects in the game, such as health points and magic points.

[0074] The embodiments of the present application provide a method, device, terminal device, computer-readable storage medium, and computer program product for displaying a virtual scene, which can improve loading efficiency while ensuring the integrity of the player's field of view. In order to facilitate easier understanding of the method for displaying a virtual scene provided by the embodiments of the present application, an exemplary implementation scenario of the method for displaying a virtual scene provided by the embodiments of the present application is first described. The virtual scene in the method for displaying a virtual scene provided by the embodiments of the present application can be completely based on the output of the terminal device, or based on the coordinated output of the terminal device and the server.

[0075] In some embodiments, the virtual scene can also be an environment for game characters to interact. For example, it can be an environment for game characters to fight in the virtual scene. By controlling the actions of the game characters, both parties can interact in the virtual scene, allowing users to relieve life stress during the game.

[0076] In one implementation scenario, see Figure 1A , Figure 1A It is a schematic diagram of the application mode of the method for displaying a virtual scene provided in an embodiment of the present application, which is applicable to some application modes that completely rely on the computing power of the graphics processing hardware of the terminal device 400 to complete the relevant data calculation of the virtual scene 100, such as stand-alone / offline mode games, and output of the virtual scene through various types of terminal devices 400 such as smart phones, tablet computers, and virtual reality / augmented reality devices. As an example, the types of graphics processing hardware include central processing units (CPU) and graphics processing units (GPU).

[0077] When forming a visual perception of the virtual scene 100, the terminal device 400 calculates the data required for display through the graphics computing hardware, and completes the loading, parsing and rendering of the display data, and outputs video frames that can form a visual perception of the virtual scene through the graphics output hardware, for example, presenting two-dimensional video frames on the display screen of a smartphone, or projecting video frames to achieve a three-dimensional display effect on the lenses of augmented reality / virtual reality glasses; in addition, in order to enrich the perception effect, the terminal device 400 can also use different hardware to form one or more of auditory perception, tactile perception, motion perception and taste perception.

[0078] As an example, a client 410 (e.g., a stand-alone game application) is running on the terminal device 400. During the operation of the client 410, a virtual scene 100 including role-playing is output. The virtual scene 100 may be an environment for game characters to interact, such as a plain, street, valley, etc. for game characters to fight against each other. Before outputting the virtual scene 100, scene information needs to be loaded to output a field of view of a virtual object as the virtual scene 100, wherein the virtual object may be a game character controlled by a user, that is, the virtual object is controlled by a real user, and will move in the virtual scene in response to the real user's operation of a controller (e.g., a touch screen, voice-controlled switch, keyboard, mouse, and joystick, etc.). For example, when the real user moves the joystick to the right, the virtual object will move to the right in the virtual scene 100, and may also remain still, jump, and control the virtual object to perform shooting operations, etc.

[0079] For example, the terminal obtains the target position of the target virtual object in the virtual scene, wherein the virtual scene is divided into multiple blocks, each block includes multiple corner areas, and the corner areas correspond to the corners in the geometric figure corresponding to the block; determines the target block where the target virtual object is located, and the adjacent blocks adjacent to the target block; when it is determined based on the target position that the target virtual object is in the target corner area in the target block, obtains the diagonal blocks in the multiple blocks that are diagonally related to the target corner area; loads the block scene information of the target block, adjacent blocks and diagonal blocks to present the field of view of the target virtual object in the virtual scene, when the target virtual object moves in the virtual scene, updates the target block, adjacent blocks and diagonal blocks where the target virtual object is located according to the moving position, and loads the block scene information of the updated blocks to update the field of view of the virtual object in the virtual scene target. Since only the block scene information of the target block, adjacent blocks and diagonal blocks related to the target virtual object is loaded, the loading efficiency can be improved while ensuring the integrity of the player's field of view.

[0080] In another implementation scenario, see Figure 1B , Figure 1B It is a schematic diagram of the application mode of the method for displaying a virtual scene provided by an embodiment of the present application, which is applied to a terminal device 400 and a server 200, and is suitable for an application mode that relies on the computing power of the server 200 to complete the calculation of the virtual scene and output the virtual scene on the terminal device 400. Taking the visual perception of the virtual scene 100 as an example, the server 200 calculates the display data related to the virtual scene (such as scene data) and sends it to the terminal device 400 through the network 300. The terminal device 400 relies on the graphics computing hardware to complete the loading, parsing and rendering of the display data, and relies on the graphics output hardware to output the virtual scene to form a visual perception, for example, a two-dimensional video frame can be presented on the display screen of a smart phone, or a video frame that realizes a three-dimensional display effect can be projected on the lenses of augmented reality / virtual reality glasses; for the perception of the form of the virtual scene, it can be understood that the corresponding hardware output of the terminal device 400 can be used, such as using a microphone to form an auditory perception, using a vibrator to form a tactile perception, and so on.

[0081] As an example, a client 410 (e.g., an online version of a game application) is running on the terminal device 400, which interacts with other users in a game by connecting to a server 200 (e.g., a game server). The terminal device 400 outputs a virtual scene 100 of the client 410. The virtual scene 100 may be an environment for game characters to interact, such as a plain, street, valley, etc. for game characters to fight against each other. Before outputting the virtual scene 100, the scene information needs to be loaded to output a field of view of a virtual object as the virtual scene 100, wherein the virtual object may be a game character controlled by a user, that is, the virtual object is controlled by a real user, and will move in the virtual scene in response to the real user's operation of a controller (e.g., a touch screen, voice-controlled switch, keyboard, mouse, joystick, etc.). For example, when the real user moves the joystick to the right, the virtual object will move to the right in the virtual scene 100, and may also remain still, jump, and control the virtual object to perform shooting operations, etc.

[0082] For example, the terminal obtains the target position of the target virtual object in the virtual scene, wherein the virtual scene is divided into multiple blocks, each block includes multiple corner areas, and the corner areas correspond to the corners in the geometric figure corresponding to the block; determines the target block where the target virtual object is located, and the adjacent blocks adjacent to the target block; when it is determined based on the target position that the target virtual object is in the target corner area in the target block, obtains the diagonal blocks in the multiple blocks that are diagonally related to the target corner area; loads the block scene information of the target block, adjacent blocks and diagonal blocks to present the field of view of the target virtual object in the virtual scene, when the target virtual object moves in the virtual scene, updates the target block, adjacent blocks and diagonal blocks where the target virtual object is located according to the moving position, and loads the block scene information of the updated blocks to update the field of view of the virtual object in the virtual scene target. Since only the block scene information of the target block, adjacent blocks and diagonal blocks related to the target virtual object is loaded, the loading efficiency can be improved while ensuring the integrity of the player's field of view.

[0083] In some embodiments, the terminal device 400 can implement the screen display method of the virtual scene provided in the embodiment of the present application by running a computer program. For example, the computer program can be a native program or software module in the operating system; it can be a native application (APP, APPlication), that is, a program that needs to be installed in the operating system to run, such as a shooting game APP (i.e., the above-mentioned client 410); it can also be a small program, that is, a program that can be run only by downloading it to a browser environment; it can also be a game small program that can be embedded in any APP. In short, the above-mentioned computer program can be an application, module or plug-in in any form.

[0084] Taking a computer program as an application program as an example, in actual implementation, the terminal device 400 installs and runs an application program that supports virtual scenes. The application program can be any one of a first-person shooter game (FPS), a third-person shooter game, a virtual reality application program, a three-dimensional map program, or a multiplayer gunfight survival game. The user uses the terminal device 400 to operate a virtual object in the virtual scene to perform an activity, which includes but is not limited to: adjusting body posture, crawling, walking, running, riding, jumping, driving, picking up, shooting, attacking, throwing, and building virtual buildings. Indicatively, the virtual object can be a virtual character, such as a simulated character or an anime character.

[0085] In other embodiments, the embodiments of the present application can also be implemented with the aid of cloud technology. 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 achieve data calculation, storage, processing, and sharing.

[0086] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, and application technology based on the cloud computing business model. It can form a resource pool that can 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.

[0087] For example, Figure 1B The server 200 in the example may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal device 400 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal device 400 and the server 200 may be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present application.

[0088] Below Figure 1A The structure of the terminal device 400 shown in FIG. Figure 2 , Figure 2 is a schematic diagram of the structure of a terminal device 400 provided in an embodiment of the present application, Figure 2The terminal device 400 shown includes: at least one processor 420, a memory 460, at least one network interface 430 and a user interface 440. The various components in the terminal device 400 are coupled together via a bus system 450. It is understood that the bus system 450 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 450 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 450 is not shown in FIG. Figure 2 Various buses are labeled as bus system 450 .

[0089] The processor 420 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0090] The user interface 440 includes one or more output devices 441 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 440 also includes one or more input devices 442, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.

[0091] The memory 460 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard drives, optical drives, etc. The memory 460 may optionally include one or more storage devices that are physically remote from the processor 420.

[0092] The memory 460 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 460 described in the embodiments of the present application is intended to include any suitable type of memory.

[0093] In some embodiments, memory 460 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.

[0094] Operating system 461, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0095] A network communication module 462, for reaching other computing devices via one or more (wired or wireless) network interfaces 430, exemplary network interfaces 430 include: Bluetooth, Wireless Compatibility Authentication (WiFi), and Universal Serial Bus (USB);

[0096] a presentation module 463 for enabling presentation of information via one or more output devices 441 (e.g., display screen, speaker, etc.) associated with the user interface 440 (e.g., a user interface for operating peripherals and displaying content and information);

[0097] The input processing module 464 is used to detect one or more user inputs or interactions from one of the one or more input devices 442 and translate the detected inputs or interactions.

[0098] In some embodiments, the virtual scene display device provided in the embodiments of the present application can be implemented in a software manner. Figure 2 A screen display device 465 of a virtual scene stored in a memory 460 is shown, which may be software in the form of a program or plug-in, including the following software modules: a first acquisition module 4651, a block determination module 4652, a second acquisition module 4653, and an information loading module 4654. These modules are logical, and therefore may be arbitrarily combined or further split according to the functions implemented. The functions of each module will be described below.

[0099] In other embodiments, the image display device of the virtual scene provided in the embodiments of the present application can be implemented in hardware. As an example, the image display device of the virtual scene provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the image display method of the virtual scene provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs) or other electronic components.

[0100] The following will specifically describe the method for displaying a virtual scene provided by the embodiment of the present application in conjunction with the accompanying drawings. The method for displaying a virtual scene provided by the embodiment of the present application can be Figure 1A The terminal device 400 in the embodiment can be executed separately, or it can be executed by Figure 1B The terminal device 400 and the server 200 execute collaboratively.

[0101] Below, by Figure 1A The terminal device 400 in the embodiment of the present application independently executes the method for displaying the virtual scene provided in the embodiment of the present application as an example. Figure 3 , Figure 3 is a flowchart of a method for displaying a virtual scene provided in an embodiment of the present application, which will be combined with Figure 3 The steps shown are explained.

[0102] It should be noted that Figure 3 The method shown can be executed by various forms of computer programs running on the terminal device 400, and is not limited to the above-mentioned client 410, and can also be the operating system 461, software module and script described above, so the client should not be regarded as a limitation of the embodiments of the present application. In addition, the target virtual object involved in the embodiments of the present application is the virtual object corresponding to the current login account, and the other virtual objects are virtual objects corresponding to other login accounts different from the current login account.

[0103] Step 101: The terminal obtains a target position of a target virtual object in a virtual scene.

[0104] In the virtual scene application, the virtual scene screen that the user sees on the display screen of the terminal corresponding to the current login account is actually the field of view screen that the target virtual object sees in real time in the virtual scene. The field of view screen is obtained by rendering the scene information of the area that the target virtual object sees in real time in the virtual scene, that is, loading the scene information that expands around the target virtual object as the center. The field of view screen of the target virtual object in the virtual scene will change with the movement of the target virtual object. Since the scene data of the field of view screens of different virtual objects in the virtual scene are mutual, such as virtual object A can see virtual object B, and virtual object B can also see virtual object A. Therefore, when the target virtual object moves, attacks, releases skills, etc. in the virtual scene, causing the corresponding scene information to change, it is necessary to broadcast the changed scene information to other virtual objects so that the field of view screens of other virtual objects are updated synchronously, that is, the corresponding operations performed by the target virtual object are displayed in the updated field of view screen.

[0105] In order to reduce performance consumption without affecting the player experience, broadcasting can be performed only to areas that the target virtual object pays attention to and is interested in. In actual implementation, the virtual scene can be divided into multiple blocks, each block can include multiple corner areas, and the corner areas and the corners in the geometric figures corresponding to the blocks are in a one-to-one correspondence. Among them, the target virtual object is located in one of the blocks, and the block where the target virtual object is located can be called the target block. The field of view of the target virtual object is an area that extends 360 degrees around the target block with the target block as the center, such as a square area or a circular area centered on the target block. For example, the square area centered on the target block can be a 3*3 nine-square grid, and the target block where the target virtual object is located is the center grid of the nine-square grid. The nine-square grids are: the target block, 4 blocks adjacent to the target block (upper, lower, left, and right), and 4 diagonal blocks adjacent to the target area.

[0106] In some embodiments, the terminal may divide the virtual scene into blocks in the following manner: when the block is a rectangular block, obtain the block size of the rectangular block; divide the virtual scene into blocks according to the block size to obtain multiple rectangular blocks of the same size.

[0107] Here, when the block is a rectangular block or a square block, the virtual scene is divided into multiple rectangular blocks of the same size according to the block size of the rectangular block or the square block, such as the block size can be 3*3, or 3*5. Each block can be a three-dimensional space or a two-dimensional space, and the coordinate range of each block can be determined according to the spatial coordinate system of the virtual scene.

[0108] In some embodiments, the terminal may divide the virtual scene into blocks in the following manner: when the virtual scene includes multiple scene categories, perform scene recognition on the virtual scene to determine the area corresponding to each scene category; divide the virtual scene into blocks according to the area corresponding to each scene category to obtain blocks corresponding to each scene category.

[0109] Among them, the block sizes corresponding to different scene categories may be different. For example, in the combat scene, the interactions between virtual objects are frequent and the scene information is relatively rich. The area of ​​the combat scene can be divided into smaller blocks. For example, the background scene is used to introduce information related to the virtual scene. There are fewer interactions between virtual objects and relatively less scene information. The area of ​​the background scene can be divided into larger blocks. In this way, the virtual scene can be divided according to the actual situation, which is conducive to the subsequent loading and display of the field of view that conforms to the real scenario.

[0110] In some embodiments, the terminal may divide the virtual scene into blocks in the following manner: when there are multiple virtual objects in the virtual scene, the virtual scene is divided into blocks according to the distribution of the multiple virtual objects to obtain corresponding multiple blocks, so that the number of virtual objects included in each block is lower than the target number.

[0111] Here, the virtual scene is divided according to the distribution of virtual objects in the virtual scene, such as dividing the area with dense virtual objects into smaller blocks, and dividing the area with sparse virtual objects into larger blocks, so that the number of virtual objects contained in each block is the same or lower than the preset target number. In this way, the virtual scene is divided according to the actual situation, which is conducive to the subsequent loading and display of the field of view that conforms to the real scene.

[0112] Step 102: Determine the target block where the target virtual object is located, and adjacent blocks adjacent to the target block.

[0113] For example, see Figure 4 , Figure 4 The block display schematic diagram provided in the embodiment of the present application takes the square area centered on the target block where the target virtual object is located as an example. Figure 4 In the 3*3 nine-square grid shown, the central block 401 is the target block where the target virtual object is located, and the upper block 402, the lower block 403, the left block 404, and the right block 405 located in the central block are adjacent blocks.

[0114] Step 103: when it is determined based on the target position that the target virtual object is in the target corner area in the target block, a diagonal block in a plurality of blocks that is in a diagonal relationship with the target corner area is obtained.

[0115] Still Figure 4 For example, each block may include multiple corner areas. Figure 4 Taking the central block 401 as an example, the block is further divided into corner area 1, corner area 2, corner area 3, corner area 4 corresponding to each corner, and central sub-area 5 other than the corner area based on the four corners. When the target virtual object is in corner area 4, the block 406 in the nine-square grid that is diagonally related to the corner area 4 is used as the diagonal block. So far, the field of view of the current target virtual object includes: target block 401, adjacent block 402, adjacent block 403, adjacent block 404, adjacent block 405 and diagonal block 406, forming a "six-square grid", and the "six-square grid" is regarded as the field of view of the target virtual object in the virtual scene.

[0116] Step 104: Loading block scene information of the target block, adjacent blocks and diagonal blocks to present a field of view picture of the target virtual object in the virtual scene.

[0117] In some embodiments, the terminal can load the block scene information of the target block, adjacent blocks and diagonal blocks in the following manner: perform the following operations for each of the target block, adjacent blocks and diagonal blocks: when the block scene information of the block includes a first number of other virtual objects, and the first number exceeds a quantity threshold, filter out a second number of other virtual objects from the first number of other virtual objects based on the interaction relationship between each other virtual object and the target virtual object, or the distance between each other virtual object and the virtual object; load the block scene information including the second number of other virtual objects to present a field of view picture of the virtual objects in the virtual scene, and the presented field of view picture includes the second number of other virtual objects.

[0118] In actual applications, in order to ensure display clarity, the terminal can set a maximum number of people on the same screen to limit the upper limit of the field of view of the virtual object. When there are multiple other virtual objects in the virtual scene, that is, many players are gathered together, the display priority can be determined based on the interaction relationship between the other virtual objects and the target virtual object (such as teammates or enemies). For example, the display priority of other virtual objects (teammates) that belong to the same group as the target virtual object is higher than the display priority of other virtual objects (hostiles) that are not in the same group as the target virtual object. Or, the display priority is determined based on the distance between other virtual objects and the target virtual object. For example, the farther the other virtual objects are from the target virtual object, the lower their display priority. According to the display priority, a specified number of other virtual objects are screened out from all other virtual objects to count the screened out other virtual objects into the objects within the player's field of view.

[0119] In some embodiments, after loading the block scene information of the target block, adjacent blocks and diagonal blocks, the terminal can update the presented field of view in the following manner: when the target virtual object moves in the virtual scene, the moving position of the target virtual object is obtained; according to the moving position, the target block, adjacent blocks and diagonal blocks where the target virtual object is located are updated to obtain updated target blocks, updated adjacent blocks and updated diagonal blocks; load the block scene information of the updated target block, updated adjacent blocks and updated diagonal blocks to update the field of view of the target virtual object in the virtual scene.

[0120] Here, in actual application, when the target virtual object moves in the virtual scene, the field of view of the target virtual object will change synchronously, and the central block where the target virtual object is currently located needs to be re-determined according to the moving position of the target virtual object after the movement. Here, in order to facilitate the distinction from the central block (target block) where the target virtual object was located before the movement, the central block where the re-determined target virtual object is currently located is called the update target block, and with the update target block as the center, the blocks on the upper, lower, left and right sides adjacent to the update target block are called update adjacent blocks. When the target virtual object is in the corner area of ​​the update target block, the diagonal block that is diagonally related to the corner area is used as the update diagonal block, and the new "six-square grid" composed of the update target block, the update adjacent block and the update diagonal block is regarded as the current field of view of the target virtual object in the virtual scene. The block scene information is loaded on each block in the new "six-square grid" to update the field of view of the target virtual object in the virtual scene.

[0121] In some embodiments, the terminal may load the block scene information of the updated target block, updated adjacent blocks and updated diagonal blocks in the following manner: determine a first block set corresponding to the target position before the update, and a second block set corresponding to the moving position after the update; wherein the first block set includes the target block, adjacent blocks and diagonal blocks, and the second block set includes the updated target block, updated adjacent blocks and updated diagonal blocks; when there is no intersection between the first block set and the second block set, load the block scene information of the blocks in the second block set, and unload the block scene information of the blocks in the first block set.

[0122] Here, after the target virtual object moves, if there is no intersection between the first block set and the second block set, it means that the target block, adjacent block and diagonal block in the first block set have left the field of view of the target virtual object. In this case, while loading the block scene information of the block in the second block set, the block scene information of the block in the first block set is directly unloaded, so as to realize the real-time synchronous update of the field of view of the target virtual object.

[0123] In some embodiments, when there is an intersection between the first block set and the second block set, the intersection block included in the intersection can also be determined; a first difference block in the first block set that is different from the intersection block, and a second difference block in the second block set that is different from the intersection block are obtained; block scene information of the second difference block is loaded, and block scene information of the first difference block is unloaded.

[0124] Here, after the target virtual object moves, if the first block set and the second block set have an intersection, the intersection block (which must be a complete block) included in the intersection has not left the field of view of the target virtual object and should remain within the field of view of the target virtual object; the block in the virtual scene that exists in the first block set but not in the second block set (i.e., the first difference block) is a block that has left the field of view of the target virtual object and should be unloaded; the block that exists in the second block set but not in the first block set (i.e., the second difference block) is a block that is newly added to the field of view of the target virtual object; during the loading and unloading process, since the intersection block has been loaded, there is no need to load it again, and the block scene information of the second difference block that is newly added to the field of view of the target virtual object is loaded, and the block scene information of the first difference block that has left the field of view of the target virtual object is unloaded to update the field of view of the target virtual object in the virtual scene.

[0125] In some embodiments, the terminal may uninstall the block scene information of the blocks in the first block set in the following manner: when the uninstallation condition is met, the block scene information of the blocks in the first block set is uninstalled, and the uninstallation condition includes at least one of the following: the time when the virtual object leaves the target position exceeds the target time; the distance between the moving position and the target position exceeds the target distance.

[0126] In actual applications, the target virtual object may move back and forth within a small area. When determining the block to be unloaded, the survival time mechanism is activated, that is, to determine whether the time the virtual object has been away from the target position has reached a preset time threshold (target time). When the time of leaving reaches the preset time threshold, the survival time of the block is over, and the operation of unloading the block scene information of the block can be performed; or, by determining whether the distance between the moving position and the target position has reached the target distance, it is determined whether to perform the unloading operation. When the distance between the moving position and the target position has reached the preset target distance, the operation of unloading the block scene information of the block can be performed to ensure the realism of the field of view of the target virtual object. In this way, it is possible to avoid repeated loading and unloading caused by moving back and forth, resulting in excessive memory usage and even jamming.

[0127] In some embodiments, after loading the block scene information of the target block, adjacent blocks and diagonal blocks, when the field of view of the presented virtual scene includes other virtual objects and the other virtual objects move in the virtual scene, the terminal obtains the moving positions of the other virtual objects; according to the moving positions of the other virtual objects, the block scene information of the target block, adjacent blocks and diagonal blocks is updated; and the updated block scene information is loaded to update the field of view of the target virtual object in the virtual scene.

[0128] Here, when other virtual objects in the virtual scene actively enter or leave the field of view of the target virtual object, it will also cause the field of view of the target virtual object to change. In actual applications, since the scene data of the field of view of different virtual objects in the virtual scene are mutual, when other virtual objects move, the terminals of other virtual objects will also broadcast the changed block scene information to the terminal of the target virtual object (that is, the current terminal). After the current terminal receives the broadcast information, it loads the updated block scene information to achieve the update of the field of view of the target virtual object.

[0129] In some embodiments, before loading the block scene information of the target block, adjacent blocks and diagonal blocks, the terminal performs the following operations for each of the target blocks, adjacent blocks and diagonal blocks: detects the object pool used to store block scene information, and when the detection result indicates that there is block-associated block scene information in the object pool, extracts the block-associated block scene information from the object pool; when the detection result indicates that there is no block-associated block scene information in the object pool, creates block-associated block scene information; adds the block and the block-associated block scene information to a bidirectional linked list; wherein the bidirectional linked list is used for traversing and loading the block scene information of the target block, adjacent blocks and diagonal blocks.

[0130] Here, the object pool technology is used to manage the block scene information associated with each block. Before loading the block scene information of each block, the block scene information of the corresponding block must be obtained first. When acquiring, the following operations need to be performed on each block: first, determine whether there is block scene information of the block in the bidirectional linked list. When it is determined that the block scene information of each block exists in the bidirectional linked list, traverse the bidirectional linked list to load the block scene information, and then display the field of view of the target virtual object; when it is determined that the block scene information of each block does not exist in the bidirectional linked list, determine whether there is block scene information associated with the block in the object pool. When it is determined that the block scene information associated with the block exists in the object pool, extract the block scene information associated with the block from the object pool. When it is determined that the block scene information associated with the block does not exist in the object pool, create the block scene information associated with the block; then, add the block and the block scene information associated with the block to the bidirectional linked list, traverse the bidirectional linked list to load the block scene information, and when the block scene information of the block is unloaded, directly delete the corresponding block from the bidirectional linked list, and then display the field of view of the target virtual object.

[0131] In actual applications, virtual objects can also be used as units, and object pool technology can be used to manage virtual objects associated with each block to optimize the performance overhead caused by the creation of new objects. For example, before loading a virtual object, it is determined whether the allocated object table (which can also be a bidirectional linked list) has the required virtual object. When it is determined that the allocated object table has the required virtual object, the object properties are directly set. When it is determined that the allocated object table does not have the required virtual object, it is determined whether the object pool of the virtual object is empty. If it is empty, a new virtual object is created. Otherwise, the virtual object is taken out of the object pool for reuse, and the object properties are set after the virtual object is obtained; finally, the set object properties are added to the allocated object table to load the virtual object, and then the virtual object is displayed in the field of view of the target virtual object.

[0132] It should be noted that different types of virtual objects may correspond to different object pools, and the initial capacity of the object pool is set according to the usage frequency of the corresponding type of virtual objects.

[0133] Below, an exemplary application of the embodiment of the present application in an actual application scenario will be described. Taking a virtual scene as a game as an example, in the loading application involving the game, the relevant technology uses a "nine-square grid" or "five-square grid" loading method centered on the block where the player is located to load the scene to ensure the integrity of the player's field of view, but the "nine-square grid" loading method requires that the scene information of 9 blocks be always saved in the memory, and it cannot solve the problem of repeated loading and unloading caused by the player's rapid movement back and forth, and it is easy to cause jamming in extreme cases. As an optimization solution of the "nine-square grid" loading method, the "five-square grid" loading method only loads the scene information of the block where the player is located and the four adjacent blocks adjacent to the block. When the player is in the corner area (any one of the four corner areas) of the current block, the diagonal block adjacent to the corner area may be within the player's visible field of view, but the scene information of the diagonal block is not loaded, resulting in an incomplete player field of view.

[0134] To this end, an embodiment of the present application provides a method for displaying a screen of a virtual scene. According to the position of the player (i.e., the target virtual object mentioned above) in the game, the target block and the adjacent blocks of the target block are determined. When the player is in the target corner area in the target block, the diagonal block that is diagonally related to the target corner area is obtained, and the scene information of 6 blocks including the target block, adjacent blocks (4) and diagonal blocks is loaded. This ensures the integrity of the player's field of view. At the same time, by introducing a life time to avoid the jamming caused by repeated loading and unloading, and by using a reference counting method to manage the scene information referenced across blocks, the purpose of reducing memory usage, avoiding jamming and flexibly managing scene information is achieved.

[0135] See also Figure 5 , Figure 5The schematic diagram of the implementation structure of block loading provided in the embodiment of the present application includes: a stream class (Streaming class), an Object class and other classes, wherein the information stream class is also called a Streaming class, which is used to provide the top-level logic of resource management and loading strategies, including: WorldPlannerProxy (top-level logic, used to manage the entire system of block loading and unloading), WorldStreamer (used to control resource loading of the entire game), MultiScenePlanner (used to control loading between multiple scenes in the game) and SectoringSceneStreamer (used to control block loading within a scene). The Object class is a resource object class with its own reference counting, and its subclasses manage various types of resource entities, such as scene entities (SceneObject), block entities (SetorObject), independent entities (EntityObject), asset entities (AssetObject), layer entities (LayerObject) and lighting entities (LightingObject). It should be noted that the resource entity is the block scene information associated with the above blocks. If the block scene information includes virtual objects, the resource entity can be the corresponding virtual object. Other classes include object pools (such as RefObjectPool, which avoids the performance overhead of updating blocks through memory reuse), BaseResLoadProxy (which implements the logic of resource loading), and WorldData (which manages the data of the connection between scenes in the game).

[0136] In actual applications, a camera for collecting scene information is attached to the player. The player's movement in the virtual scene causes a change in the field of view, which is actually caused by the change in the scene information that can be collected by the attached camera. Next, the method for displaying the virtual scene provided in the embodiment of the present application is described by taking the player's perspective as an example. Figure 6 , Figure 6 A schematic diagram of a process for displaying a virtual scene provided in an embodiment of the present application, the method comprising:

[0137] Step 201: The terminal determines the target block where the player is located in the game, the adjacent blocks adjacent to the target block, and the diagonal blocks.

[0138] In actual implementation, the embodiment of the present application uses WorldPlannerProxy as the top-level interface, and uses the event method FixedUpdate to check and execute resource loading and unloading. When FixedUpdate is called, WorldStreamer.FixedUpdate is called to enter the management logic, and then MultiScenePlanner.FixedUpdate is called. MultiScenePlanner calls the managed SceneObject.UpdateSceneStreamer to update the scene information of each block. If there is scene information that needs to be unloaded, the reference is removed and the object is recycled.

[0139] Among them, the target block in step 201 is the central block where the player is located, the adjacent blocks are blocks adjacent to the target block in four directions: left, right, upward and downward, with the target block as the center, and the diagonal blocks are diagonal blocks that are in a diagonal relationship with the target corner area when the player is in the target corner area in the target block.

[0140] Step 202: Loading block scene information of the target block, adjacent blocks and diagonal blocks to display the player's field of view in the game.

[0141] Here, the block scene information of the target block, adjacent blocks and diagonal blocks is loaded to display the player's complete field of view in the game.

[0142] Step 203: Determine whether the player moves.

[0143] Here, when the player moves in the virtual scene, step 204 is executed; otherwise, step 205 is executed.

[0144] Step 204: Obtain the update target block and update adjacent blocks where the player is located in the game.

[0145] Here, SceneObject calls SectoringSceneStreamer.UpdateStreaming to determine whether the player has moved. If the player's movement causes the position to change, the central block where the player is located must be recalculated according to the player's moving position to obtain the updated target block (that is, the central block where the player is located after moving), and the adjacent blocks in the four directions of left, right, up, and down with the updated target block as the center are obtained to obtain the updated adjacent blocks. At this point, a five-square grid is formed by the updated target block (1) and the updated adjacent blocks (4) after the move.

[0146] Step 205: Determine whether the player is in the corner area of ​​the update target block.

[0147] Here, it is detected whether the player's moving position is in the four corner areas of the central block. When it is determined that the player is in the corner area of ​​the update target block, step 206 is executed; otherwise, step 208 is executed.

[0148] Step 206: Obtain an updated diagonal block that is diagonally related to the corner area.

[0149] Here, after the player moves, when the player is in the corner area of ​​the update target block, the diagonal block that is diagonally related to the corner area is obtained as the updated diagonal block caused by the movement. At this point, a six-square grid is formed by the updated target block after the move (1), the updated adjacent blocks (4) and the updated diagonal block (1).

[0150] Step 207: Load the block scene information of the update target block, the update adjacent blocks, and the update diagonal blocks to update the field of view of the target virtual object in the virtual scene.

[0151] Here, the block scene information of each block in the six-square grid formed above is loaded, and the block scene information of other loaded blocks that do not belong to the six-square grid is unloaded. When each block is loaded, the SectorObject loads the EntityObject and its resources (i.e., the block scene information). When the block is unloaded, the survival time mechanism is started to determine whether the player has been away from the central block for a time threshold. When the time threshold is reached, it indicates that the survival time has ended, and the unloading operation can be performed. The SectorObject removes the reference to the EntityObject to achieve the unloading purpose, such as Figure 7 As shown, Figure 7 A schematic diagram of the field of view display provided in an embodiment of the present application.

[0152] Step 208: Load and update the block scene information of the target block and the adjacent blocks to update the field of view of the target virtual object in the virtual scene.

[0153] In actual implementation, before loading, the first block set corresponding to the player before moving and the second block set corresponding to the player after moving can be determined, wherein the first block set includes the target block, the adjacent blocks and the diagonal blocks, and the second block set includes the updated target block, the updated adjacent blocks and the updated diagonal blocks; then it is determined that there is no intersection between the first block set and the second block set. When there is no intersection between the first block set and the second block set, the block scene information of the blocks in the second block set is loaded, and the block scene information of the blocks in the first block set is unloaded, that is, the block scene information of the updated target block, the updated adjacent blocks and the updated diagonal blocks after the player moves is loaded, and the block scene information of the target block, the adjacent blocks and the diagonal blocks before the player moves is unloaded, so as to update the field of view of the target virtual object in the virtual scene.

[0154] When there is an intersection between the first block set and the second block set, the intersection blocks included in the intersection (blocks that need to be retained within the player's field of view) can also be determined, and the first difference blocks in the first block set that are different from the intersection blocks (blocks that leave the player's field of view) and the second difference blocks in the second block set that are different from the intersection blocks (blocks newly added to the player's field of view) are obtained, the block scene information of the second difference blocks is loaded, and the block scene information of the first difference blocks is unloaded to update the field of view of the target virtual object in the virtual scene.

[0155] The embodiment of the present application adopts the object pool technology to manage the block scene information associated with each block to optimize the performance overhead caused by the creation of new block scene information. The process of creating and destroying the block scene information of each block can be found in Figure 8 , Figure 8 A schematic diagram of a method for processing block scene information provided in an embodiment of the present application, before loading, the corresponding block scene information is obtained by performing the operation shown in Figure x on each block in the player's target block, adjacent blocks and diagonal blocks.

[0156] Step 301: Determine whether there is block scene information of the block in the bidirectional linked list.

[0157] Among them, the bidirectional linked list is used for traversing and loading the block scene information of the player's target block, adjacent blocks and diagonal blocks to display the player's field of view in the game.

[0158] In actual implementation, it is determined whether there is block scene information of each block in the bidirectional linked list. When it is determined that there is no block scene information of each block in the bidirectional linked list, step 302 is executed; otherwise, step 306 is executed.

[0159] Step 302: Check whether there is block scene information associated with the block in the object pool.

[0160] The object pool is used to store block scene information. When it is determined that block scene information associated with a block exists in the object pool, step 303 is executed; otherwise, step 304 is executed.

[0161] Step 303: extracting the block scene information associated with the block from the object pool.

[0162] Step 304: Create block scene information associated with the block.

[0163] Step 305: Add the block and the block scene information associated with the block to the bidirectional linked list.

[0164] Step 306: Traverse the bidirectional linked list to load the block scene information.

[0165] Here, when traversing the bidirectional linked list, the block scene information of the player's target block, adjacent blocks and diagonal blocks is loaded, and the block scene information of other blocks except the target block, adjacent blocks and diagonal blocks is removed from the bidirectional linked list to achieve the purpose of unloading, so as to display the player's field of view in the game.

[0166] In actual applications, object pool technology can also be used to manage objects associated with each block to optimize the performance overhead caused by creating new objects. Taking SectorObject management as an example, the process of creating and destroying objects in the object pool can be seen in Fig. 9 , Fig. 9 A schematic diagram of a method for processing block scene information provided in an embodiment of the present application, the method comprising:

[0167] Step 401: Call the logic of creating an object pool segment, that is, call PoolRequestSector.

[0168] Step 402: Determine whether the allocated object table has the required object. If it is determined that the allocated object table has the required object, execute step 406; otherwise, execute step 403.

[0169] Step 403: Determine whether the object pool is empty, if so, execute step 404; otherwise, execute step 405.

[0170] Step 404: Create a new object.

[0171] Step 405: Take out the object from the object pool for reuse.

[0172] Step 406: Set object properties.

[0173] Step 407: Add the allocated object table and the block table.

[0174] Step 408: Load the object, that is, activate the SectorObject to make it appear in the game scene.

[0175] See also Fig.10 , Fig.10 The object recycling process diagram provided in the embodiment of the present application includes:

[0176] Step 501: Call the logic of recycling the object pool block, that is, call PoolRecycleSector.

[0177] Step 502: Remove objects from various tables in the management block.

[0178] Step 503: Reset various properties of the object and release its associated resources.

[0179] Step 504: Return to the object pool.

[0180] The other RefObject objects provided in the embodiment of the present application are also managed by the same object pool method. Each type of virtual object has an independent object pool, which is allocated and recycled by each type of object management class. The object pool is implemented using a stack container, and different initial capacities are set according to the different usage frequencies of each type. For example, the resources directly used in scenes such as SectorObject, EntityObject, AssetObject, and SceneObject are 16, and the Lightmap resources managed by LightingObject are 4.

[0181] See also Figures 11A-11B , Figures 11A-11B This is a schematic diagram of the effect comparison provided by the embodiment of the present application. Compared with the six-grid loading strategy provided by the embodiment of the present application and the nine-grid loading strategy in the related art, Fig.11A The number of objects loaded has been reduced from 1494 to 1057, and the number of resources loaded has been reduced from 823 to 510. Fig. 11B In the , the peak memory is reduced from 92MB to 57MB, and the memory value is optimized by 38%.

[0182] Through the above method, the embodiment of the present application provides a solution for managing block loading and unloading based on the player's position, so that the number of blocks stored in the memory is reduced to a maximum of 6, effectively reducing the CPU and memory usage in the scene, and avoiding the lag caused by frequent loading and unloading due to the player's rapid movement through the survival time, thereby realizing flexible resource management.

[0183] The following is a description of an exemplary structure of a virtual scene screen display device 465 provided in an embodiment of the present application implemented as a software module. In some embodiments, the image display device 465 is stored in Figure 2 The software modules in the virtual scene display device 465 in the memory 465 may include:

[0184] A first acquisition module 4651 is used to acquire a target position of a target virtual object in a virtual scene, wherein the virtual scene is divided into a plurality of blocks, each of which includes a plurality of corner regions, and the corner regions are in a one-to-one correspondence with corners in a geometric figure corresponding to the block;

[0185] A block determination module 4652 is used to determine a target block where the target virtual object is located, and adjacent blocks adjacent to the target block;

[0186] A second acquisition module 4653 is configured to acquire a diagonal block in the plurality of blocks that is in a diagonal relationship with the target corner area when it is determined based on the target position that the target virtual object is in a target corner area in the target block;

[0187] The information loading module 4654 is used to load the block scene information of the target block, the adjacent block and the diagonal block to present the field of view of the target virtual object in the virtual scene.

[0188] In some embodiments, the apparatus further comprises: a block division module, for obtaining a block size of the rectangular block when the block is a rectangular block;

[0189] The virtual scene is divided into blocks according to the block size to obtain a plurality of rectangular blocks of the same size.

[0190] In some embodiments, the block division module is further used to perform scene recognition on the virtual scene when the virtual scene includes multiple scene categories to determine the area corresponding to each of the scene categories;

[0191] The virtual scene is divided into blocks according to the areas corresponding to the scene categories to obtain blocks corresponding to the scene categories.

[0192] In some embodiments, the block division module is also used to divide the virtual scene into blocks according to the distribution of the multiple virtual objects when there are multiple virtual objects in the virtual scene, so as to obtain multiple corresponding blocks, so that the number of virtual objects included in each block is lower than the target number.

[0193] In some embodiments, the information loading module is further used to perform the following operations for each of the target block, the adjacent block and the diagonal block: when the block scene information of the block includes a first number of other virtual objects, and the first number exceeds a quantity threshold, filtering out a second number of other virtual objects from the first number of other virtual objects according to the interaction relationship between each of the other virtual objects and the target virtual object, or the distance between each of the other virtual objects and the target virtual object;

[0194] The block scene information including the second number of other virtual objects is loaded to present a field of view picture of the target virtual object in the virtual scene, wherein the field of view picture includes the second number of other virtual objects.

[0195] In some embodiments, after loading the block scene information of the target block, the adjacent block and the diagonal block, the device further includes:

[0196] A loading and updating module is used to obtain a moving position of the target virtual object when the target virtual object moves in the virtual scene;

[0197] According to the moving position, the target block, the adjacent block and the diagonal block where the target virtual object is located are updated to obtain an updated target block, an updated adjacent block and an updated diagonal block;

[0198] The block scene information of the update target block, the update adjacent block and the update diagonal block is loaded to update the field of view picture of the target virtual object in the virtual scene.

[0199] In some embodiments, the loading and updating module is further used to determine a first block set corresponding to the target position before updating, and a second block set corresponding to the moving position after updating;

[0200] The first block set includes the target block, the adjacent block and the diagonal block, and the second block set includes the updated target block, the updated adjacent block and the updated diagonal block;

[0201] When there is no intersection between the first block set and the second block set, the block scene information of the blocks in the second block set is loaded, and the block scene information of the blocks in the first block set is unloaded.

[0202] In some embodiments, the loading and updating module is further used to determine the intersection blocks included in the intersection when there is an intersection between the first block set and the second block set;

[0203] Acquire a first difference block in the first block set that is different from the intersection block, and a second difference block in the second block set that is different from the intersection block;

[0204] The block scene information of the second difference block is loaded, and the block scene information of the first difference block is unloaded.

[0205] In some embodiments, the loading and updating module is further used to uninstall the block scene information of the blocks in the first block set when an uninstallation condition is met, and the uninstallation condition includes at least one of the following:

[0206] The time duration of the target virtual object leaving the target position exceeds the target time duration;

[0207] The distance between the moving position and the target position exceeds a target distance.

[0208] In some embodiments, after the block scene information of the target block, the adjacent block and the diagonal block is loaded, the loading and updating module is further used to obtain the moving position of the other virtual object when the visual field of the presented virtual scene includes other virtual objects and the other virtual objects move in the virtual scene;

[0209] According to the moving positions of the other virtual objects, updating the block scene information of the target block, the adjacent blocks and the diagonal blocks;

[0210] The updated block scene information is loaded to update the field of view of the target virtual object in the virtual scene.

[0211] In some embodiments, before loading the block scene information of the target block, the adjacent block, and the diagonal block, the device further includes: a scene information acquisition module, configured to perform the following operations for each of the target block, the adjacent block, and the diagonal block:

[0212] Detecting an object pool for storing block scene information, and when a detection result indicates that the block scene information associated with the block exists in the object pool, extracting the block scene information associated with the block from the object pool;

[0213] When the detection result indicates that the block scene information associated with the block does not exist in the object pool, creating the block scene information associated with the block;

[0214] Adding the block and the block scene information associated with the block to a bidirectional linked list;

[0215] The bidirectional linked list is used for traversing and loading the block scene information of the target block, the adjacent block and the diagonal block.

[0216] The embodiment of the present application provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the above-mentioned method for displaying a virtual scene in the embodiment of the present application.

[0217] The embodiment of the present application provides a computer-readable storage medium storing executable instructions, wherein the executable instructions are stored. When the executable instructions are executed by a processor, the processor will execute the method for displaying a virtual scene provided by the embodiment of the present application, for example, Figure 3 The method shown.

[0218] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or it may be various devices including one or any combination of the above memories.

[0219] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0220] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

[0221] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.

[0222] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims

1. A method for displaying a virtual scene, characterized in that: The method comprises: Acquire a target position of a target virtual object in a virtual scene, wherein the virtual scene is divided into a plurality of blocks, each of the blocks includes a plurality of corner regions, and the corner regions are in a one-to-one correspondence with corners in a geometric figure corresponding to the block; Determine a target block where the target virtual object is located, and an adjacent block adjacent to the target block, wherein the target block includes a rectangular block or a square block, and the adjacent block and the target block have a common edge; When it is determined based on the target position that the target virtual object is in a target corner area in the target block, obtaining a diagonal block in the plurality of blocks that is in a vertical angle relationship with the target corner area, wherein the diagonal block is adjacent to the target block; The block scene information of the target block, the adjacent block and the diagonal block is loaded to present a field of view picture of the target virtual object in the virtual scene.

2. The method according to claim 1, characterized in that The method further comprises: When the block is a rectangular block, obtaining the block size of the rectangular block; The virtual scene is divided into blocks according to the block size to obtain a plurality of rectangular blocks of the same size.

3. The method according to claim 1, characterized in that The method further comprises: When the virtual scene includes multiple scene categories, performing scene recognition on the virtual scene to determine the area corresponding to each of the scene categories; The virtual scene is divided into blocks according to the areas corresponding to the scene categories to obtain blocks corresponding to the scene categories.

4. The method according to claim 1, characterized in that The method further comprises: When there are multiple virtual objects in the virtual scene, the virtual scene is divided into blocks according to the distribution of the multiple virtual objects to obtain corresponding multiple blocks, so that the number of the virtual objects included in each block is lower than the target number.

5. The method according to claim 1, characterized in that The loading of the block scene information of the target block, the adjacent block and the diagonal block includes: For each of the target block, the adjacent blocks and the diagonal blocks, the following operations are performed: When the block scene information of the block includes a first number of other virtual objects, and the first number exceeds a number threshold, filtering out a second number of other virtual objects from the first number of other virtual objects according to an interaction relationship between each of the other virtual objects and the target virtual object, or a distance between each of the other virtual objects and the target virtual object; The block scene information including the second number of other virtual objects is loaded to present a field of view picture of the target virtual object in the virtual scene, wherein the field of view picture includes the second number of other virtual objects.

6. The method according to claim 1, characterized in that After loading the block scene information of the target block, the adjacent block and the diagonal block, the method further includes: When the target virtual object moves in the virtual scene, obtaining a moving position of the target virtual object; According to the moving position, the target block, the adjacent block and the diagonal block where the target virtual object is located are updated to obtain an updated target block, an updated adjacent block and an updated diagonal block; The block scene information of the update target block, the update adjacent block and the update diagonal block is loaded to update the field of view picture of the target virtual object in the virtual scene.

7. The method according to claim 6, characterized in that The loading of the block scene information of the update target block, the update adjacent blocks, and the update diagonal blocks includes: Determine a first block set corresponding to the target position before updating, and a second block set corresponding to the moving position after updating; The first block set includes the target block, the adjacent block and the diagonal block, and the second block set includes the updated target block, the updated adjacent block and the updated diagonal block; When there is no intersection between the first block set and the second block set, the block scene information of the blocks in the second block set is loaded, and the block scene information of the blocks in the first block set is unloaded.

8. The method according to claim 7, characterized in that The method further comprises: When there is an intersection between the first block set and the second block set, determining intersection blocks included in the intersection; Acquire a first difference block in the first block set that is different from the intersection block, and a second difference block in the second block set that is different from the intersection block; The block scene information of the second difference block is loaded, and the block scene information of the first difference block is unloaded.

9. The method according to claim 7, characterized in that The step of uninstalling the block scene information of the blocks in the first block set includes: When an uninstallation condition is met, the block scene information of the blocks in the first block set is uninstalled, and the uninstallation condition includes at least one of the following: The time duration of the target virtual object leaving the target position exceeds the target time duration; The distance between the moving position and the target position exceeds a target distance.

10. The method according to claim 1, characterized in that After loading the block scene information of the target block, the adjacent block and the diagonal block, the method further includes: When the visual field of the presented virtual scene includes other virtual objects, and the other virtual objects move in the virtual scene, obtaining the moving positions of the other virtual objects; According to the moving positions of the other virtual objects, updating the block scene information of the target block, the adjacent blocks and the diagonal blocks; The updated block scene information is loaded to update the field of view of the target virtual object in the virtual scene.

11. The method according to claim 1, characterized in that Before loading the block scene information of the target block, the adjacent block and the diagonal block, the method further includes: For each of the target block, the adjacent blocks and the diagonal blocks, the following operations are performed: Detecting an object pool for storing block scene information, and when a detection result indicates that the block scene information associated with the block exists in the object pool, extracting the block scene information associated with the block from the object pool; When the detection result indicates that the block scene information associated with the block does not exist in the object pool, creating the block scene information associated with the block; Adding the block and the block scene information associated with the block to a bidirectional linked list; The bidirectional linked list is used for traversing and loading the block scene information of the target block, the adjacent block and the diagonal block.

12. A virtual scene display device, characterized in that: The device comprises: A first acquisition module is used to acquire a target position of a target virtual object in a virtual scene, wherein the virtual scene is divided into a plurality of blocks, each of which includes a plurality of corner regions, and the corner regions are in a one-to-one correspondence with corners in a geometric figure corresponding to the block; A block determination module, used to determine a target block where the target virtual object is located, and an adjacent block adjacent to the target block, wherein the target block includes a rectangular block or a square block, and the adjacent block has a common edge with the target block; A second acquisition module is configured to acquire a diagonal block in the plurality of blocks that is in a vertical angle relationship with the target corner area when it is determined based on the target position that the target virtual object is in a target corner area in the target block, wherein the diagonal block is adjacent to the target block; The information loading module is used to load the block scene information of the target block, the adjacent block and the diagonal block to present the field of view picture of the target virtual object in the virtual scene.

13. A terminal device, characterized in that: include: A memory for storing executable instructions; A processor is used to implement the method for displaying a virtual scene as described in any one of claims 1 to 11 when executing the executable instructions stored in the memory.

14. A computer-readable storage medium, characterized in that: Executable instructions are stored, and when executed by a processor, the method for displaying a virtual scene as described in any one of claims 1 to 11 is implemented.

15. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the method for displaying a virtual scene as described in any one of claims 1 to 11 is implemented.

Citation Information

Patent Citations

  • Method and device to generate virtual resources in 3D game scene

    CN108211354A

  • Information synchronization method and device, storage medium and electronic device

    CN110898425A