This article appeared in:Walker AI

As a game test engineer, in addition to focusing on functional test, we also need to focus on weak network, performance, compatibility, security and other special tests. Recently, the project team is focusing on optimizing the performance of game client. Here, I will simply share some methods of client performance test.

1. The client performance is insufficient

The performance test of the game contain server performance testing, performance testing and client server performance test is mainly to the server before it launched carrying capacity test, load test and stress test, the purpose is to find the performance of the server bottleneck, can ensure that the game under the concurrent of preset normal play, and whether a game can run smoothly, In addition to the support of the server, the performance of the client can not be ignored, maybe you have heard the game players fierce game suddenly out of a “** off frame”, this is the performance of the client is insufficient, seriously affect the game experience.

Especially in a competitive game, without a stable output frame rate, so the game is felt only let person collapse, some students may ask, game CARDS, what is the relationship between frame rate and frame rate refers to the frame as the unit of bitmap images appear on the display of the frequency in a row, that is, on average, a second, the game update shows how many pieces of picture.

2. The reason why the game performance is slow

For games, if the FPS is less than 30, the performance of the game will be inconsistent, high frame rate can get a smoother and more realistic display effect, generally speaking, 30 FPS will not feel the obvious lag, but if can be improved to 60fps can significantly improve the fidelity of the picture, more than 75fps will not have a significant improvement. If the frame rate goes beyond the screen refresh rate, it wastes graphics power and resources, so the average mobile game is locked at 60 frames.

Frametime refers to the time between two frames, or simply to a single frame. The player sees the time between screen refresh, not the time between GPU render completion. It can be seen from the figure that the rendering time of frame B on GPU is longer than the display refresh interval, which means that the picture is not refreshed once. When the picture is not changed for many times, the picture performance of the game may be stuck.

Now that I know why the game is stuck, here are some of my personal experiences as a playtester that provide test data for developers to optimize performance. The first thing we need to know about game performance testing is the basic metrics we need to focus on.

3. What does testing need to focus on

FPS: The number of frames per second that an application displays

CPU usage: Indicates the CPU usage of an application

Memory: Indicates the memory usage of applications stored in the system

GPU: Usage: Indicates the GPU resources used by applications

Traffic: the total amount of data transferred through a network port in a unit of time

Power: The amount of charge consumed by an application per unit of time

There are also many tools on the market that can collect this data, such as Emmagee, GT, Wetest, Prefdog, etc. After comparison, it is customary to use Prefdog. The advantage is that the phone does not need root, the data is complete, the tool is easy to use, and the output of the complete performance report is readable.

Search the PrefDog download tool for Windows and MAC, download the decompression package for Windows, and double-click on it to open the Prefdog.exe application

There are two ways to connect, one is directly inserted usb link, the other is wifi link, it should be noted that USB mode can not be used for power consumption test, because the USB is always charged, this value is not much effect.

Prefdog collects jank (the number of timings within 1s) data, since a high frame rate does not fully indicate smooth or no timings. For example, fps40 frames are rendered at one frame in the first 200ms, and 39 frames in the last 800ms, which are still timings despite the frame rate of 40, as described in the transmission process diagram above.

Calculation method of PerfDog Jank:

If the following two conditions are met at the same time, it is considered to be a caton Jank. The time of the current frame > the average time of the first three frames is twice. Current frame time > two Movie frame time (1000ms/24 x 2=84ms).

After running the pre-planned scenario, click the pause button in the upper right corner to pop up the save box, and click confirm to query the report records on the Web cloud platform

Before performing client performance, it is necessary to prepare high, middle and low level test equipment. At the beginning of the establishment of each project, the minimum supported equipment will be defined. During performance testing, it is necessary to ensure the smooth operation of the minimum equipment at the beginning of the setting, so as to lay a foundation for subsequent good operation.

It should be noted that at present, there are many models on the market, some brands will have their own CPU, here is the need for targeted testing. Snapdragon is probably the most popular processor on the market, with huawei’s own Kirin, Mediatek, Apple, etc. For example, The Performance of Dodo Self-playing is basically good on the Snapdragon 435 with mid – and low-end processors, but the performance of Huawei’s Kylin 710 and Helio P20 with the Snapdragon 665 and 650 with mid – and high-end snapdragon processors is much worse. CPU ranking data from: (http://www.mydrivers.com/zhua… .

At this time, we need to test and compare processors of different phone brands, and provide the data for development to facilitate optimization and solution.

To check the performance of the client, different scenarios need to be set. Taking the self-moving as an example, the game is basically divided into two scenarios: intra-office and out-office. The out-office is mainly the function of each peripheral system, such as mall, pass, warehouse, etc. Station is mainly fight, this is also the performance consumption place, when I was doing the comparison and analysis will be the main information and paste to share documents, to facilitate rapid analysis of detailed data in view links, mainly involved in the recent local scenarios, according to different optimization package are the same process output client performance report, The data is saved and the shared document is easy for the project team to view.

As a game tester, I not only need to pay attention to the performance data at the beginning of version establishment or during performance optimization, but also need to do planned performance testing during the usual version iteration. For example, with each major version iteration, or with major changes such as engine upgrades, art iterations, etc., performance testing becomes very important to prevent the performance bias blind spots caused by these major changes, and to identify problems and focus on optimizing them.