Game development system based on Unity3D

By building directed acyclic graphs of script dependencies, optimizing log processing, dynamically cropping scene objects and predicting player scene locations, the problems of complex script dependency links, redundant log processing, low efficiency in dynamic scene management and insufficient resource allocation in the existing technology are solved, and efficient script scheduling, accurate log analysis, optimized resource management and improved game operation stability and fluency.

CN120066467AInactive Publication Date: 2025-05-30BEIJING HAPPY SPLENDID TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510142506.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-10
Publication Date
2025-05-30
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing technology is difficult to identify complex loop call links in script dependency processing, resulting in confusion of links or excessive repeated calls, which increases the execution time and debugging difficulty of script operation; it is difficult to effectively summarize duplicate fields and key information, and a large number of redundant log data need to be reviewed one by one during analysis; it is difficult to determine the importance of player perspective changes and scene characteristics in real time, and may load a large number of low-priority objects that players cannot see; resource allocation lacks optimization methods based on real-time requirements, resulting in game running lag or loading failure.

Method used

By building a directed acyclic graph of script dependencies, analyze and sort the dependency links, and generate a script scheduling priority list; optimize log processing, count the frequency of keyword occurrence and the number of triggers of the source script, and generate a key log analysis table; dynamically crop scene objects, sort and crop according to the player's perspective and object feature contribution values; dynamic optimization and allocation of resources are performed by predicting the player's scene location.

Benefits of technology

Improve the efficiency of script scheduling and avoid performance problems in script dependency chains; enhance the structure of log data and the accuracy of analysis; reduce scene resource consumption and improve operation efficiency; through dynamic resource optimization, resource conflict problems in game operation are alleviated, and the speed and balance of game scene loading are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066467A_ABST
    Figure CN120066467A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer graphic processing, in particular to a Unity3D-based game development system, which comprises a script scheduling module, a script scheduling module, a script scheduling module, a script scheduling module, a script scheduling module, a script scheduling module, a script scheduling module and a script scheduling module, wherein the script scheduling module collects calling relation data of all scripts in a Unity3D project, constructs a directed acyclic graph of a script dependency relation according to the calling relation data, analyzes dependency links among the scripts in the directed acyclic graph, and sends the dependency links to the Unity3D project; and generating a script scheduling priority list according to the intensity sorting of the dependent links. According to the script scheduling method and device, the directed acyclic graph construction and the cyclic dependency reconstruction are carried out on the dependency relationship and the calling link of the scripts, so that the logic relationship and the execution path between the scripts are optimized, the script scheduling efficiency is improved, and the performance problem possibly caused in a script dependency chain is avoided; by extracting and analyzing the timestamps, the source scripts and the key information fields in the log content, the data size occupied by repeated fields is reduced, and the structured degree of the log data and the analysis accuracy are enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer graphics processing, and particularly to a game development system based on Unity3D. Background Art

[0002] The technical field of computer graphics processing involves technologies and methods for generating, manipulating, and displaying graphical content using computer hardware and software. Its core lies in implementing functions such as complex image processing, 3D modeling, rendering, animation, and human-computer interaction through algorithms and tools. This field is widely applied in multiple industries such as game development, film special effects, virtual reality, augmented reality, industrial design, architectural visualization, and medical imaging.

[0003] Among them, the game development system of Unity3D is an integrated tool system developed using the cross-platform game engine Unity3D, mainly used for creating high-quality 2D and 3D games. Through this system, developers can implement functions such as game content design, scripting, graphics rendering, physical simulation, and platform adaptation.

[0004] The prior art is difficult to identify complex loop call chains in script dependency processing, and it is easy to have situations such as link chaos or excessive repeated calls, increasing the execution time of script operation and the difficulty of debugging. For example, when there are multiple cross-dependent script nodes in a game scene, link interruption may lead to abnormal functions; the processing of log content is mostly limited to simple storage, and it is unable to effectively summarize repeated fields and key information. When analyzing, a large amount of redundant log data needs to be checked one by one. For example, when a certain game event triggers hundreds of repeated logs, it becomes difficult to check key information; dynamic scene management is difficult to make real-time judgments on the changes in the player's perspective and the importance of scene features, and may load a large number of low-priority objects that the player cannot see. For example, when the player quickly switches the perspective, useless objects in the scene occupy a large amount of memory; there is a lack of optimization means for adjusting based on real-time requirements in resource allocation, and it is unable to dynamically allocate feature loading and script operation. At the same time, when the memory resources are insufficient, it may cause the game to run smoothly or fail to load. Summary of the Invention

[0005] The purpose of the present invention is to solve the deficiencies existing in the prior art, and to propose a game development system based on Unity3D.

[0006] In order to achieve the above purpose, the present invention adopts the following technical solutions: A game development system based on Unity3D includes:

[0007] The script scheduling module collects the call relationship data of all scripts in the Unity3D project, constructs a directed acyclic graph of script dependencies based on the call relationship data, analyzes the dependency links between scripts in the directed acyclic graph, sorts them according to the strength of the dependency links, and generates a script scheduling priority list;

[0008] The log optimization module obtains the log content generated by Unity3D, counts the occurrence frequency of keywords in the log information fields and the trigger times of the source scripts, and obtains a key log analysis table according to the statistical results and the log information corresponding to the scripts with higher priority in the script scheduling priority list;

[0009] The dynamic scene clipping module captures the dynamically changing objects in the Unity3D scene, extracts the corresponding scene object features in the key log analysis table and constructs a corresponding multi-dimensional data matrix, calculates the object feature contribution value in the multi-dimensional data matrix, compares the object feature contribution value with a preset contribution threshold, marks the to-be-dynamically-loaded status according to the comparison result, and obtains a clipping feature set;

[0010] The dynamic optimization management module immediately loads the unclipped object features in the clipping feature set, predicts the scene positions that the player will enter among the out-of-view features marked as to-be-loaded status, obtains the scene position prediction results, preloads the corresponding features according to the scene position prediction results, performs iterative optimization of resource allocation, and generates the dynamic resource optimization results for Unity3D game development.

[0011] As a further solution of the present invention, the obtaining steps of the dependency links between scripts in the directed acyclic graph are specifically as follows:

[0012] Based on the script files of the Unity3D project, by analyzing the scripts in the project directory, extracting the class, method and event definitions of the scripts, and judging the call relationships and event trigger orders between the scripts, a directed acyclic graph of script dependencies is obtained;

[0013] Based on the directed acyclic graph of the script dependency relationship, by traversing the script paths one by one, parsing the call directions, call frequencies and time intervals between script nodes, sorting out the call order and weights, a dependency link table between scripts is generated.

[0014] As a further solution of the present invention, the obtaining steps of the script scheduling priority list are specifically as follows:

[0015] Based on the dependency link table between the scripts, extracting the function definitions, call relationships and event response orders of the scripts, sorting out their dependency relationships according to the time chain and dependency levels of script calls, and detecting and optimizing the loop paths to generate a directed acyclic graph after loop dependency adjustment;

[0016] Based on the nodes and dependency paths in the directed acyclic graph after the circular dependency adjustment, the formula is adopted:

[0017]

[0018] Calculate the priority score P of the link;

[0019] Among them, w i represents the weight coefficient of the i-th dependency, d i represents the interaction strength of the ith dependency, t i represents the response time of the ith dependency, and n is the total number of dependencies in the dependency path;

[0020] Based on the priority scores of the dependent links, all script nodes are sorted according to the priority scores to generate a script scheduling priority list.

[0021] As a further solution of the present invention, the steps of obtaining the key log analysis table are specifically as follows:

[0022] Based on the Unity3D log file, by extracting the timestamp, log level, source script and information field in each line of log record, the information field is segmented and the frequency of keyword occurrence is counted. At the same time, the number of log triggers of the source script is counted to generate a keyword frequency script trigger number table;

[0023] Based on the keyword frequency script trigger count table, the log information corresponding to the source script with continuous trigger count in the script scheduling priority list is extracted, and the keywords that appear repeatedly in the information field are screened and marked, and redundant keywords are removed to obtain a key log analysis table.

[0024] As a further solution of the present invention, the step of obtaining the object feature contribution value is specifically as follows:

[0025] Based on the captured feature data of dynamically changing objects in the Unity3D scene, multidimensional feature data is extracted from the dynamic objects, and the object feature set corresponding to the key log analysis table is recorded to reflect the feature distribution of each object in each dimension, and a multidimensional data matrix is ​​established;

[0026] Based on the multidimensional data matrix, the formula is adopted:

[0027]

[0028] Calculate the feature contribution value C of the i′th object i′ ;

[0029] Among them, f i′j represents the value of the i′th object on the jth feature dimension, r jrepresents the normalized reference value of the j-th feature dimension, and m represents the total number of feature dimensions.

[0030] As a further solution of the present invention, the obtaining step of the clipped feature set is specifically as follows:

[0031] Based on the current perspective range data of the player, by obtaining the three-dimensional coordinate area of the player's perspective range, it is judged whether the three-dimensional world coordinates of each dynamic object in the scene are within the perspective range, and all the object feature contribution values are sorted to generate a sorting mapping table of object indexes and contribution values;

[0032] Based on the sorting mapping table of object indexes and contribution values, compare the object feature contribution value with a preset object feature contribution threshold, and at the same time judge whether the object is outside the player's perspective range, and mark the object with a contribution value lower than the threshold or outside the perspective range as the state to be dynamically loaded, to obtain the clipped feature set.

[0033] As a further solution of the present invention, the obtaining step of the scene position prediction result is specifically as follows:

[0034] Based on the unclipped object features in the clipped feature set, parse the object data, including the feature type and resource size, load the object resource file into the memory, allocate the resource loading order in turn according to the script scheduling priority, monitor the memory occupancy and loading time of the resource loading, and generate the current resource loading status table;

[0035] Based on the current resource loading status table, use the formula:

[0036]

[0037] Calculate the scene position prediction value S of the l-th object l , to obtain the scene position prediction result;

[0038] where, v l is the movement speed of the l-th object, t′ is the predicted time length, d lk is the distance between the l-th object and the player's current position in the k-th feature dimension, and g is the total number of dimensions of the distance.

[0039] As a further solution of the present invention, the obtaining step of the dynamic resource optimization result of Unity3D game development is specifically as follows:

[0040] Based on the scene position prediction result, parse the target scene position and the corresponding feature data set, load the highest priority features, record the loading time and memory occupancy, and generate the loading performance data table;

[0041] Based on the loaded performance data table, adjust and optimize the resource allocation strategy for loading features and scripts, re - allocate the loading order according to priority and optimize the memory occupancy ratio to generate the dynamic resource optimization result for Unity3D game development.

[0042] Compared with the prior art, the advantages and positive effects of the present invention are as follows:

[0043] In the present invention, by constructing a directed acyclic graph for the dependency relationship and call chain of scripts and reconstructing cyclic dependencies, the logical relationship and execution path between scripts are optimized, the efficiency of script scheduling is improved, and performance problems that may occur in the script dependency chain are avoided; by extracting and analyzing the timestamps, source scripts, and key information fields in the log content, the data volume occupied by duplicate fields is reduced, and the structured degree of log data and the accuracy of analysis are enhanced; in dynamic scene culling, non - critical objects are culled according to the dynamic sorting of the player's perspective range and object feature contribution values, reducing resource consumption in the scene and improving the running efficiency; in resource allocation and immediate loading, through the prediction and pre - loading of future scene positions and the comprehensive evaluation of loading time and memory occupancy, an efficient iterative optimization of resource allocation is completed, effectively alleviating resource conflict problems during game operation and improving the speed and balance of game scene loading. The overall solution significantly improves resource utilization rate and the stability and smoothness of game operation through the coordinated operation of link reconstruction, log optimization, scene culling, and dynamic resource allocation. Brief Description of the Drawings

[0044] Figure 1 It is the system flow chart of the present invention;

[0045] Figure 2 It is the flow chart for analyzing the dependency link between scripts in the directed acyclic graph of the present invention;

[0046] Figure 3 It is the flow chart for obtaining the script scheduling priority list of the present invention;

[0047] Figure 4 It is the flow chart for obtaining the key log analysis table of the present invention;

[0048] Figure 5 It is the flow chart for obtaining the object feature contribution value of the present invention;

[0049] Figure 6 It is the flow chart for obtaining the culling feature set of the present invention;

[0050] Figure 7 It is the flow chart for obtaining the scene position prediction result of the present invention;

[0051] Figure 8This is a flowchart for obtaining the dynamic resource optimization result of Unity3D game development in the present invention. Specific embodiments

[0052] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0053] In the description of the present invention, it should be understood that the orientation or positional relationship indicated by the terms "length", "width", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. is based on the orientation or positional relationship shown in the accompanying drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as limiting the present invention. In addition, in the description of the present invention, "a plurality of" means two or more, unless otherwise specifically defined.

[0054] Please refer to Figure 1 , a game development system based on Unity3D includes:

[0055] The script scheduling module collects the call relationship data of all scripts in the Unity3D project, including the execution dependency relationship and event trigger order of the scripts, constructs a directed acyclic graph of the script dependency relationship according to the call relationship data, analyzes the dependency links between the scripts in the directed acyclic graph, and for the cyclic dependency links in the directed acyclic graph, reconstructs the dependency links by inserting virtual nodes to eliminate cyclic dependencies, sorts the priorities of the script nodes according to the strength of the dependency links, and generates a script scheduling priority list;

[0056] The log optimization module obtains the log content generated by Unity3D, extracts the timestamp, log level, source script and information field in the text data of the log content, counts the occurrence frequency of keywords in the information field and the trigger times of the source script, and according to the statistical results and the log information corresponding to the scripts with higher priorities in the script scheduling priority list, identifies the frequently occurring log keywords from the filtered log information and marks them as redundant duplicate fields to obtain a key log analysis table;

[0057] The dynamic scene clipping module captures the dynamically changing objects in the Unity3D scene, extracts the corresponding scene object features in the key log analysis table, obtains the scene feature set, constructs the corresponding multi-dimensional data matrix according to the scene feature set, calculates the object feature contribution values in the multi-dimensional data matrix, combines the current perspective range data of the player, sorts all the scene feature sets according to the object feature contribution values, compares the object feature contribution values with the preset contribution threshold, clips the object feature content outside the perspective range or below the contribution threshold and marks it as the to-be-dynamically-loaded state, and obtains the clipped feature set;

[0058] The dynamic optimization management module immediately loads the unclipped object features in the clipped feature set, and performs resource allocation according to the priorities of the script nodes in the script scheduling priority list, predicts the scene positions that the player will enter in the features outside the perspective marked as to-be-loaded, obtains the scene position prediction result, preloads the corresponding features according to the scene position prediction result, evaluates the memory occupation ratio of the feature loading time and the script execution, and performs iterative optimization of resource allocation to generate the dynamic resource optimization result for Unity3D game development;

[0059] The script scheduling priority list includes the dependency order of the scripts, the strongly dependent path markers, the priority sorting values, and the reconstruction information of the cyclic dependency nodes. The key log analysis table includes the high-priority script associated logs, the abnormal trigger time intervals, the redundant keyword markers, and the high-frequency log module distribution information. The clipped feature set includes the high-priority object features, the low-priority to-be-loaded features, the outside-perspective feature markers, and the contribution value sorted list. The dynamic resource optimization result for Unity3D game development includes the immediately loaded high-priority features, the to-be-loaded features, the script resource allocation strategy, and the dynamic adjustment parameters of memory allocation.

[0060] Please refer to Figure 2 , and the specific steps for obtaining the dependency links between the scripts in the directed acyclic graph are as follows:

[0061] Based on the script files of the Unity3D project, by analyzing the scripts in the project directory, extracting the class, method, and event definitions of the scripts, and judging the call relationships and event trigger sequences between the scripts, a directed acyclic graph of the script dependency relationships is obtained;

[0062] By parsing the script files of a Unity3D project, first use static code analysis tools (such as Roslyn or Mono.Cecil) to scan the Assets / Scripts directory in the project, extract the class, method, and event definitions of all script files, record the public methods, private methods, and registered event listeners defined in each script. For example, in the PlayerController.cs script, there may be methods MovePlayer(), Jump(), Attack(), and at the same time, there is an OnInputReceived() event listener method in the InputManager.cs script. Further analyze the call relationships between these methods and events among the scripts. For example, the OnInputReceived() event of InputManager.cs calls the PlayerController.MovePlayer() method, thus establishing the call direction. Then record the time chain triggered by the scripts according to the event response order, build a preliminary dependency table in the order of the time of event registration and call, and use a graph structure editing tool (such as Graphviz, Gephi, or Neo4j) to convert the dependency table into a graphical representation. The specific operation is to add script nodes as nodes of the graph and add directional edges according to the call relationship to represent the directionality of the call relationship. Further, eliminate self-loops or duplicate dependency paths through the loop detection algorithm in the tool, and finally organize it into a complete directed acyclic graph to complete the collation of script dependency relationships.

[0063] Based on the directed acyclic graph of script dependency relationships, by traversing the script paths one by one, parse the call direction, call frequency, and time interval between script nodes, organize the call order and weights, and generate a dependency link table between scripts;

[0064] First, select the starting node in the graph (i.e., the script that does not depend on other scripts, such as InputManager.cs). Traverse all paths using the depth-first search (DFS) method, and record the script nodes and call directions in each path in sequence. For example, the path InputManager->PlayerController->EnemyAI. Analyze the specific dependencies of each node on this path. For example, PlayerController.cs depends on the input event data provided by InputManager.cs, and EnemyAI.cs depends on the attack behavior trigger event of PlayerController.cs. Further calculate the call frequency on the path. For example, by recording that the method MovePlayer() is called 60 times per second, while Attack() is called 20 times per second. Assign weights to the paths based on the call order and frequency, and prioritize the paths with higher weights. At the same time, analyze the time interval between calls (such as the interval from the input event to the character movement is 30ms). Through these analyses, organize a dependency link table between the scripts.

[0065] Please refer to Figure 3 , the steps to obtain the script scheduling priority list are specifically as follows:

[0066] Based on the dependency link table between the scripts, extract the function definitions, call relationships, and event response orders of the scripts. Organize their dependency relationships according to the time chain and dependency levels of the script calls, and perform detection and optimization of the loop paths to generate a directed acyclic graph after adjusting the cyclic dependencies;

[0067] For the cyclic dependency links existing in the directed acyclic graph, by analyzing the nodes and edges of the cyclic paths, select the key nodes in the cyclic link, and reconstruct the dependency relationship by inserting virtual nodes. For example, if there is a cyclic link of script A->B->C->A in the directed acyclic graph, first locate the entry node and exit node of the cycle, use the depth-first search (DFS) algorithm to detect the cyclic path, determine that scripts A and C are the start and end nodes of the cyclic link, insert a virtual node V between them to break the cyclic dependency link, and adjust the original path to A->V->C->A, so that the cyclic path becomes a non-cyclic path. Verify the newly inserted virtual node through a graph editing tool (such as Gephi or Neo4j) to ensure the integrity of the new path, and finally eliminate the cyclic dependencies in the graph to form a new directed acyclic graph structure without cyclic dependencies.

[0068] Based on the nodes and dependency paths in the directed acyclic graph after adjusting the cyclic dependencies, use the formula:

[0069]

[0070] Calculate the priority score P of the computing link;

[0071] Among them, w i represents the weight coefficient of the i-th dependency. The calculation method is the normalized value of the dependency call frequency and the maximum call frequency: f i is the call frequency of this dependency, obtained by the number of calls recorded in the engine log. f max is the maximum value of the dependency call frequency in the link. d i represents the interaction intensity (data volume) of the i-th dependency, in bytes, obtained by monitoring the transmission data volume of node interactions with a tool. t i represents the response time of the i-th dependency, in milliseconds. n is the total number of dependencies in the dependency path.

[0072] Suppose a link has 3 dependencies, and the call frequencies f i are f 1 = 30, f 2 = 50, f 3 = 20 times per second, and the maximum call frequency is f max = 50. Then the weight coefficient w i is calculated as follows:

[0073] The interaction intensity d i are d 1 = 500, d 2 = 1000, d 3 = 200 bytes. The response times t i are t 1 = 10, t 2 = 5, t 3 = 20 milliseconds.

[0074] Substitute the parameters into the formula:

[0075] Denominator calculation:

[0076] Priority score calculation:

[0077] The result shows that the priority score P of this link = 39.43.

[0078] Based on the priority scores of the dependency links, sort all script nodes by priority scores to generate a script scheduling priority list;

[0079] According to the calculated priority score P, sort the priorities of the script nodes. First, extract the incoming links of each script node in the directed acyclic graph and calculate its priority score. For example, assume that the incoming links of script node A are X->A and Y->A, and calculate their priority scores through the formula as P X->A = 39.43 and P Y->A = 28.50. Add these two scores as the comprehensive priority score of node A: P A = P X->A + P Y->A = 39.43 + 28.50 = 67.93. Similarly, assume that the incoming link of node B is Z->B, and its priority score is P Z->B = 45.20. The incoming links of node C are W->C and Y->C, and the priority scores are P W->C = 30.10 and P Y->C = 20.40. Then: P C = P W->C + P Y->C = 30.10 + 20.40 = 50.50. Compare and sort the comprehensive priority scores of all nodes: the comprehensive priority score of node A is 67.93, the comprehensive priority score of node B is 45.20, and the comprehensive priority score of node C is 50.50. Sort according to the scores from high to low: node A > node C > node B. The sorted scheduling priority list is: 1. node A, 2. node C, 3. node B. Through this sorted list, the execution order of script scheduling can be determined, so that the scripts with higher priorities are scheduled and executed first.

[0080] Please refer to Figure 4 , and the specific steps for obtaining the key log analysis table are as follows:

[0081] Based on the Unity3D log file, by extracting the timestamp, log level, source script, and information field in each line of the log record, perform word segmentation on the information field and count the frequency of keyword occurrences. At the same time, count the number of log triggers of the source script to generate a keyword frequency - script trigger times table;

[0082] Get the log content generated by Unity3D. By reading the Unity3D log file (such as Editor.log or Player.log), use the script tool to read and parse the log content line by line, and split each line of log record into timestamp, log level, source script and information field according to the predefined field format. The timestamp field is extracted from the log entry through a regular expression, such as the format 2024-12-1914:25:36. The log level field is extracted by matching keywords (such as INFO, DEBUG, ERROR). The source script field is obtained by identifying the class name or script name in the log content. For example, the source script extracted from the log may include PlayerController, InputManager, etc. The information field is the main content of the log. The information field is segmented by keywords through a word segmentation tool (such as jieba word segmentation), and the number of occurrences of each keyword is counted and stored as a keyword frequency table. At the same time, the number of log triggers of each module is recorded through the source script field, and all results are organized into a structured table. The table contains a trigger count statistics table for each module and a keyword occurrence frequency table.

[0083] Based on the keyword frequency script trigger times table, the log information corresponding to the source scripts with continuous trigger times in the script scheduling priority list is extracted, and the keywords that appear repeatedly in the information field are screened and marked, and redundant keywords are removed to obtain the key log analysis table;

[0084] According to the extracted keyword frequency and module trigger statistics, the priority screening range is divided, and the top 5 modules with the highest number of trigger times are used as screening targets. For example, the modules with higher trigger times are PlayerController (500 times), InputManager (300 times), EnemyAI (200 times), GameManager (150 times) and UIManager (100 times). The information field content is extracted from the log entries of these source scripts, and the frequency of occurrence of each keyword is counted. Keywords with an occurrence frequency exceeding 20% ​​of the total number of entries are marked as redundant keywords. For example, in the log information of the module PlayerController, the keyword Update appears 100 times and Move appears 80 times, while the total number of entries is 500, with frequencies of 20% and 16% respectively. Update is marked as a redundant keyword. After clearing the redundant keywords in the information field, the remaining key information field content is retained, and the cleaned log information is organized into a key log analysis table. The analysis table includes the source script, timestamp, log level, and information field after removing redundancy.

[0085] See also Figure 5 , the specific steps for obtaining the object feature contribution value are:

[0086] Based on the characteristic data of the dynamically changing objects in the captured Unity3D scene, multi-dimensional characteristic data is extracted from the dynamic objects, and the set of object characteristics corresponding to the key log analysis table is recorded, reflecting the characteristic distribution of each object in each dimension, and a multi-dimensional data matrix is established;

[0087] Capture the dynamically changing objects in the Unity3D scene. First, detect the dynamically changing objects through the physics engine in the scene update frame, such as moving characters, rotating props, etc., and record the change characteristics of these objects. These characteristics may include position (such as three-dimensional coordinates x, y, z), rotation angle (such as pitch, yaw, roll), material change (such as texture or color change), etc. Extract the log records related to these objects from the key log analysis table, match the object identifiers in the logs and the corresponding scene objects, for example, match the corresponding logs through the name of the object (such as Player1) or the unique identifier (such as UUID), extract the dynamic characteristic data fields of the object, and construct a scene characteristic set. Subsequently, organize the scene characteristic set into a multi-dimensional data matrix, where the rows represent each dynamic object, the columns represent the characteristic dimensions of the object, such as position, speed, rotation, etc., and each element in the matrix represents the value of a certain dynamic object in a specific characteristic dimension. By recording the dynamic characteristic data of multiple frames of scene updates, a multi-dimensional data matrix containing the dynamic changes of the scene is obtained.

[0088] Based on the multi-dimensional data matrix, use the formula:

[0089]

[0090] Calculate the contribution value C of the i'-th object characteristic i′ to measure the overall influence of the object in the scene;

[0091] where, f i′j represents the value of the i'-th object in the j-th characteristic dimension, which is the input data extracted from the multi-dimensional data matrix. For example, for the dynamic objects in the Unity3D scene, the characteristic dimensions may include distance, material change, and rotation change, which are obtained in the following ways respectively: the distance is calculated by the Euclidean distance between the object and the player's perspective in the scene, and directly call the Vector3.Distance method provided by Unity3D to obtain it; the material change is monitored by the material update event of the object, for example, check the number of changes in the material properties in Unity3D, record the change amplitude, and use the statistical change range as the material change value; the rotation change is obtained by recording the rotation angle change value (such as pitch, yaw, roll) of the object within a unit time, call the transform.rotation of Unity3D and calculate the angle difference, r jDenote the normalization reference value of the j-th feature dimension, which is used to standardize the numerical range of each feature. It is usually the maximum value of all objects in this feature dimension and can be directly obtained by calculating the maximum value of each column in the multi-dimensional data matrix. m represents the total number of feature dimensions and is directly determined by the number of dimensions defined in the scene feature set.

[0092] Suppose there are 3 dynamic objects (Object1, Object2, Object3) in the scene, and the multi-dimensional data matrix contains 3 feature dimensions: distance (unit: meter), material change (unit: percentage), and rotation change (unit: degree). The following are the numerical values of each object in different feature dimensions: f 1′ = {5, 20, 10}, f 2′ = {3, 15, 5}, f 3′ = {8, 10, 0}, and the maximum values of the feature dimensions are r = {8, 20, 10}.

[0093] Calculate the contribution value for each object:

[0094]

[0095] The result shows that the feature contribution value of the first object is C 1′ ≈1.52, the feature contribution value of the second object is C 2′ ≈0.94, and the feature contribution value of the third object is C 3′ ≈1.12.

[0096] Please refer to Figure 6 , and the specific steps for obtaining the clipped feature set are as follows:

[0097] Based on the player's current perspective range data, by obtaining the three-dimensional coordinate area of the player's perspective range, judge whether the three-dimensional world coordinates of each dynamic object in the scene are within the perspective range, sort all the object feature contribution values, and generate a sorted mapping table of object indexes and contribution values;

[0098] Combined with the current perspective range data of the player, the perspective range of the player is obtained through the main camera (the default MainCamera or a custom camera object) used to render the scene in the Unity3D engine. The specific methods include obtaining the frustum parameters of the camera. For example, using the Camera.main object to call its properties fieldOfView (representing the vertical viewing angle of the camera), nearClipPlane and farClipPlane (representing the distances of the near clipping plane and the far clipping plane respectively), calculating the frustum range of the camera through these parameters, and at the same time combining the direction vector transform.forward of the camera to calculate the range of the area directly in front of the player, and taking its three-dimensional coordinate area as the perspective range. For dynamic objects in the scene, their three-dimensional world coordinates are obtained one by one (by calling transform.position), and it is calculated whether these coordinate points are within the frustum range. For example, by converting the coordinates of the dynamic object into the local space coordinates of the camera, it is judged whether its position in the local space meets the conditions of the near clipping plane, the far clipping plane, and the horizontal and vertical ranges. If the conditions are met, it is marked as a visible object. For dynamic objects, according to the calculated object feature contribution values, all objects are sorted from high to low according to the contribution values, and the index position and contribution value of each object are recorded. For example, when the contribution values of objects Object1, Object2, and Object3 are 1.52, 0.94, and 1.12 respectively, the sorted order is Object1>Object3>Object2. Objects not within the current perspective range are directly marked as low priority, and the preliminary sorting result is stored as a mapping table of object indexes and contribution values.

[0099] Based on the sorted mapping table of object indexes and contribution values, compare the object feature contribution values with a preset object feature contribution threshold, and at the same time judge whether the object is outside the player's perspective range. Mark objects below the contribution threshold or outside the perspective range as the state to be dynamically loaded, and obtain the clipping feature set;

[0100] Compare the object feature contribution value with a preset object feature contribution threshold. First, determine the specific numerical range of the object feature contribution threshold. For example, set the threshold as the result of weighting the scene historical average contribution value according to the scene dynamic cropping strategy. Assume the historical average value is 1.0 and the threshold is set to 0.8. Screen the feature contribution values of each object one by one through the aforementioned sorting results. If the contribution value of an object is lower than the object feature contribution threshold or its position is outside the player's viewing range, mark the object as in the state of waiting for dynamic loading. For example, if the contribution value of Object2 is 0.94 but its coordinates are outside the viewing range, mark it as in the cropped state. Remove the object feature content that is lower than the object feature contribution threshold or outside the viewing range, and store it as a cropped feature set, which includes object index, feature dimension information, and marking status. Finally, output the optimized cropped feature set.

[0101] Please refer to Figure 7 , and the specific steps for obtaining the scene position prediction result are as follows:

[0102] Based on the uncropped object features in the cropped feature set, parse the object data, including feature type and resource size, load the object resource file into memory, allocate the resource loading order in sequence according to the script scheduling priority, monitor the memory occupancy and loading time of resource loading, and generate the current resource loading status table;

[0103] Immediately load the uncropped object features in the cropped feature set. First, parse the object data in the cropped feature set to obtain the feature type and resource size of each object. For example, the mesh, texture, or animation resource file of a dynamic object. Load the resource file of the uncropped object into memory through the resource loading function of the Unity3D engine (such as Resources.Load or Addressables.LoadAssetAsync). At the same time, according to the script node priority in the script scheduling priority list, allocate the resource loading order. For example, preferentially load the objects corresponding to the scripts with a higher interaction frequency with the player, and gradually load the object resources of the low-priority scripts. Monitor the memory occupancy during the resource loading process, record the memory consumption of each loading task, and adjust the resource allocation order in real time by statistically analyzing the data of memory occupancy ratio and loading time. Record the allocation plan as the current resource loading status table.

[0104] Based on the current resource loading status table, use the formula:

[0105]

[0106] Calculate the scene position prediction value S of the l-th object l , and obtain the scene position prediction result;

[0107] where, v lis the movement speed of the l-th object, in meters per second, directly obtained through the velocity attribute of the dynamic object in the Unity3D physics engine. For example, the real-time movement speed of the object can be obtained by calling the velocity vector Rigidbody.velocity.magnitude in the rigid body component of the object. For example, if the speed of a dynamic object in a scene is recorded as 5 m / s, then v l = 5, and t′ is the predicted time length, in seconds, used to calculate the position of the object at a future time point, defined by the dynamic loading strategy of the game design. For example, it can be determined by analyzing the average movement time window of the player (such as the time when the player switches from one scene to another). For example, if the average time for the player to switch between two scenes is 2 seconds according to historical records, then t′ = 2, is the sum of the distances between the l-th object and the player's current position in all feature dimensions, d lk is the distance between the l-th object and the player's current position in the k-th feature dimension, in meters, calculated through the three-dimensional space coordinates provided by Unity3D. For example, for d lk , if the player's current position is (x p , y p , z p ), and the position of the object is (x l , y l , z l ), then the calculation formula is: For example, if the player is at (0, 0, 0) and the object is at (10, 5, 2), then is to accumulate the distances in all dimensions of the l-th object. g is the total number of dimensions of the distance, representing the x, y, and z coordinates of the three-dimensional space, usually 3.

[0108] Suppose there are 3 objects (Object1, Object2, Object3) in the scene, and their speeds are v 1 = 5 m / s, v 2 = 3 m / s, v 3 = 4 m / s, the predicted time t′ = 2 s, the player's current position is (0, 0, 0), and the positions of the scene objects are: Object1: (10, 5, 2), Object2: (15, 10, 5), Object3: (20, 15, 10). Calculate the three-dimensional distances between each object and the player:

[0109] For Object1:

[0110] For Object2:

[0111] For Object3:

[0112] Calculate the average distance of each object:

[0113] For Object1:

[0114] For Object2:

[0115] For Object3:

[0116] Calculate the position prediction value S of each object l :

[0117] For Object1:

[0118] For Object2:

[0119] For Object3:

[0120] The results show that the scene position prediction value of the first object is S 1 ≈13.79, the scene position prediction value of the second object is S 2 ≈12.24, and the scene position prediction value of the third object is S 3 ≈16.98.

[0121] Please refer to Figure 8 , and the specific steps for obtaining the dynamic resource optimization results of Unity3D game development are as follows:

[0122] Based on the scene position prediction results, parse the target scene position and the corresponding feature data set, load the highest-priority features, record the loading time and memory occupancy, and generate a performance data table for the loading;

[0123] First, the feature with the scene position index S 3 = 16.98 has the highest priority because its prediction result indicates that the player is most likely to enter the corresponding scene position. Therefore, it is necessary to preferentially load the features related to S 3Associated feature sets, such as a dynamic mesh resource (20MB in size) and a set of high-resolution textures (10MB in size). These resources are loaded sequentially through Unity3D's Resources.Load method. Record the start time of loading the mesh resource as 10.0 seconds, the completion time as 10.6 seconds, and the loading time as 0.6 seconds. At the same time, record the start time of texture loading as 10.6 seconds, the completion time as 10.9 seconds, and the loading time as 0.3 seconds. The total loading time is 0.9 seconds. Use Profiler.GetTotalAllocatedMemoryLong to monitor the memory changes before and after loading. The memory before loading is 300MB, the memory after loading is 330MB, and the memory occupancy is 30MB. Secondly, for the feature with S 1 = 13.79, since its priority is lower than S 3 , the loading order is adjusted to the second batch. The features to be loaded include a low-resolution texture (5MB in size) and a sound effect file (2MB in size). The texture loading time is 0.2 seconds, the sound effect loading time is 0.1 seconds, the total loading time is 0.3 seconds, and the memory occupancy is 7MB. Finally, for the feature with S 2 = 12.24, since its priority is the lowest, the loading order is adjusted to the last batch. The feature to be loaded is a scene configuration file (1MB in size), and the loading time is 0.05 seconds, with a memory occupancy of 1MB. Through the above steps, record the loading time and memory occupancy ratio of each feature, and organize the results into a loading performance data table.

[0124] Based on the loading performance data table, adjust and optimize the resource allocation strategy for the loaded features and scripts, reallocate the loading order according to the priority, and optimize the memory occupancy ratio to generate the dynamic resource optimization result for Unity3D game development;

[0125] First, according to the loading performance table, prioritize the optimization allocation of the feature with the highest priority (S 3 = 16.98). Considering its total loading time of 0.9 seconds and a memory occupancy of 30MB, divide a certain resource limit strategy. For example, set the memory occupancy upper limit to 25MB, and adopt a compression algorithm for the size of the texture resource (10MB) to reduce the texture size to 8MB. After dynamic adjustment, the memory occupancy is reduced from 30MB to 28MB, and the loading time remains unchanged. Secondly, for the feature with S 1 = 13.79, since its loading time is short (0.3 seconds) and the memory occupancy ratio is low (7MB), there is no need for further compression or adjustment, and the current loading order is maintained. For the feature with the lowest priority (S 2= 12.24), since its loading time is only 0.05 seconds and its memory occupancy is 1 MB, it is marked as a low-priority task, and in the optimization strategy, its loading is allowed to be postponed until after the main scene features are loaded. Subsequently, for the resource conflict problem between script execution and loading features, it is statistically found that the memory requirement of the script with a priority of 1 in the script scheduling priority list is 20 MB and the loading time is about 0.8 seconds. Bind it to the S 3 = 16.98 related features to ensure that it is loaded simultaneously with the highest-priority features; for the script with a priority of 2, the memory requirement is 15 MB and the loading time is 0.5 seconds. Allocate it to the S 1 = 13.79 feature loading batch; for the script with a priority of 3, the memory requirement is 10 MB and the loading time is 0.2 seconds, and synchronize it with the S 2 = 12.24 feature loading. After the above allocation, further adjust the allocation strategy to optimize the resource conflict area. For example, when the total memory requirement exceeds the limit, preferentially reduce the loading allocation ratio of low-priority features. Through iterative optimization, generate the final resource allocation strategy data table, record the loading order, time, and memory occupancy of each feature and script, and generate the dynamic resource optimization result table for Unity3D game development.

[0126] The above is only a preferred embodiment of the present invention, and it is not intended to limit the present invention in other forms. Any person skilled in the art may use the technical content disclosed above to make changes or modifications into equivalent embodiments with equivalent changes and apply them to other fields. However, as long as it does not depart from the technical solution content of the present invention, any simple modification, equivalent change, and modification made to the above embodiments based on the technical essence of the present invention still fall within the protection scope of the technical solution of the present invention.

Claims

1. A game development system based on Unity3D, characterized in that: The system comprises: The script scheduling module collects the call relationship data of all scripts in the Unity3D project, builds a directed acyclic graph of script dependencies based on the call relationship data, analyzes the dependency links between scripts in the directed acyclic graph, sorts them according to the strength of the dependency links, and generates a script scheduling priority list; The log optimization module obtains the log content generated by Unity3D, counts the frequency of occurrence of keywords in the log information field and the number of triggering of the source script, and obtains a key log analysis table based on the statistical results and the log information corresponding to the script with priority in the script scheduling priority list; The dynamic scene clipping module captures dynamically changing objects in the Unity3D scene, extracts the corresponding scene object features in the key log analysis table and constructs a corresponding multidimensional data matrix, calculates the object feature contribution value in the multidimensional data matrix, compares the object feature contribution value with a preset contribution threshold, marks the state to be dynamically loaded according to the comparison result, and obtains a clipping feature set; The dynamic optimization management module instantly loads the uncropped object features in the cropping feature set, predicts the scene position that the player will enter in the out-of-view features marked as to be loaded, obtains the scene position prediction result, preloads the corresponding features according to the scene position prediction result, performs iterative optimization of resource allocation, and generates dynamic resource optimization results for Unity3D game development.

2. The Unity3D-based game development system according to claim 1, characterized in that: The steps for obtaining the dependency links between scripts in the directed acyclic graph are as follows: Based on the script files of the Unity3D project, the scripts in the project directory are analyzed to extract the classes, methods and event definitions of the scripts, determine the calling relationship and event triggering sequence between the scripts, and obtain a directed acyclic graph of the script dependency relationship; Based on the directed acyclic graph of the script dependency relationship, by traversing the script paths one by one, parsing the calling direction, calling frequency and time interval between script nodes, sorting the calling sequence and weight, and generating a dependency link table between scripts.

3. The Unity3D-based game development system according to claim 2, characterized in that: The steps for obtaining the script scheduling priority list are specifically as follows: Based on the dependency link table between the scripts, the function definition, calling relationship and event response sequence of the scripts are extracted, the dependency relationships are sorted according to the time chain and dependency hierarchy of the script calls, and the loop paths are detected and optimized to generate a directed acyclic graph after the loop dependency adjustment; Based on the nodes and dependency paths in the directed acyclic graph after the circular dependency adjustment, the formula is adopted: Calculate the priority score P of the link; Among them, w i represents the weight coefficient of the i-th dependency, d i represents the interaction strength of the ith dependency, t i represents the response time of the ith dependency, and n is the total number of dependencies in the dependency path; Based on the priority scores of the dependent links, all script nodes are sorted according to the priority scores to generate a script scheduling priority list.

4. The Unity3D-based game development system according to claim 3, characterized in that: The steps for obtaining the key log analysis table are specifically as follows: Based on the Unity3D log file, by extracting the timestamp, log level, source script and information field in each line of log record, the information field is segmented and the frequency of keyword occurrence is counted. At the same time, the log triggering times of the source script are counted to generate a keyword frequency script triggering times table; Based on the keyword frequency script trigger count table, the log information corresponding to the source script with continuous trigger count in the script scheduling priority list is extracted, and the keywords that appear repeatedly in the information field are screened and marked, and redundant keywords are removed to obtain a key log analysis table.

5. The Unity3D-based game development system according to claim 4, characterized in that: The steps for obtaining the object feature contribution value are specifically as follows: Based on the captured feature data of dynamically changing objects in the Unity3D scene, multidimensional feature data is extracted from the dynamic objects, and the object feature set corresponding to the key log analysis table is recorded to reflect the feature distribution of each object in each dimension, and a multidimensional data matrix is ​​established; Based on the multidimensional data matrix, the formula is adopted: Calculate the feature contribution value C of the i′th object i′ ; Among them, f i′j represents the value of the i′th object on the jth feature dimension, r j represents the normalized reference value of the jth feature dimension, and m represents the total number of feature dimensions.

6. The Unity3D-based game development system according to claim 5, characterized in that: The steps for obtaining the clipping feature set are specifically as follows: Based on the player's current viewing angle range data, by obtaining the three-dimensional coordinate area of ​​the player's viewing angle range, the three-dimensional world coordinates of each dynamic object in the scene are determined to determine whether it is within the viewing angle range, all the object feature contribution values ​​are sorted, and a sorting mapping table of object index and contribution value is generated; Based on the sorting mapping table of the object index and contribution value, the object feature contribution value is compared with the preset object feature contribution threshold, and at the same time, it is determined whether the object is outside the player's viewing range. Objects below the contribution threshold or beyond the viewing range are marked as being in a state to be dynamically loaded, and a clipping feature set is obtained.

7. The Unity3D-based game development system according to claim 6, characterized in that: The steps for obtaining the scene position prediction result are specifically as follows: Based on the uncut object features in the clipping feature set, parse the object data, including feature type and resource size, load the object resource file into the memory, assign the resource loading order in sequence according to the script scheduling priority, monitor the memory usage and loading time of the resource loading, and generate a current resource loading status table; Based on the current resource loading status table, the formula is adopted: Calculate the scene position prediction value S of the lth object l , get the scene position prediction result; Among them, v l is the speed of the lth object, t′ is the predicted time length, d lk is the distance between the lth object and the player's current position on the kth feature dimension, and g is the total number of dimensions of the distance.

8. The Unity3D-based game development system according to claim 7, characterized in that: The steps for obtaining the dynamic resource optimization results of the Unity3D game development are as follows: Based on the scene position prediction result, the target scene position and the corresponding feature data set are parsed, the highest priority feature is loaded, the loading time and memory usage are recorded, and a loading performance data table is generated; Based on the loaded performance data table, the resource allocation strategy of the loading characteristics and scripts is adjusted and optimized, the loading order is redistributed according to priority and the memory usage ratio is optimized, and the dynamic resource optimization result of Unity3D game development is generated.