Game performance analysis method, device, equipment and storage medium
By automatically acquiring and associating performance data and screenshots of UE game scenes, the problem of low efficiency in UE project or game performance analysis is solved, realizing automated analysis of performance issues and creation of work orders, thus improving analysis efficiency and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-18
- Publication Date
- 2026-03-17
AI Technical Summary
Existing technologies for performance analysis of UE projects or games are inefficient, fail to fully cover performance issues, and are time-consuming to perform manually. They also cannot effectively correlate performance issues with game screenshots, impacting the gaming experience and optimization efficiency.
By automatically acquiring performance data from game scenes, generating screenshot information based on frame indexes, and associating performance events with screenshot information and storing them in preset work orders, the system automates performance analysis and creates work orders.
It enables automatic screening of performance issues and creation of work orders, clearly defining the scenario, location, direction, and operational context of performance issues, facilitating subsequent reproduction, resolution, and acceptance, and improving the efficiency and accuracy of performance analysis.
Smart Images

Figure CN116474373B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of game engine processing technology, and in particular to a game performance analysis method, a game performance analysis device, a corresponding electronic device, and a corresponding computer-readable storage medium. Background Technology
[0002] For UE (Unreal Engine, a 3D computer graphics game engine) projects or games developed based on the UE engine, performance analysis is a crucial step in the startup and operation of UE projects or games. Poor performance in UE projects or games makes it difficult to provide players with a good gaming experience, or even prevents them from starting and running normally.
[0003] In the technology related to performance analysis for UE projects or games, the main approach is for performance analysts to conduct performance analysis on specific scenarios, locations, or regions on a regular and targeted basis. However, this manual approach to performance analysis is inefficient. Summary of the Invention
[0004] In view of the above problems, embodiments of the present invention are proposed to provide a game performance analysis method, a game performance analysis device, a corresponding electronic device, and a corresponding computer-readable storage medium to overcome or at least partially solve the above problems.
[0005] This invention discloses a game performance analysis method, the method comprising:
[0006] Responding to preset console commands, the system obtains performance data for a preset game scene; the performance data includes the target performance frame after performance data statistics are completed for each frame in the preset game scene and a callback is executed.
[0007] Obtain the frame index of the target performance frame, and generate screenshot information of the performance data based on the frame index;
[0008] The performance data is analyzed to obtain performance events, and the performance events and screenshot information are associated and stored in a preset work order based on the frame index.
[0009] This invention also discloses a game performance analysis device, the device comprising:
[0010] The performance data acquisition module is used to respond to preset console commands and acquire performance data of a preset game scene; the performance data includes the target performance frame after the performance data of each frame in the preset game scene is statistically analyzed and a callback is executed.
[0011] The screenshot information generation module is used to obtain the frame index of the target performance frame and generate screenshot information of the performance data based on the frame index.
[0012] The associated storage module is used to perform performance analysis on the performance data to obtain performance events, and to associate and store the performance events and screenshot information in a preset work order based on the frame index.
[0013] This invention also discloses an electronic device, including: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements any of the aforementioned game performance analysis methods.
[0014] This invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the game performance analysis methods described above.
[0015] The embodiments of the present invention have the following advantages:
[0016] In this embodiment of the invention, performance data of a preset game scene is obtained by responding to preset console commands. Based on the frame index of the target performance frame after performance data statistics are completed for each frame in the preset game scene, screenshot information of the performance data is generated. After performance data is analyzed to obtain performance events, the performance events and screenshot information are associated and stored in a preset work order based on the frame index. By automatically filtering performance issues that meet the conditions and automatically creating corresponding work orders, the performance analysis and work order creation are automated. The performance data involved in the automatic performance analysis process, the frame where the performance problem occurs, and the game interface screenshot when the performance problem occurs are linked to the performance problem in the created work order. This allows for a clear understanding of the context of the performance problem, such as the scene, location, direction, and operation, which facilitates subsequent operations such as reproducing, resolving, and accepting the performance problem. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating the steps of an embodiment of the game performance analysis method of the present invention;
[0018] Figure 2 This is a schematic diagram of the framework of the game performance analysis system provided in an embodiment of the present invention;
[0019] Figure 3 This is the main process of game performance analysis based on the game performance analysis system provided in the embodiments of the present invention;
[0020] Figure 4 This is a flowchart illustrating the steps of another embodiment of the game performance analysis method of the present invention;
[0021] Figure 5 This is a schematic diagram of the core processes related to screenshots provided in the embodiments of the present invention;
[0022] Figure 6 This is a schematic diagram of the data acquisition and filtering process provided in an embodiment of the present invention;
[0023] Figure 7 This is a schematic diagram of the automatic order creation process provided in an embodiment of the present invention;
[0024] Figure 8 This is a flowchart illustrating the process from data collection and analysis to work order creation provided in an embodiment of the present invention.
[0025] Figure 9 This is a structural block diagram of an embodiment of a game performance analysis device according to the present invention. Detailed Implementation
[0026] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0027] For UE projects or games developed based on the UE engine, performance analysis is a crucial step in the startup and operation of UE projects or games. Poor performance in UE projects or games makes it difficult to provide players with a good gaming experience, or even prevents them from starting and running normally.
[0028] In performance analysis techniques for UE projects or games, the main approach involves performance analysts (usually experienced programmers) periodically and purposefully performing performance analysis on specific scenarios, locations, or areas. Issues identified are then documented in work orders (or simply work orders) to facilitate subsequent optimization. In practice, the Profiler tool provided by the official UE team is commonly used. This tool collects and tracks game data, which can be used to identify the causes of game glitches and slow startup / running speeds, enabling performance monitoring.
[0029] Specifically, in the performance analysis method based on manual, periodic, targeted, and specified scenarios, the relevant console Stat commands can be enabled when the target scene is presented in the game or before any operation is performed in the target scene. These Stat commands are then disabled after the target scene ends or the operation is completed. The console commands executed in the UE console are used to specifically display various game performance statistics, obtaining a performance data file from the time the Stat commands are enabled to their disabling. The obtained performance data file can then be analyzed in detail in an editor. Performance issues identified in the analysis can be individually documented, with information such as the scenario where the issue occurred, screenshots, issue stack traces, key resources, or code names added to the work order description and title. Reasonable priorities can then be set, and the corresponding work orders can be assigned to relevant personnel for optimization of the performance issues mentioned in the work orders.
[0030] However, performance analysis places high demands on analysts. It's generally believed that experienced analysts are more comprehensive, accurate, and efficient in their analysis. Conversely, those new to performance analysis need to learn the relevant tools and processes, and are less efficient at identifying hotspots and pinpointing the root causes or resources affecting performance. Furthermore, performance analysis is a necessary and recurring operation in almost all game development, and the time spent on each analysis is significant due to factors such as the number of target platforms, target scenarios, scenario complexity, the number of performance issues, and the size of performance files. Additionally, manually conducted, periodic, targeted, and scenario-specific performance analyses cannot guarantee full coverage, meaning it's difficult to ensure that performance issues are not overlooked. Furthermore, after performance analysis, it is necessary to create work orders for the identified performance issues. This involves creating work orders, compiling similar issues, filling in titles and descriptions, and organizing and filling in key data information. The time spent creating work orders is directly proportional to the number of performance issues analyzed. In addition, there are no relevant screenshots for the identified performance issues. Even if screen recordings are made during performance testing, these recordings cannot be easily associated with the analyzed performance issues. This makes it difficult to clearly understand the context, location, direction, and operation of the performance issues, which hinders the subsequent reproduction, resolution, and acceptance of the performance issues.
[0031] Based on the shortcomings of the aforementioned technologies for performance analysis of UE projects or games, the core idea of this invention is to automatically analyze and create work orders based on the performance data generated by the UE Profiler. Specifically, it can automatically filter performance issues that meet the conditions and automatically create corresponding work orders, thereby automating performance analysis and work order creation. In the process of automatic performance analysis, the performance data involved, the frame where the performance issue occurs, and the screenshot of the game interface when the performance issue occurs, etc., are linked with the performance issue in the created work order. This allows for a clear understanding of the context of the performance issue, such as the scene, location, direction, and operation, which facilitates subsequent operations such as reproducing, resolving, and accepting the performance issue.
[0032] Reference Figure 1 The diagram illustrates a flowchart of an embodiment of a game performance analysis method according to the present invention, which may specifically include the following steps:
[0033] Step 101: Respond to preset console commands and obtain performance data for preset game scenes;
[0034] In one embodiment of the present invention, the preset console command can specifically be manifested as a start command and a stop command for the preset console command to capture performance data for this time period. The preset console command can be a statistical data collection command. For example, it can be manifested as the UE engine's built-in console commands Stat startfile (a command to start statistical data collection and create a new file in the analysis directory) and Stat stopfile (a command to stop the aforementioned data collection operation) to achieve the capture of performance data.
[0035] A preset game scene can refer to a specified scene, location, or area. Each frame in a preset game scene can be represented as an image of the preset game scene presented in a frame-by-frame manner according to the game thread.
[0036] Performance data can be obtained based on performance data statistics of each frame in a preset game scene. This can be represented by capturing the performance data of each frame in the preset game scene by executing a performance capture frame event. The captured performance data may include the target performance frame after the performance data statistics of each frame in the preset game scene are completed and the callback is executed.
[0037] Specifically, this can manifest as responding to start and stop commands from preset console commands, executing performance capture frame events to capture performance data for each frame in a preset game scene, and after completing the performance data statistics for each frame in the preset game scene, executing performance capture frame event callback operations to determine the target performance frame and obtain the performance frame for which the callback is executed in response to the performance capture frame event.
[0038] In the performance analysis of a single frame, there may be multiple target performance frames. The determined target performance frames may include several target performance frames for which performance capture frame event callback operations are performed for each frame.
[0039] Step 102: Obtain the frame index of the target performance frame, and generate screenshot information of the performance data based on the frame index;
[0040] In one embodiment of the present invention, the frame index of the target performance frame can be obtained. The obtained frame index may refer to the frame index of each frame in the game thread, so as to represent the sorting of each game screen frame.
[0041] In practical applications, this frame index can be used to determine the interval frame number. Specifically, it can generate screenshots based on whether the interval frame number between the current frame and the previous frame reaches the interval frame number configured for automatic screenshot. In other words, it can generate screenshot information based on the frame index of this performance frame.
[0042] Step 103: Perform performance analysis on the performance data to obtain performance events, and store the performance events and screenshot information in a preset work order based on the frame index.
[0043] A single frame can include multiple performance events, each representing a performance issue, such as a performance point or performance stack. For example, if a stutter occurs, it could be represented by a resource loading function stack within a performance event; this stack can also be considered a performance event. Another example is if the execution cost of a function is too high, causing significant overhead in this frame; this would also result in a stack within the performance event, representing the execution of that function, and can also be understood as a performance event.
[0044] In one embodiment of the present invention, performance data can be parsed to obtain performance events corresponding to each frame index. Then, preprocessing operations can be performed on the performance events, including but not limited to filtering, optimizing, and merging the parsed performance events, to obtain target performance events with optimization needs. This facilitates the association and storage of target performance events and screenshot paths based on frame indexes, which are then used as performance analysis data and saved to a performance analysis table. The performance analysis table is used to provide information for the creation of preset work orders, realizing the association and storage of performance events and screenshot information in preset work orders based on frame indexes.
[0045] In this embodiment of the invention, performance data of a preset game scene is obtained by responding to preset console commands. Based on the frame index of the target performance frame after performance data statistics are completed for each frame in the preset game scene, screenshot information of the performance data is generated. This allows performance events to be obtained through performance analysis, and the performance events and screenshot information are associated and stored in a preset work order based on the frame index. By automatically filtering performance issues that meet the conditions and automatically creating corresponding work orders, the performance analysis and work order creation are automated. The performance data involved in the automatic performance analysis process, the frame where the performance issue occurs, and the game interface screenshot when the performance issue occurs are linked to the performance issue in the created work order. This allows for a clear understanding of the context of the performance issue, such as the scene, location, direction, and operation, facilitating subsequent operations such as reproducing, resolving, and accepting the performance issue.
[0046] Reference Figure 2 The diagram shows a framework schematic of a game performance analysis system provided in an embodiment of the present invention. The game performance analysis system 210 includes an automatic screenshot module 21, an automatic analysis module 22, and an automatic order creation module 23.
[0047] The automatic screenshot module 21 implements a Stat-based automatic screenshot mechanism, primarily used to provide on-site screenshots of problems for each order created by the automatic order creation module, and corresponding on-site screenshots of events for each performance event obtained by the automatic analysis module and each work order created by the automatic order creation module, facilitating problem reproduction and acceptance. The automatic analysis module 22 implements an automatic performance analysis mechanism, primarily used to filter out relevant and hot-button performance issues based on performance files and screenshot files (including on-site screenshots of problems and events), and create a performance analysis data table to provide data for automatic work order creation. The automatic order creation module 23 enables automatic work order creation, primarily used to create work orders with appropriate priorities, titles, and descriptions based on the data compiled by the automatic performance analysis module, so that performance optimization personnel can optimize them.
[0048] The main process of game performance analysis based on the game performance analysis system can be summarized as follows: Figure 3As shown, during game runtime, performance data can be captured and a performance file obtained using the UE engine's built-in console commands `Stat startfile` (to start statistical data collection and create a new file in the analysis directory) and `Stat stopfile` (to stop the aforementioned data collection operation). Simultaneously, screenshot logic can be performed within the performance capture frame events. This screenshot logic refers to the frame count judgment logic at the callback point in the automatic screenshot mechanism, and can generate corresponding screenshots based on the performance file name and frame index. This facilitates subsequent retrieval of the screenshot address and file corresponding to the frame based on the performance file and the frame index corresponding to the performance issue. Furthermore, performance files can be loaded and parsed in the editor. Based on various conditions and algorithms, the parsed performance events can be filtered, optimized, and merged. Combined with the screenshot path calculated based on the performance file and frame index corresponding to the performance event, performance analysis data can be obtained and saved to a performance analysis table.
[0049] In practical applications, the performance events contained in the performance analysis data can be represented as performance stacks and resource names and saved in the performance analysis table. The screenshot paths contained in the performance analysis data can be represented as screenshot addresses and saved in the performance analysis table; these screenshot addresses can represent the remote address from which the image was captured. In a preferred embodiment of the invention, after saving the performance analysis data to the performance analysis table, a work order creation table can be created based on the performance stack, resource name, screenshot address, cost, and calculated priority information in the performance analysis table. This allows for the creation of corresponding work orders, which are then assigned to relevant personnel for optimization.
[0050] Reference Figure 4 The diagram illustrates a flowchart of another embodiment of the game performance analysis method of the present invention, which may specifically include the following steps:
[0051] Step 401: Respond to the start and end commands of the preset console commands, and execute the performance capture frame event to capture the performance data of each frame in the preset game scene;
[0052] In one embodiment of the present invention, the preset console command can specifically be manifested as a start command and a stop command for the preset console command, so as to capture performance data for this time period.
[0053] The preset console commands can be statistical data collection commands. For example, they can be represented by the UE engine's built-in console commands Stat startfile (a command to start statistical data collection and create a new file in the analysis directory) and Stat stopfile (a command to stop the aforementioned operation), thus capturing performance data. Specifically, it can be represented by responding to the start and stop commands of the preset console commands, executing performance capture frame events to capture performance data for each frame in the preset game scene.
[0054] In this embodiment of the invention, the execution of the performance capture frame event can be implemented based on the operation of the performance statistics thread, in which each frame of the game scene is pre-defined to have a corresponding performance frame index.
[0055] During the process of capturing performance data for each frame in a preset game scene through the performance capture frame event, the performance frame index of each frame in the preset game scene can be obtained by running a performance statistics thread. The performance frame index includes the current performance frame index and the previous performance frame index relative to the current performance frame index. In one scenario, if the difference between the current performance frame index and the previous performance frame index meets a preset threshold, the current performance frame corresponding to the current performance frame index is used as the starting performance frame, triggering the start of performance data statistics with the current performance frame corresponding to the current performance frame index as the starting performance frame. In another scenario, if the difference between the current performance frame index and the previous performance frame index does not meet the preset threshold, the previous performance frame index is used as the starting performance frame, and performance data statistics with the current performance frame corresponding to the previous performance frame index as the starting performance frame continue.
[0056] For example, after executing the SStat instruction, the system listens for the capture performance frame event (FStatsThreadState::GetLocalState().NewFrameDelegate). If the difference between the current performance frame index and the most recent performance frame index is greater than 1, it can be determined that a new performance capture is triggered. In this case, the starting performance frame can be reset to the current performance frame, meaning the current performance frame can be used as the starting performance frame for a new performance capture. Conversely, if the difference between the current performance frame index and the most recent performance frame index is less than or equal to 1, the most recent performance frame index can be reset to the current performance frame index, and the old performance capture can continue.
[0057] A new performance capture indicates the existence of a new performance analysis being executed; that is, Statstartfile has been executed again, and a new performance analysis has begun. A performance event is just one piece of data in a single frame of a performance analysis, but a performance analysis often consists of many frames, each carrying many performance events, meaning each frame contains many function stacks.
[0058] It should be noted that the performance frame index represents the frame in which the performance statistics passed in the formal parameter during the execution of the performance thread callback, and it is not determined at the beginning, but will change continuously during runtime; and the current performance frame index can be used to represent the performance frame returned in the formal parameter when the performance statistics callback is executed, which is not necessarily the current game frame. For example, the performance statistics of the 1000th frame may be executed in the 1001st game thread frame; the most recent performance frame index can represent the performance frame when the performance callback was executed last time. Since the difference between the old performance statistics and the new performance statistics must be 1, if the result of the subtraction of the two is greater than 1, it can indicate that a new performance statistics exists.
[0059] Step 402: After completing the performance data statistics for each frame in the preset game scene, execute the performance capture frame event callback operation to determine the target performance frame;
[0060] Performance data can be obtained based on performance data statistics of each frame in a preset game scene. This can be represented by capturing the performance data of each frame in the preset game scene by executing a performance capture frame event. The captured performance data may include the target performance frame after the performance data statistics of each frame in the preset game scene are completed and the callback is executed.
[0061] In one embodiment of the present invention, after completing the performance data statistics for each frame in a preset game scene, a performance capture frame event callback operation is executed to determine the target performance frame and obtain the performance frame for which the performance capture frame event callback is executed.
[0062] In the performance analysis of a single frame, there may be multiple target performance frames. The determined target performance frames may include several target performance frames for which performance capture frame event callback operations are performed for each frame.
[0063] Step 403: During the execution of the performance capture frame event, the number of interval frames between each target performance frame is determined based on the frame index of each target performance frame, and screenshot information of the performance data is generated according to the number of interval frames.
[0064] A frame index can be used to determine the interval number of frames. It can refer to the frame index of each frame in the game thread, used to represent the order of each game frame. It is different from the performance frame index. The performance frame index is the frame index of each frame in the performance analysis thread, used to represent the performance data obtained by performing multiple performance captures in the current frame. In the performance analysis of a single frame, there may be multiple target performance frames, meaning that different target performance frame indices may belong to the same frame index.
[0065] In one embodiment of the present invention, during the execution of a performance capture frame event, the interval frame number between each target performance frame is determined based on the frame index of each target performance frame, and screenshot information of the performance data is generated according to the interval frame number. The determined interval frame number may refer to the interval frame number between the current target performance frame and the previous target performance frame for which a screenshot was taken.
[0066] Taking screenshots for every frame of a pre-defined game scene will have a greater impact on performance. To avoid taking screenshots for every frame, screenshot information can be generated at intervals of several frames to minimize the performance overhead caused by screenshots.
[0067] Specifically, it can obtain the current frame index of the corresponding frame in the game thread of the preset game scene for the current target performance frame, and the previous frame index of the corresponding frame in the game thread of the preset game scene for the target performance frame that was captured before the current target performance frame; using the current frame index and the previous frame index, it can determine the number of frames between the corresponding frame in the game thread of the preset game scene for the current target performance frame and the corresponding frame in the game thread of the preset game scene for the target performance frame that was captured before the previous frame.
[0068] In practical applications, an automatic screenshot interval can be set to represent the screenshot interval, facilitating the determination of when to generate screenshot information. For example, it can be determined whether the difference between the current frame index and the index of the most recent screenshot frame is greater than or equal to the screenshot interval, i.e., CurrentFrameCount (representing the current frame) - LastCaptureFrame (representing the frame from the last screenshot) >= ShotFrequency (representing the screenshot interval). In one scenario, if the difference between the current frame index and the index of the most recent screenshot frame is less than the screenshot interval, it means the preset screenshot timing has not yet been reached, and the current frame can be skipped. If the difference between the current frame index and the index of the most recent screenshot frame is greater than or equal to the screenshot interval, it means the preset screenshot timing has been reached, and the current frame can be captured.
[0069] This means that it can automatically capture screenshots at pre-configured frame intervals, taking a screenshot of the corresponding frame in the game thread of a preset game scene for the current target performance frame, and generating screenshot information. Specifically, it can obtain the performance data of the corresponding frame in the game thread for the current target performance frame and use this performance data as the screenshot information.
[0070] The screenshot information can include screenshots of the problem scene or the event scene. Screenshots of the problem scene and the event scene refer to screenshots taken when the problem occurs. In general, since performance events that only reflect performance problems can only reveal the existing performance problem or function stack, it is difficult to clarify the situation, scenario, location, and user operations when the performance event occurred. In this case, screenshot information that can reflect the aforementioned details can be generated, which is helpful for subsequent performance analysis, optimization, and reproduction.
[0071] Regarding the method of generating screenshot information, such as Figure 5 As shown, the automatic screenshot mechanism, which balances performance and visual appeal and responds to performance events, avoids using the built-in screenshot interfaces `shot` and `HighResShot` (high-resolution screenshot) in the UE, primarily because these interfaces have high overhead. To minimize the impact of screenshots on game performance, it utilizes its own encapsulated asynchronous methods. These methods primarily use `FViewport::ReadPixels` to obtain screen information and `FImageUtils::ImageResize` and `FImageUtils::CompressImageArray` to set a performance-friendly image size and format that minimally affects image recognition.
[0072] In some embodiments of this invention, the filename of the screenshot is crucial to this screenshot mechanism. To obtain a game screenshot corresponding to any frame at any time after the game is closed via the performance file, it is necessary to combine the screenshot with the performance file and the performance frame. The filename of the screenshot information can also be represented by obtaining the index of the current target performance frame in the performance analysis thread, and the performance filename of the corresponding frame in the game thread, so as to generate a screenshot path based on the current target performance frame index and the performance filename. In a specific implementation, the screenshot path can be a screenshot address, which can represent the remote address of the image being screenshotted, such as https: / / www.xxxx.com / img / screenshot_123.jpg, etc. The image can be displayed on a webpage in HTML (HyperText Markup Language) format, or it can be directly downloaded to the local machine for viewing. In other words, the screenshot path can be used to store the aforementioned screenshot information.
[0073] In practical applications, a function can be encapsulated to obtain the screenshot file path based on the performance file name and performance frame index. When creating a screenshot, i.e. generating screenshot information, the performance file name and performance frame index can be passed in to generate a unique file path, which can then be used as the screenshot path. This makes it easy to obtain a clear and unique screenshot path at any time afterward using the performance file name and performance frame index.
[0074] In a preferred embodiment of the present invention, to avoid excessively frequent screenshot creation, the screenshot filename can be adjusted based on the screenshot path generated above. For example, the impact of the screenshot interval on the screenshot filename can be considered; that is, the screenshot filename can be determined based on the performance filename and performance frame index, combined with the screenshot interval. For example, the algorithm can be expressed as: part of the filename = (screenshot frame index % screenshot interval == 0) ? Screenshot frame index : (screenshot frame index + screenshot interval - (screenshot frame index % screenshot interval)), meaning only one screenshot is taken per screenshot interval, and the frame index in the screenshot filename is rounded based on the screenshot interval. It should be noted that the present invention does not limit other screenshot filename naming methods or methods for generating unique screenshot paths.
[0075] Step 404: Perform performance analysis on the performance data to obtain performance events, and store the performance events and screenshot information in a preset work order based on the frame index.
[0076] In one embodiment of the present invention, performance data can be parsed to obtain performance events corresponding to each frame index. Then, preprocessing operations can be performed on the performance events, including but not limited to filtering, optimizing, and merging the parsed performance events to obtain target performance events with optimization needs. The target performance events and their screenshot paths can then be associated and stored based on the frame index as performance analysis data and saved to a performance analysis table. The performance analysis table is used to provide information for the creation of preset work orders, thereby realizing the association and storage of performance events and screenshot information in preset work orders based on frame indexes.
[0077] A single frame can include multiple performance events, each representing a performance issue, such as a performance point or performance stack. For example, if a stutter occurs, it could be represented by a resource loading function stack within a performance event; this stack can also be considered a performance event. Another example is if the execution cost of a function is too high, causing significant overhead in this frame; this would also result in a stack within the performance event, representing the execution of that function, and can also be understood as a performance event.
[0078] The process of preprocessing performance events to identify target performance events requiring optimization can be summarized as follows: performance events are filtered according to preset criteria. These criteria limit the filtering to non-critical thread data, data with overhead below a preset threshold, and non-leaf node data. Then, the stack traces corresponding to the filtered performance events are obtained. For identical stack traces, the one with the highest overhead is selected as the target performance event requiring optimization.
[0079] Specifically, refer to Figure 6 The diagram illustrates a data acquisition and filtering process provided by an embodiment of the present invention. The process presented is one of the keys to automatic performance analysis, which is to find problematic performance events from massive performance event data, organize the key information such as overhead, full stack trace, resources or class and function names, filter out duplicate information, and find the corresponding screenshots.
[0080] like Figure 6 As shown, in practical applications, after the performance data is imported and analyzed by the Profiler, the performance event graph container FEventGraphContainer can be obtained by using the built-in APIs FProfilerManager's GetProfilerSession and FProfilerSession::CreateEventGraphData. Then, by using EventGraphContainer.Maximum's GetRoot(), the root node of the event tree sorted by time cost can be obtained. By performing a breadth-first traversal on it, all event nodes corresponding to the current performance file can be obtained.
[0081] Performance event data can be categorized according to different dimensions, including critical thread data, non-critical thread data, data with overhead exceeding a preset overhead threshold, data with overhead below a preset overhead threshold, leaf node data, and non-leaf node data.
[0082] In some embodiments of the present invention, performance event data can be filtered to achieve the filtering of corresponding performance events. This filtering is based on preset filtering conditions, specifically by first filtering out threads unrelated to the performance analysis performed in these embodiments. For game performance, generally only RHIThread, GameThread, and RenderThread need to be considered; other thread data are not considered. It should be noted that the number of threads to be analyzed can be increased or decreased according to actual needs.
[0083] In practice, performance event data often contains a large amount of data with near-zero overhead. By filtering according to preset criteria, data with overhead below a pre-configured minimum overhead threshold, such as calls with overhead <0.001ms, can be filtered out. The overhead of all nodes is determined based on the overhead of their leaf nodes. Considering that the overhead of non-leaf node data would lead to data redundancy, performance event data from non-leaf nodes can also be filtered according to preset criteria. Then, the GetStack function of the engine's FEventGraphSamplePtr can be used to obtain the stack trace corresponding to the performance event and format it in a readable style.
[0084] In some embodiments of the present invention, the performance event data obtained after the above filtering can be processed to obtain information such as, but not limited to, key resources and problem types. Furthermore, the screenshot path can be calculated based on the performance file name and performance frame, and the aforementioned information can be assembled into performance analysis data, which is then stored in a data table. In practical applications, since there may be multiple performance files, a final performance analysis table can be generated to merge, streamline, and optimize the results from all performance files, allowing other modules to access the data.
[0085] Performance events can be represented as performance stacks and resource names, and screenshot paths can be represented as screenshot addresses. Performance analysis data can include performance stacks, resource names, screenshot paths, as well as overhead and calculated priorities. At this point, performance data can be associated and stored in a pre-created work order. This allows for the linking of performance data involved in the automatic performance analysis process, the frame where the performance problem occurred, and the game interface screenshot when the performance problem occurred, with the performance problem in the created work order. This enables a clear understanding of the context of the performance problem, such as the scene, location, direction, and operation, facilitating subsequent operations such as reproducing, resolving, and accepting the performance problem.
[0086] In some embodiments of the present invention, based on performance issues identified through automated performance analysis, corresponding work orders can be created one by one for designated personnel to perform optimization. The work order creation process can be as follows: Figure 7 As shown, this is specifically manifested in creating work orders based on the work order data table.
[0087] For example, each performance analysis can ultimately be categorized into a large work order (which can be simply referred to as a "large order"). For instance, a large order with the subject "Performance Analysis and Optimization – 202302 (Date)" can be used to summarize all performance analysis issues within that date. Specifically, this large order can be represented as a top-level parent order, which can be configured before automatic performance analysis and order creation. However, due to the difficulty in classifying and assigning a large number of performance analysis issues, not all smaller orders or performance issues are directly attached to this top-level parent order. In one embodiment of this invention, certain smaller orders or performance issues can typically be automatically placed under automatically created second-level parent orders based on certain conditions.
[0088] In practical applications, this manifests first as triggering the creation of a Ticket based on the DataTable, as shown by UTicketBPLibrary..Create TicketByDT. Then, the top-level parent ticket can be obtained and created. The logic for determining the top-level parent ticket is that the parent ticket ID in the work order data is not 0 (i.e., the parent ticket ID in the configuration), which can be specifically shown by UTicketBPLibrary:.GetFirstParentTickets; UTicketBPLibrary-:CreateTicketsLimited.
[0089] Then, you can obtain and create secondary tickets, i.e., second-level parent tickets, represented by `UTicketBPLibrary:GetSecondParentTickets;UTicketBPLibrary:CreateTicketsLimited`. The judgment logic for second-level parent tickets can be that the parent ticket ID is 0 and the subject starts with the keyword symbol of the second-level parent ticket. After that, you can traverse the work order DataTable and create various sub-tickets based on the DataTable, represented by `UTicketBPLibrary.:.CreateTicketByDT`. When creating sub-tickets, you can create tickets based on row names, represented by `UTicketBPLibrary::CreateTicketsByRowNames`, and limit the number of work orders created per request, specifically represented by `UTicketBPLibrary.CreateTicketsLimited`. Then, you can create tickets based on the `FTicketableData` list, represented by `UTicketBPLibrary:CreateTickets`, and create tickets based on `FTicketableData`, represented by `UTicketBPLibrary:CreateTicketByTicketableData`.
[0090] In the specific implementation, attachments, such as screenshots, can be uploaded first, represented by `US3CloudDiskBPLibrary::UploadFile`. When creating a sub-ticket, a creation request can be sent based on the information in the ticket and the requirements of the ticket creation interface. This is specifically manifested by calling `UNetworkExtensionBPLibrary` to create a Ticket. Specifically, this can be represented by `UTicketBPLibrary:.CreateTicketByTicketableData; UNetworkExtensionBPLibrary::SendRequest; UHttpRequestHelper:SendRequest; FWinHttpHttpRequest::ProcessRequest`.
[0091] The priority assignment in the created preset work orders can be mainly determined based on different performance impact types (such as determining frame rate or stuttering) and different performance difference data configured. In addition to the performance impact type, the performance difference data can also include a dictionary of corresponding overhead and priority, which can be used to determine the performance data for each performance impact type and the overhead range corresponding to each priority. For example, for frame rate issues, performance issues with overhead between 0.01-0.1ms can be assigned priority 3, those with overhead between 0.1-1ms priority 4, and those with overhead between 1-10ms priority 5, and so on.
[0092] The determination of whether a performance issue is a frame rate problem or a stuttering problem has a decisive impact on its overhead requirements and priority. The method for determining whether a performance event or issue is a frame rate problem or a stuttering problem can be based on the frequency of the corresponding stack trace appearing in all stack traces and events. Specifically, when acquiring performance data, the number of stack trace occurrences and the total number of frames can be counted, and the statistical results can be stored in persistent performance analysis data. The target performance type (e.g., stuttering, frame rate, or others) set in the performance difference configuration data has a corresponding frequency threshold. In other words, in the specific implementation, the specific performance type of the relevant performance data can be determined based on the comparison between these two factors.
[0093] In practical implementation, the priority of the data itself can be determined by the position of the priority in the priority dictionary based on the performance difference data of the corresponding type in the configuration; while the priority of the order can be determined by the highest priority among the master data and related data. In actual application, the data with the highest priority will be set as the master data.
[0094] The rules for merging work orders based on performance issues can be represented as merging different stacks into a single work order according to relevant conditions. In reality, different performance stacks may have the same or similar issues. For example, for the same resource, calls in different code may lead to different stacks, but the problem may still lie with the resource. If each of these issues were created as a separate work order, it would generate a large number of work orders related to the same resource, which would be inconvenient for optimization personnel. In this case, performance issues can be merged to achieve work order consolidation. Specifically, when acquiring and organizing performance data, some important attributes can be set, such as stack type (which can be abbreviated as StackType) and key class (which can be abbreviated as KeyClass). Among these, the acquisition of stack type and key class is mainly based on the fact that the format of event stacks for code and resources in UE is basically fixed, and can be obtained based on information such as the type of code resource, resource path, and resource name.
[0095] For example, the merging algorithm can be expressed as follows: for non-Function tasks, if a StackType exists (in this case, a resource type, such as ABP or Niagara), merging can be performed based on the StackType; otherwise, if a KeyClass exists (such as a class name or file name), work orders with the same KeyClass can be merged into one work order; furthermore, if a SimplifiedKeyStack exists, merging can be performed based on it. It should be noted that if none of the above rules are satisfied, merging can also be performed based on the stack. This embodiment of the invention does not limit the merging rules and specific merging methods.
[0096] In some embodiments of the present invention, the game performance analysis process provided by the embodiments of the present invention may involve a process from data collection and analysis to work order creation, specifically as follows: Figure 8 As shown.
[0097] Specifically, this can be manifested as follows: after selecting a performance file in the plugin interface, the plugin entry code is invoked to automatically analyze these files and create work orders, as shown in `UAnalayzerTicketBPLibraryAnalysisAndCreateTicketByPrfilrFiles`. Then, the performance files are sequentially loaded into the UE's Profiler for preliminary data parsing, i.e., simple analysis. This is mainly achieved using the UE's own `FProfilerManager::LoadProfilerCapture` interface for loading and preliminary parsing of performance files. Next, the system can listen for the broadcast indicating that the performance file loading is complete. This can be achieved by dispatching a callback to the outside world in `ProfilerSession_OnCaptureFileProcessed`, as shown in `UProfileAnalyzerHelper:Register; UProfileriilty::Getinstance0->OnCaptureFileProcessedMulticasted`. Furthermore, the system can automatically perform in-depth analysis and create work orders for the just-loaded performance files, as shown in `UProfileAnalyzerHelpercAutoAnalyzeProfileData`. Then, you can first upload the performance file to the cloud drive, which will be represented as US3CloudDiskBPLibrarycUploadFile, so that it can be added to the list later for reference when necessary. Then, you can obtain all the performance data and convert and filter it into assembled performance analysis data, which will be represented as UProfileAnalyzerHelpercGetFiterdProfilerDatas.
[0098] In a preferred embodiment of the present invention, performance analysis data can also be stored in a DataTable. Depending on the configuration, it is possible to create a corresponding CSV (Comma SeparateValues, a specific file format used as a data exchange format between different programs), manifested as UDataTableExtensionBPLibrany.CreateDataTableByTableRows; UDataTableExtensionBPLibrarycExportDataTableToCSV; and after all performance files have been analyzed, all performance data DataTables are merged, manifested as UDataTableExtensionBPLibranycMergeDataTableByFiles; and the performance data DataTable is further optimized and integrated (merging similar problems into related problems), manifested as UNalayzerTicketBPLibrary.OptimizeMergedProflerDataTable. Afterwards, a work order can be created based on the performance analysis data, represented by UProfileAnalyzerHelper.CreateTicketByAnalyzerDataTable. Specifically, work order data can be generated first based on the performance data, with the option to create a corresponding CSV file, represented by UProfileAnalyzerSubsystem:ConvertProfilerDataDataTableToTicketableDataFor DT; UDataTableExtensionBPLibrary:ExportDataTableToCSV. Then, an easy-to-collaborate work order can be created based on the work order data DataTable, represented by UTicketBPLibrany:CreateTicketByDT.
[0099] In this embodiment of the invention, based on the performance data generated by the UE's Profiler, automatic analysis and automatic creation of work orders are performed. Specifically, performance issues that meet the conditions can be automatically filtered and corresponding work orders can be automatically created. In the case of automating performance analysis and work order creation, the performance data involved in the automatic performance analysis process, the frame where the performance issue is located, and the game interface screenshot when the performance issue occurs can be linked with the performance issue in the created work order. This allows for a clear understanding of the context of the performance issue, such as the scene, location, direction, and operation, which facilitates subsequent operations such as reproducing, resolving, and accepting the performance issue.
[0100] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0101] Reference Figure 9 The diagram shows a structural block diagram of an embodiment of a game performance analysis device according to the present invention, which may specifically include the following modules:
[0102] The performance data acquisition module 901 is used to respond to preset console commands and acquire performance data of a preset game scene; the performance data includes the target performance frame after the performance data of each frame in the preset game scene is statistically analyzed and a callback is executed.
[0103] The screenshot information generation module 902 is used to obtain the frame index of the target performance frame and generate screenshot information of the performance data based on the frame index;
[0104] The associated storage module 903 is used to perform performance analysis on the performance data to obtain performance events, and to associate and store the performance events and screenshot information in a preset work order based on the frame index.
[0105] In one embodiment of the present invention, the performance data is obtained based on performance data statistics of each frame in a preset game scene, and the performance data acquisition module 901 may include the following sub-modules:
[0106] The performance data capture submodule is used to respond to start and stop commands of preset console commands and execute performance capture frame events to capture performance data of each frame in the preset game scene;
[0107] The performance data acquisition module 901 may also include the following sub-modules:
[0108] The target performance frame determination submodule is used to perform a performance capture frame event callback operation to determine the target performance frame after completing the performance data statistics for each frame in the preset game scene; the target performance frame includes several target performance frames for which the performance capture frame event callback operation is performed for each frame.
[0109] In one embodiment of the present invention, the execution of the performance capture frame event is based on the operation of a performance statistics thread, in which each frame of the game scene is pre-defined to have a corresponding performance frame index.
[0110] The performance data capture submodule may include the following units:
[0111] The performance frame index running unit is used to run the performance statistics thread to obtain the performance frame index of each frame in the preset game scene; the performance frame index includes the current performance frame index and the previous performance frame index compared to the current performance frame index;
[0112] The first performance data statistics unit is used to respond to the fact that the difference between the current performance frame index and the previous performance frame index meets a preset threshold, and to take the current performance frame corresponding to the current performance frame index as the starting performance frame to trigger the start of performance data statistics with the current performance frame corresponding to the current performance frame index as the starting performance frame.
[0113] The second performance data statistics unit is used to respond to the situation where the difference between the current performance frame index and the previous performance frame index does not meet a preset threshold, and to take the previous performance frame index as the starting performance frame and continue to perform performance data statistics with the current performance frame corresponding to the previous performance frame index as the starting performance frame.
[0114] In one embodiment of the present invention, the frame index is used to determine the number of interval frames; the screenshot information generation module 902 may include the following sub-modules:
[0115] The interval frame number determination submodule is used to determine the interval frame number between each target performance frame based on the frame index of each target performance frame during the execution of the performance capture frame event.
[0116] The screenshot information generation submodule is used to generate screenshot information of the performance data based on the interval frame number.
[0117] In one embodiment of the present invention, the interval frame count includes the interval frame count between the current target performance frame and the previous target performance frame for which a screenshot was taken; the interval frame count determination submodule may include the following units:
[0118] The frame index acquisition unit is used to acquire the current frame index of the corresponding frame in the game thread of the preset game scene of the current target performance frame, and the previous frame index of the target performance frame that was captured in the game thread of the preset game scene compared to the previous frame of the current target performance frame.
[0119] The interval frame count calculation unit is used to determine the interval frame count between the current target performance frame and the previous frame in the game thread of the preset game scene, using the current frame index and the previous frame index.
[0120] The screenshot information generation submodule may include the following units:
[0121] The screenshot information generation unit is used to take a screenshot of the corresponding frame of the current target performance frame in the game thread of the preset game scene in response to the interval frame number reaching the pre-configured automatic screenshot interval frame number, and generate screenshot information.
[0122] In one embodiment of the present invention, the screenshot information generation unit may include the following sub-units:
[0123] The screenshot information acquisition subunit is used to acquire the performance data of the corresponding frame of the current target performance frame in the game thread, and use the performance data of the corresponding frame of the current target performance frame in the game thread as screenshot information.
[0124] The screenshot information generation unit may also include the following sub-units:
[0125] The performance file name acquisition subunit is used to acquire the index of the current target performance frame in the performance analysis thread, and the performance file name of the corresponding frame in the game thread.
[0126] The screenshot path generation subunit is used to generate a screenshot path based on the current target performance frame index and the performance file name; the screenshot path is used to store the screenshot information.
[0127] In one embodiment of the present invention, the associated storage module 903 may include the following sub-modules:
[0128] The performance data parsing submodule is used to parse the performance data to obtain the performance events corresponding to each frame index;
[0129] The target performance event acquisition submodule is used to perform preprocessing operations on the performance events to obtain target performance events that have optimization needs.
[0130] The screenshot path acquisition submodule is used to acquire the frame index of the target performance event and the screenshot path of the target performance event;
[0131] The associated storage submodule is used to associate and store the target performance event and the screenshot path of the target performance event based on the frame index, as performance analysis data;
[0132] The performance analysis data storage submodule is used to store the performance analysis data in a preset work order.
[0133] In one embodiment of the present invention, the target performance event acquisition submodule may include the following units:
[0134] The performance event filtering unit is used to filter the performance events according to preset filtering conditions. The preset filtering conditions are used to limit the filtering to non-critical thread data, data with overhead below a preset overhead threshold, and non-leaf node data.
[0135] The target performance event determination unit is used to obtain the stack corresponding to the filtered performance events, and for the same stack, the one with the largest overhead is selected as the target performance event with optimization requirements.
[0136] In this embodiment of the invention, the game performance analysis device can obtain performance data of a preset game scene by responding to preset console commands. Based on the frame index of the target performance frame after performance data statistics are completed for each frame in the preset game scene, a screenshot of the performance data is generated. This allows for the association and storage of the performance event and the screenshot information in a preset work order based on the frame index after performance analysis of the performance data yields a performance event. By automatically filtering performance issues that meet the criteria and automatically creating corresponding work orders, the performance analysis and work order creation are automated. This links the performance data involved in the automatic performance analysis, the frame where the performance issue occurs, and the game interface screenshot when the performance issue occurs, with the performance issue in the created work order. This allows for a clear understanding of the context of the performance issue, including its scene, location, direction, and operation, facilitating subsequent reproduction, resolution, and acceptance of the performance issue.
[0137] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0138] This invention also provides an electronic device, comprising:
[0139] It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the various processes of the above-described game performance analysis method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0140] This invention also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described game performance analysis method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0141] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0142] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0143] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0144] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0145] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0146] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.
[0147] Finally, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this invention are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse. Also, the related embodiments provided in this invention are implemented on the basis of complying with the relevant laws, regulations, and standards of the relevant countries and regions.
[0148] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0149] The foregoing has provided a detailed description of a game performance analysis method, a game performance analysis device, a corresponding electronic device, and a corresponding computer-readable storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A game performance analysis method characterized by comprising: The method comprises: in response to a preset console instruction, obtaining performance data of a preset game scene; the performance data comprises a target performance frame performing callback after performance data statistics of each frame in the preset game scene are completed, and the performance data is obtained based on the performance data statistics of each frame in the preset game scene; wherein, in response to a preset console instruction, obtaining performance data of a preset game scene comprises: in response to a start instruction and an end instruction of the preset console instruction, executing a performance capture frame event to capture performance data of each frame in the preset game scene; further comprising: after completing the performance data statistics of each frame in the preset game scene, performing a performance capture frame event callback operation to determine a target performance frame; the target performance frame comprises a plurality of target performance frames performing the performance capture frame event callback operation for each frame; obtaining the frame index of the target performance frame, obtaining the current frame index of the corresponding frame of the current target performance frame in the game thread of the preset game scene, and the last frame index of the corresponding frame of the last target performance frame performing screenshot in the game thread of the preset game scene in the process of executing the performance capture frame event, and the frame index is used to determine the interval frame number; using the current frame index and the last frame index to determine the interval frame number of the corresponding frame of the current target performance frame in the game thread of the preset game scene and the corresponding frame of the last target performance frame performing screenshot in the game thread of the preset game scene, the interval frame number comprises the interval frame number of the current target performance frame and the last target performance frame performing screenshot; in response to the interval frame number reaching the preconfigured automatic screenshot interval frame number, performing screenshot on the corresponding frame of the current target performance frame in the game thread of the preset game scene to generate screenshot information; performing performance analysis on the performance data to obtain performance events, and storing the performance events and the screenshot information in a preset work order based on the frame index.
2. The method of claim 1, wherein, The execution of the performance capture frame event is based on the running of a performance statistics thread, and each frame of the preset game scene has a corresponding performance frame index in the performance statistics thread; the execution of the performance capture frame event to capture performance data of each frame in the preset game scene comprises: running the performance statistics thread to obtain the performance frame index of each frame in the preset game scene; the performance frame index comprises a current performance frame index and a last performance frame index compared with the current performance frame index; in response to the difference between the current performance frame index and the last performance frame index satisfying a preset threshold, taking the current performance frame corresponding to the current performance frame index as a start performance frame, and triggering the start of performance data statistics with the current performance frame corresponding to the current performance frame index as the start performance frame; and / or, in response to the difference between the current performance frame index and the last performance frame index not satisfying the preset threshold, taking the last performance frame index as the start performance frame, and continuing to perform the performance data statistics with the current performance frame corresponding to the last performance frame index as the start performance frame.
3. The method of claim 1, wherein, the screenshot on the corresponding frame of the current target performance frame in the game thread of the preset game scene to generate screenshot information comprises: obtaining performance data of a corresponding frame in a game thread of the current target performance frame, and taking the performance data of the corresponding frame in the game thread of the current target performance frame as screenshot information; Further comprising: obtaining a current target performance frame index of the current target performance frame in a performance analysis thread, and a performance file name of a corresponding frame in a game thread of the current target performance frame; generating a screenshot path based on the current target performance frame index and the performance file name; the screenshot path is used to store the screenshot information.
4. The method of claim 1, wherein, The performance analysis on the performance data obtains performance events, and the performance events and the screenshot information are stored in a preset work order based on the frame index, and the performance analysis on the performance data comprises: parsing the performance data to obtain performance events corresponding to each frame index; performing a preprocessing operation on the performance events to obtain target performance events with optimization needs; obtaining a frame index of the target performance event and a screenshot path of the target performance event; storing the target performance event and the screenshot path of the target performance event based on the frame index, as performance analysis data; storing the performance analysis data in a preset work order.
5. The method of claim 4, wherein, The preprocessing operation on the performance events to obtain target performance events with optimization needs comprises: performing filtering on the performance events according to a preset filtering condition, the preset filtering condition being used to limit filtering of non-critical thread data, data with an overhead lower than a preset overhead threshold, and non-leaf node data; obtaining a stack corresponding to the filtered performance events, and obtaining a largest one of the stacks as a target performance event with optimization needs.
6. A game performance analysis apparatus characterized by comprising: The device for the game performance analysis method of claim 1 comprises: a performance data obtaining module, configured to obtain performance data of a preset game scene in response to a preset console instruction; the performance data comprises target performance frames performing callback after performance data statistics of each frame in the preset game scene are completed, and the performance data is obtained based on the performance data statistics of each frame in the preset game scene; wherein the performance data obtaining module comprises the following sub-modules: a performance data capturing sub-module, configured to execute performance capture frame event to capture performance data of each frame in the preset game scene in response to a start instruction and an end instruction of the preset console instruction; further comprising the following sub-modules: a target performance frame determining sub-module, configured to determine target performance frames by executing performance capture frame event callback operation after the performance data statistics of each frame in the preset game scene are completed; the target performance frames comprise a plurality of target performance frames performing the performance capture frame event callback operation for each frame; The screenshot information generation module is configured to obtain a frame index of the target performance frame, obtain a current frame index of a corresponding frame of a current target performance frame in a game thread of the preset game scene during execution of the performance capture frame event, and obtain a previous frame index of a corresponding frame of a previous target performance frame that has been screenshot in the game thread of the preset game scene, the frame index being used to determine an interval frame number; determine an interval frame number of the corresponding frame of the current target performance frame in the game thread of the preset game scene and the corresponding frame of the previous target performance frame that has been screenshot in the game thread of the preset game scene by using the current frame index and the previous frame index, the interval frame number including an interval frame number of the current target performance frame and the previous target performance frame that has been screenshot; and perform screenshot on the corresponding frame of the current target performance frame in the game thread of the preset game scene to generate screenshot information in response to the interval frame number reaching a preconfigured automatic screenshot interval frame number. The association storage module is configured to perform performance analysis on the performance data to obtain a performance event, and store the performance event and the screenshot information in association based on the frame index in a preset work order.
7. An electronic device, comprising: The game performance analysis method comprises the following steps: A processor, a memory, and a computer program stored on the memory and capable of running on the processor, the computer program being executed by the processor to implement the game performance analysis method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer program is stored on the computer readable storage medium and is executed by the processor to implement the game performance analysis method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Card frame detection method based on Unreal engine, and system thereof
CN111104530A
Work order processing method and device
CN115757516A