Monday, 1 November 2010

AAII Quadtree improvements

 

The Quadtree class has been made slightly more robust. Although Annihilation Arena II uses a 3D engine, it's really only 2.5D as it uses a fixed isometric view point. This changes only for cinematic NIS's on occasion but for the most part a quad tree is ideal for visibility culling as it's been relatively simple to implement and works fine within the 2.5D view point.

A Quadtree is a tree data structure with four children. They are useful for a number of things but AAII uses them to calculate which static level geometry is in screen space. To see if an object is visible we test which quad at the top of the tree it is contained in and iterate down. This means we quickly eliminate testing in large areas such as the upper-right quad, in-fact, we can probably eliminate testing on three thirds of the entire level area in the first iteration.

The Quadtree of a small level in Annihilation Arena II

 

No comments:

Post a Comment