Node updating method and device in three-dimensional game, electronic equipment and storage medium

CN121534389BActive Publication Date: 2026-10-20BEIJING PIXEL SOFTWARE TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511907616.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-17
Publication Date
2026-10-20
Estimated Expiration
2045-12-17

AI Technical Summary

Technical Problem

[0003]通常情况下,角色运动时会更新节点,一个节点更新,会级联更新所有子节点以及子节点的子节点,如果角色比较多,附加的节点也比较多,频繁更新的时候会影响游戏运行性能,降低游戏帧率

Benefits of technology

[0015]本发明实施例提供的三维游戏中节点更新方法、装置、电子设备和存储介质,该方法包括:在任一节点的局部空间数据发生变化的情况下,若节点的第一标识为不需要延迟更新,则更新节点的世界空间数据;若节点的第一标识为需要延迟更新,则将节点的第二标识设置为需要更新,并逐级遍历节点的子节点,将子节点的第二标识设置为需要更新;在给任一节点添加子节点的情况下,若节点的第二标识为需要更新,则将子节点的第二标识设置为需要更新;若节点的第二标识为不需要更新,则更新子节点的世界空间数据;在父节点的世界空间数据发生更新的情况下,逐级遍历父节点的子节点;若子节点的第一标识为不需要延迟更新,则更新子节点的世界空间数据;若子节点的第一标识为需要延迟更新,则将子节点的第二标识设置为需要更新;在需要获取任一节点的世界空间数据的情况下,若节点的第二标识为需要更新,则更新节点的世界空间数据,并将节点的第二标识设置为不需要更新;若节点的第二标识为不需要更新,则直接获取节点的世界空间数据。该方法通过为每个节点配置表征是否延迟更新的第一标识和表征是否需要更新的第二标识,当节点的局部空间数据变化或父节点的世界空间数据更新时,仅对需要立即更新的节点和子节点进行更新,而不需要立即更新的节点及子节点仅被标记为需要更新,并不立即执行计算,实际的世界空间数据更新是在真正需要获取该世界空间数据时才触发;在添加子节点时,是根据父节点的更新状态决定子节点的初始化更新行为。可见,该方法仅在必要时执行实际更新,实现了节点更新的按需触发,避免了频繁、无效的级联更新,有效提升了节点更新效率与游戏帧率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121534389B_ABST
    Figure CN121534389B_ABST
Patent Text Reader

Abstract

The application provides a node updating method and device in a three-dimensional game, electronic equipment and a storage medium, and relates to the technical field of computers. A first identifier indicating whether to delay updating and a second identifier indicating whether to update are configured for each node. When local space data of the node changes or world space data of a parent node is updated, only the nodes and child nodes that need to be immediately updated are updated, and the nodes and child nodes that do not need to be immediately updated are only marked as needing to be updated and do not immediately perform calculation. Actual world space data updating is triggered when world space data is really needed. When a child node is added, the initialization updating behavior of the child node is determined according to the updating state of the parent node. It can be seen that the application only performs actual updating when necessary, realizes on-demand triggering of node updating, avoids frequent and invalid cascading updating, and effectively improves node updating efficiency and a game frame rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and more specifically, to a method, apparatus, electronic device, and storage medium for updating nodes in a three-dimensional game. Background Technology

[0002] In 3D games, spatial information is usually represented by nodes. A character typically has one node representing the character's spatial information, and many nodes represent the character's body parts, such as the position information of the hands and back. The weapons and special effects held by the character are also linked to the character nodes through nodes.

[0003] Normally, nodes are updated when a character moves. When one node is updated, all child nodes and their child nodes are updated in a cascading fashion. If there are many characters, there will be many additional nodes. Frequent updates can affect game performance and reduce the game's frame rate. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a node update method, apparatus, electronic device and storage medium in a three-dimensional game to improve the node update efficiency in a three-dimensional game, thereby improving the game frame rate.

[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of the present invention are as follows: In a first aspect, the present invention provides a node update method for a 3D game, wherein each node in the 3D game is pre-configured with a first identifier and a second identifier; the first identifier indicates whether an update is delayed, and the second identifier indicates whether an update is needed; the method includes: If the local spatial data of any node changes, and the first identifier of the node indicates that it does not require delayed update, then the world spatial data of the node is updated; if the first identifier of the node indicates that it requires delayed update, then the second identifier of the node is set to require update, and the child nodes of the node are traversed level by level, and the second identifier of the child nodes is set to require update. When adding a child node to any node, if the second identifier of the node needs to be updated, then the second identifier of the child node is set to need to be updated; if the second identifier of the node does not need to be updated, then the world space data of the child node is updated. When the world space data of the parent node is updated, the child nodes of the parent node are traversed level by level; if the first identifier of the child node is that it does not need to be updated with a delay, then the world space data of the child node is updated; if the first identifier of the child node is that it needs to be updated with a delay, then the second identifier of the child node is set to need to be updated. If it is necessary to obtain the world space data of any node, and the second identifier of the node is required to be updated, then the world space data of the node is updated, and the second identifier of the node is set to not need to be updated; if the second identifier of the node is not required to be updated, then the world space data of the node is obtained directly.

[0006] In an optional implementation, the step of traversing the child nodes of the node level by level and setting the second identifier of the child node to need updating includes: If the second identifier of the currently traversed child node is not required to be updated, then the second identifier of the child node is set to require updating. If the second identifier of the currently traversed child node needs to be updated, then stop traversing the child nodes corresponding to that child node.

[0007] In an optional implementation, setting the second identifier of the child node to require updating if the first identifier of the child node is to be delayed includes: If the first identifier of the child node indicates that it needs to be delayed in updating and the second identifier of the child node indicates that it does not need to be updated, then the second identifier of the child node is set to need to be updated. If the first identifier of the child node indicates that it needs to be delayed in updating and the second identifier of the child node indicates that it needs to be updated, stop traversing the child nodes corresponding to the child node.

[0008] In an optional implementation, the world space data of any node is calculated based on the world space data of the node's parent node and the node's local space data.

[0009] Secondly, the present invention provides a node update device for a three-dimensional game, wherein each node in the three-dimensional game is pre-configured with a first identifier and a second identifier; the first identifier indicates whether an update is delayed, and the second identifier indicates whether an update is required; the device includes: The local spatial data change processing module is used to update the world spatial data of any node if the first identifier of the node does not require delayed update when the local spatial data of any node changes; if the first identifier of the node requires delayed update, the second identifier of the node is set to require update, and the node's child nodes are traversed level by level, and the second identifier of the child nodes is set to require update. The child node addition processing module is used to, when adding a child node to any node, set the second identifier of the child node to need updating if the second identifier of the node needs updating; otherwise, update the world space data of the child node. The parent node update processing module is used to traverse the child nodes of the parent node level by level when the world space data of the parent node is updated; if the first identifier of the child node is that it does not need to be updated with a delay, then the world space data of the child node is updated; if the first identifier of the child node is that it needs to be updated with a delay, then the second identifier of the child node is set to need to be updated. The world space data acquisition module is used to, when it is necessary to acquire the world space data of any node, update the world space data of the node if the second identifier of the node needs to be updated, and set the second identifier of the node to not need to be updated; if the second identifier of the node does not need to be updated, directly acquire the world space data of the node.

[0010] In an optional implementation, the local spatial data change processing module is configured to set the second identifier of the currently traversed child node to need updating if the second identifier of the child node does not need updating; and to stop traversing the child nodes corresponding to the currently traversed child node if the second identifier of the currently traversed child node needs updating.

[0011] In an optional implementation, the parent node update processing module is configured to set the second identifier of the child node to need updating if the first identifier of the child node needs to be delayed and the second identifier of the child node does not need to be updated; and to stop traversing the child nodes corresponding to the child node if the first identifier of the child node needs to be delayed and the second identifier of the child node needs to be updated.

[0012] In an optional implementation, the world space data of any node is calculated based on the world space data of the node's parent node and the node's local space data.

[0013] Thirdly, the present invention provides an electronic device including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the node update method in a three-dimensional game as described in any of the foregoing embodiments.

[0014] Fourthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the node update method in a three-dimensional game as described in any of the foregoing embodiments.

[0015] The present invention provides a node update method, apparatus, electronic device, and storage medium for a three-dimensional game. The method includes: when the local spatial data of any node changes, if the first identifier of the node indicates that it does not require delayed update, then update the world spatial data of the node; if the first identifier of the node indicates that it requires delayed update, then set the second identifier of the node to require update, and traverse the child nodes of the node level by level, setting the second identifier of the child nodes to require update; when adding a child node to any node, if the second identifier of the node indicates that it requires update, then set the second identifier of the child node to require update; if the second identifier of the node does not require update, then update the world spatial data of the child node; when the world spatial data of the parent node is updated, traverse the child nodes of the parent node level by level; if the first identifier of the child node indicates that it does not require delayed update, then update the world spatial data of the child node; if the first identifier of the child node indicates that it requires delayed update, then set the second identifier of the child node to require update; when it is necessary to obtain the world spatial data of any node, if the second identifier of the node indicates that it requires update, then update the world spatial data of the node and set the second identifier of the node to not require update; if the second identifier of the node does not require update, then directly obtain the world spatial data of the node. This method configures each node with a first flag indicating whether updates are delayed and a second flag indicating whether updates are needed. When a node's local space data changes or its parent node's world space data updates, only nodes and child nodes that require immediate updates are updated. Nodes and child nodes that do not require immediate updates are merely marked as needing updates, without immediate computation. The actual world space data update is triggered only when the world space data is truly needed. When adding child nodes, the initial update behavior of the child node is determined by the update status of the parent node. Therefore, this method executes actual updates only when necessary, achieving on-demand triggering of node updates, avoiding frequent and ineffective cascading updates, and effectively improving node update efficiency and game frame rate.

[0016] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This invention illustrates a flowchart of a node update method in a 3D game according to an embodiment of the present invention. Figure 2 This invention illustrates a functional block diagram of a node update device in a 3D game according to an embodiment of the present invention. Figure 3 A block diagram of an electronic device provided in an embodiment of the present invention is shown.

[0019] Icons: 100 - Electronic device; 110 - Memory; 120 - Processor; 130 - Communication module; 600 - Node update device in 3D game; 610 - Local spatial data change processing module; 620 - Child node addition processing module; 630 - Parent node update processing module; 640 - World spatial data acquisition module. Detailed Implementation

[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0021] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0022] It should be noted that relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0023] For ease of understanding, the following terms involved in the embodiments of the present invention will be explained first.

[0024] Node: A data structure in the three-dimensional world that represents spatial information, generally with three parameters: displacement, rotation, and scaling; multiple nodes are associated through parent-child relationships; in this embodiment, a node is defined as Node.

[0025] Parent node: The parent node of some nodes. The data of the parent node will affect the data of the child nodes. In this embodiment, the parent node is defined as ParentNode.

[0026] Child node: A node that is subordinate to another node. A node can only have one parent node, but can have multiple child nodes. In this embodiment, a child node is defined as ChildNode.

[0027] Cascading updates: A change in the data of one node will also update the associated child nodes, because the data of the parent node also affects the data of the child nodes.

[0028] To address the issues of low update efficiency and reduced game frame rate caused by frequent cascading updates in existing technologies, this invention proposes a node update method, apparatus, electronic device, and storage medium for 3D games. It optimizes the world space data update mechanism for nodes in 3D games by introducing a first identifier (indicating whether an update is delayed) and a second identifier (indicating whether an update is needed). When the local space data of any node changes, if the node is configured to require delayed updates, its world space data is not immediately calculated. Instead, only the second identifier of the node and its child nodes at all levels is set to require updates, avoiding unnecessary real-time recursive calculations. Only when the first identifier of a node indicates that delayed updates are not needed is the world space data updated immediately. When adding child nodes, the initial update behavior of the child nodes is determined based on the update status of the parent node. When the world space data of the parent node changes, by traversing the child nodes level by level and judging based on their first identifiers, for child nodes that do not require delayed updates, their world space data is updated immediately; for child nodes that require delayed updates, only their second identifier is set to require updates, postponing the actual calculation until the world space data is actually needed. Ultimately, when acquiring world space data for a node, if its second identifier is detected as needing an update, then the world space data calculation for that node is triggered, and the second identifier is reset to not needing an update, thus achieving on-demand updates. This mechanism significantly reduces redundant update overhead for numerous non-critical nodes (such as effects, target points, and auxiliary equipment) during high-frequency operations like character movement and scene changes. Especially when outside the camera's field of view or when logic is not triggered, it avoids invalid calculations, improving the overall efficiency of node updates and consequently increasing the game's frame rate.

[0029] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0030] Please refer to Figure 1 This is a schematic flowchart illustrating a node update method in a 3D game provided by an embodiment of the present invention. It should be noted that the node update method in a 3D game of the present invention does not rely on... Figure 1The specific order described below is a limitation. It should be understood that in other embodiments, the order of some steps in the node update method for 3D games of the present invention can be interchanged according to actual needs, or some steps can be omitted or deleted. The following will describe... Figure 1 The specific process shown will be explained in detail.

[0031] Step S101: If the local spatial data of any node changes, and the first identifier of the node does not need to be delayed, then update the world spatial data of the node; if the first identifier of the node needs to be delayed, then set the second identifier of the node to need to be updated, and traverse the child nodes of the node level by level, setting the second identifier of the child nodes to need to be updated.

[0032] In this embodiment, for each node in the 3D game, two flags are pre-configured: a first flag (DelayUpdate) and a second flag (NeedUpdate). The first flag indicates whether an update is delayed, and the second flag indicates whether an update is needed. The default values ​​for both DelayUpdate and NeedUpdate are false.

[0033] In this embodiment, for nodes on a character in a 3D game that do not require immediate updates, their first identifier, DelayUpdate, is set to true. Examples include skill-related target points and additional weapon effects. It can be understood that when a node's first identifier is set to true, it indicates that the node needs delayed updates (i.e., it does not need immediate updates); when a node's first identifier is set to false, it indicates that the node does not need delayed updates (i.e., it needs immediate updates). When a node's second identifier is set to true, it indicates that the node needs updates (i.e., the data has changed and needs updating); when a node's second identifier is set to false, it indicates that the node does not need updates (i.e., the data is already up-to-date).

[0034] As can be seen, the first identifier can be used to divide the nodes in the 3D game into two different types: one type needs to be updated immediately, and the other type does not need to be updated immediately. The type that needs to be updated immediately will be updated along with the update of the parent node; the type that does not need to be updated immediately can be marked with the second identifier, but it will not be updated along with the update of the parent node until the position needs to be obtained.

[0035] In this embodiment, a node in a 3D game typically has two types of data: local space data and world space data. Local space data includes displacement, rotation, and scaling in local space, defined as LocalPositon, LocalOrientation, and LocalScale. World space data includes displacement, rotation, and scaling in world space, defined as WorldPositon, WorldOrientation, and WorldScale. The world space data of any node can be calculated based on the world space data of its parent node and the node's local space data.

[0036] When the local spatial data of a node changes, differential processing is performed based on the node's first identifier. If the node's first identifier indicates that no delayed update is required (false), it means that the node belongs to a type with high real-time requirements, and its world spatial data needs to be kept accurate and timely. Therefore, the calculation and update process of the node's world spatial data is immediately triggered. That is, the node's world spatial data is calculated based on the world spatial data of its parent node and its own local spatial data, and may further cascade and update the world spatial data of its child nodes.

[0037] If the first identifier of a node is set to "needs delayed update (true)," the world space data calculation is not performed immediately. Instead, the second identifier of the node is set to "needs update (true)," indicating that the current world space data of the node is in a pending update state. To further ensure the consistency of the entire subtree state, it is necessary to traverse the child nodes of the node level by level and set the second identifier of each child node to "needs update (true)" in the same way.

[0038] In one implementation, step S101 above, which involves traversing the child nodes of a node level by level and setting the second identifier of the child node to be updated, specifically includes: If the second identifier of the currently traversed child node does not need to be updated, then set the second identifier of the child node to need to be updated; if the second identifier of the currently traversed child node needs to be updated, then stop traversing the child nodes corresponding to the child node.

[0039] In other words, during the traversal, if the second identifier of a child node has been marked as needing to be updated, it can be inferred that its subsequent child nodes have been marked as needing to be updated, thus avoiding unnecessary traversal operations and state writing operations, and improving overall processing efficiency.

[0040] As can be seen, this embodiment introduces a first identifier and a second identifier, so that world space data calculation is only performed when necessary; in the case of local space data changes, the first identifier is used to determine whether to delay the update, and the hierarchical setting mechanism of the second identifier is used to maintain the consistency of the subtree state, which effectively reduces the performance overhead caused by frequent updates.

[0041] In step S102, when adding a child node to any node, if the second identifier of the node needs to be updated, then the second identifier of the child node is set to need to be updated; if the second identifier of the node does not need to be updated, then the world space data of the child node is updated.

[0042] In this embodiment, when adding a child node to a node, it not only involves changes to the node topology, but also requires ensuring that the newly added child node has the correct consistency state in order to maintain the accuracy and real-time requirements of subsequent world space data acquisition.

[0043] Specifically, when adding a child node to any node, the system first checks whether the second identifier of that node (parent node) needs to be updated. If the second identifier of that node needs to be updated, it indicates that the world space data of that node has not yet been updated. The second identifier of the added child node is then synchronously set to need to be updated, thereby triggering a cascading update when acquiring world space data.

[0044] If the second identifier of the node does not need to be updated, it means that the world space data of the node is already up-to-date. In this case, the world space data of the child node is calculated directly using the world space data of the node and the local space data of the child node itself, so as to update the world space data of the child node and ensure that it has an accurate spatial representation when it is added to the scene.

[0045] Step S103: If the world space data of the parent node is updated, traverse the child nodes of the parent node level by level; if the first identifier of the child node is not required to delay the update, then update the world space data of the child node; if the first identifier of the child node is required to delay the update, then set the second identifier of the child node to require the update.

[0046] In this embodiment, changes to the world space data of a parent node directly affect the world space state of all its child nodes. When the world space data of a parent node is updated, it is necessary to ensure that its subordinate nodes can perceive this change and process it accordingly according to their respective data update strategies.

[0047] Specifically, when the world space data of the parent node is updated, all child nodes of the parent node are traversed level by level. For each traversed child node, its first identifier is checked to see if it does not require delayed updating. If the child node's first identifier indicates that it does not require delayed updating, it means that the child node has high real-time requirements and needs to immediately reflect the changes of the parent node. Therefore, using the updated world space data of the parent node and the child node's own local space data, the child node's world space data is recalculated and updated to keep its space data synchronized with the parent node. This update operation not only applies to the current child node but also continues to be executed on its subsequent child nodes, thus achieving a complete cascading update process.

[0048] Conversely, if the first identifier of the child node is "needs delayed update", it means that the node can postpone the calculation under certain conditions. In this case, the second identifier of the child node is set to "needs update", indicating that its world space data is in a state of pending update, but the actual calculation is not performed immediately, thereby avoiding unnecessary computational overhead.

[0049] In one implementation, if the first identifier of the child node in step S103 above is set to require delayed update, then the second identifier of the child node is set to require update, specifically including: If the first identifier of a child node indicates that it needs to be delayed in updating and the second identifier of a child node indicates that it does not need to be updated, then set the second identifier of the child node to indicate that it needs to be updated; if the first identifier of a child node indicates that it needs to be delayed in updating and the second identifier of a child node needs to be updated, stop traversing the child nodes corresponding to the child node.

[0050] In other words, during the process of traversing the child nodes of the parent node, if the first identifier of the child node is marked as needing delayed update and the second identifier of the child node has been marked as needing update, it can be inferred that its subsequent child nodes have been marked as needing update. Therefore, it is not necessary to repeatedly set the second identifier of the child nodes after the child node, thereby avoiding unnecessary traversal operations and state writing operations and improving the overall processing efficiency.

[0051] Step S104: If it is necessary to obtain the world space data of any node, and the second identifier of the node is required to be updated, then update the world space data of the node and set the second identifier of the node to not need to be updated; if the second identifier of the node is not required to be updated, then directly obtain the world space data of the node.

[0052] In this embodiment, when it is necessary to obtain the world space data of any node, the first step is to determine whether the node's second identifier needs to be updated. If the node's second identifier needs to be updated, it indicates that its currently stored world space data is not up-to-date, thus triggering the actual calculation process for the world space data: by obtaining the world space data of the node's parent node and combining it with the node's own local space data, the latest world space data is calculated. After the calculation is completed, the node's second identifier is set to not need updating, indicating that its world space data is already up-to-date. If the node's second identifier does not need to be updated, it means that its world space data is up-to-date and does not need to be recalculated. In this case, the cached world space data can be directly read and returned, thereby skipping the redundant calculation process and improving access efficiency.

[0053] It should be noted that since the world space data of any node is calculated based on the world space data of its parent node and the local space data of the node, when updating the world space data of any node, it is necessary to obtain the world space data of its parent node. At this point, the second identifier of the parent node is checked. If the second identifier of the parent node indicates that it needs updating, it means that the world space data of the parent node is not up-to-date and also needs to be updated; that is, it is necessary to continue obtaining the world space data of the parent node's parent. If the world space data of the parent node's parent is already up-to-date, the world space data of the parent node's parent is directly obtained, then the world space data of the parent node is updated, and the second identifier of the parent node is set to not need updating. Then, the latest world space data of the node is obtained based on the latest world space data of its parent node.

[0054] Similarly, if it is determined that the world space data of the parent node of the parent node of the current node is not up-to-date, the process will continue to traverse the previous level of parent nodes. By tracing upwards level by level, the world space data and second identifier of all parent nodes that need to be updated will be updated in a cascading manner. This ensures that the world space data of the parent node on which each node updates its world space data is based is accurate, and thus ensures that the world space data updated by each node is also accurate.

[0055] In this way, updates are only triggered when the world space data of a node is actually acquired, thereby reducing update overhead, since some nodes do not require immediate updates.

[0056] It's important to note that in 3D game scenes, characters typically contain multiple associated child nodes, such as nodes representing weapons, accessories, and other attachments, as well as target point nodes for logical positioning, like the head and feet. Under traditional update mechanisms, these child nodes immediately cascade and update upon changes to their parent nodes, leading to a significant computational burden during high-frequency operations like character movement. This embodiment employs a delayed update strategy. When the parent node changes, for child nodes marked as deferred-updateable, world space data calculation and updates are not immediately performed. Instead, a second flag is set to record their pending update status. The actual data update is postponed until the application truly needs to access the node's world space data, thus avoiding a large amount of unnecessary intermediate calculations.

[0057] For example, a character might have one main node, ten weapon-related child nodes, and ten skill target child nodes. When the character moves, updating the main node simultaneously updates all child nodes, resulting in significant update costs. However, these child nodes don't always need real-time updates; some only require accurate world space data under specific conditions. For the ten target-related child nodes, updates are mostly triggered by certain logic, such as being hit, requiring the target node's position to be retrieved. These child nodes don't update simply when the character moves, and the update flag in the child nodes only needs to be set once, resetting only after an update is triggered. For weapon-related child nodes, updates are only needed when the weapon is rendered. When the character is outside the camera's view, these child nodes don't need updating, reducing update overhead when the character moves outside the camera's view. Therefore, by using the delayed update method in this embodiment—updating only the main node and not the 20 child nodes—updating child node updates significantly reduces update time. This primarily involves updating only when necessary, minimizing wasted update time.

[0058] It should also be noted that in this embodiment, weapon and accessory child nodes are attached to the main character node. Therefore, visibility checks and rendering are not performed separately for weapon and accessory child nodes; only the main character node's visibility within the camera's field of view is checked. Taking a weapon as an example, if the main character node to which it is attached moves outside the camera's field of view, the main character node's world space data needs to be updated in real time, but this will not trigger an update to the weapon's world space data. Only when the main character node is within the camera's field of view and needs to be rendered will the weapon's world space data be acquired, thereby triggering an update to the weapon's world space data.

[0059] To perform the corresponding steps in the above embodiments and various possible methods, an implementation of a node update device in a 3D game is given below. Please refer to... Figure 2 This is a functional block diagram of a node update device 600 in a 3D game provided in this embodiment of the invention. It should be noted that the basic principle and technical effects of the node update device 600 in the 3D game provided in this embodiment are the same as those in the above embodiments. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the above embodiments. The node update device 600 in the 3D game includes: a local spatial data change processing module 610, a child node addition processing module 620, a parent node update processing module 630, and a world spatial data acquisition module 640.

[0060] The local spatial data change processing module 610 is used to update the world spatial data of a node if the first identifier of the node does not require delayed update when the local spatial data of any node changes; if the first identifier of the node requires delayed update, the second identifier of the node is set to require update, and the node's child nodes are traversed level by level, and the second identifier of the child nodes is set to require update.

[0061] It is understood that the local spatial data change processing module 610 can execute the above step S101.

[0062] The child node addition processing module 620 is used to, when adding a child node to any node, set the second identifier of the child node to need updating if the second identifier of the node needs updating; otherwise, update the world space data of the child node.

[0063] It is understandable that the child node can add processing module 620 to perform the above step S102.

[0064] The parent node update processing module 630 is used to traverse the child nodes of the parent node level by level when the world space data of the parent node is updated; if the first identifier of the child node is not required to delay the update, then the world space data of the child node is updated; if the first identifier of the child node is required to delay the update, then the second identifier of the child node is set to require the update.

[0065] It is understandable that the parent node update processing module 630 can execute the above step S103.

[0066] The world space data acquisition module 640 is used to, when it is necessary to acquire the world space data of any node, update the world space data of the node if the second identifier of the node needs to be updated, and set the second identifier of the node to not need to be updated; if the second identifier of the node does not need to be updated, directly acquire the world space data of the node.

[0067] It is understandable that the world space data acquisition module 640 can perform the above step S104.

[0068] Optionally, the local spatial data change processing module 610 is specifically used to set the second identifier of the currently traversed child node to need updating if the second identifier of the child node does not need updating; and to stop traversing the child nodes corresponding to the child node if the second identifier of the currently traversed child node does need updating.

[0069] Optionally, the parent node update processing module 630 is specifically used to set the second identifier of the child node to need to be updated if the first identifier of the child node needs to be delayed and the second identifier of the child node does not need to be updated; and to stop traversing the child nodes corresponding to the child node if the first identifier of the child node needs to be delayed and the second identifier of the child node needs to be updated.

[0070] Optionally, the world space data of any node is calculated based on the world space data of the node's parent node and the node's local space data.

[0071] Please refer to Figure 3 This is a block diagram of an electronic device 100 provided in an embodiment of the present invention. The electronic device 100 includes a memory 110, a processor 120, and a communication module 130. The memory 110, processor 120, and communication module 130 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.

[0072] The memory 110 is used to store programs or data. The memory 110 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.

[0073] The processor 120 is used to read / write data or programs stored in the memory 110 and perform corresponding functions. For example, when a computer program stored in the memory 110 is executed by the processor 120, the node update method in the three-dimensional game disclosed in the above embodiments can be implemented.

[0074] The communication module 130 is used to establish a communication connection between the electronic device 100 and other devices via a network, and to send and receive data via the network.

[0075] It should be understood that, Figure 3 The structure shown is only a schematic diagram of the electronic device 100. The electronic device 100 may also include components that are larger than... Figure 3 The more or fewer components shown, or having the same Figure 3 The different configurations shown. Figure 3 The components shown can be implemented using hardware, software, or a combination thereof.

[0076] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor 120, implements the node update method in the three-dimensional game disclosed in the above embodiments.

[0077] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0078] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0079] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0080] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A node update method in a 3D game, characterized in that, Each node in the 3D game is pre-configured with a first identifier and a second identifier; The first identifier indicates whether the update is delayed, and the second identifier indicates whether the update is needed; the method includes: If the local spatial data of any node changes, and the first identifier of the node indicates that it does not require delayed update, then the world spatial data of the node is updated; if the first identifier of the node indicates that it requires delayed update, then the second identifier of the node is set to require update, and the child nodes of the node are traversed level by level, and the second identifier of the child nodes is set to require update. When adding a child node to any node, if the second identifier of the node needs to be updated, then the second identifier of the child node is set to need to be updated; if the second identifier of the node does not need to be updated, then the world space data of the child node is updated. When the world space data of the parent node is updated, the child nodes of the parent node are traversed level by level; if the first identifier of the child node is that it does not need to be updated with a delay, then the world space data of the child node is updated; if the first identifier of the child node is that it needs to be updated with a delay, then the second identifier of the child node is set to need to be updated. When it is necessary to obtain the world space data of any node, if the second identifier of the node needs to be updated, then the world space data of the node is updated and the second identifier of the node is set to not need to be updated; if the second identifier of the node does not need to be updated, then the world space data of the node is obtained directly; the world space data of any node is calculated based on the world space data of the node's parent node and the local space data of the node.

2. The node update method in a 3D game according to claim 1, characterized in that, The step of traversing the child nodes of the node level by level and setting the second identifier of the child node to need updating includes: If the second identifier of the currently traversed child node is not required to be updated, then the second identifier of the child node is set to require updating. If the second identifier of the currently traversed child node needs to be updated, then stop traversing the child nodes corresponding to that child node.

3. The node update method in a 3D game according to claim 1, characterized in that, If the first identifier of the child node is set to require delayed update, then setting the second identifier of the child node to require update includes: If the first identifier of the child node indicates that it needs to be delayed in updating and the second identifier of the child node indicates that it does not need to be updated, then the second identifier of the child node is set to need to be updated. If the first identifier of the child node indicates that it needs to be delayed in updating and the second identifier of the child node indicates that it needs to be updated, stop traversing the child nodes corresponding to the child node.

4. A node update device for a three-dimensional game, characterized in that, Each node in the 3D game is pre-configured with a first identifier and a second identifier; The first identifier indicates whether an update is delayed, and the second identifier indicates whether an update is needed; the device includes: The local spatial data change processing module is used to update the world spatial data of any node if the first identifier of the node does not require delayed update when the local spatial data of any node changes; if the first identifier of the node requires delayed update, the second identifier of the node is set to require update, and the node's child nodes are traversed level by level, and the second identifier of the child nodes is set to require update. The child node addition processing module is used to, when adding a child node to any node, set the second identifier of the child node to need updating if the second identifier of the node needs updating; otherwise, update the world space data of the child node. The parent node update processing module is used to traverse the child nodes of the parent node level by level when the world space data of the parent node is updated; if the first identifier of the child node is that it does not need to be updated with a delay, then the world space data of the child node is updated; if the first identifier of the child node is that it needs to be updated with a delay, then the second identifier of the child node is set to need to be updated. The world space data acquisition module is used to, when it is necessary to acquire the world space data of any node, update the world space data of the node if the second identifier of the node needs to be updated, and set the second identifier of the node to not need to be updated; if the second identifier of the node does not need to be updated, directly acquire the world space data of the node; the world space data of any node is calculated based on the world space data of the node's parent node and the local space data of the node.

5. The node update device in a three-dimensional game according to claim 4, characterized in that, The local spatial data change processing module is used to set the second identifier of the currently traversed child node to need updating if the second identifier of the child node does not need updating; and to stop traversing the child nodes corresponding to the child node if the second identifier of the currently traversed child node needs updating.

6. The node update device in a three-dimensional game according to claim 4, characterized in that, The parent node update processing module is used to set the second identifier of the child node to need to be updated if the first identifier of the child node needs to be delayed and the second identifier of the child node does not need to be updated; and to stop traversing the child nodes corresponding to the child node if the first identifier of the child node needs to be delayed and the second identifier of the child node needs to be updated.

7. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the node update method in any one of claims 1-3.

8. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the steps of the node update method in a three-dimensional game as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Spatial data management method and device, equipment and storage medium

    CN109947889A

  • Data processing method and device

    CN112070910A