Gamasutra: The Art & Business of Making Gamesspacer
Sponsored: The World of Just Cause 2 - Using Creative Technology to Build Huge Open Landscapes
View All     RSS
September 18, 2018
arrowPress Releases
September 18, 2018
Games Press
View All     RSS
  • Editor-In-Chief:
    Kris Graft
  • Editor:
    Alex Wawro
  • Contributors:
    Chris Kerr
    Alissa McAloon
    Emma Kidwell
    Bryant Francis
    Katherine Cross
  • Advertising:
    Libby Kruse






If you enjoy reading this site, you might also want to check out these UBM Tech sites:


 

Sponsored: The World of Just Cause 2 - Using Creative Technology to Build Huge Open Landscapes


May 16, 2013 Article Start Previous Page 6 of 6
 

Vertex and Index Buffer Generation

Generating the vertex and index buffers is quite straightforward. When the terrain system receives a construction callback for a terrain patch from the patch manager, it queries the corresponding stream patch for the triangle tree data for that terrain patch. It then also asks the stream patch for the triangle tree data of the parent terrain patch. Now, since the parent terrain patch covers four times the area of the child patch, we must locate the branch of that tree that covers the same quadrant as the child patch. The two triangle trees are then traversed at the same time to build the vertex and index buffers, with the parent tree used to locate morph targets. This can be seen in the following pseudo code:

Figure 6: Pseudo code of the TraverseTree function that builds the vertex and index buffers of the terrain mesh. Click for larger version.

Partially Overlapping Patches

By definition, in a patch system some patches completely covered by child patches, some are not covered at all, and some are only partially covered. This is because each patch map is centered on the camera and 'moves' at different resolutions when the camera moves, since the size of the patches differs by a power of two between each patch map.

Figure 7: The patch maps 'moves' in different resolution due to the size difference of the patches

As a consequence of this, and as a final hurdle, we need to deal with the case of partially covered terrain patches so that we may draw quadrants of patches separately. This is achieved by organizing the index buffers of each patch into quadrants so that any quadrant can be drawn independently. A child coverage mask for each patch is provided by the patch system, indicating which quadrants (if any) are occluded by child patches.

Conclusion

The terrain system of the Avalanche Engine has proven to be very efficient on a wide range of hardware. It's the result of many years of development and iterations, and since the launch of Just Cause 2 there has been much further development that must be shrouded in secrecy for a little while longer. Creating technology that enables game designs that most sane designers never would dream of proposing is what drives me, and much of the inspiration goes all the way back to the childhood spaceship in the closet.

Who back in 1984 would pitch a game idea that featured 8,000 unique planets where you could choose to become a trader, a pirate, or a bounty hunter, when most games were about jumping on platforms avoiding monsters? Well Braben and Bell did, because they possessed the spells of creative technology. With so many new markets emerging and new generations of hardware on the horizon, these are exiting times if you're into creating technology that people reference in articles 30 years later.


Article Start Previous Page 6 of 6

Related Jobs

Endnight Games Ltd
Endnight Games Ltd — Vancouver, British Columbia, Canada
[09.18.18]

Senior Programmer (Generalist)
Wombat Studio
Wombat Studio — Silicon Valley, California, United States
[09.18.18]

Backend Engineer
Wombat Studio
Wombat Studio — Silicon Valley, California, United States
[09.18.18]

Graphics Engineer
Obsidian Entertainment
Obsidian Entertainment — Irvine, California, United States
[09.18.18]

Engine Programmer





Loading Comments

loader image