Unity game user behavior data mining method and system
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- FEELINGTOUCH INC
- Filing Date
- 2026-04-02
- Publication Date
- 2026-06-26
Smart Images

Figure CN121944534B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, specifically to a method and system for mining user behavior data in Unity games. Background Technology
[0002] Unity game user behavior data mining refers to the process of collecting, cleaning, and analyzing user behavior data in games developed using the Unity engine to uncover patterns, user preferences, and potential problems, ultimately providing data support for game optimization, operational decisions, and monetization. In large-scale open-world software developed using the Unity engine, scene resources are typically divided into multiple independent blocks, and these resources are streamed based on the position of rigid body character objects. Current technologies generally employ a static Euclidean distance trigger mechanism to manage the resource lifecycle. This means that each physics simulation update frame checks the straight-line distance between the character's coordinates and the center point of the resource area; when the distance is less than a preset threshold, storage read and instantiation operations are triggered. This mechanism implicitly assumes that the character will move directly towards the target area at a constant speed.
[0003] However, character actions involve complex non-linear characteristics, such as lateral movement, stationary spinning, or high-speed dashes at the edge of triggers. In these scenarios, although the physical location meets the distance trigger condition, the character's trajectory and line of sight may not be pointing towards the resource area, potentially causing the system to perform invalid loading operations on uninterested areas, consuming limited I / O bandwidth and memory resources. Furthermore, when a character rushes into an area at extremely high speed, the static distance threshold often fails to provide sufficient buffer time to offset storage system read latency, leading to situations where the character arrives before the resource is fully loaded, resulting in visual model gaps or rendering errors. Therefore, the static Euclidean distance trigger mechanism struggles to establish an effective balance between the character's dynamically changing movement intentions and the limited system processing capabilities. Summary of the Invention
[0004] This invention provides a method and system for mining user behavior data in Unity games, addressing the problem that static Euclidean distance triggering mechanisms struggle to establish an effective balance between the dynamic movement intentions of characters and the limited processing capabilities of the system. The specific technical solution adopted is as follows:
[0005] In a first aspect, one embodiment of the present invention provides a method for mining user behavior data in Unity games, the method comprising the following steps:
[0006] Read the constant configuration parameters and the 3D instantaneous velocity vector of the rigid body character object in the physics simulation update frame, perform horizontal projection on the 3D instantaneous velocity vector, establish the movement unit vector of the rigid body character object in the physics simulation update frame, and construct the braking buffer distance of the rigid body character object in the physics simulation update frame based on the constant configuration parameters, inertial constraints and loading delay braking buffer distance.
[0007] Construct a resource metadata collision body and assign resource identifiers. Before the main scene logic starts, initialize the environment based on the resource metadata collision body, establish a proxy physical layer, determine the line-of-sight alignment factor of the rigid body character object in the physical simulation update frame based on the projection vector and movement unit vector of the main camera in the physical simulation update frame, establish a resource detection ray cluster based on the line-of-sight alignment factor and braking buffer distance of the rigid body character object in the physical simulation update frame, and use the resource detection ray cluster to detect the proxy physical layer. Based on the detection results, determine the throughput requirement of the rigid body character object in the physical simulation update frame.
[0008] Based on the actual frame time of the preceding adjacent frame of the physical simulation update frame, the available loading bandwidth of the physical simulation update frame is determined. Combined with the throughput requirements, the system's scheduling strategy is determined.
[0009] Furthermore, the method for establishing the movement unit vector of the rigid body character object in the physics simulation update frame is as follows:
[0010] The magnitude of the horizontal projection of the three-dimensional instantaneous velocity vector of the rigid body character object in the physics simulation update frame is denoted as the horizontal displacement rate of the rigid body character object in the physics simulation update frame.
[0011] When the horizontal displacement rate is greater than the static determination threshold, the normalized result of the horizontal projection of the three-dimensional instantaneous velocity vector of the rigid body character object in the physical simulation update frame is recorded as the unit movement vector of the rigid body character object in the physical simulation update frame; otherwise, the normalized value of the horizontal projection of the forward vector of the main camera in the physical simulation update frame is recorded as the unit movement vector of the rigid body character object in the physical simulation update frame.
[0012] Furthermore, the method for constructing the braking buffer distance of the rigid body character object in the physics simulation update frame is as follows:
[0013] The constant configuration parameters include maximum deceleration acceleration, estimated resource loading time, and basic interaction radius;
[0014] The ratio of the square of the horizontal displacement rate of the rigid body character object in the physics simulation update frame to twice the preset maximum deceleration is denoted as the theoretical braking displacement of the rigid body character object.
[0015] The product of the horizontal displacement rate of the rigid body character object and the estimated time of resource loading is recorded as the current continuous distance of the rigid body character object.
[0016] The sum of the basic interaction radius, the theoretical braking displacement of the rigid body character object, and the current continuous distance is denoted as the braking buffer distance of the rigid body character object in the physics simulation update frame.
[0017] Furthermore, the proxy physical layer specifically comprises:
[0018] Based on the spatial bounding box of the resource prefab to be streamed, generate resource metadata colliders that do not contain mesh rendering components, configure the layers containing all resource metadata colliders to be invisible to the rendering camera and only physically interact with the rays of the resource detection ray clusters, and use the layers containing all resource metadata colliders as proxy physical layers.
[0019] Furthermore, the method for determining the line-of-sight alignment factor of the rigid body character object in the physics simulation update frame is as follows:
[0020] The normalized result of the horizontal projection vector of the main camera in the physical simulation update frame is denoted as the line-of-sight unit vector of the physical simulation update frame.
[0021] The dot product of the rigid body character object's movement unit vector and the view unit vector in the physics simulation update frame is truncated to non-negative values. The result is recorded as the rigid body character object's view movement alignment factor in the physics simulation update frame.
[0022] Furthermore, the method for establishing the resource detection ray cluster is as follows:
[0023] Based on the line-of-sight alignment factor and braking buffer distance of the rigid body character object in the physics simulation update frame, the ray detection length and ray cluster scattering angle of the rigid body character object in the physics simulation update frame are determined. The ray detection length is positively correlated with the braking buffer distance, the ray detection length is negatively correlated with the line-of-sight alignment factor, and the ray cluster scattering angle is negatively correlated with the line-of-sight alignment factor.
[0024] Using the position of the rigid body character object in the physics simulation update frame as the origin of the coordinate system, the ray detection length and ray cluster scattering angle of the rigid body character object in the physics simulation update frame are respectively used as the length and scattering angle of the ray cluster to establish a resource detection ray cluster. Each resource detection ray in the resource detection ray cluster is emitted in a fan-shaped distribution.
[0025] Furthermore, the method for using resource detection ray clusters to detect the proxy physical layer and determining the throughput requirements of the rigid body role object in the physical simulation update frame based on the detection results includes:
[0026] Initialize an empty hash set, denoted as the unique resource set, and write the resource identifier and resource file size recorded by the collision body of the resource metadata collider hit by the ray in the resource detection ray cluster into the unique resource set;
[0027] The ratio of the resource file size corresponding to the resource identifier in the unique resource set to the estimated resource loading time is denoted as the loading ratio of the resource identifier in the unique resource set. The sum of the loading ratios of all resource identifiers in the unique resource set is multiplied by the line-of-sight alignment factor of the rigid body character object in the physics simulation update frame, and denoted as the throughput requirement of the rigid body character object in the physics simulation update frame.
[0028] Furthermore, the method for determining the available loading bandwidth of the physical simulation update frame is as follows:
[0029] The ratio of the preset target frame time of the physical simulation update frame to the actual frame time of the previous adjacent frame of the physical simulation update frame is denoted as the adjacent time ratio of the physical simulation update frame. The product of the numerical constraint result of the adjacent time ratio of the physical simulation update frame and the preset reference bandwidth constant is denoted as the available loading bandwidth of the physical simulation update frame.
[0030] Furthermore, the specific methods for determining the system scheduling strategy based on throughput requirements include:
[0031] When the throughput requirement of a rigid body character object in a physics simulation update frame is less than or equal to a preset minimum threshold, a silent suspension strategy is executed.
[0032] When the throughput requirement of a rigid body character object in a physics simulation update frame is greater than a preset minimum threshold and less than the available loading bandwidth of the physics simulation update frame, the standard warm-up strategy is executed.
[0033] When the throughput requirement of a rigid body character object in a physics simulation update frame is greater than or equal to the available loading bandwidth of the physics simulation update frame, an overload degradation strategy is executed.
[0034] Secondly, embodiments of the present invention also provide a Unity game user behavior data mining system, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the steps of any of the methods described above.
[0035] The beneficial effects of this invention are:
[0036] This application considers that when a rigid body character object approaches a resource boundary at high speed, it often crosses the trigger boundary due to inertia before the resource is fully loaded, resulting in a visual model loss for the rigid body character object. Therefore, a braking buffer distance, including physical braking distance and loading time compensation, is calculated. Then, a proxy physics layer is established before the main scene logic starts. Based on the degree of overlap between the rigid body character object's movement direction and its gaze direction in the physics simulation update frame, the gaze movement alignment factor of the rigid body character object in the physics simulation update frame is obtained. To simulate the "tunneling effect" of human visual attention in Unity game systems, the spatial topology of the detection rays is dynamically adjusted according to the rigid body character object's intent. A resource detection ray cluster is established and used to detect the proxy physics layer. Based on the detection results, the physical movement of the rigid body character object is determined. The system simulates the throughput requirements of update frames, aiming to determine the needs of physical simulation update frames based on the consistency between the rigid body character's movement trend and the viewpoint of focus in the physical simulation update frames. It then determines the available loading bandwidth of the physical simulation update frames based on the actual frame time of the preceding adjacent frame. This available loading bandwidth is determined by the numerical relationship between the actual frame time of the preceding adjacent frame and the preset target frame time of the physical simulation update frame. When a stutter occurs in the preceding adjacent frame, the available loading bandwidth is automatically reduced to suppress new loading requests and free up CPU resources for rendering logic. Finally, combined with the throughput requirements, the system's scheduling strategy is determined to address the difficulty of establishing an effective balance between the dynamic movement intentions of the character and the limited system processing capabilities of the static Euclidean distance triggering mechanism. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 This is a flowchart illustrating a Unity game user behavior data mining method according to an embodiment of the present invention. Detailed Implementation
[0039] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0040] Please see Figure 1 The diagram illustrates a flowchart of a Unity game user behavior data mining method according to an embodiment of the present invention, which includes the following steps:
[0041] Step S001: Read the constant configuration parameters and the three-dimensional instantaneous velocity vector of the rigid body character object in the physics simulation update frame. Project the three-dimensional instantaneous velocity vector horizontally to establish the movement unit vector of the rigid body character object in the physics simulation update frame. Based on the constant configuration parameters and the braking buffer distance based on inertial constraints and loading delay, construct the braking buffer distance of the rigid body character object in the physics simulation update frame.
[0042] In large open-world scenarios, game resources are typically distributed horizontally along the ground. However, rigid body character objects in actual gameplay include vertical displacement components such as jumping and falling. Directly using 3D instantaneous velocity vectors for distance determination can lead to vertical motion mistakenly triggering horizontal resource loading. Furthermore, when a rigid body character object is stationary or undergoing slight movement, the velocity vector output by the physics engine approaches zero, causing orientation calculations to fail and affecting the generation of subsequent probe rays. Therefore, in each physics simulation update frame, it is necessary to perform dimensionality reduction projection and orientation cleaning on the original dynamic data of the rigid body character object.
[0043] Specifically, the process accesses the physical rigid body component mounted on the rigid body character object, reads the 3D instantaneous velocity vector of the physics simulation update frame, projects the 3D instantaneous velocity vector onto the XZ horizontal plane of the world coordinate system, obtains the magnitude of the projected vector, and records the magnitude of the projected vector as the horizontal displacement rate of the rigid body character object in the physics simulation update frame. .
[0044] The purpose of projecting the three-dimensional instantaneous velocity vector onto the XZ horizontal plane of the world coordinate system is to ignore the Y-axis component in order to eliminate vertical motion interference.
[0045] A preset static determination threshold is set. In this embodiment, the static determination threshold is set to 0.01 m / s. When the horizontal displacement rate of the rigid body character object in the physical simulation update frame is greater than the static determination threshold, the rigid body character object is determined to be in an effective moving state in the physical simulation update frame. The horizontal projection results of the three-dimensional instantaneous velocity vectors of all rigid body character objects in the physical simulation update frame are normalized, and the unit movement vector of each rigid body character object in the physical simulation update frame is obtained. When the horizontal displacement rate of the rigid body character object in the physical simulation update frame is less than or equal to the static determination threshold, the rigid body character object is determined to be in a static or slightly trembling state in the physical simulation update frame. The horizontal displacement rate of the rigid body character object in the physical simulation update frame cannot represent its intentional direction. The normalized value of the forward vector of the main camera in the XZ plane in the physical simulation update frame is recorded as the unit movement vector of the rigid body character object in the physical simulation update frame.
[0046] In particular, the forward vector of the main camera in the XZ plane in the physics simulation update frame is read by the Unity game system.
[0047] Reading resource files from storage media involves an inherent physical time consumption, namely the estimated resource loading time. Furthermore, rigid body objects are constrained by resistance and friction in the physics engine, preventing them from instantly stopping from high speeds. If only the physical position of the rigid body object in the physics simulation update frame and its distance from the resource boundary are detected, when the rigid body object approaches the resource boundary at high speed, it often crosses the trigger boundary due to inertia before the resource loading is complete, resulting in a visual model loss for the rigid body object. Therefore, it is necessary to calculate a braking buffer distance that includes physical braking travel and loading time compensation, using this braking buffer distance as the dynamic electronic fence radius.
[0048] Specifically, it reads all preset constant configuration parameters from the global configuration file. These constant configuration parameters include the maximum deceleration acceleration, the estimated resource loading time, and the basic interaction radius. The maximum deceleration acceleration represents the maximum reverse acceleration of a rigid body character object when it brakes at full speed on a specific surface material; the basic interaction radius represents the minimum preload range required for a rigid body character object to maintain visual integrity when stationary.
[0049] The ratio of the square of the horizontal displacement rate of the rigid body character object in the physics simulation update frame to twice the preset maximum deceleration is denoted as the theoretical braking displacement of the rigid body character object; the product of the horizontal displacement rate of the rigid body character object and the estimated resource loading time is denoted as the current continuous distance of the rigid body character object; the sum of the basic interaction radius, the theoretical braking displacement, and the current continuous distance of the rigid body character object is denoted as the braking buffer distance of the rigid body character object in the physics simulation update frame.
[0050] The rate of the rigid body character object in the physics simulation update frame can be determined based on the three-dimensional instantaneous velocity vector of the rigid body character object in the physics simulation update frame.
[0051] Understandably, the basic interaction radius can be interpreted as the basic positional guarantee for a rigid body character object. The theoretical braking displacement of a rigid body character object can be understood as the theoretical braking displacement required for the rigid body character object to decelerate to zero during a physics simulation update frame. The current sustained distance of a rigid body character object can be understood as the distance the rigid body character object can cover while maintaining its current speed within the estimated resource loading time window of the Unity game system's I / O operation; the current sustained distance is the displacement compensation of the rigid body character object during the estimated resource loading time of the I / O operation.
[0052] It is understandable that the braking buffer distance of the rigid body character object is temporarily stored in memory.
[0053] At this point, the braking buffer distance of the rigid body character object in the physics simulation update frame is obtained.
[0054] Step S002: Construct a resource metadata collision body and assign resource identifiers. Before the main scene logic starts, initialize the environment based on the resource metadata collision body, establish a proxy physical layer, determine the line-of-sight alignment factor of the rigid body character object in the physical simulation update frame based on the projection vector and movement unit vector of the main camera in the physical simulation update frame, establish a resource detection ray cluster based on the line-of-sight alignment factor and braking buffer distance of the rigid body character object in the physical simulation update frame, and use the resource detection ray cluster to detect the proxy physical layer. Based on the detection results, determine the throughput requirement of the rigid body character object in the physical simulation update frame.
[0055] It is important to understand that "physical proximity" is not the same as "immediate resource access needs". The consistency between the motion trend of the rigid body character object in the physical simulation update frame and the viewpoint of attention truly determines the urgency of IO load, and the triggering of resource loading should be determined based on the urgency of IO load.
[0056] Because of the dynamic loading mechanism during game execution, resources that have not yet been instantiated do not have mesh models or entity data in the scene. This causes conventional physics detection methods to be unable to detect the existence of unloaded areas, resulting in a logical deadlock of "detection depending on loading, and loading depending on detection". To solve this data dependency problem, a lightweight proxy layer containing only space and metadata must be built before the resource entity is loaded.
[0057] First, during the scene editing phase, for each resource prefab to be streamed, the bounding box of the resource prefab is extracted, and a resource metadata collider without a mesh rendering component is generated based on the bounding box. The file size of the packaged resource metadata collider is obtained and written as key metadata into the script component attached to the resource metadata collider. A unique resource identifier is assigned to each resource metadata collider. All generated resource metadata colliders are assigned to a dedicated "proxy physics layer." The layer containing the proxy physics layer should be configured to be invisible to the rendering camera and only physically interact with specific probe rays.
[0058] Before the main scene logic starts, all resource metadata collision data are loaded into memory at once.
[0059] It is important to understand that the resource metadata collider contains only simple geometric shapes and a very small amount of integer data, with a very low memory footprint. The construction of the resource metadata collider can provide a resident physical detection environment that is decoupled from the rendering state, and can provide the necessary interactive objects for subsequent real-time detection.
[0060] To quantify the intensity of a rigid body object's motion intent in a physics simulation update frame, it is necessary to distinguish between two behavior modes: high intent and low intent. The high intent behavior mode of the resource metadata collider includes running in a straight line, while the low intent behavior mode includes sideways translation and backward movement.
[0061] To distinguish behavioral patterns, a geometric alignment metric is first required. Specifically, the normalized result of the projection vector of the main camera on the XZ plane in the physics simulation update frame is denoted as the gaze unit vector of the physics simulation update frame; the dot product of the movement unit vector and the gaze unit vector of the rigid body character object in the physics simulation update frame is truncated non-negatively, and the processed result is denoted as the gaze movement alignment factor of the rigid body character object in the physics simulation update frame.
[0062] Non-negative truncation is a fundamental operation in the field of data preprocessing. Its core is to forcibly correct all values less than 0 in the dataset to 0, retaining only values greater than or equal to 0, ultimately ensuring that all processed data are non-negative. Non-negative truncation is a well-known technique and will not be elaborated further. The purpose of non-negative truncation is to ensure that the line-of-sight alignment factor is greater than or equal to 0. When the dot product result is less than 0, the contribution of the rigid body character object in the physical simulation update frame to the loading of resources in front is considered to be 0.
[0063] When the line-of-sight alignment factor of a rigid body character object in a physics simulation update frame is closer to 1, the degree of overlap between the rigid body character object's movement direction and the line-of-sight direction is higher. This indicates the rigid body character object is in a more pronounced "rushing" or "rushing" state in the physics simulation update frame, and a higher detection sensitivity should be maintained to avoid visual model gaps or rendering artifacts. Conversely, when the line-of-sight alignment factor of a rigid body character object in a physics simulation update frame is closer to 0, the degree of overlap between the rigid body character object's movement direction and the line-of-sight direction is lower. This indicates the rigid body character object is in a more pronounced lateral translation or stationary rotation state in the physics simulation update frame, and a lower demand for loading remote resources. This is to avoid the system performing invalid loading operations on non-interested areas, thus avoiding the consumption of limited I / O bandwidth and memory resources.
[0064] Human visual attention exhibits a "tunneling effect," which manifests as a narrowing and widening of the field of vision during high-speed movement and a widening and narrowing of the field of vision during slow, meandering movement. To simulate this "tunneling effect" in Unity game systems, fixed-shape detection areas should not be used. Instead, the spatial topology of the detection rays should be dynamically adjusted according to the intent of the rigid body character object.
[0065] Based on the line-of-sight alignment factor and braking buffer distance of the rigid body character object in the physics simulation update frame, the ray detection length and ray cluster scattering angle of the rigid body character object in the physics simulation update frame are determined. The ray detection length is positively correlated with the braking buffer distance and the line-of-sight alignment factor. The ray cluster scattering angle is negatively correlated with the line-of-sight alignment factor.
[0066] It is understood that the positive and negative correlations in this application refer to the relationship between the independent and dependent variables. A positive correlation means that the dependent variable increases (decreases) as the independent variable increases (decreases), and can be an additive or multiplicative relationship. A negative correlation means that the dependent variable decreases (increases) as the independent variable increases (decreases), and can be an inverse relationship or a subtractive relationship.
[0067] Preferably, as an embodiment of this application, the formula for calculating the ray detection length of the rigid body character object in the physics simulation update frame is:
[0068]
[0069] This indicates the ray detection length of the rigid body character object in the physics simulation update frame; This represents the line-of-sight alignment factor of the rigid body character object in the physics simulation update frame; This represents the braking buffer distance of the rigid body character object in the physics simulation update frame; This represents the preset minimum length coefficient. In this embodiment, the minimum length coefficient is set to 0.3.
[0070] Preferably, as an embodiment of this application, the formulas for calculating the ray detection length and ray cluster scattering angle of the rigid body character object in the physics simulation update frame are as follows:
[0071]
[0072] in, This represents the angle of ray cluster scattering of the rigid body character object in the physics simulation update frame; This indicates the preset maximum scattering angle; in this embodiment, the maximum scattering angle is set to 90°. This represents a preset coefficient parameter; in this embodiment, the value of the coefficient parameter is 0.5. This represents the line-of-sight alignment factor of the rigid body character object in the physics simulation update frame.
[0073] Using the position of the rigid body character object in the physics simulation update frame as the origin, and taking the ray detection length and ray cluster scattering angle of the rigid body character object in the physics simulation update frame as the length and scattering angle of the ray cluster, a resource detection ray cluster is established. This resource detection ray cluster contains... Each resource detection ray is emitted in a fan-shaped distribution.
[0074] in, This indicates a preset quantity; in this embodiment, it refers to... The value is 5.
[0075] Understandably, when the line-of-sight alignment factor is closer to 1, the resource detection ray cluster determined by the line-of-sight alignment factor is more elongated, so as to detect resources located far away from the rigid body character object in advance; when the line-of-sight alignment factor is closer to 0, the resource detection ray cluster determined by the line-of-sight alignment factor presents a shorter and wider fan shape, and the resource detection ray cluster determined by the line-of-sight alignment factor tends to cover the near field area around the rigid body character object, filtering out invalid detections of non-interest areas at the geometric level.
[0076] The resource detection ray cluster constructed using a non-allocation discrete detection scheme can avoid the high overhead problem of continuous volume detection, transform collision events in geometric space into quantitative indicators characterizing system bandwidth pressure, and solve the technical problem of distinguishing between valid loading requests and invalid edge walks under limited bandwidth.
[0077] Understandably, the resource detection ray cluster established using the rigid body character object in the physics simulation update frame is used to detect the proxy physics layer. Based on the detection results, the throughput requirement of the rigid body character object in the physics simulation update frame is determined. This detection is implemented by the system calling the ray detection interface of the physics engine. The specific steps are as follows:
[0078] 1. Initialize an empty hash set and denote the hash set as the unique resource set, which is used for deduplication.
[0079] 2. Iterate through the detection results of each ray in the resource detection ray cluster established in the physics simulation update frame for the rigid body character object. If the ray hits a resource metadata collider, read the resource identifier stored in the collider script.
[0080] 3. Check if the read resource identifier already exists in the unique resource set. If not, store the read resource identifier and the resource file size recorded by the collider into the unique resource set to eliminate the data duplication and accumulation error caused by multiple rays in the resource detection ray cluster hitting the same volume resource at the same time.
[0081] 4. The ratio of the resource file size corresponding to the resource identifier in the unique resource set to the estimated resource loading time is recorded as the loading ratio of the resource identifier in the unique resource set. The sum of the loading ratios of all resource identifiers in the unique resource set is multiplied by the line-of-sight alignment factor of the rigid body character object in the physics simulation update frame, and recorded as the throughput requirement of the rigid body character object in the physics simulation update frame.
[0082] The throughput requirement of a rigid body character object in a physics simulation update frame can be understood as the minimum data transfer rate required by the system to load all potential target resources of the rigid body character object within the estimated resource loading time window for the physics simulation update frame. Therefore, based on the throughput requirement and available loading bandwidth, hierarchical resource scheduling can be performed to adaptively allocate limited system computing resources, solve the problem of CPU time slice occupation by I / O operations on the main thread, and ensure the stability of the rendering frame rate under complex dynamic loads.
[0083] This establishes the throughput requirements of rigid body character objects in physics simulation update frames.
[0084] Step S003: Based on the actual frame time of the previous adjacent frame of the physical simulation update frame, determine the available loading bandwidth of the physical simulation update frame, and combine it with the throughput requirements to determine the system's scheduling strategy.
[0085] Although the game engine's asynchronous loading tasks read data in a background thread, their initialization, submission, and completion callback phases still consume CPU time on the main thread. When the rendering frame rate drops, the time slice allocated to IO callbacks on the main thread is further compressed. Maintaining a fixed loading concurrency at this time would lead to severe frame rate jitter. Therefore, it is necessary to dynamically calculate the available loading bandwidth based on the update frame rate of the physics simulation.
[0086] The ratio of the preset target frame time of the physical simulation update frame to the actual frame time of the previous adjacent frame of the physical simulation update frame is denoted as the adjacent time ratio of the physical simulation update frame. The adjacent time ratio of the physical simulation update frame is numerically constrained using the Clamp function. The product of the numerical constraint result and the preset baseline bandwidth constant is denoted as the available loading bandwidth of the physical simulation update frame.
[0087] The numerical range of the numerical constraint is a preset range. Specifically, in this embodiment, the lower limit and upper limit of the numerical constraint are set to 0.1 and 1, respectively. The preset base bandwidth constant is set to 50MB / s, and the preset target frame time is set to 16.6ms, corresponding to 60FPS.
[0088] The adjacent time ratio of the physical simulation update frame can be determined based on the numerical relationship between the actual frame time of the previous adjacent frame and the preset target frame time of the physical simulation update frame. When a stutter occurs in the previous adjacent frame of the physical simulation update frame, the available loading bandwidth of the physical simulation update frame is automatically reduced to suppress new loading requests and make way for CPU resources for the rendering logic.
[0089] Based on the numerical relationship between the throughput requirements of rigid body character objects in the physics simulation update frame and the available loading bandwidth of the physics simulation update frame, as well as the LOD hierarchical path information pre-set in the resource metadata collider, the system scheduling strategy is determined.
[0090] When the throughput requirement of a rigid body character object in a physics simulation update frame is less than or equal to a preset minimum threshold, a silent suspension strategy is executed. Specifically, the silent suspension strategy involves not executing any loading API calls. During the execution of the silent suspension strategy, the rigid body character object is in a static observation or backward movement state, and there is no urgent resource loading requirement within the rigid body character object's current field of view. The silent suspension strategy avoids invalid pre-reading of non-interested areas, completely freeing up the I / O channels for other background tasks.
[0091] In this embodiment, the preset minimum threshold value is 0.1 MB / s.
[0092] When the throughput requirement of a rigid body character object in a physics simulation update frame exceeds a preset minimum threshold but is less than the available loading bandwidth of the physics simulation update frame, a standard preheating strategy is executed. Specifically, the standard preheating strategy involves reading the LOD0 high-precision model resource path recorded in the resource metadata collider, calling the engine's standard asynchronous loading interface (e.g., AssetBundle.LoadAssetAsync), and initiating a preloading task for the high-precision resources. When executing the standard preheating strategy, the loading requirement of the rigid body character object in the physics simulation update frame is within the system's processing capacity, allowing for smooth resource streaming transmission using idle bandwidth.
[0093] When the throughput requirement of a rigid body character object in a physics simulation update frame is greater than or equal to the available loading bandwidth of that frame, an overload degradation strategy is executed. This strategy triggers the system's defensive degradation logic, reading the LOD2 low-precision model or pure collider resource path recorded in the resource metadata collider. Since the volume of low-precision resources is significantly smaller than that of high-precision resources, the real-time throughput requirement corresponding to low-precision resources will fall back to a safe range, and the system prioritizes loading low-precision resources. When executing the overload degradation strategy, if the amount of data required by the rigid body character object according to its current intent in the physics simulation update frame exceeds the system's real-time processing capacity, forcibly loading a high-precision model will cause the estimated resource loading time to overflow, leading to visual glitches or main thread crashes. The overload degradation strategy can ensure that the physical collision environment and basic visual outlines are in place in a timely manner under high-speed movement or IO storm conditions by sacrificing local visual details, maintaining the continuity of game logic.
[0094] This completes the system's adaptive scheduling.
[0095] Based on the same inventive concept as the above method, this embodiment of the invention also provides a Unity game user behavior data mining system, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of any one of the above-described Unity game user behavior data mining methods.
[0096] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for mining user behavior data in Unity games, characterized in that, The method includes the following steps: Read the constant configuration parameters and the 3D instantaneous velocity vector of the rigid body character object in the physics simulation update frame, perform horizontal projection on the 3D instantaneous velocity vector, establish the movement unit vector of the rigid body character object in the physics simulation update frame, and construct the braking buffer distance of the rigid body character object in the physics simulation update frame based on the constant configuration parameters, inertial constraints and loading delay braking buffer distance. Construct a resource metadata collision body and assign resource identifiers. Before the main scene logic starts, initialize the environment based on the resource metadata collision body, establish a proxy physical layer, determine the line-of-sight alignment factor of the rigid body character object in the physical simulation update frame based on the projection vector and movement unit vector of the main camera in the physical simulation update frame, establish a resource detection ray cluster based on the line-of-sight alignment factor and braking buffer distance of the rigid body character object in the physical simulation update frame, and use the resource detection ray cluster to detect the proxy physical layer. Based on the detection results, determine the throughput requirement of the rigid body character object in the physical simulation update frame. Based on the actual frame time of the previous adjacent frame of the physical simulation update frame, determine the available loading bandwidth of the physical simulation update frame, and combine it with the throughput requirements to determine the system's scheduling strategy. The method for determining the line-of-sight alignment factor of the rigid body character object in the physics simulation update frame is as follows: The normalized result of the horizontal projection vector of the main camera in the physical simulation update frame is denoted as the line-of-sight unit vector of the physical simulation update frame. The dot product of the rigid body character object's movement unit vector and the view unit vector in the physics simulation update frame is truncated to non-negative values, and the result is recorded as the rigid body character object's view movement alignment factor in the physics simulation update frame. The method for determining the available loading bandwidth of the physical simulation update frame is as follows: The ratio of the preset target frame time of the physical simulation update frame to the actual frame time of the previous adjacent frame of the physical simulation update frame is denoted as the adjacent time ratio of the physical simulation update frame. The product of the numerical constraint result of the adjacent time ratio of the physical simulation update frame and the preset reference bandwidth constant is denoted as the available loading bandwidth of the physical simulation update frame. The specific methods for determining the system scheduling strategy based on throughput requirements are as follows: When the throughput requirement of a rigid body character object in a physics simulation update frame is less than or equal to a preset minimum threshold, a silent suspension strategy is executed. When the throughput requirement of a rigid body character object in a physics simulation update frame is greater than a preset minimum threshold and less than the available loading bandwidth of the physics simulation update frame, the standard warm-up strategy is executed. When the throughput requirement of a rigid body character object in a physics simulation update frame is greater than or equal to the available loading bandwidth of the physics simulation update frame, an overload degradation strategy is executed.
2. The Unity game user behavior data mining method according to claim 1, characterized in that, The method for establishing the movement unit vector of the rigid body character object in the physics simulation update frame is as follows: The magnitude of the horizontal projection of the three-dimensional instantaneous velocity vector of the rigid body character object in the physics simulation update frame is denoted as the horizontal displacement rate of the rigid body character object in the physics simulation update frame. When the horizontal displacement rate is greater than the static determination threshold, the normalized result of the horizontal projection of the three-dimensional instantaneous velocity vector of the rigid body character object in the physical simulation update frame is recorded as the unit movement vector of the rigid body character object in the physical simulation update frame. Conversely, the normalized value of the horizontal projection result of the main camera's forward vector in the physics simulation update frame is denoted as the rigid body character object's movement unit vector in the physics simulation update frame.
3. The Unity game user behavior data mining method according to claim 2, characterized in that, The method for constructing the braking buffer distance of the rigid body character object in the physics simulation update frame is as follows: The constant configuration parameters include maximum deceleration acceleration, estimated resource loading time, and basic interaction radius; The ratio of the square of the horizontal displacement rate of the rigid body character object in the physics simulation update frame to twice the preset maximum deceleration is denoted as the theoretical braking displacement of the rigid body character object. The product of the horizontal displacement rate of the rigid body character object and the estimated time of resource loading is recorded as the current continuous distance of the rigid body character object. The sum of the basic interaction radius, the theoretical braking displacement of the rigid body character object, and the current continuous distance is denoted as the braking buffer distance of the rigid body character object in the physics simulation update frame.
4. The Unity game user behavior data mining method according to claim 1, characterized in that, The proxy physical layer is specifically: Based on the spatial bounding box of the resource prefab to be streamed, generate resource metadata colliders that do not contain mesh rendering components, configure the layers containing all resource metadata colliders to be invisible to the rendering camera and only physically interact with the rays of the resource detection ray clusters, and use the layers containing all resource metadata colliders as proxy physical layers.
5. The Unity game user behavior data mining method according to claim 1, characterized in that, The method for establishing the resource detection ray cluster is as follows: Based on the line-of-sight alignment factor and braking buffer distance of the rigid body character object in the physics simulation update frame, the ray detection length and ray cluster scattering angle of the rigid body character object in the physics simulation update frame are determined. The ray detection length is positively correlated with the braking buffer distance, the ray detection length is negatively correlated with the line-of-sight alignment factor, and the ray cluster scattering angle is negatively correlated with the line-of-sight alignment factor. Using the position of the rigid body character object in the physics simulation update frame as the origin of the coordinate system, the ray detection length and ray cluster scattering angle of the rigid body character object in the physics simulation update frame are respectively used as the length and scattering angle of the ray cluster to establish a resource detection ray cluster. Each resource detection ray in the resource detection ray cluster is emitted in a fan-shaped distribution.
6. The Unity game user behavior data mining method according to claim 3, characterized in that, The method for using resource detection ray clusters to detect the proxy physical layer and determining the throughput requirements of the rigid body role object in the physical simulation update frame based on the detection results includes the following specific methods: Initialize an empty hash set, denoted as the unique resource set, and write the resource identifier and resource file size recorded by the collision body of the resource metadata collider hit by the ray in the resource detection ray cluster into the unique resource set; The ratio of the resource file size corresponding to the resource identifier in the unique resource set to the estimated resource loading time is denoted as the loading ratio of the resource identifier in the unique resource set. The sum of the loading ratios of all resource identifiers in the unique resource set is multiplied by the line-of-sight alignment factor of the rigid body character object in the physics simulation update frame, and denoted as the throughput requirement of the rigid body character object in the physics simulation update frame.
7. A Unity game user behavior data mining system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as claimed in any one of claims 1-6.
Citation Information
Patent Citations
Mobile game resource dynamic loading optimization method, terminal equipment and system
CN120950148A
Game virtual object resource dynamic loading method and system
CN121243768A