Layout and operation management method and system of entities in two-dimensional scene, and electronic device

By coordinating and optimizing the layout engine module, physics engine module, and dynamic scheduling manager module, the system solves the problem of layout and operation management of hybrid entities in 2D scenes, realizes the scientific layout of static entities and the efficient management of dynamic entities, and improves the adaptability and stability of 2D scenes.

CN121327913BActive Publication Date: 2026-02-27ROCK AI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511883862.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-15
Publication Date
2026-02-27
Estimated Expiration
2045-12-15

AI Technical Summary

Technical Problem

Existing technologies struggle to efficiently and stably manage the layout and operation of hybrid entities in 2D scenes, resulting in poor collision avoidance and impacting the adaptability and stability of 2D scenes.

Method used

The collaborative optimization system employs a layout engine module, a physics engine module, and a dynamic scheduling manager module. By dynamically adjusting performance parameters during scene design and runtime, it achieves scientific layout of static entities and dedicated motion area management for dynamic entities. Combined with multi-scale mesh generation, spiral layout overlap resolution, and adaptive quantity optimization algorithms, it reduces the risk of entity collisions.

Benefits of technology

It achieves a reasonable distribution of static entities and efficient operation management of dynamic entities, reduces the risk of collisions, improves the adaptability and stability of 2D scenes, and ensures the smoothness of the scene interface and the reasonable layout of entities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121327913B_ABST
    Figure CN121327913B_ABST
Patent Text Reader

Abstract

The application discloses a kind of layout and running management method, system and electronic equipment of entity in two-dimensional scene, the system includes layout engine module, physics engine module and dynamic scheduling manager module, the method includes: layout engine module is in the scene design period of two-dimensional scene, based on the layout engine performance parameter corresponding to layout engine module, layout processing is carried out to entity in two-dimensional scene, to obtain the initial scene interface of two-dimensional scene, layout engine performance parameter is dynamically adjusted according to layout engine performance configuration instruction information by dynamic scheduling manager module;Physics engine module is in the scene running period of two-dimensional scene, based on the physical engine performance parameter corresponding to physics engine module, running management processing is carried out to entity in two-dimensional scene, to update the scene interface of two-dimensional scene, physical engine performance parameter is dynamically adjusted according to physical engine performance configuration instruction information by dynamic scheduling manager module.Such that, entity layout, running is more reasonable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of layout and operation management technology of entities in two-dimensional scenes, and particularly to a method, system, and electronic device for layout and operation management of entities in two-dimensional scenes. Background Technology

[0002] Entity placement and collision avoidance technology in 2D scenes is a fundamental and crucial technology in computer graphics, game development, industrial simulation, and other fields. Its applications primarily include automatic generation of game levels, path simulation for warehouse or inspection robots, furniture placement in augmented reality (AR) environments, map / visual annotation, and automatic layout of user interfaces (UIs) for various visualization systems. Currently, entities in 2D scenes are typically hybrid entities, meaning they usually include both static and dynamic entities. Therefore, how to more efficiently and stably implement the placement and operational management of hybrid entities in 2D scenes to achieve collision avoidance is vital for improving the adaptability and stability of 2D scenes. Summary of the Invention

[0003] The purpose of this application is to solve the problem of how to more efficiently and stably implement the layout and operation management of hybrid entities in a two-dimensional scene in order to achieve collision avoidance and thus improve the adaptability and stability of the two-dimensional scene.

[0004] To address the aforementioned technical problems, in a first aspect, this application discloses a method for the layout and operation management of entities in a two-dimensional scene, applied to a layout and operation management system for entities in a two-dimensional scene. The system includes a layout engine module, a physics engine module, and a dynamic scheduling manager module. The method includes: during the scene design phase of the two-dimensional scene, the layout engine module performs layout processing on entities in the two-dimensional scene based on the layout engine performance parameters corresponding to the layout engine module, to obtain an initial scene interface for the two-dimensional scene; the layout engine performance parameters are dynamically adjusted by the dynamic scheduling manager module according to layout engine performance configuration indication information; during the scene operation phase of the two-dimensional scene, the physics engine module performs operation management processing on entities in the two-dimensional scene based on the physics engine performance parameters corresponding to the physics engine module, to update the scene interface of the two-dimensional scene; the physics engine performance parameters are dynamically adjusted by the dynamic scheduling manager module according to physics engine performance configuration indication information.

[0005] By employing the above method, a system comprised of a layout engine module, a physics engine module, and a dynamic scheduling manager module is used to achieve collaborative optimization of entity layout and operation management in a 2D scene. During scene design, the layout engine module processes entities based on performance parameters dynamically adjusted by the dynamic scheduling manager module, generating the initial scene interface. This results in a more scientific and reasonable initial distribution of entities, reducing the risk of subsequent collisions. During scene runtime, the physics engine module manages entity operation based on performance parameters dynamically adjusted by the dynamic scheduling manager, updating the scene interface in real time. This makes entity operation management more accurate and efficient. Consequently, the entity layout and operation management are more rational, better collision avoidance is achieved, and the scene interface display is smoother, improving the adaptability and stability of the 2D scene.

[0006] In one possible implementation of the first aspect above, the layout processing of entities in a two-dimensional scene includes: classifying entities in the two-dimensional scene to determine static and dynamic entities in the two-dimensional scene; assigning layout positions to static entities to obtain corresponding target static entity layout results, and assigning dedicated motion regions to dynamic entities to obtain corresponding target dynamic entity layout results; fusing the target static entity layout results and the target dynamic entity layout results to obtain corresponding target fused entity layout results; and completing the entity layout based on the target fused entity layout results.

[0007] Using the above method, entities in a 2D scene are classified to identify static and dynamic entities. Separate static entities are then assigned layout positions and dedicated motion areas. Finally, the layout results of the target static entities and the target dynamic entities are merged, achieving unified management of static and dynamic entities. Stable positions are assigned to static entities, and dedicated activity areas are planned for dynamic entities, thereby reducing the probability of unexpected collisions between entities of different properties. This lays a solid foundation for scene operation, resulting in a more rational entity layout and better prevention of entity collisions.

[0008] In one possible implementation of the first aspect mentioned above, the static entity layout position allocation process is performed to obtain the corresponding target static entity layout result. This includes: determining candidate layout positions in the canvas corresponding to the two-dimensional scene, where candidate layout positions include gridded candidate points and random candidate points, with the number of gridded candidate points being greater than the number of random candidate points. The gridded candidate points are obtained by the layout engine module based on multi-scale grid generation technology, constructing entity layout grids of different scales combining coarse and fine layers according to the layout configuration information corresponding to the two-dimensional scene; and based on an entity layout ranking and evaluation system, performing entity layout priority ranking processing according to entity attributes to determine the entity layout order. The entity layout ranking evaluation system is a three-dimensional evaluation system based on entity value, entity physical attributes, and entity function. A multi-factor weighted scoring algorithm is used to determine the candidate point scores corresponding to the candidate layout positions. Based on the candidate layout positions, candidate point scores, and entity layout order, the entity layout positions are determined, resulting in the corresponding first static entity layout result. A spiral layout overlap resolution algorithm is used to eliminate overlapping entities in the first static entity layout result, resulting in the corresponding second static entity layout result. Finally, an adaptive quantity optimization algorithm is used to adjust the number of entities in the second static entity layout result, resulting in the corresponding target static entity layout result.

[0009] Using the above method, a multi-scale mesh generation technique is employed to construct entity layout meshes of varying scales, combining coarse and fine layers, to determine candidate layout locations. An entity layout priority ranking is then performed based on a three-dimensional evaluation system considering entity value, physical attributes, and function. Finally, a multi-factor weighted scoring algorithm determines the entity layout location, achieving automation, rationalization, and optimization of static entity layout. This method fully utilizes the canvas space, ensuring priority for high-value entities with key physical attributes or functions, resulting in a more accurate and efficient initial layout. Consequently, the entity layout is more rational, better preventing entity collisions.

[0010] In one possible implementation of the first aspect above, based on the spiral layout overlap resolution algorithm, overlapping entity elimination processing is performed on the entities in the first static entity layout result to obtain the corresponding second static entity layout result. This includes: performing overlapping entity detection processing on the entities in the first static entity layout result to detect the overlap between all entities and generate a list of overlapping entity pairs; for each overlapping entity pair, selecting one entity in the overlapping entity pair as the target entity to be relocated according to the priority rule; based on the multiple relocation strategy, searching for available positions in the target direction around the target entity; if an available position is found, positioning the target entity to the corresponding available position; if no available position is found, searching for available positions along the Archimedes spiral path with the current position of the target entity as the center; if an available position is found, positioning the target entity to the corresponding available position; if no available position is found, removing the target entity and / or removing the associated entities corresponding to the target entity, until there are no overlapping entity pairs, thus obtaining the corresponding second static entity layout result.

[0011] The method described above generates a list of overlapping entity pairs through overlapping entity detection, selects target entities based on priority rules, and comprehensively utilizes multiple relocation strategies and Archimedes' spiral path search to find available locations. Finally, the target entities are removed to complete the elimination process, thus performing a gradual and thorough elimination of overlapping entities. This method can efficiently find available space in complex layout situations, preserving the original layout intent to the greatest extent possible, and removing entities only when necessary, thereby ensuring the high availability of the final static layout result. Furthermore, it makes the layout of entities more reasonable and better avoids entity collisions.

[0012] In one possible implementation of the first aspect above, based on an adaptive quantity optimization algorithm, the entities in the second static entity layout result are adjusted to obtain the corresponding target static entity layout result. This includes: determining the current entity density and current frame processing time corresponding to the second static entity layout result; if the system performance does not meet the corresponding frame processing time requirement based on the current frame processing time, the entities in the second static entity layout result are sorted according to entity value to obtain entity value ranking, and the number of entities to be removed is determined according to the current frame processing time. Based on the number of entities, the corresponding entities are removed in ascending order of entity value ranking until the system performance recovers to meet the corresponding frame processing time requirement; if the entity density does not meet the corresponding entity density requirement based on the current entity density, the remaining available space area in the canvas is calculated. If the available space area is greater than the minimum space area threshold, the target number of new entities are generated and added to the two-dimensional scene according to the size of the available space area and the current entity type ratio; and the proportion of different types of entities is adjusted according to entity type ratio indication information to obtain the corresponding target static entity layout result. The entity type ratio indication information includes system performance indication information and scene requirement indication information.

[0013] By employing the above method, and determining the current entity density and current frame processing time, when system performance does not meet requirements, entities are removed from low to high based on their value. When entity density does not meet requirements, a target number of new entities are generated based on the available space area and the current entity type ratio. This achieves adaptive control of the entity quantity based on performance and scene requirements. This dynamic adjustment mechanism allows the layout engine to flexibly respond to different operating environments and performance requirements, optimizing entities in the scene. Furthermore, it makes the entity layout more reasonable and better avoids entity collisions.

[0014] In one possible implementation of the first aspect above, the dynamic entity is assigned a dedicated motion region to obtain the corresponding target dynamic entity layout result. This includes: calculating the movable boundary and the corresponding safety boundary for the dynamic entity based on the scene type of the two-dimensional scene and the physical properties of the dynamic entity, using a collision-free strategy; and obtaining the dedicated motion region corresponding to the dynamic entity based on the movable boundary and the safety boundary to obtain the corresponding target dynamic entity layout result.

[0015] By employing the above method, based on the scene type and the number of dynamic entities in the 2D scene, and using a collision-free strategy, the dedicated movement area of ​​each dynamic entity is delineated by calculating its movable boundary and the corresponding safety boundary. This effectively physically isolates the activity range of dynamic entities from static areas and other dynamic entities. Safe movement paths are pre-defined for dynamic entities, avoiding potential boundary conflicts and collisions between entities. This allows dynamic entities to operate efficiently within their dedicated areas during scene runtime, reducing the collision detection load on the physics engine and making entity operation management more rational, thereby better preventing entity collisions.

[0016] In one possible implementation of the first aspect above, the operation management processing of entities in a two-dimensional scene includes: determining the collision detection range and collision detection algorithm corresponding to the entities in the two-dimensional scene; performing collision detection processing based on the collision detection range and collision detection algorithm; determining the collision type corresponding to the entity; the collision detection algorithm includes a standard discrete collision detection algorithm and a continuous collision detection algorithm; wherein, for entities whose motion state conforms to the discrete collision detection method, the corresponding collision detection processing is performed based on the standard discrete collision detection algorithm; for entities whose motion state conforms to the continuous collision detection method, the corresponding collision detection processing is performed based on the continuous collision detection algorithm; the collision type includes static entity collision type, dynamic entity collision type, and boundary collision type; and performing a corresponding collision response based on the collision type to update the motion state of the corresponding entity; wherein, when the collision type is a static entity collision type, a corresponding standard collision response is performed; when the collision type is a dynamic entity collision type, a corresponding differentiated collision response is performed; and when the collision type is a boundary collision type, a corresponding boundary collision response is performed.

[0017] By employing the above method, the collision detection range and collision detection algorithm corresponding to entities in a two-dimensional scene are determined. For entities whose motion states conform to the discrete collision detection method, a standard discrete collision detection algorithm is selected, while for entities whose motion states conform to the continuous collision detection method, a continuous collision detection algorithm is selected for classification and detection. Based on static entity collision types, dynamic entity collision types, and boundary collision types, standard collision responses, differentiated collision responses, and boundary collision responses are performed. This achieves refined and efficient operation management, improves the accuracy and efficiency of collision detection, ensures the rationality and authenticity of collision responses, and makes the operation management of entities more reasonable, thereby better avoiding entity collisions.

[0018] In one possible implementation of the first aspect above, the layout engine performance parameters include the algorithm configuration parameters corresponding to the layout engine algorithm and the resource configuration parameters corresponding to the system resources that the layout engine can allocate; the physics engine performance parameters include the algorithm configuration parameters corresponding to the physics engine algorithm and the resource configuration parameters corresponding to the system resources that the physics engine can allocate; the performance configuration indication information corresponding to the algorithm configuration parameters includes system performance indication information, and the performance configuration indication information corresponding to the resource configuration parameters includes system performance indication information, hardware performance indication information, scenario requirement indication information, and user experience indication information.

[0019] Using the above method, the dynamic scheduling manager module transforms multi-dimensional performance configuration indicators, including system performance indicators, hardware performance indicators, scene requirement indicators, and user experience indicators, into algorithm configuration parameters corresponding to the layout engine algorithm and resource configuration parameters corresponding to the system resources that the layout engine can allocate. This dynamic control mechanism performs the same operation on the physics engine. This allows the entire system to adaptively allocate computing resources, resulting in more rational entity operation management and better prevention of entity collisions.

[0020] Secondly, the embodiments of this application disclose a layout and operation management system for entities in a two-dimensional scene. The system includes a layout engine module, a physics engine module, and a dynamic scheduling manager module. The layout engine module is used to perform layout processing on entities in the two-dimensional scene based on the performance parameters of the layout engine corresponding to the layout engine module during the scene design phase of the two-dimensional scene to obtain the initial scene interface of the two-dimensional scene. The physics engine module is used to perform operation management processing on entities in the two-dimensional scene based on the performance parameters of the physics engine corresponding to the physics engine module during the scene operation phase of the two-dimensional scene to update the scene interface of the two-dimensional scene. The dynamic scheduling manager module is used to dynamically adjust the performance parameters of the layout engine corresponding to the layout engine module according to the performance configuration indication information of the layout engine module, and to dynamically adjust the performance parameters of the physics engine corresponding to the physics engine module according to the performance configuration indication information of the physics engine module.

[0021] Thirdly, this application also discloses an electronic device, including: a processor and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to enable the electronic device to implement the layout and operation management method of entities in a two-dimensional scene provided in any of the embodiments of the first aspect above.

[0022] The relevant beneficial effects of the second and third aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0023] To more clearly illustrate the technical solution of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below.

[0024] Figure 1 A schematic diagram of the first structure of the layout and operation management system for entities in a two-dimensional scene provided in the embodiments of this application;

[0025] Figure 2 A schematic diagram of a second structure for the layout and operation management system of entities in a two-dimensional scene provided in an embodiment of this application;

[0026] Figure 3 A schematic diagram of a third structure for the layout and operation management system of entities in a two-dimensional scene provided in the embodiments of this application;

[0027] Figure 4 A schematic diagram of the fourth structure of the layout and operation management system for entities in a two-dimensional scene provided in the embodiments of this application;

[0028] Figure 5 A flowchart illustrating a method for managing the layout and operation of entities in a two-dimensional scene, as provided in an embodiment of this application.

[0029] Figure 6 A schematic diagram of the scene interface of the miner game provided in this application embodiment;

[0030] Figure 7 A schematic diagram of the layout and operation management system for entities in a two-dimensional scene corresponding to the miner game provided in this application embodiment;

[0031] Figure 8 This is a flowchart illustrating a method for the layout and operation management of entities in a two-dimensional scene corresponding to a miner game provided in this application embodiment;

[0032] Figure 9 A schematic flowchart illustrating the design phase of the method for layout and operation management of entities in a two-dimensional scene corresponding to the miner game provided in this application embodiment;

[0033] Figure 10 A schematic diagram illustrating the principle of a spiral search path provided in an embodiment of this application;

[0034] Figure 11 This is a schematic flowchart illustrating the operation of a method for managing the layout and operation of entities in a two-dimensional scene corresponding to a miner game provided in this application embodiment.

[0035] Figure 12 A schematic diagram of a runtime collision detection process provided in an embodiment of this application;

[0036] Figure 13This is a flowchart illustrating the data flow and call relationship based on the interface call sequence in the method for managing the layout and operation of entities in a two-dimensional scene corresponding to the miner game provided in this application embodiment;

[0037] Figure 14 This is a flowchart illustrating a collaborative process based on the interaction sequence of game layout and region allocation in the layout and operation management method of entities in a two-dimensional scene corresponding to the miner game provided in the embodiments of this application.

[0038] Figure 15 This is a schematic diagram of the data structure corresponding to the layout and operation management system for entities in a two-dimensional scene provided in the embodiments of this application.

[0039] Figure 16 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0040] As mentioned earlier, entity layout and collision avoidance in 2D scenes are widely used in fields such as automatic generation of game levels, simulation of warehouse / inspection robots, placement of augmented reality (AR) furniture, map / visual annotation, and automatic layout of user interface (UI).

[0041] The entity layout and collision avoidance process in existing 2D scenes typically includes the following: entity placement based on rule-based or random strategies, such as uniform grids, Poisson disk sampling, simple random or jittery distributions; offline collision checking for static entities, often relying on bounding boxes (e.g., axis-aligned bounding boxes (AABB)) or circular approximation methods; path planning and online collision detection for dynamic entities, often using single-step discrete collision detection or simple avoidance rules; boundary handling often employs hard clipping or instantaneous bounce methods; and the number and density of entities are usually set based on fixed parameters or human experience.

[0042] The above-mentioned solution is effective in scenarios with simple scenarios, high homogeneity of entities, low density, and offline computing scenarios. It also has the advantages of simple implementation, low engineering implementation cost, and high community maturity. However, when faced with complex requirements such as the coexistence of static and dynamic entities, high-density placement within a limited space, and strong real-time interaction and rendering, it exposes several limitations. Space utilization is low, with large layout gaps due to random placement or single-scale grids, and a lack of a loading strategy that prioritizes larger entities over smaller ones, as well as local density constraints. Dynamic entities are easily obstructed, leading to frequent replanning or even system crashes during runtime due to the absence of dedicated movement areas. Overlapping and flickering phenomena occur frequently, and the system lacks a complete closed-loop processing mechanism from overlap detection and resolution to rollback. Parameter configuration is fragile, with quantity and density parameters often based on fixed empirical values, making it difficult to adapt to changes in resolution or canvas scale. Collision detection is relatively coarse, failing to implement differentiated precision or expansion coefficient adjustments for entity types, resulting in increased false alarms and false negatives. Boundary processing is rigid, with hard clipping or instantaneous rebound easily causing user discomfort, and a lack of progressive damping and natural rebound trajectory design. Furthermore, existing methods struggle to optimize space allocation based on entity importance and function, resulting in poor overall scalability and an inability to flexibly adapt to changes in scene scale and entity type.

[0043] In summary, existing technologies lack a deep understanding of the characteristics of static and dynamic entities in mixed scenarios and have not established a unified intelligent layout framework to coordinate the spatial needs and interaction relationships of different types of entities.

[0044] Therefore, how to achieve more efficient and stable layout and collision avoidance of hybrid entities in two-dimensional scenes is crucial for improving the adaptability and stability of two-dimensional scenes.

[0045] Based on this, the embodiments of this application provide a method for the layout and operation management of entities in a two-dimensional scene, applied to the layout and operation management system of entities in a two-dimensional scene. For example... Figure 1 As shown, the system includes a layout engine module, a physics engine module, and a dynamic scheduling manager module. The layout engine module, during the scene design phase of the 2D scene, performs layout processing on entities in the 2D scene based on the performance parameters of its corresponding layout engine to obtain the initial scene interface. The physics engine module, during the scene runtime phase of the 2D scene, performs runtime management processing on entities in the 2D scene based on the performance parameters of its corresponding physics engine to update the scene interface. The dynamic scheduling manager module dynamically adjusts the performance parameters of both the layout engine and physics engine modules according to the layout engine performance configuration instructions.

[0046] Furthermore, such as Figure 2As shown, the layout engine module includes a hybrid entity classifier unit, an adaptive mesh system unit, and a spatial optimization algorithm unit. The hybrid entity classifier unit classifies entities in the 2D scene, the adaptive mesh system unit generates candidate layout locations, and the spatial optimization algorithm unit optimizes entity layout. Additionally, the layout engine module includes a layout unit, a region management unit, and an occupied grid management unit. The layout unit acts as the scheduling and execution center of the layout engine, calling the functions of all other units. The region management unit plans and allocates spatial regions, and the occupied grid management unit establishes and maintains a dynamically updated occupied grid, recording the occupied status of each location or grid cell in the canvas in real time.

[0047] The aforementioned physics engine module includes a Continuous Collision Detection (CCD) unit, a Differentiated Collision Response unit, and a Boundary Constraint Processing unit. The CCD unit implements continuous collision detection processing, the Differentiated Collision Response unit implements differentiated collision response processing, and the Boundary Constraint Processing unit implements boundary constraint processing. Additionally, the physics engine module includes a Collision Avoidance Management unit, which works in conjunction with the CCD and Differentiated Collision Response units to calculate safe avoidance paths and adjust strategies for dynamic entities.

[0048] The aforementioned dynamic scheduling manager module includes a real-time performance monitoring unit, an adaptive parameter adjustment unit, and a load balancing optimization unit. Specifically, the real-time performance monitoring unit monitors performance configuration indication information in real time; the adaptive parameter adjustment unit dynamically adjusts the corresponding algorithm configuration parameters based on the monitored performance configuration indication information; and the load balancing optimization unit dynamically adjusts the corresponding resource configuration parameters based on the monitored performance configuration indication information.

[0049] Furthermore, such as Figure 3 As shown, the layout and operation management system for entities in a two-dimensional scene also includes a rendering system module, which is used to implement scene rendering processing for the two-dimensional scene.

[0050] Furthermore, such as Figure 4As shown, the entity layout and operation management system in the 2D scene also includes an application main program module. This module is used during scene design to input layout configuration information and layout control parameters into the layout engine module. The layout configuration information includes canvas configuration parameters and an entity configuration list. During scene design, the layout engine module, based on its performance parameters and the layout configuration and control parameters, performs entity layout and returns layout feedback information to the main application module. This feedback information includes entity layout results, entity layout quality statistics, and scene runtime configuration information. The application main program module initializes the parameters of the physics engine module based on the layout feedback information. The main application module is also used to input entity state information and interaction state information into the physics engine module during scene runtime. The physics engine module, based on physics engine performance parameters and the entity state and interaction state information, performs runtime management processing on entities in the 2D scene during scene runtime, obtaining runtime management information, which is then sent to the main application module. This runtime management information includes entity state update information, collision event record information, physics engine module performance metrics, and entity runtime status. The main application module then sends updated rendering data to the rendering system module based on the runtime management information. The rendering system module performs scene interface rendering processing based on the updated rendering data to update the 2D scene interface.

[0051] The layout engine module can be called an intelligent layout engine or simply a layout engine; the physics engine module can be called a high-precision physics engine or simply a physics engine; and the dynamic scheduler module can be called a dynamic scheduler. The application main program module can be the game's main program or a module corresponding to other application main programs.

[0052] Furthermore, the various modules mentioned above can be directly abbreviated, that is, the word "module" can be omitted and the abbreviation can be used directly.

[0053] Furthermore, the layout and operation management system for entities in the aforementioned two-dimensional scene may also include other modules, and the aforementioned modules may also include other units, which can be set as needed.

[0054] This application also discloses a method for the layout and operation management of entities in a two-dimensional scene applied to the above-mentioned system, such as... Figure 5 As shown in the embodiments of this application, the method for layout and operation management of entities in a two-dimensional scene specifically includes the following steps.

[0055] S100, during the scene design phase of a 2D scene, the layout engine module performs layout processing on entities in the 2D scene based on the corresponding layout engine performance parameters to obtain the initial scene interface of the 2D scene. The layout engine performance parameters are dynamically adjusted by the dynamic scheduling manager module according to the layout engine performance configuration instruction information.

[0056] S200, during the runtime of the 2D scene, the physics engine module performs runtime management processing on entities in the 2D scene based on the physics engine performance parameters corresponding to the physics engine module, so as to update the scene interface of the 2D scene. The physics engine performance parameters are dynamically adjusted by the dynamic scheduling manager module according to the physics engine performance configuration instruction information.

[0057] The scene design phase can be simply referred to as the design phase, and the scene operation phase can be simply referred to as the operation phase. An entity refers to all independent objects or elements that need to be laid out, managed, and interacted with in the two-dimensional scene. It is the basic unit processed by the system, such as: gold nuggets, diamonds, rocks, mystery bags, hooks, etc. A two-dimensional scene refers to a virtual planar workspace or canvas, which is the spatial range for all entities to be laid out, moved, and interacted with. In addition, operation management includes the management and processing of operational content such as entity movement, collisions, and physical interactions.

[0058] Furthermore, the layout engine performance parameters include algorithm configuration parameters corresponding to the layout engine algorithm and resource configuration parameters corresponding to the system resources available to the layout engine. Similarly, the physics engine performance parameters include algorithm configuration parameters corresponding to the physics engine algorithm and resource configuration parameters corresponding to the system resources available to the physics engine. Therefore, the layout engine performance configuration indication information includes performance configuration indication information corresponding to the corresponding algorithm configuration parameters and performance configuration indication information corresponding to the corresponding resource configuration parameters. Likewise, the physics engine performance configuration indication information also includes performance configuration indication information corresponding to the corresponding algorithm configuration parameters and performance configuration indication information corresponding to the corresponding resource configuration parameters. Additionally, the performance configuration indication information corresponding to the algorithm configuration parameters includes corresponding system performance indication information, and the performance configuration indication information corresponding to the resource configuration parameters includes corresponding system performance indication information, hardware performance indication information, scenario requirement indication information, and user experience indication information.

[0059] Furthermore, the layout engine performance configuration information and the physics engine performance configuration information can be the same or different.

[0060] By employing the above method, a system comprised of a layout engine module, a physics engine module, and a dynamic scheduler module is used to achieve collaborative optimization of entity layout and operation management in a 2D scene. During scene design, the layout engine module processes entities based on performance parameters dynamically adjusted by the dynamic scheduler module, generating the initial scene interface. This results in a more scientific and reasonable initial distribution of entities, reducing the risk of collisions. During scene runtime, the physics engine module manages entity operation based on performance parameters dynamically adjusted by the dynamic scheduler module and updates the scene interface in real time, making collision detection and response more accurate and efficient. This leads to more reasonable entity layout and operation management, better avoiding entity collisions, and thus improving the adaptability and stability of the 2D scene.

[0061] Furthermore, through the dynamic scheduling manager module, multi-dimensional performance configuration indicators, including system performance indicators, hardware performance indicators, scene requirement indicators, and user experience indicators, are transformed in real time into algorithm configuration parameters corresponding to the layout engine algorithm and resource configuration parameters corresponding to the system resources that the layout engine can allocate. This dynamic control mechanism performs the same operation on the physics engine. This enables the entire system to adaptively allocate computing resources, resulting in more rational entity operation management and better prevention of entity collisions.

[0062] In one possible implementation of the above method, the layout processing of entities in a two-dimensional scene includes: classifying the entities in the two-dimensional scene to determine static and dynamic entities; assigning layout positions to static entities to obtain corresponding target static entity layout results, and assigning dedicated motion regions to dynamic entities to obtain corresponding target dynamic entity layout results; fusing the target static entity layout results and the target dynamic entity layout results to obtain corresponding target fused entity layout results; and completing the entity layout based on the target fused entity layout results.

[0063] Furthermore, the layout processing of entities in the 2D scene also includes: performing layout processing on the entities in the 2D scene according to layout configuration information and layout control parameters. The layout configuration information includes the canvas configuration parameters and entity configuration list corresponding to the 2D scene.

[0064] The canvas configuration parameters can include, for example, canvas width and height in pixels, device pixel ratio parameters, rendering accuracy requirements, or other canvas configuration parameters. The entity configuration list can include, for example, entity types (e.g., gold nuggets, diamonds, rocks, mystery bags, moving animals in a mining game), target quantity (the expected number of each entity to generate), entity dimensions (width and height specifications), value weight (the numerical value affecting layout priority), or other entity configuration lists. Layout control parameters can include, for example, the desired scene fill density ratio, minimum spacing (the minimum safe distance between entities), edge margin (the safe distance between entities and the canvas edge), the proportion of space reserved for dynamic entities, or other layout control parameters.

[0065] Using the above method, entities in a 2D scene are classified to identify static and dynamic entities. Separate static entities are then assigned layout positions and dedicated motion areas. Finally, the layout results of the target static entities and the target dynamic entities are merged, achieving unified management of static and dynamic entities. Stable positions are assigned to static entities, and dedicated activity areas are planned for dynamic entities, thereby reducing the probability of unexpected collisions between entities of different properties and laying a solid foundation for scene operation. This results in a more rational layout of entities and better avoids collisions.

[0066] Furthermore, the entities in the two-dimensional scene are classified, including: classifying the entities in the two-dimensional scene according to the entity configuration list.

[0067] In one possible implementation of the above method, the static entities are assigned layout positions to obtain the corresponding target static entity layout results. This includes: determining candidate layout positions in the canvas corresponding to the 2D scene; these candidate positions include gridded candidate points and random candidate points, with the number of gridded candidate points exceeding the number of random candidate points; the gridded candidate points are obtained by the layout engine module based on multi-scale grid generation technology, constructing entity layout grids of different scales combining coarse and fine layers according to the layout configuration information corresponding to the 2D scene; and based on an entity layout ranking and evaluation system, performing entity layout priority ranking processing according to entity attributes to determine the entity layout order. The entity layout ranking evaluation system is a three-dimensional evaluation system based on entity value, entity physical attributes, and entity function. A multi-factor weighted scoring algorithm is used to determine the candidate point scores corresponding to the candidate layout positions. Based on the candidate layout positions, candidate point scores, and entity layout order, the entity layout positions are determined, resulting in the corresponding first static entity layout result. A spiral layout overlap resolution algorithm is used to eliminate overlapping entities in the first static entity layout result, resulting in the corresponding second static entity layout result. An adaptive quantity optimization algorithm is used to adjust the number of entities in the second static entity layout result, resulting in the corresponding target static entity layout result.

[0068] The entity's physical attributes can be its size, quantity, or other physical attributes. Random candidate points can be generated by the layout engine module based on the adaptive mesh system's strategy of 70% meshing + 30% randomization, or they can be generated in other ways.

[0069] Layout configuration information can include canvas configuration parameters, canvas size, number of entities, or other layout configuration information. Entity attributes can be obtained directly or indirectly from the entity configuration list, or from entity attributes obtained through other methods. Entity layout sorting can be referred to as entity priority sorting.

[0070] The first static entity layout result refers to the layout result after the static entities have completed the initial, score-based intelligent localization, but without overlap resolution. The second static entity layout result refers to the layout result obtained after applying the spiral layout overlap resolution algorithm to the first static entity layout result to complete overlap detection and elimination. The target static entity layout result can be the final static entity layout result obtained by further applying an adaptive quantity optimization algorithm to the second static entity layout result, dynamically adjusting the number and type of entities according to system performance and scene density. Alternatively, it can be either the first static entity layout result or the second static entity layout result that meets the conditions.

[0071] The spiral layout overlap resolution algorithm is a systematic and deterministic solution to the problem of overlapping entities after layout. It uses an Archimedes spiral path for searching to ensure that a usable position is found or subsequent processing is triggered. Entity quantity adjustment processing refers to the process of dynamically adding or removing entities based on real-time evaluation of system performance and scene density.

[0072] Furthermore, given that the evaluation factors included in the aforementioned multi-factor weighted scoring algorithm include the distance between static entities and already laid-out entities, the distance between static entities and boundaries, the value of the area where the static entity is located, and the avoidance distance between static entities and the movement areas of dynamic entities, the candidate point score corresponding to the candidate layout location is determined based on the multi-factor weighted scoring algorithm, including determining the candidate point score using the following formula:

[0073]

[0074] in, It is a candidate point for the layout position corresponding to a static entity. It can be a gridded candidate point or a random candidate point. It is a position to place the entity. It is the distance between the static entity and the boundary. It is the spacing between static entities and already laid-out entities. It is the value of the area where the static entity is located. It is the avoidance distance between the static entity and the moving area of ​​the dynamic entity. , , , For example, weighting coefficients. , , , The values ​​can be 0.3, 0.4, 0.2, and 0.1, respectively.

[0075] Furthermore, the goal of this formula is to calculate any candidate point on the layout canvas. Overall score The higher the score, the more points it represents. This formula is suitable for placing the entities currently to be laid out. By comprehensively considering four key factors—boundary distance, entity spacing, area value, and dynamic avoidance—the layout of entities becomes more rational.

[0076] Using the above method, a multi-scale mesh generation technique is employed to construct entity layout meshes of varying scales, combining coarse and fine layers, to determine candidate layout locations. An entity layout priority ranking is then performed based on a three-dimensional evaluation system considering entity value, physical attributes, and function. Finally, a multi-factor weighted scoring algorithm determines the entity layout location, achieving automation, rationalization, and optimization of static entity layout. This fully utilizes the canvas space, ensuring priority for high-value entities, such as large-sized entities with strong physical attributes or critical functions, resulting in a more accurate and efficient initial layout. Consequently, the entity layout is more rational, better preventing entity collisions.

[0077] In one possible implementation of the above method, based on the spiral layout overlap resolution algorithm, overlapping entity elimination processing is performed on the entities in the first static entity layout result to obtain the corresponding second static entity layout result. This includes: performing overlapping entity detection processing on the entities in the first static entity layout result to detect the overlap between all entities and generate a list of overlapping entity pairs; for each overlapping entity pair, selecting one entity in the overlapping entity pair as the target entity to be relocated according to the priority rule; based on the multiple relocation strategy, searching for available positions in the target direction around the target entity; if an available position is found, positioning the target entity to the corresponding available position; if no available position is found, searching for available positions along the Archimedes spiral path with the current position of the target entity as the center; if an available position is found, positioning the target entity to the corresponding available position; if no available position is found, removing the target entity and / or removing the associated entities corresponding to the target entity, until there are no overlapping entity pairs, thus obtaining the corresponding second static entity layout result.

[0078] In this context, "available location" refers to the coordinates or area on the canvas that meets all preset constraints and can be used to safely place entities in the current layout state. "Related entity" refers to other entities that have spatial or logical relationships with the currently processed entity or the current candidate location during the layout process and need to be considered, detected, or avoided.

[0079] The method described above generates a list of overlapping entity pairs through overlapping entity detection, selects target entities based on priority rules, and comprehensively utilizes multiple relocation strategies and Archimedes' spiral path search to find available locations. Finally, the target entities are removed to complete the elimination process, thus performing a gradual and thorough elimination of overlapping entities. This method can efficiently find available space in complex layout situations, preserving the original layout intent to the greatest extent possible, and removing entities only when necessary, thereby ensuring the high availability of the final static layout result. Furthermore, it makes the layout of entities more reasonable and better avoids entity collisions.

[0080] In one possible implementation of the above method, based on an adaptive quantity optimization algorithm, the entities in the second static entity layout result are adjusted to obtain the corresponding target static entity layout result. This includes: determining the current entity density and current frame processing time corresponding to the second static entity layout result; if, based on the current frame processing time, the system performance does not meet the corresponding frame processing time requirement, the entities in the second static entity layout result are sorted according to entity value to obtain an entity value ranking, and the number of entities to be removed is determined based on the current frame processing time. Based on the number of entities, the corresponding entities are removed in ascending order of entity value ranking until the system performance recovers to meet the corresponding frame processing time requirement; if, based on the current entity density, the entity density does not meet the corresponding entity density requirement, the remaining available space area in the canvas is calculated. If the available space area is greater than the minimum space area threshold, the target number of new entities are generated and added to the 2D scene based on the size of the available space area and the current entity type ratio; and the proportion of different entity types is adjusted according to entity type ratio indication information to obtain the corresponding target static entity layout result. The entity type ratio indication information includes system performance indication information and scene requirement indication information.

[0081] By employing the above method, and determining the current entity density and current frame processing time, when system performance does not meet requirements, entities are removed from low to high based on their value. When entity density does not meet requirements, a target number of new entities are generated based on the available space area and the current entity type ratio. This achieves adaptive control of the entity quantity based on performance and scene requirements. This dynamic adjustment mechanism allows the layout engine to flexibly respond to different operating environments and performance requirements, optimizing entities in the scene. Furthermore, it makes the entity layout more reasonable and better avoids entity collisions.

[0082] In one possible implementation of the above method, a dedicated motion region allocation process is performed on the dynamic entity to obtain the corresponding target dynamic entity layout result, including: calculating the movable boundary and the corresponding safety boundary for the dynamic entity based on the scene type of the two-dimensional scene and the physical properties of the dynamic entity, and based on the collision-free strategy; obtaining the dedicated motion region corresponding to the dynamic object based on the movable boundary and the safety boundary to obtain the corresponding target dynamic entity layout result.

[0083] By employing the above method, based on the scene type and the number of dynamic entities in the 2D scene, and using a collision-free strategy, the dedicated movement area of ​​each dynamic entity is delineated by calculating its movable boundary and the corresponding safety boundary. This effectively physically isolates the activity range of dynamic entities from static areas and other dynamic entities. Safe movement paths are pre-defined for dynamic entities, avoiding potential boundary conflicts and collisions between entities. This allows dynamic entities to operate efficiently within their dedicated areas during scene runtime, reducing the collision detection load on the physics engine and making entity operation management more rational, thereby better preventing entity collisions.

[0084] Then, the target static entity layout result and the target dynamic entity layout result are fused to obtain the corresponding target fused entity layout result. The fusion process is to integrate the initially completed static entity layout with the dynamic entity dedicated area allocation result and eliminate conflicts through an algorithm.

[0085] Finally, based on the target fused entity layout result, complete the entity layout. This may involve verifying the fused entity layout result and confirming the entity layout is complete if the verification is successful.

[0086] Based on the above processing, entity layout can be achieved, and corresponding entity operation management processing can be performed during the scene runtime based on the aforementioned entity layout.

[0087] In one possible implementation of the above method, the operation management of entities in a two-dimensional scene includes: determining the collision detection range and collision detection algorithm corresponding to the entities in the two-dimensional scene; performing collision detection processing based on the collision detection range and collision detection algorithm; determining the collision type corresponding to the entity; the collision detection algorithm includes a standard discrete collision detection algorithm and a continuous collision detection algorithm; for entities whose motion state conforms to the discrete collision detection method, the corresponding collision detection processing is performed based on the standard discrete collision detection algorithm; for entities whose motion state conforms to the continuous collision detection method, the corresponding collision detection processing is performed based on the continuous collision detection algorithm; the collision types include static entity collision types, dynamic entity collision types, and boundary collision types; and performing corresponding collision responses based on the collision types to update the motion state of the corresponding entities; wherein, when the collision type is a static entity collision type, a corresponding standard collision response is performed; when the collision type is a dynamic entity collision type, a corresponding differentiated collision response is performed; and when the collision type is a boundary collision type, a corresponding boundary collision response is performed.

[0088] The collision detection range can be the radius of the collision, or it can be a collision detection range set as needed. The motion state of an entity can be, for example, its position, velocity, or other entity motion states.

[0089] Standard collision response refers to the baseline physical response used for collisions between ordinary static entities, such as gold nuggets or rocks, or with dynamic entities like hooks. Differentiated collision response is a collection of response strategies that dynamically adjust based on the type, value, and function of the colliding entities. For example, setting a generous tolerance radius for diamonds makes them easier to capture; setting a larger collision radius and applying intelligent avoidance forces for moving animals makes their movement more natural; and making slight parameter adjustments for decorative items to balance effect and performance. Boundary collision response is a response mechanism specifically designed to handle collisions between entities and canvas boundaries.

[0090] Furthermore, when the motion state is motion speed, the collision detection algorithm corresponding to the entity in the two-dimensional scene is determined, including: based on the entity's motion speed and speed threshold, if the motion speed is determined to be greater than or equal to the speed threshold, the collision detection algorithm is determined to be a continuous collision detection algorithm; if the motion speed is determined to be less than the speed threshold, the collision detection algorithm is determined to be a standard discrete collision detection algorithm.

[0091] When the collision detection algorithm is a continuous collision detection algorithm, collision detection processing is performed, including: determining the complete motion trajectory of the entity from the current position to the target position; determining the first contact time point between the complete motion trajectory and the obstacle; and based on the first contact time point and the entity's motion speed, advancing the entity to a safe position or to a safe time point to avoid penetration.

[0092] When the collision type is a boundary collision, a corresponding boundary collision response is performed, including: determining the distance between the entity and the set safety boundary; determining the motion damping of the entity based on the distance; adjusting the motion speed of the entity based on the motion damping; and when the distance is less than the distance threshold, controlling the entity to bounce based on a bounce strategy so that the entity is within the safety boundary.

[0093] When the collision type is dynamic entity collision, a corresponding differentiated collision response is performed, including: determining the predicted motion trajectory of the entity; determining the distance between the entity and the obstacle within the collision detection range based on the predicted motion trajectory; and when the distance is less than the safe distance, performing avoidance processing on the entity according to the avoidance strategy.

[0094] By employing the above method, the collision detection range and algorithm corresponding to entities in a 2D scene are determined. For entities whose motion states conform to discrete collision detection, a standard discrete collision detection algorithm is selected; for entities whose motion states conform to continuous collision detection, a continuous collision detection algorithm is selected for classification and detection. Standard collision responses, differentiated collision responses, and boundary collision responses are then implemented based on static entity collision types, dynamic entity collision types, and boundary collision types. This achieves refined and efficient operation management. It improves the accuracy and efficiency of collision detection, ensures the rationality and authenticity of collision responses, and makes entity operation management more reasonable, thereby better avoiding entity collisions.

[0095] Furthermore, the operation and management of entities in a two-dimensional scene can also include the management and processing of other motion states and physical interaction states of the entities, which can be set as needed.

[0096] The following section uses the two-dimensional scene provided in this application, which is the two-dimensional scene corresponding to the miner game, as an example to further explain the layout and operation management method and system of entities in the two-dimensional scene provided in the implementation method of this application.

[0097] like Figure 6 As shown, Figure 6 This is an example image of a miner game. The top left corner of the interface displays game data such as total coins (e.g., 2332), target (e.g., 2300), player coins (e.g., 1266), and monkey coins (e.g., 1066). The top right corner shows level progress and resource information such as level 3, remaining time (e.g., 0:28), player bombs (e.g., 3), and monkey bombs (e.g., 3). Static entities in the scene include: gold nuggets, available in large, medium, and small sizes, which are the main targets for grabbing and the source of points; diamonds, high-value items, which are usually given higher layout weight and differentiated collision responses; and rocks, low-value or negative-score items, which may be prioritized for removal during layout optimization to ensure performance. Dynamic entities in the scene include: mice, monkeys, and interactive hooks, which move along specific paths or randomly in the scene, interfering with the player's grabbing.

[0098] like Figure 7 As shown, the layout and operation management system for entities in the two-dimensional scene corresponding to the miner game includes: an intelligent layout engine, a high-precision physics engine, and a dynamic scheduling manager.

[0099] The intelligent layout engine is the core module of the entire system, responsible for intelligently locating all entities during the game scene initialization phase. The module's design philosophy is "divide and conquer," fundamentally solving the problem of interference between static and dynamic entities in traditional methods by breaking down the complex problem of mixed entity layout into two sub-problems: static entity mesh layout and dynamic entity dedicated area allocation.

[0100] Furthermore, the intelligent layout engine also includes a hybrid entity classifier, which is the intelligent recognition system of the intelligent layout engine. This classifier employs a multi-dimensional classification algorithm based on entity attributes. It can accurately distinguish between static entities (such as gold nuggets, diamonds, and rocks) and dynamic entities (such as moving animals), and can also perform refined classification based on attributes such as the entity's value level, size characteristics, and game function. The core technological breakthrough of the classifier lies in the introduction of a three-dimensional evaluation system of "value, size, and function," ensuring that high-value items are given priority for optimal placement, and large-sized items are prioritized for placement to avoid subsequent conflicts.

[0101] The adaptive grid system is a spatial planning system within the intelligent layout engine, employing multi-scale grid generation technology. The system dynamically constructs a multi-layered grid structure, ranging from coarse-grained to fine-grained, based on the canvas size and entity density requirements. Coarse-grained grids are used for rapid positioning of large entities, while fine-grained grids are used for precise layout of small entities. The system's technological innovation lies in its introduction of a hybrid candidate point generation strategy: 70% gridding + 30% randomization. This ensures the integrity of spatial coverage while avoiding visual monotony caused by excessive regularization.

[0102] The spatial optimization algorithm is the decision-making and execution system of the intelligent layout engine, integrating three core algorithms: intelligent positioning, spiral overlap resolution, and adaptive quantity optimization. The intelligent positioning algorithm adopts a weighted scoring mechanism, comprehensively considering multiple factors such as entity spacing, boundary distance, and region weight; the spiral overlap resolution algorithm adopts an Archimedes spiral scanning strategy to ensure a 100% overlap resolution success rate; and the adaptive quantity optimization algorithm dynamically adjusts the number and type ratio of entities based on performance monitoring feedback.

[0103] The high-precision physics engine is the core driving module during system runtime, responsible for handling the motion, collisions, and physical interactions of all entities. The design of this module prioritizes a balance between accuracy and performance, achieving smooth operation at 60 FPS while maintaining the accuracy of the physical simulation through differentiated processing strategies and continuous collision detection technology.

[0104] Among them, continuous collision detection technology is a precision radar system within the high-precision physics engine, specifically designed to solve the problem of penetration by high-speed moving entities. Traditional discrete collision detection is prone to the "tunneling effect" when entities are moving at high speeds, meaning that the entity passes through the obstacle within a single frame. Continuous collision detection ensures accurate collision detection at any speed by calculating the first contact time between the entity's trajectory and the obstacle. The technological breakthrough of this system lies in the introduction of a speed-adaptive threshold mechanism, which enables continuous collision detection technology only for high-speed moving entities, avoiding unnecessary performance overhead.

[0105] Differentiated collision response is an intelligent response system within the high-precision physics engine, employing differentiated collision handling strategies based on different entity types. Valuable items like diamonds receive a more lenient collision radius, increasing the player's margin for error; moving animals have a larger collision buffer zone to avoid unnatural collisions with static objects; and ordinary objects undergo standard-precision collision detection to ensure realism. This differentiated design significantly enhances the game's playability and user experience.

[0106] Boundary constraint handling is the boundary protection system of the high-precision physics engine, employing a progressive damping bounce mechanism to handle boundary collisions of entities. Traditional hard boundary bounce can easily produce unnatural motion effects. This system introduces a distance-aware progressive damping algorithm, where the damping effect is more pronounced the closer the entity is to the boundary, thus achieving a natural and smooth boundary interaction effect.

[0107] The dynamic scheduler is the "intelligent brain" of the entire system, responsible for monitoring the system's operating status and dynamically adjusting algorithm parameters to ensure optimal performance under various hardware environments. This module is designed with "adaptive optimization" in mind, achieving system self-optimization and load balancing through real-time performance monitoring and intelligent parameter adjustment.

[0108] Among them, real-time performance monitoring is the health detection system of the dynamic scheduler, which continuously monitors key performance indicators such as frame time, collision detection count, memory usage, and central processing unit (CPU) utilization. The monitoring system uses a sliding window averaging algorithm to avoid interference from instantaneous fluctuations in system judgment, ensuring the accuracy and stability of performance evaluation.

[0109] Adaptive parameter adjustment is an intelligent adjustment system within the scheduler that dynamically adjusts the algorithm parameters of each module based on performance monitoring feedback. When a performance bottleneck is detected, the system automatically reduces entity density, simplifies collision detection accuracy, and reduces special effects rendering; when performance has spare capacity, the system appropriately improves image quality and physical simulation accuracy. This adaptive mechanism ensures optimal system performance under different hardware configurations.

[0110] Load balancing optimization is the resource coordination system of the scheduler, seeking the optimal balance between image quality, physics accuracy, and runtime performance. The system employs a multi-objective optimization algorithm, comprehensively considering multiple dimensions such as user experience, hardware performance, and game requirements, dynamically adjusting resource allocation strategies to ensure the system always operates in its best state.

[0111] Furthermore, the method for layout and operation management of entities in a two-dimensional scene corresponding to the miner game provided in this application embodiment includes a design phase and an operation phase. The design phase is executed by the intelligent layout engine module, which is responsible for the initial construction of the two-dimensional scene, and the implementation process is as follows: Figure 8 Steps S201-S204 and Figure 9 As shown. The runtime is executed by the high-precision physics engine module, responsible for updating the interface of the 2D scene. The implementation process is as follows: Figure 8 Steps S205-S208 and Figure 11 As shown in the attached diagram. Furthermore, global parameters are adjusted by a dynamic scheduler. Based on this, the specific implementation process of this method will be explained below with reference to the attached diagram.

[0112] like Figure 8 As shown, the layout and collision management method for entities in the two-dimensional scene corresponding to the miner game includes design phase steps S201-S204 and runtime phase steps S205-S208. The implementation process of each step is as follows.

[0113] Step S201: The main game program starts and enters scene initialization. The main game program inputs the entity list into the intelligent layout engine.

[0114] Specifically, upon startup, the game's main program enters the scene initialization phase. The main program inputs an entity list into the intelligent layout engine: canvas configuration parameters, setting the game canvas width, height, etc. The entity configuration list includes static entities, such as large, medium, and small gold nuggets, diamonds, rocks, and mystery bags, and dynamic entities, such as moving animals like mice, specifying their type, number, size, and value weight. Layout control parameters are also included, setting the target density, minimum spacing, and reserving a dedicated motion zone in the lower half of the canvas for dynamic entities.

[0115] In step S202, the hybrid entity classifier of the intelligent layout engine performs hybrid entity classification, dividing entities into static and dynamic categories. For static entities, static entity layout is performed, including the adaptive mesh system using multi-scale mesh construction technology to generate candidate points. Subsequently, mesh-based intelligent positioning is performed for each entity. Through a weighted scoring function that comprehensively considers boundary distance, entity spacing, region weight, and dynamic region avoidance, the optimal position is selected for placement, generating the preliminary first static entity layout result.

[0116] The intelligent layout engine's hybrid entity classifier first classifies input entities into static and dynamic entities. For static entities, an adaptive mesh system is activated, employing multi-scale mesh construction technology to build a mesh of varying coarseness based on the canvas size, and generating candidate layout locations according to a 70% meshing + 30% randomization strategy. Next, the spatial optimization algorithm unit begins its work. First, based on a three-dimensional evaluation system of value, size, and function, it prioritizes the layout of static entities, giving priority to larger, higher-value entities. Then, it performs meshed intelligent positioning for each entity. A multi-factor weighted scoring algorithm is used to calculate the optimal positioning for each candidate point. Taking all factors into consideration Spacing between static entities and already laid-out entities The value of the area where the static entity is located The avoidance distance between the static and dynamic entities in their movement areas The system uses the weight coefficients of each factor to select the highest-scoring position for each entity, thereby generating the first static entity layout result.

[0117] In step S203, the system performs overlap detection and automatic elimination processing on the first static entity layout result. Specifically, if overlap is detected, the spiral layout overlap resolution algorithm is activated, outputting a second static entity layout result without overlap.

[0118] After completing the first static entity layout, the system performs overlapping entity detection processing. If an overlap is detected, the spiral layout overlap resolution algorithm is activated. This algorithm first attempts to perform rapid relocation by displacement in eight directions; if that fails, it then performs a systematic search along the Archimedes spiral path, centered on the overlap point, to ensure a high success rate in overlap resolution, thereby obtaining the second static entity layout result.

[0119] Specifically, in the implementation process of the spiral layout overlap resolution algorithm, the system first performs initialization and loop control, setting a maximum number of iterations, such as 100, to prevent infinite loops, and initializing the current iteration counter to 0. Then, it enters an overlap detection and processing loop. When overlapping entities still exist in the system and the maximum number of iterations has not been reached, the resolution process continues, detecting overlap between all entities and generating a list of overlapping entity pairs. For each pair of overlapping entities in the list, the system selects the target entity to be relocated according to priority rules. The priority is determined by key items, such as diamonds having higher priority than ordinary items, and larger items having higher priority than smaller items. Next, a multi-level relocation strategy is executed. First, it attempts eight-directional displacement, searching for available positions in the eight directions around the target entity: up, down, left, right, upper left, upper right, lower left, and lower right. If a position is successfully found, the entity is relocated to that position, and the next pair of overlapping entities is processed. If the eight-directional displacement fails, a spiral search is initiated, searching for available positions centered on the target entity's current position using an Archimedean spiral path. If the spiral search also fails, an adaptive quantity mechanism is triggered, removing the entity to ensure system stability. Finally, iterative control and result output are performed. The iteration counter is incremented by 1 after each round of processing. When all overlaps are resolved or the maximum number of iterations is reached, the processed entity list is returned.

[0120] The mathematical model for the spiral search path is as follows:

[0121]

[0122] in, The coordinates of the current search point. Let be the coordinates of the starting point of the spiral. The distance from the current search point to the center point. This represents the radian distance of the current search point relative to the center point. The base unit width is a spatial measurement unit within the system.

[0123] like Figure 10 The diagram shows a spiral search path, where C is the spiral center (overlapping position). The search order is: C → 1 → 2 → 3 → 4 → 5 → … Each asterisk (*) in the diagram represents a search node, including nodes 1, 2, 3, 4, 5, etc.

[0124] In step S204, the region management unit divides a dedicated motion zone for dynamic entities in the lower half of the canvas, calculates their feasible movement boundaries, sets their initial positions, and generates the target dynamic entity layout result. Simultaneously, an adaptive quantity optimization algorithm is triggered, dynamically adjusting the quantity and type ratio of entities based on the current entity density and estimated performance to optimize the second static entity layout result. Finally, the optimized static layout result is fused with the dynamic layout result, and layout verification is performed to confirm the layout is complete and generate the target static entity layout result.

[0125] Specifically, the regional management unit performs dynamic entity-specific region allocation processing in parallel. For example... Figure 6 The system depicts a dedicated motion zone for dynamic entities in the lower half of the canvas, e.g., 65%-85%. It calculates the movable and safe boundaries for each mouse and sets its initial position near the center of the feasible region, resulting in the target dynamic entity layout. Simultaneously, an adaptive quantity optimization algorithm is triggered to evaluate the second static entity layout result. The algorithm calculates the current entity density and the current frame processing time. If the performance estimate does not meet the standard (60FPS) requirement, for example, if the frame time is >16.67ms, entities are sorted by value and low-value entities are removed from low to high. If the entity density is below the target threshold and the canvas has sufficient usable space, new entities are generated and added according to their type ratio. After quantity and density optimization, the final target static entity layout result is obtained. This result is fused with the target dynamic entity layout result to generate a complete initial scene interface. The intelligent layout engine ultimately outputs the entity layout result, layout quality statistics, and runtime configuration information, thus completing the design phase.

[0126] In the implementation strategy of the dynamic entity dedicated area allocation system, the following area division principles are followed: A dedicated motion zone for dynamic entities is drawn in the lower half of the canvas, such as 65%-85%, with safety buffer zones set at the sides and top and bottom boundaries. Different allocation strategies are adopted according to the number of dynamic entities. The allocation strategies are detailed as follows: a single dynamic entity uses a large central channel, such as approximately 40% of the canvas width or no less than a certain number of reference units; two dynamic entities are divided into left and right partitions with sufficient spacing to avoid mutual interference; multiple dynamic entities are evenly divided with a minimum partition width to ensure each entity has sufficient movement space. Boundary calculation and initialization include: calculating feasible movement boundaries for each dynamic entity, such as left / right / top / bottom, and adding safety margins to ensure that dynamic entities do not cross boundaries or intrude into static areas; placing the initial position near the center of the feasible region randomly, avoiding edge-grabbing and increasing trajectory diversity; if the partition is too narrow, the system automatically widens the partition or reduces the number of partitions to ensure the minimum feasible movement width.

[0127] In the implementation process of the adaptive quantity optimization algorithm, the system first performs performance and density evaluation, including calculating the current entity density (i.e., the coverage rate of entities per unit area) and obtaining the current frame time (i.e., the average processing time of the last few frames obtained from the performance monitoring module). If the current frame time exceeds 16.67 milliseconds, an optimization strategy for insufficient performance is executed: all entities are sorted according to their value score, low-value entities with a value score below a threshold such as 0.3 are selected, the number of entities to be removed is calculated based on the degree to which the current frame time exceeds the limit, and low-value entities are removed first until the performance recovers to an acceptable range. If the current entity density is below an ideal density threshold such as 0.6, an incremental strategy for insufficient density is executed: the remaining available space area in the canvas is calculated, and if the available space is greater than the minimum space threshold, an appropriate number of new entities are generated and added to the scene based on the available space size and the current type ratio. Subsequently, the type ratio is dynamically adjusted, and the proportion of different types of entities is dynamically adjusted according to the current performance indicators and game requirements to ensure that the number of key items (such as diamonds and gold nuggets) meets the gameplay requirements, and to balance the proportion of decorative and functional entities to optimize the overall game experience. Finally, the algorithm returns the optimized result, outputting a list of entities optimized in terms of quantity and type for subsequent use.

[0128] Step S205: The high-precision physics engine starts. The high-precision physics engine receives the output parameters of the intelligent layout engine and initializes the physical state. The game enters the main runtime loop, and the high-precision physics engine starts running.

[0129] Specifically, the high-precision physics engine startup system switches from the design phase to the runtime phase. Based on the output of the layout phase, the system loads the initial states, collision parameters, and physical rules of all entities, such as... Figure 11As shown, the main loop is entered to perform continuous collision detection and collision response based on the identified collision type. Additionally, the physical state is initialized, assigning initial velocity, acceleration, and other kinematic properties to all entities. The main loop runs at a fixed high frequency, such as 60 or 100 frames per second. The loop ends when all physical calculations and state updates for the current frame are completed and the results are output to the rendering system.

[0130] The intelligent layout engine outputs parameters including the final position, size, and layout status of each entity; layout quality statistics covering spatial coverage, overlap rate, and actual density; and runtime configuration information such as dynamic region definition and collision radius configuration. These outputs form the initialization basis for the high-precision physics engine. The high-precision physics engine receives inputs including entity state information containing entity identifiers, positions, velocities, types, and collision radii; interaction state data including hook states and player input; and physical simulation parameters such as gravity, damping, and continuous collision detection trigger thresholds. During runtime, the high-precision physics engine output interface provides four types of real-time data per frame: entity state updates including the latest position and velocity of entities; collision event records recording collision types, participating entities, and positions; system performance metrics covering frame time, number of active entities, and number of collision detections; and system runtime status including timestamps, frame numbers, and stability indicators. These structured interfaces ensure seamless data flow from intelligent layout to real-time physics simulation and efficient system collaboration.

[0131] In step S206, in each frame of simulation, the physics engine first calculates the differentiated collision radius for moving entities. Then, a crucial velocity threshold is determined: if the entity's velocity exceeds the threshold, a continuous collision detection algorithm is activated; otherwise, standard discrete collision detection is used. The system uses this method to identify potential static entity collisions, dynamic entity collisions, or boundary collisions.

[0132] Among them, the high-precision physics engine acquires the state, position, and velocity of all entities. For example... Figure 12 As shown, Figure 12 This is a flowchart of the collision detection process. The collision detection process can begin with the system calculating the differential collision radius for each moving entity, such as the player hook or a moving mouse, using the following formula:

[0133]

[0134] in, . This is the type coefficient, which is the coefficient that adjusts the collision sensitivity based on the entity type. The standard cell width of the canvas grid is the base unit width. This is the importance adjustment value, which is a pixel-level fine-tuning based on the importance of the entity.

[0135] Furthermore, the technical design philosophy behind the differentiated collision radius is as follows: a lenient strategy for valuable items, meaning that high-value items such as diamonds use a smaller collision radius to improve the player's margin for error; a buffer strategy for animal entities, meaning that moving animals use a larger collision buffer zone to avoid unnatural collisions with static objects; a standard strategy for ordinary items, meaning that regular game items use standard collision accuracy to ensure the realism of the game; and an optimized strategy for decorative items, meaning that decorative items undergo slight adjustments to balance visual effects and performance overhead.

[0136] For example, setting diamond-type items: base radius + 10% type adjustment + 0 pixel importance adjustment (lenient tolerance). Regular game items: base radius + 0% type adjustment + 3 pixel importance adjustment (standard precision). Moving animal entities: base radius + 30% type adjustment + 5 pixel importance adjustment (large buffer). Decorative items: base radius + 20% type adjustment + 2 pixel importance adjustment (minor adjustment).

[0137] Then, a crucial speed threshold judgment is performed: compare whether the speed of the entity's movement exceeds a speed threshold such as 1 / 10 of its width.

[0138] If so, such as a hook launched at high speed, then the collision detection algorithm is determined to be a continuous collision detection algorithm. This algorithm calculates the complete motion trajectory of the entity from its current position to the target position and determines the first contact point between the complete motion trajectory and the obstacle.

[0139] If not, such as a slow-moving mouse, then the collision detection algorithm is determined to be the standard discrete collision detection algorithm, which directly detects whether there is an intersection between the bounding box of the entity and the obstacle at the current moment.

[0140] Specifically, the continuous collision detection algorithm ensures accurate collision detection at any speed by calculating the continuous path of an entity's motion trajectory. Its speed adaptive mechanism includes automatically enabling continuous collision detection when the entity's speed exceeds 1 / 10 of its width, thus enabling continuous collision detection only for high-speed moving entities to avoid unnecessary performance overhead, while using standard discrete detection for low-speed moving entities to balance accuracy and efficiency. In continuous path calculation, the algorithm performs trajectory tracking, calculates the complete motion trajectory of the entity from its current position to the target position, and accurately calculates the first contact time between the trajectory and the obstacle, thereby advancing the entity to a safe position to avoid penetration. The accurate calculation of the first contact time is further manifested in finding the earliest contact point with the obstacle on the entity's motion trajectory with a time accuracy down to the sub-pixel level, and supporting simultaneous detection of multiple obstacles to select the earliest collision time. Finally, the safe position advancement strategy stipulates that for high-speed moving entities, they are advanced to the safe time point; for low-speed moving entities, they are advanced normally to the target position; the overall contact time is used as a safety factor to ensure that penetration does not occur.

[0141] In step S207, the system triggers a corresponding collision response based on the identified collision type. For static entity collisions, a standard momentum response is executed; for dynamic entity collisions, an avoidance force is applied in advance based on a preset differentiated buffer radius to achieve intelligent avoidance. When a boundary collision occurs, the system triggers a progressive damping rebound mechanism, dynamically calculating the damping coefficient based on the depth of the entity's intrusion into the safety boundary.

[0142] Specifically, upon detecting a collision, the system identifies the collision type. Static entity collisions: such as a hook capturing a gold nugget, trigger a standard collision response, calculating the hook's velocity change based on momentum conservation. Dynamic entity collisions: such as a hook approaching a mouse, trigger a differentiated collision response. Because the mouse has a large collision buffer zone, the system applies a force away from the hook before actual contact, based on a preset avoidance force formula, enabling intelligent avoidance. Boundary collisions: when the hook or mouse reaches the canvas boundary, boundary damping rebound processing is triggered. The system uses a progressive damping formula to calculate the rebound velocity.

[0143] In the boundary detection and damping rebound mechanism, a safe boundary is first set based on the boundary distance calculation principle. This includes setting a safe boundary distance, such as 20 pixels, and calculating the distance in four directions based on the entity's position coordinates (x, y) and canvas dimensions (width W, height H). Specifically, the left boundary distance (current x-coordinate minus the safe distance), right boundary distance (canvas width minus the safe distance and then minus the current x-coordinate), top boundary distance (current y-coordinate minus the safe distance), and bottom boundary distance (canvas height minus the safe distance and then minus the current y-coordinate) are calculated. The boundary trigger judgment is based on the minimum value of the four directions. When the minimum distance is less than or equal to 0, the boundary rebound mechanism is triggered to ensure that the entity always remains within the safe boundary. The damping rebound trigger and calculation mechanism is based on the set basic damping parameters: a standard damping factor, such as 0.6, to ensure a natural rebound effect, and is executed based on the original velocity components (horizontal velocity Vx, vertical velocity Vy). The horizontal rebound strategy is as follows: upon collision at the left boundary, the velocity is reversed to positive and multiplied by a damping factor; upon collision at the right boundary, the velocity is reversed to negative and multiplied by a damping factor; if there is no collision, the original horizontal velocity is maintained. The vertical rebound strategy is as follows: upon collision at the upper boundary, the velocity is reversed to downward and multiplied by a damping factor; upon collision at the lower boundary, the velocity is reversed to upward and multiplied by a damping factor; if there is no collision, the original vertical velocity is maintained. Further progressive damping optimization is employed: as the entity approaches the boundary, the damping strength is dynamically adjusted based on the distance; the closer the entity, the stronger the damping effect, thus achieving smooth boundary interactions.

[0144] The formula for progressive damping is as follows:

[0145] in, This represents the new velocity vector of the entity after it bounces back from the boundary. The original velocity vector of the entity before the collision. The negative sign indicates a rebound, where the speed direction is opposite to the original. The progressive damping coefficient is a dynamic coefficient between 0.6 and 1.2, which determines the degree of velocity decay after the rebound. The dynamic adjustment component is a scaling factor that varies from 0 to 1, dynamically adjusting the damping strength based on the depth of the entity entering the safety boundary. The preset safety boundary distance, This is the minimum distance between the current entity and any canvas boundary.

[0146] In step S208, after completing all collision response calculations, the physics engine updates the position and velocity of each entity and outputs the final state of the current frame. Simultaneously, the real-time performance monitoring unit of the dynamic scheduling manager continuously collects metrics such as frame time and memory usage. Based on this performance feedback, its adaptive parameter adjustment unit dynamically fine-tunes key parameters of the physics engine and layout engine, achieving continuous load balancing optimization between image quality, simulation accuracy, and runtime performance.

[0147] Furthermore, such as Figure 13 As shown, in the two core phases of game initialization and runtime, the data flow and call relationships between the game main program, intelligent layout engine, high-precision physics engine, and rendering system can be as follows: In the game initialization phase, the process begins with the game main program inputting canvas configuration parameters, entity configuration list, and layout control parameters to the intelligent layout engine; the intelligent layout engine then executes intelligent scoring, runs the spiral layout algorithm, and applies overlap elimination algorithms to achieve entity layout, and finally returns the entity layout results, layout quality statistics, and runtime configuration information to the game main program. The game main program initializes the high-precision physics engine parameters so that the high-precision physics engine can complete its own initialization based on these configurations. After entering the game runtime loop, each frame loops at 100 FPS as an example. The game main program inputs entity state information and interaction state information to the high-precision physics engine; the high-precision physics engine performs collision detection, calculates motion updates, and handles boundary collisions, and then returns entity state updates, collision event records, performance indicators, and runtime status; at the same time, the intelligent layout engine checks performance indicators and triggers optimizations in real time; finally, the rendering system renders the game screen based on the updated data.

[0148] Furthermore, such as Figure 14 As shown, the collaborative process of the layout unit, region management unit, occupancy grid management unit in the intelligent layout engine, and collision avoidance management unit in the high-precision physics engine during the layout phase can be as follows: First, the layout unit delineates the dynamic dedicated region and writes the initial static occupancy to the occupancy grid management unit; then, the layout unit performs multi-scale grid scoring and location selection, following the principle of large to small, and performs overlap detection / spiral / forced relocation processing; subsequently, the layout unit updates the occupancy and density to the occupancy grid management unit, and the collision avoidance management unit dynamically maintains the occupancy status during runtime, and is responsible for continuous collision detection approximation, differentiated expansion, and congestion feedback, as well as excitation adaptive processing; finally, the process is closed, and the modules continue to collaborate.

[0149] The collision avoidance strategy first achieves early warning through an avoidance detection mechanism. The detection range is set to a detection area 1.5 times the collision radius. By calculating the Euclidean distance between the animal and the obstacle in real time, the avoidance mechanism is immediately activated when this distance is less than or equal to the detection radius. Under this mechanism, the avoidance force is designed according to a clear principle: the force direction is the opposite of the animal's direction towards the obstacle, and its intensity is inversely proportional to the square of the distance, making the avoidance stronger the closer the distance. Simultaneously, a linear decay function is used to ensure smooth and natural avoidance behavior, optimizing key parameters to achieve the best avoidance effect.

[0150] Furthermore, the default entity parameters suggested in this application can be: candidate point size is 3 × number of items, minimum spacing ≈ 1.6 × getWidth(); diamond Y range is 75% to 90% of canvas height; regular item range is 45% to 90% of canvas height; dedicated area buffer is A × getWidth() on both sides, where A ranges from 2 to 3; channel width is ≥ B × getWidth(), where B ranges from 6 to 10; spiral step is angular step ≈ π / 3, radius step ≈ 1.8 × getWidth(); differentiation radius is diamond = item.size() + 0.1 * getWidth(); other content = item.size() + 3. Here, getWidth() is a function used to obtain the baseline unit width, and item.size() is the size of an entity (item) or its base collision radius.

[0151] This application's animal motion trajectory prediction technology integrates physical modeling, environmental simulation, and random factors to achieve high-precision prediction of the future movement of dynamic entities. The technology is based on Newton's laws of motion for physical modeling, comprehensively considering the combined effects of position, velocity, and acceleration; it introduces gravitational acceleration (9.8 m / s² converted to pixel units) to enhance the realism of the motion; and it simulates the uncertainty in animal movement by adding small random acceleration components. Ultimately, it achieves the accuracy of predicting the trajectory within 0.5-1 seconds, thus providing a crucial basis for intelligent decision-making such as collision avoidance.

[0152] Furthermore, by designing the relationships between tables in the database, the system achieves end-to-end data state management for hybrid entities, from definition, layout generation, and region allocation to runtime collision tracking. For example... Figure 15As shown, the data structure corresponding to the entity layout and operation management system in this mining game scheme includes, for example, the complete data structure design of the Physics Engine Output, which contains entity position, entity velocity, collision events, performance metrics, and communication configuration. It is also associated with four sub-modules: first, Performance Metrics, including frame rate, number of active entities, number of collision detections, number of consecutive collision detection activations, CPU utilization, and memory utilization; second, Collision Events, which includes event type, entity A, entity B, position, timestamp, and normal vector; third, Vector2D, involving X component, Y component, magnitude, and normalization; and fourth, enumerationEventType, which includes entity collision, boundary collision, capture event, and trigger event. Of course, these are just examples; more data content could be included. Thus, based on this data structure, all information items of the Physics Engine Output and its associated modules are fully presented.

[0153] By employing the above method and an innovative three-layer separated architecture design, intelligent layout during the design phase, high-precision physics engine during runtime, and global scheduling management are organically combined to achieve efficient processing of mixed static and dynamic entities. Specifically, during the scene design phase, the intelligent layout engine adopts a grid-based intelligent positioning algorithm. This algorithm overcomes the problems of frequent overlap, wasted space, and visual monotony caused by purely random layouts in traditional games. It innovatively adopts a triple optimization strategy of "multi-scale grid + intelligent scoring + large-to-small" to achieve a high-coverage, low-overlap, and naturally distributed intelligent layout effect. Specifically, it achieves high space utilization and low overlap rate intelligent positioning through multi-scale grid generation technology, a hybrid candidate point strategy of 70% gridding + 30% randomization, and a weighted scoring function that integrates boundary distance, entity spacing, regional weight, and dynamic regional avoidance distance. Furthermore, through the spiral layout overlap resolution algorithm, which overcomes the uncertainty of traditional overlap processing, it innovatively adopts an Archimedes spiral scanning strategy to achieve systematic and deterministic overlap resolution, ensuring a 100% processing success rate and guaranteeing the complete elimination of overlaps. Meanwhile, combined with an adaptive quantity optimization algorithm, this algorithm breaks through the performance bottleneck of fixed configuration and innovatively introduces a real-time performance monitoring and dynamic adjustment mechanism. Its core technical principle is based on a multi-objective optimization strategy, namely density optimization, performance optimization, experience optimization and adaptive adjustment mechanism, namely performance monitoring, intelligent decision-making and quality assurance. It achieves an intelligent balance between performance and game quality, dynamically adjusts the density and quantity of entities, and outputs a stable, cross-resolution adaptive initial scene interface, making the initial distribution of entities more scientific and reasonable, and reducing the risk of collision from the source.

[0154] During scene operation, the high-precision physics engine employs a differentiated continuous collision detection system. This system overcomes the limitations of traditional unified collision detection by innovatively introducing a differentiated collision detection mechanism. It dynamically adjusts collision detection parameters based on factors such as entity type, importance, and game function, achieving a perfect balance between accuracy and user experience. Specifically, it uses a speed-adaptive threshold mechanism to enable continuous collision detection algorithms for high-speed entities to prevent the "tunneling effect," and employs differentiated collision radius strategies for different entities. For example, it sets a lenient tolerance radius for diamonds and a larger buffer radius and progressive damping rebound mechanism for animals, achieving precise, efficient, and natural operation management. Furthermore, through a special collision handling algorithm for moving animals, this algorithm achieves technological innovation in intelligent avoidance and natural movement. Its intelligent trajectory prediction system innovatively introduces a physical trajectory prediction mechanism, combining gravity, inertia, and random perturbations to simulate the movement characteristics of real animals, further optimizing the interactive experience of dynamic entities and significantly reducing false alarms, jitter, and unexpected penetration. Throughout the process, the dynamic scheduling manager continuously monitors performance metrics such as frame time and memory, and dynamically adjusts the algorithm and resource configuration parameters of the intelligent layout engine and the high-precision physics engine based on multi-dimensional indicators such as system performance, hardware capabilities, scene requirements, and user experience. This ensures that the system can maintain the best balance between image quality, physical accuracy, and running performance under various hardware environments, ultimately achieving significant technical effects such as a ≥15% increase in unit area coverage during the layout phase, a ≥30% reduction in the average number of collision warnings during the dynamic entity running period, and a ≤10% fluctuation in layout stability metrics across resolutions.

[0155] Furthermore, while providing the above-described implementation method, this application also considers various alternative technical paths to enhance the compatibility and universality of the solution. Regarding alternative solutions, several mature solutions exist for different technical stages: In the sampling stage, Poisson disk sampling with good uniformity or simple blue noise sampling can be used, but both are insufficient in adapting to entities of different sizes and ensuring global optimality; in the spatial indexing stage, pure quadtrees / octrees can replace multi-scale grids, but they are weaker in the consistency of candidate point generation and scoring; in the optimization strategy stage, force-directed / spring models are intuitive but converge slowly, while simulated annealing / genetic algorithms can approximate the global optimum but have high computational costs; in the collision detection stage, the Separating Axis Theorem (SAT) / algorithm (Gilbert–Johnson–Keerthi, GJK) combined with the Bounding Volume Hierarchy (BVH) can be used to obtain more accurate detection of complex shapes, but this will lead to increased engineering complexity and runtime overhead. These alternatives can be used as compatibility or fallback options under specific constraints, but all sacrifice the overall advantages of this invention in terms of efficiency, adaptability, or simplicity of implementation to varying degrees. In terms of application examples, this application can be applied to several typical fields: in game level generation, level objectives are reflected through scoring function weights, and dedicated channels are set for dynamic entities, thereby improving layout coverage and reducing collisions during operation; in Automated Guided Vehicle (AGV) simulation, shelves and AGVs are treated as static and dynamic entities respectively, and channels are adaptively planned based on the physical dimensions of the AGVs, while efficient obstacle avoidance is achieved during operation by combining continuous collision detection and the Reciprocal Velocity Obstacles (RVO) algorithm; in security patrol robot scenarios, the system can handle the coexistence of static obstacles and dynamic crowds, and use dynamic occupancy grids to quickly prohibit high-density crowds to manage congestion; in AR furniture placement applications, furniture is separated from users / pets, a "large first, small later" strategy is adopted in the layout stage, and aisles are planned as dedicated channels, while a boundary bounce mechanism is used to prevent wall penetration. These embodiments fully demonstrate the effectiveness, versatility, and practical value of the proposed solution in different mixed static / dynamic entity scenarios.

[0156] The method for layout and operation management of entities in a two-dimensional scene provided in this application can be applied to electronic devices, such as computers, servers, and other electronic devices.

[0157] like Figure 16 The diagram shown is a structural schematic of an electronic device provided in an embodiment of this application. Figure 16As shown, the electronic device may include: transceiver 121, processor 122, and memory 123.

[0158] The processor 122 executes computer execution instructions stored in the memory, causing it to perform the technical solution of the layout and operation management method for entities in the two-dimensional scene described in the above embodiments. The memory 123 is connected to the processor 122 via the system bus and completes mutual communication; the memory 123 is used to store computer program instructions. The transceiver 121 can be used to obtain the task to be run and its configuration information.

[0159] This application also provides a computer program product containing instructions. The computer program product may be software or program products containing instructions, capable of running on a computing device or stored on any usable medium. When the computer program product runs on at least one computing device, it causes the at least one computing device to execute the above-described method for layout and operation management of entities in a two-dimensional scene.

[0160] This application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium capable of being stored by a computing device, or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute the above-described method for layout and operation management of entities in a two-dimensional scene.

[0161] It should be noted that, in addition to the specific embodiments described above, those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. Although the description of this application is presented in conjunction with preferred embodiments, this does not mean that the features of this application are limited to these embodiments. On the contrary, the purpose of describing the application in conjunction with the embodiments is to cover other options or modifications that may be derived based on the claims of this application. To provide a thorough understanding of this application, many specific details are included in the above description, and this application may also be implemented without using these details. Furthermore, to avoid confusion or obscuring the focus of this application, some specific details will be omitted in the description. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of this application can be combined with each other.

[0162] It should be noted that in this specification, similar reference numerals and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0163] The terms “first”, “second”, etc., are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.

[0164] Although this application has been illustrated and described with reference to certain preferred embodiments, those skilled in the art should understand that the above description is a further detailed explanation of the application in conjunction with specific embodiments, and should not be construed as limiting the specific implementation of the application to these descriptions. Those skilled in the art can make various changes in form and detail, including some simple deductions or substitutions, without departing from the spirit and scope of this application.

Claims

1. A method for layout and operation management of entities in a two-dimensional scene, characterized in that, The application relates to a layout and running management system for entities in a two-dimensional scene, the system comprising a layout engine module, a physical engine module and a dynamic scheduling manager module, and the method comprises the following steps: The layout engine module performs layout processing on the entities in the two-dimensional scene during a scene design period of the two-dimensional scene based on layout engine performance parameters corresponding to the layout engine module, so as to obtain an initial scene interface of the two-dimensional scene, wherein the layout engine performance parameters are dynamically adjusted by the dynamic scheduling manager module according to layout engine performance configuration indication information, and wherein the layout processing on the entities in the two-dimensional scene comprises the following steps: classifying the entities in the two-dimensional scene to determine static entities and dynamic entities in the two-dimensional scene; performing layout position allocation processing on the static entities to set stable positions for the static entities and obtain corresponding target static entity layout results; and performing special motion area allocation processing on the dynamic entities to plan exclusive activity areas for the dynamic entities and obtain corresponding target dynamic entity layout results; fusing the target static entity layout results and the target dynamic entity layout results to obtain corresponding target fused entity layout results; and completing entity layout according to the target fused entity layout results; The physical engine module performs running management processing on the entities in the two-dimensional scene during a scene running period of the two-dimensional scene based on physical engine performance parameters corresponding to the physical engine module, so as to update the scene interface of the two-dimensional scene, wherein the physical engine performance parameters are dynamically adjusted by the dynamic scheduling manager module according to physical engine performance configuration indication information, and wherein the running management processing on the entities in the two-dimensional scene comprises the following steps: determining collision detection ranges and collision detection algorithms corresponding to the entities in the two-dimensional scene, performing collision detection processing according to the collision detection ranges and the collision detection algorithms to determine collision types corresponding to the entities; and performing corresponding collision responses based on the collision types to update the motion states of the corresponding entities.

2. The method of claim 1, wherein, The layout position allocation processing on the static entities to obtain the target static entity layout results comprises the following steps: determining layout position candidate points in a canvas corresponding to the two-dimensional scene, wherein the layout position candidate points comprise gridized candidate points and random candidate points, the number of the gridized candidate points is greater than the number of the random candidate points, the gridized candidate points are obtained by the layout engine module based on a multi-scale grid generation technology according to layout configuration information corresponding to the two-dimensional scene to construct different-scale entity layout grids with a combination of coarse and fine levels; and performing entity layout priority order processing according to entity attributes to determine entity layout orders based on an entity layout order evaluation system, wherein the entity layout order evaluation system is a three-dimensional evaluation system based on entity value, entity physical attributes and entity functions; determining candidate point scores corresponding to the layout position candidate points based on a multi-factor weighted scoring algorithm. determine an entity layout position based on the layout position candidate point, the candidate point score, and the entity layout sequence, to obtain a corresponding first static entity layout result; based on a spiral layout overlap resolution algorithm, perform overlapping entity elimination processing on the entities in the first static entity layout result, to obtain a corresponding second static entity layout result; based on an adaptive number optimization algorithm, perform entity number adjustment processing on the entities in the second static entity layout result, to obtain a corresponding target static entity layout result.

3. The method of claim 2, wherein, based on a spiral layout overlap resolution algorithm, perform overlapping entity elimination processing on the entities in the first static entity layout result, to obtain a corresponding second static entity layout result, including: perform overlapping entity detection processing on the entities in the first static entity layout result, to detect the overlapping conditions between all entities, and generate an overlapping entity pair list; for each overlapping entity pair, select one entity in the overlapping entity pair as a target entity that needs to be relocated according to a priority rule; based on a multiple relocation strategy, search for available positions in a target direction around the target entity, if an available position is found, position the target entity to the corresponding available position, if no available position is found, search for an available position according to an Archimedes spiral path with the current position of the target entity as the center, if an available position is found, position the target entity to the corresponding available position, if no available position is found, remove the target entity and / or remove the associated entities corresponding to the target entity, until there is no overlapping entity pair, to obtain a corresponding second static entity layout result.

4. The method of claim 3, wherein, based on an adaptive number optimization algorithm, perform entity number adjustment processing on the entities in the second static entity layout result, to obtain a corresponding target static entity layout result, including: determine the current entity density and the current frame processing time corresponding to the second static entity layout result; in a case where it is determined according to the current frame processing time that the system performance does not meet the corresponding frame processing time requirement, sort the entities in the second static entity layout result according to entity value to obtain an entity value order, and determine the number of entities that need to be removed according to the current frame processing time, remove the corresponding entities in order from low to high according to the entity value order according to the number of entities, until the system performance recovers to meet the corresponding frame processing time requirement; in a case where it is determined according to the current entity density that the entity density does not meet the corresponding entity density requirement, calculate the available space area remaining in the canvas, in a case where the available space area is greater than a minimum space area threshold, generate a target number of new entities according to the size of the available space area and the current entity type ratio, and add them to the two-dimensional scene; adjust the proportion of different types of entities according to entity type ratio indication information to obtain a corresponding target static entity layout result, the entity type ratio indication information including system performance indication information and scene demand indication information.

5. The method of claim 4, wherein, perform special motion area allocation processing on the dynamic entities to obtain a corresponding target dynamic entity layout result, including: According to the scene type of the two-dimensional scene and the physical attribute of the dynamic entity, a movable boundary and a safety boundary corresponding to the movable boundary are calculated for the dynamic entity based on a collision avoidance strategy; According to the movable boundary and the safety boundary, a dedicated movement area corresponding to the dynamic entity is obtained to obtain a corresponding target dynamic entity layout result.

6. The method of claim 5, wherein The collision detection algorithm includes a standard discrete collision detection algorithm and a continuous collision detection algorithm, wherein for an entity whose movement state conforms to a discrete collision detection mode, corresponding collision detection processing is performed based on the standard discrete collision detection algorithm, and for an entity whose movement state conforms to a continuous collision detection mode, corresponding collision detection processing is performed based on the continuous collision detection algorithm. The collision type includes a static entity collision type, a dynamic entity collision type, and a boundary collision type. In a case where the collision type is the static entity collision type, corresponding standard collision response is performed, in a case where the collision type is the dynamic entity collision type, corresponding differentiated collision response is performed, and in a case where the collision type is the boundary collision type, corresponding boundary collision response is performed.

7. The method of claim 6, wherein The layout engine performance parameter includes an algorithm configuration parameter corresponding to a layout engine algorithm and a resource configuration parameter corresponding to a layout engine allocable system resource. The physical engine performance parameter includes an algorithm configuration parameter corresponding to a physical engine algorithm and a resource configuration parameter corresponding to a physical engine allocable system resource. The performance configuration indication information corresponding to the algorithm configuration parameter includes system performance indication information, and the performance configuration indication information corresponding to the resource configuration parameter includes system performance indication information, hardware performance indication information, scene demand indication information, and user experience indication information.

8. A system for layout and operation management of entities in a two-dimensional scene, characterized by The system includes a layout engine module, a physical engine module, and a dynamic scheduling manager module, wherein The layout engine module is configured to, during a scene design period of the two-dimensional scene, perform layout processing on entities in the two-dimensional scene based on layout engine performance parameters corresponding to the layout engine module to obtain an initial scene interface of the two-dimensional scene. The physical engine module is configured to perform running management processing on the entities in the two-dimensional scene based on the physical engine performance parameters of the physical engine module corresponding to the scene running period of the two-dimensional scene, so as to update the scene interface of the two-dimensional scene. The layout processing on the entities in the two-dimensional scene includes: classifying the entities in the two-dimensional scene to determine static entities and dynamic entities in the two-dimensional scene; performing layout position allocation processing on the static entities to set stable positions for the static entities, thereby obtaining corresponding target static entity layout results; and performing special motion area allocation processing on the dynamic entities to plan exclusive activity areas for the dynamic entities, thereby obtaining corresponding target dynamic entity layout results; performing fusion processing on the target static entity layout results and the target dynamic entity layout results, thereby obtaining corresponding target fusion entity layout results; and completing entity layout according to the target fusion entity layout results; The dynamic scheduling manager module is configured to dynamically adjust the layout engine performance parameters of the layout engine module corresponding to the layout engine performance configuration indication information, and dynamically adjust the physical engine performance parameters of the physical engine module corresponding to the physical engine performance configuration indication information. The running management processing on the entities in the two-dimensional scene includes: determining the collision detection range and the collision detection algorithm corresponding to the entities in the two-dimensional scene, performing collision detection processing according to the collision detection range and the collision detection algorithm, and determining the collision type corresponding to the entities; and performing corresponding collision response based on the collision type to update the motion state of the corresponding entities.

9. An electronic device, comprising: Comprise: A processor and a memory connected in communication with the processor; The memory stores computer execution instructions; The processor executes the computer execution instructions stored in the memory, so that the electronic device performs the layout and running management method of the entities in the two-dimensional scene as claimed in any one of claims 1-7.

Citation Information

Patent Citations

  • Page layout method and device based on display material drive, equipment and medium

    CN120407981A

  • Real-time dynamic rendering method based on multi-layer ray tracing and cache collaboration

    CN120747329A