A data processing method, apparatus, electronic device, computer-readable storage medium, and computer program product for a virtual scene.

By removing and updating the state data of virtual objects in the virtual scene, the problem of high computational load caused by frame synchronization is solved, achieving resource-saving and timely presentation of state changes.

CN122298002APending Publication Date: 2026-06-30TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2024-12-27
Publication Date
2026-06-30

Smart Images

  • Figure CN122298002A_ABST
    Figure CN122298002A_ABST
Patent Text Reader

Abstract

This application provides a data processing method, apparatus, electronic device, computer program product, and computer-readable storage medium for virtual scenes. Embodiments of this application can be applied to data processing in game scenes and virtual reality scenes. The method includes: removing a first virtual object from the virtual scene when it meets data simulation conditions; updating the state data of the first virtual object in memory to obtain updated state data; and loading the first virtual object into the virtual scene based on the updated state data when it meets real-time display conditions. This application reduces the computational load required for updating virtual scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to computer technology, and more particularly to a data processing method, apparatus, electronic device, computer-readable storage medium, and computer program product for a virtual scene. Background Technology

[0002] To provide users with a more realistic experience in virtual scenes, some elements need to change over time, unaffected by distance from the user-controlled virtual object or whether the user-controlled virtual object is offline. Frame synchronization technology can achieve this effect; however, updating the virtual scene via frame synchronization involves significant computational overhead. Summary of the Invention

[0003] This application provides a data processing method, apparatus, electronic device, computer-readable storage medium, and computer program product for virtual scenes, which can reduce the amount of computation required for updating virtual scenes.

[0004] The technical solution of this application embodiment is implemented as follows:

[0005] This application provides a data processing method for a virtual scene, the method comprising:

[0006] When the first virtual object in the virtual scene meets the data simulation conditions, the first virtual object is removed from the virtual scene;

[0007] Update the state data of the first virtual object in memory to obtain the updated state data of the first virtual object;

[0008] When the first virtual object meets the conditions for real-time display, the first virtual object is loaded into the virtual scene based on the updated state data.

[0009] This application provides a data processing device for a virtual scene, including:

[0010] The object removal module is used to remove the first virtual object from the virtual scene when the first virtual object in the virtual scene meets the data simulation conditions;

[0011] The state update module is used to update the state data of the first virtual object in memory to obtain the updated state data of the first virtual object.

[0012] An object loading module is used to load the first virtual object into the virtual scene based on the updated state data when the first virtual object reaches the real-time display condition.

[0013] In the above scheme, the first virtual object includes: a first sub-object, the state data includes: first sub-state data, and the updated state data includes: updated first sub-state data;

[0014] The state update module is further configured to update the first sub-state data of the first sub-object based on the first attribute information of the first sub-object, so as to obtain the updated first sub-state data.

[0015] In the above scheme, the first virtual object includes: a first sub-object and a second sub-object, the state data includes: first sub-state data and second sub-state data, and the updated memory data includes: updated first sub-state data and updated second sub-state data.

[0016] The state update module is further configured to: determine associated sub-objects from the second sub-objects for the first sub-object; update the first sub-state data of the first sub-object based on the second attribute information of the associated sub-objects to obtain the updated first sub-state data of the first sub-object; and update the second sub-state data of the associated sub-object based on the first attribute information of the first sub-object to obtain the updated second sub-state data of the associated sub-object.

[0017] In the above scheme, the state update module is further configured to determine the target simulated behavior for the first sub-object; and based on the target simulated behavior, determine the associated sub-object of the first sub-object from the second sub-object.

[0018] In the above scheme, the state update module is further configured to determine candidate simulated behaviors of the first sub-object based on the behaviors allowed to be executed at the current time; and determine the target simulated behavior from the candidate simulated behaviors based on the first sub-state data.

[0019] In the above scheme, the state update module is further configured to extract candidate sub-objects from the second sub-object for supporting the target simulation behavior; and to determine the candidate sub-objects in the allowed-use state as the associated sub-objects of the first sub-object.

[0020] In the above scheme, the state update module is further configured to calculate the state update amount for the first sub-object based on the second attribute information of the associated sub-object; and update the first sub-state data using the state update amount to obtain the updated first sub-state data of the first sub-object.

[0021] In the above scheme, the object removal module is further configured to hide the first virtual object and delete the rendering object of the first virtual object when the first virtual object in the virtual scene reaches the data simulation conditions.

[0022] In the above scheme, the object loading module is further configured to, when the first virtual object reaches the real-time display condition, create a rendering object for the first virtual object based on the updated state data, and load the first virtual object into the virtual scene through the rendering object.

[0023] In the above scheme, the data processing device for the virtual scene further includes: an object creation module, used to create and update a simulation object for the first virtual object;

[0024] The state update module is further configured to update the state data of the first virtual object in the memory through the updated simulation object, so as to obtain the updated state data.

[0025] This application provides an electronic device, the electronic device comprising:

[0026] Memory is used to store executable instructions or computer programs.

[0027] The processor, when executing computer-executable instructions or computer programs stored in the memory, implements the data processing method for the virtual scene provided in the embodiments of this application.

[0028] This application provides a computer-readable storage medium storing a computer program or computer-executable instructions, which, when executed by a processor, implements the data processing method for a virtual scene provided in this application.

[0029] This application provides a computer program product, including a computer program or computer executable instructions. When the computer program or computer executable instructions are executed by a processor, they implement the data processing method for a virtual scene provided in this application.

[0030] The embodiments of this application have the following beneficial effects: When the first virtual object in the virtual scene meets the data simulation conditions, the first virtual object in the virtual scene is removed, and the state data of the first virtual object is updated in memory, so that the state changes of the first virtual object can be recorded in real time. Then, when the first virtual object meets the real-time display conditions, the first virtual object can be reloaded into the virtual scene based on the updated state data, so that the changes of the first virtual object can still be presented visually, thereby realizing the update of the virtual scene. In this process, only the state data of the first virtual object needs to be updated, without calculating all elements in the virtual scene, which reduces the amount of computation required for updating the virtual scene. Attached Figure Description

[0031] Figure 1 This is a schematic diagram of the architecture of the data processing system for virtual scenes provided in the embodiments of this application;

[0032] Figure 2 This is provided by the embodiments of this application. Figure 1 A schematic diagram of the server structure in the diagram;

[0033] Figure 3 This is a flowchart illustrating the data processing method for virtual scenes provided in the embodiments of this application. Figure 1 ;

[0034] Figure 4 This is a flowchart illustrating the data processing method for virtual scenes provided in the embodiments of this application. Figure 2 ;

[0035] Figure 5 This is a schematic diagram illustrating a user's game character being within the visible range of a virtual base, as provided in an embodiment of this application.

[0036] Figure 6 This is a schematic diagram illustrating a user's game character being outside the visible range of a virtual base, as provided in an embodiment of this application.

[0037] Figure 7 This is a schematic diagram illustrating the user's game character re-entering the visible range of a virtual stronghold, as provided in an embodiment of this application.

[0038] Figure 8 This is a schematic diagram of the storage box provided in an embodiment of this application;

[0039] Figure 9 This is a flowchart illustrating the implementation of the virtual base simulation calculation provided in the embodiments of this application;

[0040] Figure 10 This is a schematic diagram illustrating the relationship between the visible range of a user's game character and a virtual base, provided in an embodiment of this application. Figure 1 ;

[0041] Figure 11 This is a schematic diagram illustrating the relationship between the visible range of a user's game character and a virtual base, provided in an embodiment of this application. Figure 2 ;

[0042] Figure 12 This is a schematic diagram illustrating the relationship between the entities and data interfaces of the visual objects provided in the embodiments of this application;

[0043] Figure 13 This is a schematic diagram of the data interface for the virtual pet provided in an embodiment of this application;

[0044] Figure 14 This is a schematic diagram of the data interface for the virtual building provided in an embodiment of this application;

[0045] Figure 15 This is a diagram illustrating the simulation calculation process of the remaining recovery time of a virtual pet provided in an embodiment of this application;

[0046] Figure 16 This is a schematic diagram illustrating the behavior that requires the participation of virtual buildings during the simulation provided in the embodiments of this application. Detailed Implementation

[0047] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0048] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is 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.

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

[0050] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0051] Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in the embodiments of this application is for the purpose of describing the embodiments of this application only and is not intended to limit this application.

[0052] In the implementation of this application, the collection and processing of relevant data should strictly comply with the requirements of relevant laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.

[0053] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.

[0054] 1) A virtual scene refers to a scene used to provide virtual activities for virtual objects, such as a game scene, a simulation scene, an animation scene, etc. This virtual scene can be a simulation environment of the real world, a semi-simulated / semi-fictional virtual environment, or a purely fictional virtual environment. A virtual scene can be any of a two-dimensional, 2.5-dimensional, or three-dimensional virtual scene; this application does not limit the dimension of the virtual scene. For example, a virtual scene may include the sky, land, ocean, etc., and the land may include environmental elements such as deserts and cities. Virtual objects can be controlled to perform virtual activities within this virtual scene.

[0055] 2) Virtual objects refer to the images of various people and things that can be interacted with in a virtual scene, or movable objects in a virtual scene, or objects that can be interacted with in a virtual scene. These virtual objects can be virtual characters, virtual animals, anime characters, and virtual props, such as the people and animals displayed in the virtual scene; a virtual object can also be a virtual character representing the user in the virtual scene. A virtual scene can include multiple virtual objects, each with its own shape and volume, occupying a portion of the space in the virtual scene; a virtual object can also be a functional virtual location in the virtual scene, such as the user's virtual home, virtual base, etc.

[0056] 3) State data is a collection of information describing the current state of a virtual object. The current state of a virtual object will change with the user's operation and the passage of time in the virtual scene, and this change needs to be recorded through state data.

[0057] 4) Data simulation conditions are used to determine whether to remove a virtual object from the virtual scene and to perform background simulation updates for the virtual object. That is, when a virtual object meets the data simulation conditions, the virtual object will no longer be displayed in the virtual scene, and its state changes will be simulated in memory and will not be reflected in the virtual scene.

[0058] 5) Real-time display conditions are used to determine whether virtual objects need to be loaded into the virtual scene. That is, when a virtual object meets the real-time display conditions, the virtual object needs to be loaded into the virtual scene so that changes in the state of the virtual object can be reflected in the virtual scene.

[0059] 6) A rendering object is an object that generates the visual appearance of a virtual object based on the relevant data of the virtual object in memory. This object usually contains visually related attributes such as the virtual object's mesh, texture, and material.

[0060] 7) Intelligent agents refer to artificial intelligence entities that are capable of making autonomous decisions and taking actions within a virtual environment.

[0061] 8) Streaming level mechanism is a visual element loading mechanism in the rendering engine. It loads virtual objects according to demand. For example, it loads visual elements near the virtual objects controlled by the user, while visual elements that exceed the distance threshold are not loaded.

[0062] To provide users with a more realistic experience in virtual environments, some elements need to change over time, regardless of their distance from the user-controlled virtual object or whether the virtual object is offline. For example, if the user-controlled virtual object assigns a production task to its virtual pet before going offline, when the user-controlled virtual object comes back online, it will see the items generated by the virtual pet, thus experiencing the virtual environment changing over time.

[0063] In related technologies, the above effect can be achieved through frame synchronization, which uses the starting frame and the user's historical input to restore changes in the virtual scene, i.e., update the virtual scene. However, frame synchronization often involves all elements in the virtual scene. As the virtual scene grows, the number of changes that need to be restored increases, thus increasing the computational load. Therefore, it is evident that related technologies suffer from a significant computational burden when updating the virtual scene.

[0064] This application provides a data processing method, apparatus, electronic device, computer-readable storage medium, and computer program product for virtual scenes, which can reduce the computational load required for updating virtual scenes. The following describes exemplary applications of the electronic device provided in this application. The electronic device provided in this application can be implemented as various types of terminals such as laptops, tablets, desktop computers, set-top boxes, smartphones, smart speakers, smartwatches, smart TVs, and in-vehicle terminals, or it can be implemented as a server. The following will describe exemplary applications when the electronic device is implemented as a server.

[0065] See Figure 1 , Figure 1 This is a schematic diagram of the architecture of a virtual scene data processing system provided in this application embodiment. To support a data processing application for a virtual scene, in the virtual scene data processing system 100, a terminal 400 (terminals 400-1 and 400-2 are shown as examples) connects to a server 200 via a network 300. The network 300 can be a wide area network (WAN), a local area network (LAN), or a combination of both. It should be noted that the virtual scene data processing system 100 may also include a database 500, which can be independent of the server or configured within the server 200. Figure 1 This illustrates the scenario where database 500 is independent of server 200.

[0066] Server 200 is used to remove the first virtual object from the virtual scene when the first virtual object in the virtual scene meets the data simulation conditions; update the memory data of the first virtual object to obtain the updated memory data of the first virtual object; load the first virtual object into the virtual scene based on the updated memory data when the first virtual object meets the real-time display conditions; and send the data of the virtual scene to terminal 400.

[0067] Terminal 400 is used to receive virtual scene data sent by the server and display the virtual scene on a graphical interface (graphical interfaces 400-11 and 400-21 are shown as examples).

[0068] In some embodiments, server 200 may be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. Terminals and servers can be connected directly or indirectly via wired or wireless communication, which is not limited in this embodiment.

[0069] See Figure 2 , Figure 2 This is provided by the embodiments of this application. Figure 1 A schematic diagram of the structure of a server (an embodiment of an electronic device) in the diagram. Figure 2 The server 200 shown includes at least one processor 210, memory 250, and at least one network interface 220. The various components of server 200 are coupled together via a bus system 240. It is understood that the bus system 240 is used to implement communication between these components. In addition to a data bus, the bus system 240 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 2 The general labeled all buses as Bus System 240.

[0070] The processor 210 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. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0071] The memory 250 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 250 may optionally include one or more storage devices physically located away from the processor 210.

[0072] The memory 250 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 250 described in this application embodiment is intended to include any suitable type of memory.

[0073] In some embodiments, memory 250 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.

[0074] Operating system 251 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;

[0075] The network communication module 252 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 220, exemplary network interfaces 220 including: Bluetooth, WiFi, and Universal Serial Bus (USB), etc.

[0076] In some embodiments, the data processing device for virtual scenes provided in this application can be implemented in software. Figure 2 A data processing device 255 for a virtual scene stored in memory 250 is shown. This device can be software in the form of programs and plugins, and includes the following software modules: an object removal module 2551, a state update module 2552, an object loading module 2553, and an object creation module 2554. These modules are logically linked and can therefore be arbitrarily combined or further separated according to their implemented functions. The functions of each module will be described below.

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

[0078] In some embodiments, a terminal or server (both possible implementations of electronic devices) can implement the data processing method for virtual scenes provided in this application by running various computer-executable instructions or computer programs. For example, computer-executable instructions can be microprogram-level commands, machine instructions, or software instructions. Computer programs can be native programs or software modules in an operating system; they can be native applications (APPs), i.e., programs that need to be installed in the operating system to run, such as game APPs or virtual reality APPs; or they can be applets that can be embedded in any APP, i.e., programs that only need to be downloaded to a browser environment to run. In summary, the aforementioned computer-executable instructions can be any form of instruction, and the aforementioned computer programs can be any form of application, module, or plugin.

[0079] The data processing method for virtual scenes provided in this application will be described below with reference to exemplary applications and implementations of the electronic devices provided in the embodiments of this application. As mentioned above, the electronic device implementing the data processing method for virtual scenes in the embodiments of this application can be a terminal, a server, or a combination of both. Therefore, the executing entity of each step will not be described again below.

[0080] See Figure 3 , Figure 3 This is a flowchart illustrating the data processing method for virtual scenes provided in the embodiments of this application. Figure 1 , will combine Figure 3 The steps shown are explained below. Figure 3 The main component of the process is electronic equipment.

[0081] Step 101: When the first virtual object in the virtual scene meets the data simulation conditions, remove the first virtual object from the virtual scene.

[0082] This application embodiment updates the virtual scene to allow users to perceive changes in the virtual scene over time, thus providing a more realistic experience. First, the electronic device determines whether a first virtual object already loaded in the virtual scene meets the data simulation conditions. If the first virtual object meets the conditions, it means that the first virtual object does not currently need to be loaded in the virtual scene, and the electronic device removes the loaded first virtual object from the virtual scene. It should be noted that although removing the first virtual object from the virtual scene makes it invisible to the user, in order to ensure that the state of the first virtual object still changes over time, the state data of the first virtual object needs to be simulated and updated in the background. This allows for rapid restoration of the state changes of the first virtual object when it needs to be reloaded into the virtual scene, ensuring that the latest state of the first virtual object is presented to the user.

[0083] In this embodiment, the virtual scene can be a game scene, such as a large-scale open-world game scene, a role-playing game (RPG) scene, etc.; the virtual scene can also be a virtual reality scene, such as a virtual reality city scene, a virtual reality forest scene, etc. The virtual scene contains a first virtual object and a second virtual object. The second virtual object is a user-controlled virtual object, thus representing the user. The user can control the second virtual object to move within the virtual scene and interact with the first virtual object in the virtual scene, etc. The first virtual object can be a single virtual object in the virtual scene other than the second virtual object, such as other user-controlled virtual objects, non-player characters (NPCs), a virtual building, etc.; the first virtual object can also be a virtual facility comprising multiple sub-objects and possessing certain functions, such as a user's virtual home, virtual base, etc., which are not limited in this embodiment.

[0084] In this context, NPCs can be controlled by artificial intelligence agents, which are artificial intelligence entities capable of making autonomous decisions and taking actions within a virtual scene. These NPCs can act autonomously within the virtual scene, such as moving randomly or actively interacting with virtual objects (which can be user-controlled virtual objects or other NPCs) in the virtual scene, engaging in combat, etc. When the first virtual object is a virtual facility that includes multiple sub-objects and has certain functions, the sub-objects included in the first virtual object can be virtual objects that can interact with the second virtual object, such as virtual pets, virtual buildings, virtual props, etc. Thus, the first virtual object can be regarded as a collection of these interactive virtual objects.

[0085] Data simulation conditions are used to determine whether to remove a virtual object from the virtual scene and to perform background simulation updates for the first virtual object. In this embodiment, the data simulation conditions may include one of the following: the second virtual object is located outside the display range of the first virtual object; or the second virtual object changes from an online state to an offline state. The display range of the first virtual object is a boundary used to control whether the first virtual object is visible, i.e., it determines when to load and remove the first virtual object.

[0086] In other words, when the first virtual object is far from the second virtual object, meaning the user cannot see the first virtual object, or perhaps when the user logs off, the electronic device will remove the first virtual object from the virtual scene and perform a simulated update for the first virtual object in the background. This allows for on-demand loading and removal of the first virtual object, ensuring timely release of the first virtual resources needed for loading the first virtual resource and reducing unnecessary resource consumption. It should be noted that in this embodiment, although the first virtual object is removed from the virtual scene when the user logs off, a simulated update is performed in the background to quickly restore the state changes of the first virtual object when the user re-enters the virtual scene. However, performing a simulated update for the first virtual object in the background consumes certain computing resources; if the user is offline for a long time, this will result in a waste of computing resources. At this time, the electronic device can limit the duration of the simulation update of the first virtual object by using a time threshold. Thus, the data simulation condition can be that the second virtual object changes from an online state to an offline state, and the offline duration is less than the time threshold. When the offline duration is greater than the time threshold, the electronic device will cancel the simulation update of the first virtual object. At this time, the electronic device can use frame synchronization to restore the state change of the first virtual object.

[0087] It should be noted that the display range of the first virtual object can be preset by the virtual scene developers, set by the user in the virtual scene control panel, or automatically set by the electronic device according to the level difficulty and the virtual equipment held by the first virtual object (for example, when the first virtual object holds a virtual prop that increases the display range, the electronic device can increase the display range of the first virtual object). This application embodiment does not limit this. The aforementioned time threshold can be preset by the virtual scene developers, set by the user in the virtual scene control panel, or set according to the user's usage habits of the virtual scene (for example, according to the frequency and duration of the user's short offline time). This application embodiment does not specifically limit this either.

[0088] The following section explains the process of removing the first virtual object from the virtual scene.

[0089] In some embodiments of this application, Figure 3 Step 101, which is to remove the first virtual object from the virtual scene when the first virtual object in the virtual scene meets the data simulation conditions, can be achieved by the following process: when the first virtual object meets the data simulation conditions, hide the first virtual object in the virtual scene and delete the rendering object of the first virtual object.

[0090] In other words, when the electronic device determines that the first virtual object meets the data simulation conditions, it can first set the first virtual object from a visible state to an invisible state, thus removing it from the virtual scene. Next, the electronic device will locate the rendering object of the first virtual object in the rendering pipeline and delete it from the pipeline, thereby removing the first virtual object. Of course, the electronic device can also release the computing resources occupied by the rendering object, such as memory and video memory.

[0091] It should be noted that when the first virtual object is a single virtual object other than the second virtual object, the electronic device can make the virtual object invisible and delete the rendering object of the virtual object from the rendering pipeline; while when the first virtual object is a virtual facility that includes multiple sub-objects and has certain functions, the electronic device makes all the sub-objects of the virtual facility invisible, locates the rendering objects of all the sub-objects in the rendering pipeline, and then deletes these rendering objects.

[0092] Here, the rendering object of the first virtual object refers to the object that generates the visual appearance of the first virtual object based on the relevant data of the first virtual object in memory. This object typically contains visually relevant attributes such as the first virtual object's mesh, texture, and material. The rendering pipeline refers to the entire process of converting a 3D model into a 2D image and displaying it on a graphical interface. This process, after processing the 3D vertex data through vertex processing, primitive assembly, clipping, rasterization, and pixel processing, ultimately generates the corresponding 2D image. Therefore, removing a rendering object from the rendering pipeline can be understood as stopping the supply of data for that rendering object to the rendering pipeline, thus ensuring that the rendering object is not processed by the rendering pipeline.

[0093] Electronic devices can call the rendering engine through its Application Programming Interface (API) and remove rendered objects from the rendering pipeline through the rendering engine. The rendering engine here can be Unreal Engine (UE) or Unity; this embodiment of the application does not limit the choice.

[0094] Step 102: Update the state data of the first virtual object in memory to obtain the updated state data of the first virtual object.

[0095] Although the electronic device removes the first virtual object from the virtual scene, it does not delete the first virtual object's state data from memory. Instead, it updates the first virtual object's state data based on the update logic of the first virtual object's state data, obtaining the updated state data, thereby achieving a background simulation update of the first virtual object. The data update logic of the first virtual object can be the same as or different from the data update logic when the first virtual object is displayed in the virtual scene. The data update logic can be set by the developers during the virtual scene development phase.

[0096] It should be noted that the state data of the first virtual object is a collection of information describing the current state of the first virtual object. This current state changes with user actions and the passage of time within the virtual scene. The state data of the first virtual object may include its location, health, mana, hunger, fatigue, position within the virtual scene, behavioral data, virtual resources it possesses, and its resource usage. In addition to storing the state data, the memory may also store static first attribute information of the first virtual object, such as its virtual skills, type, capabilities, benefits it can provide to other virtual objects, the state recovery amount in a single simulation calculation, and the state recovery amount per unit time. This embodiment of the application does not limit this specific storage method.

[0097] It should also be noted that when the first virtual object is a single virtual object, the state data of the first virtual object is the set of the current states of the virtual object; when the first virtual object is a functional facility that includes multiple sub-objects, the state data of the first virtual object may include the set of the current states of each sub-object, that is, the state data of the first virtual object includes the sub-state data of each sub-object.

[0098] When the first virtual object is a single virtual object, the electronic device can update the state data of the first virtual object in memory based on the attribute information of the first virtual object and the time data of the virtual scene. For example, when the first virtual object is an NPC, the behavior data of the first virtual object can be updated based on the current time of the virtual scene and the behavior schedule of the NPC. The electronic device can also update the state data of the first virtual object by combining the historical interaction information between the first virtual object and the second virtual object and the time data of the virtual scene. For example, after the second virtual object casts a virtual skill with continuous damage on the first virtual object, the health of the first virtual object can be updated based on the damage value per second of the virtual skill, the casting time of the virtual skill, and the current time of the virtual scene.

[0099] When the first virtual object includes multiple sub-objects, the electronic device can directly update the sub-state data of each sub-object based on the attribute information of each sub-object and the time data of the virtual scene. Alternatively, it can update the sub-state data of each sub-object by combining the historical interaction information between the second virtual object and each sub-object, as well as the time data of the virtual scene. It can also update the sub-state data of each sub-object by combining the interaction between different sub-objects and the time data of the virtual scene.

[0100] In some embodiments of this application, the first virtual object includes a first sub-object, the state data includes first sub-state data, and the updated state data includes the updated first sub-state data. In this case, Figure 3 Step 102, which is to update the state data of the first virtual object in memory to obtain the updated state data of the first virtual object, can be achieved by the following process: based on the first attribute information of the first sub-object, update the first sub-state data of the first sub-object to obtain the updated first sub-state data.

[0101] It should be noted that the first sub-object is a movable sub-object within the first virtual object. In the real-time example of this application, the electronic device can update the first sub-state data without interacting with other sub-objects; that is, it can update the first sub-state data based solely on its own attribute information. The first sub-object can be a virtual pet in an abnormal state (e.g., health or mana is below a threshold), and the first sub-state can be health or mana; the first sub-object can also be a virtual monster, and the first sub-state can be the level of the virtual monster.

[0102] The electronic device can determine the change in the first sub-state of the first sub-object during a single simulation from its attribute information. It then uses this change to update the first sub-state data, obtaining the updated first sub-state data. For example, if the first sub-object is a virtual pet in an abnormal state, the electronic device can determine the reduction time of the abnormal state during a single simulation from the virtual pet's first attribute information. It can then use this reduction time to update the remaining time of the abnormal state, thus obtaining the updated remaining time and completing the update of the first sub-state data.

[0103] The electronic device can also determine the state change of the first sub-state of the first sub-object per unit time from its attribute information. Using this state change and the time change calculated in the simulation (i.e., the time difference between the current simulation and the previous simulation), the total state change is calculated. This total state change is then used to update the first sub-state data, resulting in the updated first sub-state data. For example, when the first sub-object is a virtual monster, the electronic device determines the amount of health points restored to the virtual monster per unit time from its first attribute information. Using the time difference between the current simulation and the previous simulation, it calculates the amount of health points that should be restored and updates the virtual monster's health points accordingly.

[0104] See Figure 4 , Figure 4 This is a flowchart illustrating the data processing method for virtual scenes provided in the embodiments of this application. Figure 2In some embodiments of this application, the first virtual object includes: a first sub-object and a second sub-object; the state data includes: first sub-state data and second sub-state data; and the updated memory data includes: updated first sub-state data and updated second sub-state data. In this case, Figure 3 Step 102, which involves updating the state data of the first virtual object in memory to obtain the updated state data of the first virtual object, can be achieved through the following processing:

[0105] Step 1021: For the first sub-object, determine the associated sub-object from the second sub-object.

[0106] It should be noted that the first sub-object is a movable sub-object within the first virtual object, such as a virtual pet, while the second sub-object is a non-movable sub-object within the first virtual object, such as a static virtual building. When the first virtual object includes both a first sub-object and a second sub-object, the electronic device can determine associated sub-objects for the first sub-object from the second sub-object. These associated sub-objects are those that can influence the state of the first sub-object; for example, they can increase the first sub-object's hunger value or deplete its stamina value. Correspondingly, the first sub-object can also influence the second sub-state data of the associated sub-object, such as changing the associated sub-object's occupancy status or the quantity of consumable virtual items within it.

[0107] The electronic device can randomly select one of the second sub-objects as the associated sub-object of the first sub-object. For example, when the first sub-object is a virtual pet, and the second sub-objects include a virtual mine (used to produce virtual ore), a virtual food box (used to increase the virtual pet's hunger value), and a virtual bed (used to increase the virtual pet's stamina value), the electronic device can determine any one of the virtual mine, virtual food box, and virtual bed as the associated sub-object of the virtual pet.

[0108] Electronic devices can also associate idle sub-objects within a second sub-object with the first sub-object. For example, when the first sub-object is a virtual pet and the second sub-object includes multiple virtual beds, the electronic device can associate the currently idle (i.e., unoccupied) virtual beds with the virtual pet.

[0109] The electronic device can also first determine the behavior that needs to be simulated for the first sub-object, and then determine the sub-objects that are compatible with the target simulation behavior from the sub-objects included in the second sub-object as the associated sub-objects of the first sub-object.

[0110] In other words, in some embodiments... Figure 4 Step 1021, namely, determining the associated sub-object from the second sub-object for the first sub-object, can be achieved through the following process: determining the target simulated behavior for the first sub-object; and determining the associated sub-object of the first sub-object from the second sub-object based on the target simulated behavior.

[0111] Here, the target simulated behavior of the first sub-object is the behavior that is simulated and calculated for the first sub-object at the current moment, which can be sleeping, eating, relaxing, working, etc.; the sub-object that matches the target simulated behavior refers to the sub-object that is necessary to complete the target simulated behavior. For example, sleeping needs to be completed through a virtual bed, eating needs to be completed through a virtual food box, relaxing needs to be completed through a virtual hot spring, etc.

[0112] The electronic device can choose any one of the available simulation behaviors as the target simulation behavior for the first sub-object from all available simulation behaviors at the current moment, or it can first determine the available simulation behaviors for the first sub-object based on the current time, and then select the most suitable target simulation behavior for the first sub-object based on its own state.

[0113] In other words, in some embodiments, the above-mentioned determination of the target simulated behavior for the first sub-object can be achieved through the following process: determining candidate simulated behaviors for the first sub-object based on behaviors that are allowed to be executed at the current time; and determining the target simulated behavior from the candidate simulated behaviors based on the first sub-state data.

[0114] To make the virtual scene more realistic, the execution of the first child object's behavior is affected by the time in the virtual scene. For example, resting can only be done at night, while eating and working can only be done during the day. Therefore, the electronic device needs to combine the current time of the virtual scene to determine the behaviors that the first child object is allowed to execute, and then use these behaviors as candidate simulated behaviors. Thus, the candidate simulated behaviors include all behaviors that the first child object is allowed to execute at the current time.

[0115] For example, if the first sub-object is a virtual pet, which can only rest at night and engage in various activities during the day, such as eating, soaking in hot springs, and working, and the virtual scene is currently in daytime, then the electronic device can identify eating, soaking in hot springs, and working as candidate simulated behaviors for the virtual pet. As another example, if the first sub-object is an NPC, which can wander around both day and night, and the virtual scene is currently in nighttime, the electronic device can identify wandering as a candidate simulated behavior for the NPC.

[0116] After identifying candidate simulated behaviors, the electronic device combines the first sub-state data corresponding to the first sub-object to determine the most suitable candidate simulated behavior for the first sub-object and designates that candidate simulated behavior as the target simulated behavior. When the first sub-state data includes multiple state values, the electronic device can use the candidate simulated behavior corresponding to the lowest state value as the target simulated behavior, or it can use the candidate simulated behavior corresponding to a state value exceeding a corresponding threshold as the target simulated behavior. This embodiment of the application does not limit this. For example, when the first sub-object is a virtual pet, and the first sub-state data includes the virtual pet's fatigue value and satiety value, and the candidate simulated behaviors include resting, eating, and working, the electronic device can determine resting as the target simulated behavior for the virtual pet when the virtual pet's fatigue value is greater than the corresponding threshold. As another example, when the first sub-object is a virtual pet, and the first sub-state data includes satiety value and fatigue value, the electronic device can determine eating as the target simulated behavior for the virtual pet when the satiety value is lower than the fatigue value. Of course, the electronic device can also determine the target simulated behavior based on the priority of the candidate simulated behaviors.

[0117] This completes the determination of the target's simulated behavior, which will facilitate the subsequent determination of associated sub-objects based on the target's simulated behavior.

[0118] In some embodiments, the above-described process of determining the associated sub-object of the first sub-object from the second sub-object based on the target simulated behavior can be achieved by the following steps: extracting candidate sub-objects from the second sub-object to support the target simulated behavior; and determining the candidate sub-objects in the allowed-use state as associated sub-objects of the first sub-object.

[0119] In other words, the electronic device first parses each sub-object contained in the second sub-object to determine whether it supports the target simulated behavior, and then selects the sub-objects that support the target simulated behavior as candidate sub-objects. Next, the electronic device determines whether each candidate sub-object is allowed to be used, and selects the candidate sub-objects that are allowed to be used as the associated sub-objects of the first sub-object.

[0120] For example, the first sub-object is a virtual pet, and the second sub-object includes multiple virtual food boxes, multiple virtual beds, multiple virtual hot springs, and other virtual buildings. If the target simulated behavior is dining, the electronic device will consider all virtual food boxes that support dining as candidate sub-objects, and will consider the virtual food boxes that are in an allowed-to-use state (i.e., those with more than a threshold of food and are in an idle state) as the associated sub-objects of the virtual pet. If the target simulated behavior is soaking in hot springs, the electronic device will consider all virtual hot springs as candidate sub-objects, and will consider the virtual hot springs that still have available spaces as the associated sub-objects of the virtual pet.

[0121] In other embodiments, the above-described method of determining the associated sub-object of the first sub-object from the second sub-object based on the target simulation behavior can also be achieved by the following process: directly determining the sub-object in the second sub-object used to support the target simulation behavior as the associated sub-object of the first sub-object.

[0122] Step 1022: Based on the second attribute information of the associated sub-object, update the first sub-state data of the first sub-object to obtain the updated first sub-state data of the first sub-object.

[0123] The associated sub-object is one or more of the second sub-objects; therefore, the associated sub-object also has corresponding second attribute information and second sub-state data. After obtaining the associated sub-object, the electronic device acquires the second attribute information of the associated sub-object and uses the acquired second attribute information to update the first sub-state data of the first sub-object, thereby obtaining the updated first sub-state data.

[0124] It should be noted that the second attribute information of the associated sub-object refers to the attribute information related to the state changes of the first sub-object, that is, the attribute information that can bring gains or losses to the state of the first sub-object. For example, when the first sub-state data is the satiety value and the associated sub-object is a virtual food box, the second attribute information of the associated sub-object can be the increase in the satiety value in a single simulation; when the first sub-state data is the fatigue value and the associated sub-object is a virtual bed, the second attribute information of the associated sub-object can be the decrease in the fatigue value per unit time. In other words, the change pattern of the first sub-state data can be determined based on the second attribute information of the associated sub-object.

[0125] Thus, in some embodiments, Figure 4 Step 1022, which is to update the first sub-state data of the first sub-object based on the second attribute information of the associated sub-object to obtain the updated first sub-state data of the first sub-object, can be achieved by the following process: calculate the state update amount for the first sub-object based on the second attribute information of the associated sub-object; update the first sub-state data using the state update amount to obtain the updated first sub-state data of the first sub-object.

[0126] In other words, the electronic device first needs to determine the state change of the first sub-object during the current simulation from the second attribute information of the associated sub-object, i.e., determine the state update amount. Then, based on the first sub-state data, this state update amount is added or subtracted to obtain the updated first sub-state data. The state update amount can be determined by the state change amount in a single simulation provided by the second attribute information, or by the state change amount per unit time provided by the second attribute information, and the duration of the current simulation.

[0127] For example, the associated sub-object is a virtual food box, the first sub-object is a virtual pet, and the first sub-state data is the satiety value of the virtual pet. If the second attribute information is the satiety value that the virtual food box can increase per second, the electronic device will calculate the increase in the satiety value of the virtual pet during this simulation based on the duration of this simulation, such as 5 seconds, and add the increase to the original satiety value to obtain the updated satiety value of the virtual pet. If the second attribute information is the increase in satiety value provided by the virtual food box in each simulation, the electronic device will directly add the increase to the original satiety value to obtain the updated satiety value of the virtual pet.

[0128] Step 1023: Based on the first attribute information of the first sub-object, update the second sub-state data of the associated sub-object to obtain the updated second sub-state data of the associated sub-object.

[0129] Since the associated sub-object has been used by the first sub-object, its state has changed. Therefore, the electronic device needs to update the associated sub-object's state by combining its first attribute information and second sub-state data, ensuring the latest state is recorded in memory. Here, the first attribute information of the first sub-object refers to the attribute information associated with the state change of the associated sub-object, i.e., the attribute information that updates the state of the second sub-object. For example, if the associated sub-object is a virtual food box, the second sub-state data could be the remaining food quantity, and the first attribute information could be the amount of food consumed in a single simulation; if the associated sub-object is a virtual hot spring, the second sub-state data could be the current user of the virtual hot spring, and the first attribute information could be the identifier information of the first sub-object.

[0130] Therefore, in this embodiment of the application, the electronic device can determine the state change amount of the second sub-state data based on the first attribute information of the first sub-object, and update the second sub-state data using the state change amount to obtain the updated second sub-state data. For example, when the associated sub-object is a virtual food box, the electronic device can use the amount of food consumed in this simulation to calculate the updated remaining food amount to complete the update of the first sub-state data.

[0131] The electronic device can also rewrite the second sub-state data based on the first attribute information of the first sub-object, thereby updating the second sub-state data. For example, when the associated sub-object is a virtual hot spring and the second sub-state data is the user of the virtual hot spring, the electronic device can change the usage status of the virtual hot spring from blank to the identification information of the first sub-object.

[0132] After obtaining the updated first sub-state data and the updated second sub-state data, the update of the state data of the first virtual object is completed.

[0133] Step 103: When the first virtual object meets the conditions for real-time display, load the first virtual object in the virtual scene based on the updated memory data.

[0134] After receiving the updated state data of the first virtual object, the electronic device determines whether the first virtual object has met the real-time display conditions. If it does, it reloads the first virtual object into the virtual scene based on the updated memory data to restore its latest state, allowing the user to perceive the changes in the first virtual object over time. If the first virtual object has not met the real-time display conditions, the electronic device begins the next round of simulated updates to its state data.

[0135] It should be noted that the real-time display conditions are used to determine whether virtual objects need to be loaded in the virtual scene. The real-time display conditions include one of the following conditions: the second virtual object is within the display range of the first virtual object, or the second virtual object changes from an offline state to an online state.

[0136] In other words, when the first virtual object is closer to the second virtual object, meaning the user can see the first virtual object, or when the user logs in to enter the virtual scene, the first virtual object needs to be reloaded into the virtual scene so that it can be presented to the user.

[0137] In some embodiments of this application, Figure 3 Step 103, which is loading the first virtual object into the virtual scene based on the updated state data when the first virtual object reaches the real-time display condition, can be achieved through the following process: when the first virtual object reaches the real-time display condition, create a rendering object for the first virtual object based on the updated state data, and load the first virtual object into the virtual scene through the rendering object.

[0138] When the electronic device determines that the first virtual object meets the real-time display conditions, it will first use the updated state data of the first virtual object to create a new rendering object for the first virtual object, and input the rendering object into the rendering pipeline for processing, so that the rendering object can be rendered into the virtual scene, thereby realizing the loading of the first virtual object.

[0139] The creation of a rendering object based on the updated state data can be achieved through the following processes: parsing the updated state data to determine the attributes of the rendering object to be created; loading the resources required by the rendering object, such as meshes, textures, and animations; calling the rendering engine to instantiate the rendering object based on the loaded resources; and adding necessary components to the rendering object, such as colliders and particle systems. After these processes, the rendering object of the first virtual object can be obtained.

[0140] The rendering pipeline's processing of rendered objects can include the following stages: vertex processing, which converts the world coordinates of the rendered object into view coordinates, and then converts the view coordinates into screen coordinates based on the camera's position and view; clipping, which removes parts that are outside the camera's field of view or are occluded; rasterization, which converts the clipped geometry into pixels, involving dividing the clipped geometry into fragments (i.e., pixel-level graphic elements) and determining the color and depth of each fragment; fragment processing, which applies textures, lighting, shadows, and other effects to each fragment to determine the color of each pixel; and output merging, where the output of the rendering pipeline is merged into the framebuffer for display on the graphical interface.

[0141] It should be noted that when the first virtual object is a single virtual object, the electronic device loads the virtual object into the virtual scene; while when the first virtual object includes multiple sub-objects, the electronic device loads each sub-object into the virtual scene based on the updated sub-state data of each sub-object.

[0142] Understandably, compared to related technologies where frame synchronization of all elements in the virtual scene is required, leading to a large computational load during virtual scene updates, this embodiment removes the first virtual object from the virtual scene when it meets the data simulation conditions. The state data of the first virtual object is then updated in memory, allowing its state changes to be recorded in real time. When the first virtual object meets the real-time display conditions, it is reloaded into the virtual scene based on the updated state data, ensuring that changes to the first virtual object are still visually apparent. This achieves virtual scene updates. Furthermore, this process only requires updating the state data of the first virtual object, without needing to calculate all elements in the virtual scene, thus reducing the computational load required for virtual scene updates.

[0143] It should be noted that after the electronic device removes the first virtual object from the virtual scene, it may be unable to update the state data of the first virtual object in memory due to reasons such as missing data carrier or unexecutable processing logic. Missing data carrier means that the instance of the first virtual object provides a data structure for storing its state data. If the instance of the first virtual object does not exist, these data structures also do not exist, and therefore the state data cannot be stored in memory, thus preventing updates to the state data in memory. Unexecutable processing logic means that the instance of the first virtual object typically defines methods or functions related to the logical processing of the first virtual object. If the instance of the first virtual object does not exist, these methods and functions also do not exist, making it impossible to update the state data. Therefore, in this embodiment, after the electronic device removes the first virtual object from the virtual scene, it needs to create a simple replacement object for the first virtual object to update the state data through this replacement object.

[0144] In other words, in some embodiments of this application, in Figure 3 After step 101 and before step 102, that is, after the first virtual object in the virtual scene reaches the data simulation condition and the first virtual object is removed from the virtual scene, and before the state data of the first virtual object in memory is updated to obtain the updated state data of the first virtual object, the method also includes the following processing: creating an updated simulation object for the first virtual object.

[0145] Correspondingly, Figure 3 Step 102, which is to update the state data of the first virtual object in memory to obtain the updated state data of the first virtual object, can be achieved by the following process: updating the state data of the first virtual object in memory through the update simulation interface to obtain the updated state data.

[0146] Here, the updated simulation object is a simplified replacement for the first virtual object. It can retain only the data structure of the state data in the first virtual object, the attribute information needed to update the state data, such as the interaction logic with other virtual objects, and the identification information of the first virtual object, while excluding the visual appearance data of the first virtual object, such as mesh and texture data. This allows the first virtual object to be represented in less memory, ensuring that the state data of the first virtual object can be updated normally in memory, and also removing redundant information that is not related to the update of the state data, thus saving memory space.

[0147] In this embodiment, the electronic device can instantiate a first virtual object to obtain an instance of the first virtual object, delete information unrelated to the update of state data from the instance, and use the instance after deletion as the update simulation object of the first virtual object. The electronic device can read the state data of the first virtual object from the data structure provided by the update simulation object, as well as the attribute information provided by the update simulation object, and update the state data of the first virtual object.

[0148] The following describes the specific application scenarios of the data processing method for virtual scenes in the embodiments of this application.

[0149] The virtual scene data processing method of this application embodiment can be applied to the data processing of game scenes. In this case, the first virtual object is a game element in the game scene. When the game element in the game scene reaches the data simulation condition, the game element is removed from the game scene. The state data of the game element in memory is updated to obtain the updated state data of the game element. When the game element reaches the real-time display condition, the game element is loaded into the game scene based on the updated state data.

[0150] The virtual scene data processing method of this application embodiment can also be applied to the data processing of virtual reality scenes. In this case, the first virtual object is the visual element in the virtual reality scene. When the visual element in the virtual reality scene reaches the data simulation condition, the visual element is removed from the virtual reality scene; the state data of the visual element in memory is updated to obtain the updated state data of the visual element; when the visual element reaches the real-time display condition, the visual element is loaded into the virtual reality scene based on the updated state data.

[0151] The following will describe an exemplary application of the embodiments of this application in a real-world application scenario.

[0152] The embodiments of this application are implemented in a scenario where data processing is performed on a virtual stronghold (corresponding to the first virtual object) in a game scene.

[0153] First, the display changes of virtual strongholds in the game scene will be explained. See [link / reference] Figure 5 , Figure 5 This is a schematic diagram illustrating a user's game character within the visible range (corresponding to the display range) of a virtual stronghold, as provided in this application embodiment. As can be seen from game scene 5-1, when the game character 5-12 (corresponding to the second virtual object) is within the visible range of the virtual stronghold 5-11, the virtual pets and virtual buildings in the virtual stronghold are loaded onto the graphical interface. Furthermore, the virtual pets perform tasks on the virtual buildings; for example, one virtual pet produces virtual ore in a virtual mine, while another transports the virtual ore to a storage box.

[0154] If a user's game character leaves a virtual base when the storage box is empty, and the server detects that the distance to the virtual base is greater than the distance threshold (corresponding to the data simulation condition), the server will destroy the virtual base through the streaming level mechanism. Figure 6 This is a schematic diagram of a user's game character being outside the visible range of a virtual stronghold, as provided in this application embodiment. As can be seen from game scene 6-1, when the user's game character 6-11 is very far away from the virtual stronghold, the virtual stronghold has been removed from game scene 6-1 by the server.

[0155] In this scenario, the server performs simulated calculations on the data (corresponding to state data) of the virtual stronghold in memory every 5 seconds. This ensures that even if the server removes each visible object from the virtual stronghold, the activity of each visible object continues in the background. Thus, when the user's game character re-enters the visible range of the virtual stronghold (corresponding to the real-time display conditions), the virtual stronghold is restored to its original display using the simulated data (corresponding to the updated state data).

[0156] Figure 7 This is a schematic diagram of a user's game character re-entering the visible range of a virtual stronghold, as provided in the embodiments of this application. As can be seen from game scene 7-1, when the user's game character 7-12 re-enters the visible range of the virtual stronghold 7-11, the virtual pets in the virtual stronghold 7-11 are still working on the virtual buildings, for example, a virtual pet is still moving virtual ore.

[0157] Figure 8 This is a schematic diagram of the storage box provided in the embodiments of this application. When the user triggers the opening of the storage box, the specific contents of the storage box will be displayed in the game scene 8-1. At this time, the number of each virtual object in the storage box is determined by the data calculated by simulation. In this way, the user can feel that the virtual base is still running after leaving the virtual base.

[0158] The following section explains the implementation process of the simulation calculation for virtual base stations.

[0159] Figure 9 This is a flowchart illustrating the implementation of the virtual base simulation calculation provided in this application embodiment. See also: Figure 9 The server will start a timed operation event in each frame. The timed operation event includes executing steps 2001 to 2002 in each frame, executing steps 2003 to 2011 every 5 seconds, and executing steps 2012 to 2013 in each frame.

[0160] Step 2001: Determine if the game character is within the visible range of the stronghold. If not, proceed to step 2002; if yes, no further processing is performed.

[0161] Figure 10 This is a schematic diagram illustrating the relationship between the visible range of a user's game character and a virtual base, provided in an embodiment of this application. Figure 1 When the user's game character 10-1 is within the display range 10-3 of the virtual stronghold 10-2, the virtual pets and virtual buildings of the virtual stronghold 10-2 are present and can be displayed to the user. The virtual pets are controlled by intelligent agents to perform various activities, such as moving, eating, working, etc. Driving the virtual pets to perform these behaviors requires a large amount of computing power.

[0162] Step 2002: Destroy all rendering objects in the virtual base, including the rendering objects of the virtual pet (corresponding to the first sub-object) and the rendering objects of the virtual building (corresponding to the second sub-object).

[0163] If it is detected that the user's game character leaves the virtual extreme and moves to a distance until it is outside the visible range of the virtual stronghold, all visible elements in the virtual stronghold, namely the rendering objects of virtual pets and virtual buildings, will be destroyed. At this time, there is no need to calculate the virtual stronghold anymore, and since the user's game character has moved away from the virtual stronghold, the user will not know that the virtual stronghold has been destroyed.

[0164] Figure 11 This is a schematic diagram illustrating the relationship between the visible range of a user's game character and a virtual base, provided in an embodiment of this application. Figure 2 When the user's game character 11-1 is outside the display range 11-3 of the virtual stronghold 11-2, the destruction process of the virtual stronghold 11-2 will be triggered.

[0165] Step 2003: Determine whether the rendering objects in the base have been destroyed. If yes, proceed to step 2004; otherwise, no further processing is performed.

[0166] Step 2004: Create a data interface using the data in memory (corresponding to updating the simulated object). This operation interface includes the data interface for the virtual pet and the data interface for the virtual building.

[0167] The server creates data interfaces for each visible object in the virtual base—namely, virtual objects and virtual buildings—to simulate the rendering objects' operations on data in memory, such as querying a virtual pet's health or modifying its status. Subsequently, the server will use these data interfaces to simulate the state of virtual pets and virtual buildings even when no physical entities of the virtual pets and virtual buildings exist. The server can simulate this every 5 seconds. Therefore, subsequent data processing for virtual pets and virtual buildings can be performed through their respective data interfaces.

[0168] For example, Figure 12This is a schematic diagram illustrating the relationship between the entities and data interfaces of the visual objects provided in an embodiment of this application. From... Figure 12 As can be seen from this, the created data interface 12-1 is used to replace entity 12-2 of the visible object in the virtual stronghold in order to realize the operation of the data of the virtual stronghold in memory.

[0169] Figure 13 This is a schematic diagram of the data interface for the virtual pet provided in this application embodiment. Since the physical entity of the virtual pet no longer exists, in order to ensure that the simulation calculation of the virtual pet can be performed normally, the server needs to create a corresponding data interface 13-2 for each virtual pet in the virtual stronghold from the data 13-1 of the virtual stronghold in memory.

[0170] Because some behaviors of virtual pets need to be simulated in conjunction with corresponding virtual structures, such as dining, which requires the virtual food box to be simulated, the server also needs to create a corresponding data interface for each virtual structure. Figure 14 This is a schematic diagram of the data interface of the virtual building provided in the embodiment of this application. The server needs to create a corresponding data interface 14-2 for each virtual building in the virtual base from the data 14-1 of the virtual base in memory.

[0171] It should be noted that the virtual buildings here can include virtual beds, virtual food boxes, virtual hot springs, and virtual workplaces, etc.

[0172] Step 2005: Determine if the virtual pet's health is ≤ 0 and the remaining recovery time is > 0. If yes, proceed to step 2006; otherwise, proceed to step 2007.

[0173] Step 2006: Reduce the remaining recovery time of the virtual pet (corresponding to the first sub-state data) by 5 seconds.

[0174] For example, Figure 15 This is a diagram illustrating the simulation calculation process of the remaining recovery time of a virtual pet provided in this application embodiment. First, the server needs to determine whether the virtual pet's health is ≤ 0.15-1. If so, it continues to determine whether the remaining recovery time of the virtual pet is > 0.15-2. If not, the remaining recovery time is reduced by 5 seconds.

[0175] For the remaining virtual pets that do not require health regeneration, further simulations will continue, all of which require the participation of virtual structures. For example, Figure 16This is a schematic diagram illustrating the virtual building's participation in the simulation provided in this application embodiment. First, the server needs to determine whether it is nighttime (16-1). If yes, it simulates the virtual pet's resting behavior (16-2). If no, it can simulate the virtual pet's eating behavior (16-3), hot spring soaking behavior (16-4), and working behavior (16-5). Below, we continue with... Figure 9 These simulation processes will be explained.

[0176] Step 2007: Determine if it is currently nighttime. If yes, proceed to step 2008; otherwise, proceed to steps 2009 through 2011.

[0177] Step 2008: Simulate rest behavior (corresponding to the target simulated behavior). This process includes the following steps:

[0178] Step 20081: Iterate through all unassigned virtual pets.

[0179] Iterate through all unassigned virtual pets, sort them by fatigue value, and put the one with the highest fatigue value at the top.

[0180] Step 20082: Determine if there are any vacant virtual beds (here, all virtual beds correspond to candidate sub-objects). If yes, proceed to step 20083; otherwise, no further processing is performed.

[0181] Step 20083: Assign the virtual pet to the virtual bed (associated sub-object).

[0182] Obtain all virtual beds and assign them to virtual beds in the order of the virtual pets. When a virtual bed is full, assign the virtual pet to the next virtual bed.

[0183] Step 20084: Increase the virtual pet's spirit value (corresponding to the first sub-state data). Then, continue with step 20081.

[0184] For virtual pets assigned to virtual beds, the mental value increases by 1 point per second (corresponding to the second attribute information), and the data in memory is modified through the data interface of the aforementioned virtual pet.

[0185] Step 2009: Simulate dining behavior (corresponding to the target simulated behavior). This process includes the following steps:

[0186] Step 20091: Iterate through unassigned and hungry virtual pets.

[0187] Iterate through all unassigned virtual pets that are in a state of hunger, sort the virtual pets whose hunger level is greater than a threshold, and put the virtual pets with the highest hunger level at the front.

[0188] Step 20092: Determine if there are any virtual food boxes with remaining space (here, all virtual food boxes are the corresponding candidate sub-objects). If yes, proceed to step 20093; otherwise, no further processing is performed.

[0189] Step 20093: Assign the virtual pet to this virtual food box (corresponding associated sub-object).

[0190] Obtain all virtual food boxes containing food, and assign virtual pets to these food boxes for meals according to the aforementioned order.

[0191] Step 20094: Increase the virtual pet's satiety value (corresponding to the first sub-state data).

[0192] By using the data interface of the virtual pet created above, the data of the virtual pet in memory can be modified, that is, the hunger value can be increased.

[0193] Step 20095: Deduct the quantity of food in the virtual food box (corresponding to the second sub-state data). Then, continue with step 20091.

[0194] For the virtual food box, the remaining amount of food in the virtual food box in memory will be modified through the corresponding data interface.

[0195] Step 2010: Simulate hot spring bathing behavior (corresponding to the target simulated behavior). This process includes the following steps:

[0196] Step 20101: Iterate through unassigned, mentally unstable virtual pets.

[0197] Iterate through all unassigned virtual pets and obtain those with a spirit value less than the threshold. Sort the obtained virtual pets and place the one with the lowest spirit value at the top.

[0198] Step 20102: Determine if there is a virtual hot spring with a virtual pet available (here, all virtual hot springs are the corresponding candidate sub-objects). If yes, proceed to step 20103; otherwise, no further processing is performed.

[0199] Step 20103: Assign the virtual pet to this virtual hot spring (corresponding associated sub-object).

[0200] Step 20104: Increase the virtual pet's spirit value (corresponding to the first sub-state data). After that, continue with step 20101.

[0201] Iterate through all the virtual hot springs, find those with available slots, assign the virtual pet to the hot spring, modify the virtual pet's spirit value in memory, and modify the usage status of the virtual hot spring in memory, i.e., record the virtual pet currently in use.

[0202] Step 2011: Simulate work behavior (corresponding to target simulated behavior), this process includes the following steps:

[0203] Step 20111: Iterate through all unassigned virtual pets.

[0204] Step 20112: Determine if there are any workable virtual workplaces (here, all virtual workplaces are the corresponding candidate sub-objects). If yes, proceed to step 20113; otherwise, no further processing is performed.

[0205] Acquire all working virtual buildings, such as virtual buildings awaiting the addition of virtual materials for construction, virtual mines that have not yet been mined, virtual forests that have not yet been mined, and virtual ranches that have not yet been used for animal husbandry.

[0206] Step 20113: Assign the virtual pet to this virtual workplace (corresponding associated sub-object).

[0207] Acquire the virtual pet's work capabilities, match the virtual pet's work capabilities with the work requirements of the available virtual buildings, and if a match is successful, assign the virtual pet to the corresponding virtual building to work.

[0208] Step 20114: Reduce the virtual pet's sanity and hunger values ​​(corresponding to the first sub-state data).

[0209] This reduces the virtual pet's sanity and hunger levels based on the duration of its work.

[0210] Step 20115: Modify the work progress and output quantity of the virtual workplace. Then, continue with step 20111.

[0211] This section records the virtual pets working on virtual buildings and calculates the corresponding output based on the working time. For example, for virtual buildings waiting to be constructed with virtual materials, the amount of virtual materials already invested is increased; for virtual mines that have not yet been mined, the mining progress and the amount of virtual ore already produced are increased; for virtual forests that have not yet been mined, the mining progress and the amount of virtual timber already produced are increased; and for virtual ranches that have not yet been used for animal husbandry, the animal husbandry progress and the amount of virtual animal husbandry products already produced are increased.

[0212] 2012. Determine if the game character is within the visible range of the virtual base. If yes, proceed to step 2013; otherwise, do nothing.

[0213] 2013. Use the simulated data to create rendering objects for the virtual stronghold.

[0214] When the user's game character re-enters the virtual base, the virtual base is restored based on the data obtained from the previous simulation calculations.

[0215] It is understood that in the embodiments of this application, user information, such as data related to the user's game character, is involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with relevant laws, regulations and standards.

[0216] The following description continues to illustrate the exemplary structure of the virtual scene data processing device 255 provided in the embodiments of this application as a software module. In some embodiments, such as... Figure 2 As shown, the software modules in the data processing device 255 storing the virtual scene in the memory 450 may include:

[0217] The object removal module 2551 is used to remove the first virtual object from the virtual scene when the first virtual object in the virtual scene meets the data simulation conditions;

[0218] The state update module 2552 is used to update the state data of the first virtual object in memory to obtain the updated state data of the first virtual object.

[0219] The object loading module 2553 is used to load the first virtual object into the virtual scene based on the updated state data when the first virtual object reaches the real-time display condition.

[0220] In the above scheme, the first virtual object includes: a first sub-object, the state data includes: first sub-state data, and the updated state data includes: updated first sub-state data;

[0221] The state update module 2552 is further configured to update the first sub-state data of the first sub-object based on the first attribute information of the first sub-object, so as to obtain the updated first sub-state data.

[0222] In the above scheme, the first virtual object includes: a first sub-object and a second sub-object, the state data includes: first sub-state data and second sub-state data, and the updated memory data includes: updated first sub-state data and updated second sub-state data.

[0223] The state update module 2552 is further configured to: determine an associated sub-object from the second sub-object for the first sub-object; update the first sub-state data of the first sub-object based on the second attribute information of the associated sub-object to obtain the updated first sub-state data of the first sub-object; and update the second sub-state data of the associated sub-object based on the first attribute information of the first sub-object to obtain the updated second sub-state data of the associated sub-object.

[0224] In the above scheme, the state update module 2552 is further configured to determine the target simulated behavior for the first sub-object; and based on the target simulated behavior, determine the associated sub-object of the first sub-object from the second sub-object.

[0225] In the above scheme, the state update module 2552 is further configured to determine candidate simulated behaviors of the first sub-object based on the behaviors allowed to be executed at the current time; and determine the target simulated behavior from the candidate simulated behaviors based on the first sub-state data.

[0226] In the above scheme, the state update module 2552 is further configured to extract candidate sub-objects from the second sub-object for supporting the target simulation behavior; and determine the candidate sub-objects in the allowed use state as the associated sub-objects of the first sub-object.

[0227] In the above scheme, the state update module 2552 is further configured to calculate the state update amount for the first sub-object based on the second attribute information of the associated sub-object; and update the first sub-state data using the state update amount to obtain the updated first sub-state data of the first sub-object.

[0228] In the above scheme, the object removal module 2551 is further configured to hide the first virtual object and delete the rendering object of the first virtual object when the first virtual object in the virtual scene reaches the data simulation conditions.

[0229] In the above scheme, the object loading module 2553 is further configured to, when the first virtual object reaches the real-time display condition, create a rendering object for the first virtual object based on the updated state data, and load the first virtual object into the virtual scene through the rendering object.

[0230] In the above scheme, the data processing device 255 of the virtual scene further includes: an object creation module 2554, used to create and update a simulation object for the first virtual object;

[0231] The state update module 2552 is further configured to update the state data of the first virtual object in the memory through the updated simulation object, so as to obtain the updated state data.

[0232] This application provides a computer program product, which includes a computer program or computer-executable instructions stored in a computer-readable storage medium. The processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the virtual scene data processing method described above in this application.

[0233] This application provides a computer-readable storage medium storing computer-executable instructions or a computer program. When the computer-executable instructions or the computer program are executed by a processor, the processor will execute the data processing method for a virtual scene provided in this application. For example, ... Figure 3 The data processing method for the virtual scene is shown.

[0234] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.

[0235] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, 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 stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.

[0236] As an example, computer-executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files that store one or more modules, subroutines, or code sections).

[0237] As an example, computer-executable instructions can be deployed to execute on a single electronic device, or on multiple electronic devices located at one location, or on multiple electronic devices distributed across multiple locations and interconnected via a communication network.

[0238] In summary, through the embodiments of this application, when the first virtual object in the virtual scene meets the data simulation conditions, the first virtual object in the virtual scene is removed, and the state data of the first virtual object is updated in memory. This allows the state changes of the first virtual object to be recorded in real time. Then, when the first virtual object meets the real-time display conditions, it can be reloaded into the virtual scene based on the updated state data, so that the changes of the first virtual object can still be presented visually. This achieves the updating of the virtual scene. In this process, only the state data of the first virtual object needs to be updated, without calculating all elements in the virtual scene, thus reducing the amount of computation required for updating the virtual scene. Only a small amount of space is needed in memory to represent the first virtual object. This not only ensures that the state data of the first virtual object can be updated normally in memory, but also removes redundant information unrelated to the update of state data, saving memory space.

[0239] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.

Claims

1. A data processing method for a virtual scene, characterized in that, The method includes: When the first virtual object in the virtual scene meets the data simulation conditions, the first virtual object is removed from the virtual scene; Update the state data of the first virtual object in memory to obtain the updated state data of the first virtual object; When the first virtual object meets the conditions for real-time display, the first virtual object is loaded into the virtual scene based on the updated state data.

2. The method according to claim 1, characterized in that, The first virtual object includes: a first sub-object; the state data includes: first sub-state data; and the updated state data includes: updated first sub-state data. The step of updating the state data of the first virtual object in memory to obtain the updated state data of the first virtual object includes: Based on the first attribute information of the first sub-object, the first sub-state data of the first sub-object is updated to obtain the updated first sub-state data.

3. The method according to claim 1, characterized in that, The first virtual object includes: a first sub-object and a second sub-object; the state data includes: first sub-state data and second sub-state data; the updated memory data includes: updated first sub-state data and updated second sub-state data. The step of updating the state data of the first virtual object in memory to obtain the updated state data of the first virtual object includes: For the first sub-object, determine the associated sub-object from the second sub-object; Based on the second attribute information of the associated sub-object, the first sub-state data of the first sub-object is updated to obtain the updated first sub-state data of the first sub-object; Based on the first attribute information of the first sub-object, the second sub-state data of the associated sub-object is updated to obtain the updated second sub-state data of the associated sub-object.

4. The method according to claim 3, characterized in that, The step of determining the associated sub-object from the second sub-object for the first sub-object includes: Determine the target simulated behavior for the first sub-object; Based on the target simulated behavior, the associated sub-object of the first sub-object is determined from the second sub-object.

5. The method according to claim 4, characterized in that, Determining the target simulated behavior for the first sub-object includes: The actions allowed to be executed at the current time are used to determine the candidate simulated actions for the first sub-object; The target simulation behavior is determined from the candidate simulation behaviors based on the first sub-state data.

6. The method according to claim 4, characterized in that, The step of determining the associated sub-object of the first sub-object from the second sub-object based on the target simulated behavior includes: Extract candidate sub-objects from the second sub-object to support the target simulated behavior; The candidate sub-object that is in an allowed-use state is identified as the associated sub-object of the first sub-object.

7. The method according to any one of claims 3 to 6, characterized in that, The step of updating the first sub-state data of the first sub-object based on the second attribute information of the associated sub-object to obtain the updated first sub-state data of the first sub-object includes: Based on the second attribute information of the associated sub-object, calculate the state update amount for the first sub-object; The first sub-state data is updated using the state update amount to obtain the updated first sub-state data of the first sub-object.

8. The method according to any one of claims 1 to 6, characterized in that, The data simulation conditions include one of the following conditions: the second virtual object is located outside the display range of the first virtual object, and the second virtual object changes from an online state to an offline state; The real-time display conditions include one of the following: the second virtual object is located within the display range of the first virtual object, and the second virtual object changes from an offline state to an online state.

9. The method according to claim 8, characterized in that, When the first virtual object in the virtual scene meets the data simulation conditions, removing the first virtual object from the virtual scene includes: When the first virtual object in the virtual scene meets the data simulation conditions, the first virtual object is hidden and the rendering object of the first virtual object is deleted.

10. The method according to claim 8, characterized in that, When the first virtual object meets the real-time display conditions, loading the first virtual object into the virtual scene based on the updated state data includes: When the first virtual object reaches the real-time display condition, a rendering object is created for the first virtual object based on the updated state data, and the first virtual object is loaded into the virtual scene through the rendering object.

11. The method according to any one of claims 1 to 6, characterized in that, When the first virtual object in the virtual scene meets the data simulation conditions, after removing the first virtual object from the virtual scene, and before updating the state data of the first virtual object in memory to obtain the updated state data of the first virtual object, the method further includes: Create and update a mock object for the first virtual object; The step of updating the state data of the first virtual object in memory to obtain the updated state data of the first virtual object includes: The state data of the first virtual object in memory is updated by updating the simulated object to obtain the updated state data.

12. A data processing device for a virtual scene, characterized in that, The device includes: The object removal module is used to remove the first virtual object from the virtual scene when the first virtual object in the virtual scene meets the data simulation conditions; The state update module is used to update the state data of the first virtual object in memory to obtain the updated state data of the first virtual object. An object loading module is used to load the first virtual object into the virtual scene based on the updated state data when the first virtual object reaches the real-time display condition.

13. An electronic device, characterized in that, The electronic device includes: Memory is used to store executable instructions or computer programs. A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the method according to any one of claims 1 to 11.

14. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, they implement the method described in any one of claims 1 to 11.

15. A computer program product comprising computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, they implement the method according to any one of claims 1 to 11.