Integrating the Example into a Real Game

We do not claim that the example is fast for game engines, but rather that it has a better set of techniques to speed up a game engine. Although implementing these techniques in a real game will take time, it will also require applying these techniques and perhaps some others. We want to do two things to validate the example:

  • Review the source structure of the game to determine which techniques we can apply and whether there are gaps in the techniques we need. The review must determine how much code restructuring is needed and the step-by-step sequence such that the game can be tested at each step.

  • Update the example code to model the structure of the game at each step, plus the performance modeling needed to see whether the expected performance and scalability will be attained if the code is transformed.

Spatially decomposing a k-d data structure may be appropriate for physics and scene management, but how can you provide good scalability for other game components? The answer is not clear. Let’s do a thought exercise. Suppose, for example, that online players only interact with players in the current neighborhood. Although they may see other players moving at a distance in other spatial domains, the group of players nearby have much more game play to be executed. It will be necessary to spread these closer players’ game-play structures across tasks to get speedup.

To achieve this, it would be necessary for:

  • The player’s space structure to be load-balanced across tasks. There can be granularity problems.

  • Tasks to execute the player’s work space in a timely manner, interacting players to enter and leave the player space structure, and the work to remain balanced (by domain decomposition or task stealing).

  • Tasks executing the player structure to synchronize with the spatial data structures. This is the most complex problem because even if the synchronization is not contended, there may be a cache-thrashing problem.

The granularity of tasks must allow threads that execute few player tasks to have more other tasks to execute in idle periods.

Synchronization between the data structures may mean that there is a direct trade-off between processing speedup and memory bandwidth utilized.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.22.136