Procedural synthesis
Procedural synthesis is a technique in computer programming, specifically computer graphics and game design, wherein content is dynamically generated using algorithms, instead of being composed ahead of time.
In a typical modern video game, game content such as textures and character and environment models are created by artists beforehand, then rendered in the game engine. As the technical capabilities of computers and video game consoles increases, the amount of work required by artists also increases. Firstly, high-end gaming PCs and new-generation game consoles like the XBox 360 and Playstation 3 are capable of rendering scenes containing many very detailed objects with high-resolution textures in high-definition. This means that artists must invest a great deal more time into creating a single character, vehicle, building, or texture, since gamers will tend to expect very detailed environments in new-generation games. Secondly, the number of unique objects displayed in a video game is increasing. In older games, a single character or object model might have been used over and over again throughout a game. With the increased visual fidelity of modern games, however, it is very jarring (and threatens the suspension of disbelief) to see many copies of a single object, while the real world contains vastly more variety. Again, artists would be required to complete orders of magnitude more work in order to create many different varieties of a particular object. The need to hire larger art staffs is frequently cited as one of the reasons for skyrocketing game development budgets.
Procedural synthesis attempts to solve these problems by shifting the burden of content generation, at least in part, from the artists to the CPU. Instead of storing many different versions of an object (for example, a tree) on a game disc, the game program would instead contain an algorithm which randomly generates tree models on the fly. The algorithm could be called a number of times to create trees to fill a forest, each time generating a different-looking tree from scratch. The advantage of this approach is obvious, in that it creates a more realistic and immersive game-world, while at the same time reducing the burden on artists and saving space on game storage media. The disadvantage is that a great deal of processing power is required to generate objects on the fly instead of simply loading pre-made objects from the disk. As microprocessor designs increase in power, procedural synthesis becomes more and more attractive to game designers. In 2004, an impressive PC first-person shooter called .kkrieger was released that made heavy use of procedural synthesis. .kkrieger, while not a very long or complex game, featured advanced visual effects, and most stunningly, was released as an executable measuring only 100 kilobytes in size. In contrast, many modern first-person shooters are released across several CDs or a DVD, and total upwards of two gigabytes in size, or more than 20,000 times larger. Several upcoming commercial titles for the PC, such as Will Wright's Spore, will also make use of procedural synthesis. In the console world, both the XBox 360 and the Playstation 3 have impressive procedural synthesis capabilities, but they differ in implementation.
The XBox 360's CPU, known as Xenon, is a 3-core design. When running procedural synthesis algorithms, one of the Xenon CPU's cores may "lock" a portion of the 1 MB shared L2 cache. When locked, a segment of cache no longer contains any prefetched instructions or data for the CPU, but is instead used as output space for the procedural synthesis thread. The graphics processing unit, called Xenos, can then read directly from this locked cache space and render the procedurally generated objects. The rationale behind this design is that procedurally generated game content can be streamed directly from CPU to GPU, without incurring additional latency by being stored in system RAM as an intermediary step. The downside to this approach is that when part of the L2 cache is locked, there is even less data immediately available to keep the 3 symmetric cores in the Xenon CPU running at full efficiency (1 MB of shared L2 is already a rather small amount of cache for 3 symmetric cores to share, especially considering that the Xenon CPU does not support out-of-order execution to more efficiently use available clock cycles).
The Playstation 3's CPU, the Cell, contains 8 independent vector processing units called SPEs. The SPEs each have 256K of directly attached memory, and can "stream" data to eachother, with each SPE performing a different operation on a large set of data and passing it, thus creating a highly efficient chain which performs a sequence of operations on a data set of arbitrary size (see stream processing for more details). In the context of procedural synthesis, each SPE can execute a different task in the procedural synthesis algorithm (to return to our tree example, a task might be to generate the trunk, another to add branches, another to add leaves, another to properly color the various parts of the tree) and pass the result on to another SPE which does the next peice of work. The cell can thus generate game objects very quickly by dividing the algorithm into smaller tasks and setting up a chain of SPEs to do the work on an arbitrarily large number of objects. Unlike the Xenon, the Cell does not support "cache locking" to buffer the generated objects. This would be redundant, however, as there is a direct 35 GB/s link between the Cell and the PS3's "Reality Synthesizer" graphics processing unit, allowing objects to be sent directly to the GPU to be rendered as soon as they are generated.