We love playing games. A game provides a large amount of components pleasing us, including visuals, audio, playable elements, interaction etc. As that many struff should be loaded on a commodity computers/devices, how to optimize the game engine such that we won’t endure poor user experience on speed for instance becomes a critical problem in practice. In this post, I will describe some conslusions about the optimization in games based on my experience of using unreal engine sdk.

Before releasing a game, there should be a number of rounds of testing (by an automatic pipeline and enerineers), user-study (normally conducted by game players). One of the most important thing is to identify the bottleneck, commonly via Profiling Games Performance. The following factors should be considered for a technically sucesseful game:

1: speed (framerate)

2: feedback: how long the game respond to user’s input, as key or mouse events, even gestures

3: memory footprint

Now game Apps become popular, thus additionally, we should consider:

1: traffic consumption

2: battery consumption

First, let’s say something specific to PC games. Then, the key consideration is the frame rate. There are many ways of increasing the speed. Unfortuanatelly, currently most approaches of that trade off the speed against visuals, leading to downside rendering, texture quality, polygon faces.

Those approaches can be boldly classified into two categories: low-level optimization and algorithmic optimization.

low-level optimization

This is can be done by exloiting parallel computing, such as CUDA, Intel® Threading Building Blocks, even simply the OpenMP. This needs skillful programmers to re-design the codes, so that the parallelizable parts are in the form of blocks, each of which corresponds to a thread for instance. Note that this way will require the adaption to different platforms. Futhermore, given a platform, programmers should know well the associated instruction set, as using a specific command or function would largely boost the performence and also reduce the number of lines of codes.

A game engine uses shaders, we can optimize the shaders, thereby largely boosting the performace as well.

Based on my experience, low-level coding is difficult. For example, the CUDA programming always consumes me a lot of energy, to debug, and well orginize the data-io.

algorithmic optimization

As a pseudo-researcher, I prefer the optimization via elegant algorithms. This way tries to develop improved algorithms that increase the speed without sacrificing, even with improvements of, the X quality. A sucess algorithm should meet at least one of the following conditions:

1: higher speed, same (+-) quality

2: same (+-) speed, better quality

3: higher speed and better quality

Another aspect is the more efficient data sturcture, for example, for dynamically managing the objects in scene; for scoring system; for retrieving character skeletal motion.

A game engine often has its own formats for textures, motion, meshes, configuration files, communication commands. These formats actually also give a significant imact on the performance. For example, for character deformaiton, most engines only support skeletal skinning rather than the blendshape and other deformers (cf. MAYA), and BVH motion rather than directly the C3D (cf. Vicon).

Here, I would like to say more about the textures which are the major asset. For different platforms, we should choose a suitable format, and futher a compression scheme. For detailed discussion, I refer readers to texturepacker. Actually, how to orgnize the large amount of assets now becomes a issue more critical for a large game engine.

It’s beging argued that, next generation of games would be VR-based games. For that, the bottleneck still is how to reduce vertiginous sensation and the support good wearing.

To conclude, local optimization is not enough since in practice it is not really, locally XXX (without mutual effect). Finally, the senior engineer who ideally developed indie games will guide a global optimization (emphasizing the optimization of the part consuming at most).

how to make a sucess game? I only restrict the discussion to the visuals. There is a research branch on game design, playful design, which brings interdisciplinarity into games such as psychology. If the game supports more and more visual effetcs that usally appear in films, such as fire, fog, fluid, hair, cloth, fracturing, strong feedback from collision, I believe the game will attract the players a lot.