03.02.2015 Views

Game Engines for Visualization - The Study Stream

Game Engines for Visualization - The Study Stream

Game Engines for Visualization - The Study Stream

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Game</strong> <strong>Engines</strong> <strong>for</strong> <strong>Visualization</strong><br />

Nick Green and Alex Pang<br />

Computer Science Department<br />

University of Cali<strong>for</strong>nia, Santa Cruz<br />

ABSTRACT<br />

<strong>Game</strong> engines include several specialized components <strong>for</strong> supporting<br />

different aspects of computer games. <strong>The</strong>y often include a<br />

graphics engine, a physics engine, an artifical intelligence engine,<br />

a sound engine, network support and user interface toolkits to handle<br />

different modes of input and game play displays. A resource<br />

manager or a scene management system may also be part of a game<br />

engine. Because of the realtime nature of computer games, these<br />

components are usually highly optimized and very efficient. In this<br />

paper, we investigate how one can take advantage of these capability<br />

in building visualization systems. Specifically, we revisit the<br />

Spray Rendering system, describe how its functionality can be implemented<br />

and enhanced with the use of game engines, and describe<br />

a sample implementation.<br />

1 SPRAY RENDERING<br />

It has been 15 years since Spray Rendering [4, 5] was first introduced.<br />

Spray rendering is a visualization framework that uses the<br />

metaphor of spraying paint to visualize data. It uses smart particles<br />

(sparts), delivered from spray cans, that can seek specific targets<br />

and follow specific behaviors. A primary difference between spray<br />

rendering and other visualization systems is that rather than pumping<br />

data through a network of modules, spray rendering sends sparts<br />

(one can think of these as intelligent agents) through the data. As<br />

a result spray rendering can theoretically handle massive data sets,<br />

whether gridded or particle-based, more efficiently than a data flow<br />

approach. However, the efficiency of spray rendering is dependent<br />

on a number of factors – primarily the complexity of the sparts and<br />

the number of active sparts. Optimizing interactions among large<br />

numbers of semi-intelligent entities, such as sparts, and the 3D environment<br />

environment, which includes the data and its artifacts,<br />

is something game engines that support massively multiplayer online<br />

role playing games (MMORPG) excel at. It allows <strong>for</strong> more<br />

complicated and optimized spray rendering techniques to be rapidly<br />

implemented. Next, we discuss how different components of game<br />

engines can be used to carry out visualization tasks in the context<br />

of spray rendering.<br />

2 ARTIFICIAL INTELLIGENCE<br />

<strong>Game</strong> engines often provide a set of libraries to assist with steering<br />

behavior of a non-player character (NPC), in this case a smart<br />

particle, to navigate around its world, seeking out a given target<br />

while avoiding what it sees as threats. Steering behavior can also<br />

make decisions based on the actions of peers, in this case, other<br />

sparts. <strong>Game</strong> engines provide a means <strong>for</strong> sparts of the same group<br />

to share in<strong>for</strong>mation, and act upon this conveyed in<strong>for</strong>mation [1].<br />

Using steering libraries from a game engine, particles may actively<br />

seek out their targets, they can choose where to travel in their n-<br />

dimensional data set based on in<strong>for</strong>mation from other smart particles,<br />

or from the data itself.<br />

3 NETWORKING<br />

One of the most powerful feature of spray rendering is the ability<br />

of sparts to communicate with each other. Sparts may communicate<br />

directly with other sparts within their local neighborhood just<br />

as boids communicate with each other [6]), or indirectly by leaving<br />

messages in the <strong>for</strong>m of rendered or non-rendered artifacts <strong>for</strong><br />

other sparts, or by posting to a common “message board” that other<br />

sparts can access. <strong>The</strong> ability to communicate allows sparts to work<br />

as a team to identify more complex targets than an individual spart<br />

is capable of finding. <strong>Game</strong> engines provide a means <strong>for</strong> NPCs<br />

to act as a group, communicating in<strong>for</strong>mation amongst each other<br />

and basing behavior such as steering upon the in<strong>for</strong>mation passed<br />

among these entities. Sparts may use this same inter-entity communication<br />

to <strong>for</strong>m groups and identify complex structures located<br />

within a data set and then render a visualization of these structures.<br />

Furthermore, these NPCs can step through time-varying data just<br />

as easily as multivariate data sets. <strong>The</strong> optimization of this communication<br />

and group-based behavior in game engines allows these<br />

groups to be fairly large, contain complex target definitions, and<br />

still be feasible in real-time.<br />

4 PHYSICS<br />

Collision detection and handling are usually found in physics engines.<br />

We can use the collision detection system <strong>for</strong> its rich spatial<br />

partitioning schemes to help sparts efficiently navigate through data<br />

space – quickly skipping regions where there is no data. <strong>Game</strong> engines<br />

generally maintain a scene graph associated with a spatial partitioning<br />

scheme, and this graph can keep track of the data density<br />

of particular regions and whether or not data within the bounds of<br />

the target is present. Scene graphs can also be used to keep track of<br />

which data has been visited, and relay in<strong>for</strong>mation from sparts who<br />

have already been to a given space to sparts who later encounter<br />

the same space. And where there may be data, bounding volume<br />

checks provide another layer of efficiency.<br />

5 GRAPHICS<br />

Fast hardware based rendering is the <strong>for</strong>te of graphics engines. <strong>The</strong><br />

artifacts found by sparts can be passed to graphics engines <strong>for</strong> efficient<br />

rendering allowing the users to see the data as they are being<br />

discovered. Fast rendering allows interactive exploration of large<br />

data sets in conjunction with the ability of sparts to vary their scope<br />

of interest (e.g. by adjusting their neighborhood size) which in turn<br />

varies the level of detail of data visualization. Points of interest can<br />

be zoomed in <strong>for</strong> more detailed exploration. Scene graph hierarchy<br />

can also be exploited by the graphics engine to further improve its<br />

rendering speed.<br />

6 THREADS<br />

<strong>Game</strong> engines also provide a set of valuable libraries <strong>for</strong> efficient<br />

multi-threading. As spart visualizations require many instances of<br />

different algorithms to be simultaneously active, multi-threading<br />

is an important optimization to make spray rendering attractive.<br />

Multi-threading in game engines is fairly young, but most game<br />

engines do partition physics, rendering and other code into separate<br />

threads [2, 3]. Thread support <strong>for</strong> sparts will need to be more<br />

fine-grained – at the level of individual NPC. This is one area where


spray rendering will need to drive further development of support<br />

and management of large number of threads.<br />

7 SOUND<br />

<strong>The</strong> goal of understanding and gaining insight from data sets is not<br />

restricted to mapping data to visual channels. Sonification have<br />

been found to be effective in communicating in<strong>for</strong>mation as well.<br />

Sound in games adds realism and reflects the mood of the game.<br />

This is supported by sound engines that can dynamically adjust<br />

playback parameters, be triggered by proximity sensors, etc. <strong>The</strong>se<br />

capabilities can also be used to map data to sound. <strong>The</strong> combination<br />

of scene graphs and audio engines allow sound clips to have<br />

fairly advanced behaviors. For example, an audio clip could only<br />

be triggered if the conjunction of the output of two sparts produce<br />

a positive outcome. Allowing such complex behaviors would help<br />

preserve the significance and meaning of sound and keep it from<br />

over-use. 3D positional sounds e.g. OpenAL, can allow users to<br />

know when one or more of his sparts have found an important piece<br />

of data and intuitively localize where the data was found.<br />

8 GUI<br />

User interfaces <strong>for</strong> playing games must be intuitive whether it is<br />

controlling a first person shooter (FPS) game or directing an entire<br />

army. <strong>The</strong> metaphor of using cans of spray paint is ideal <strong>for</strong> an<br />

FPS type interface. In our sample application described below, the<br />

user’s ability to shoot sparts from the camera’s viewpoint was implemented<br />

with basic a GUI API. <strong>Game</strong> engines provide efficient<br />

yet simple to use features such as firing and switching weapons i.e.<br />

spray cans and hence type of sparts being fired.<br />

9 SAMPLE IMPLEMENTATION<br />

We have some initial results of implementing this idea using Open-<br />

Steer (http://opensteer.source<strong>for</strong>ge.net/) as the game engine.<br />

<strong>The</strong> primary strength of OpenSteer is in controlling crowd behavior<br />

– which corresponds to the primary task of controlling the behavior<br />

of sparts. We describe how some spray rendering visualization<br />

techniques can be realized using OpenSteer.<br />

9.1 Isosurface Rendering<br />

In this visualization, the user chooses the target (scalar threshold)<br />

that the sparts are searching <strong>for</strong>. Upon finding their target, the sparts<br />

render a small polygon that is oriented on a plane perpendicular to<br />

the gradient of the data at that point, centered at that point. <strong>The</strong><br />

color of the polygon can be mapped to the scalar magnitude at<br />

that point. Alternatively, the red, green, blue components can be<br />

mapped to the components of the gradient.<br />

9.2 <strong>Stream</strong>line Rendering<br />

In this visualization, sparts will set their trajectories to that of the<br />

data they have encountered. Each spart will proceed to travel along<br />

the trajectory of the data at its current location. As each spart travels,<br />

it will leave behind a polyline to indicate its path. A target may<br />

also be associated with each spart e.g. velocity magnitude, which<br />

can be used to control the generation of a streamline. For example,<br />

if the velocity magnitude has fallen below a specified threshold, the<br />

streamline may be terminated.<br />

9.3 Explosive Tracing<br />

Typically, an FPS interface is used to deliver the sparts into the<br />

data space. An alternative is to allow sparts to spawn themselves.<br />

As be<strong>for</strong>e, the spart are fired towards the data until it finds its target.<br />

It then analyzes its six immediate neighborhoods and <strong>for</strong> each<br />

of the adjacent points that also satisfies its target conditions, this<br />

spart spawns another spart traveling towards that direction. Positions<br />

that have been visited are marked. This procedure is applied<br />

Figure 1: Image shows results using two types of sparts. Isosurface<br />

sparts render the low-magnitude portions of the data, while streamline<br />

sparts show the flow pattern.<br />

recursively. For sparts that find streamlines, spawned sparts traveling<br />

within valid data also leave behind a color mapped line.<br />

Figure 2: This visualization starts from one spart that recursively<br />

sends sparts to adjacent spaces where target data is found. Each<br />

new spart renders a small segment of a streamline. All data matching<br />

the original sparts target, and reachable from the first target data<br />

found is discovered. <strong>The</strong> gray area visible on some edges are many<br />

sparts, still finding target data and spawning new sparts.<br />

10 CONCLUSION<br />

We are interested to find out how one can take advantage of game<br />

engines to per<strong>for</strong>m visualization. <strong>The</strong> different components of a<br />

game engine i.e. AI, physics, graphics, networking, sound, etc. can<br />

be readily mapped to the Spray Rendering paradigm. Our initial investigation<br />

uses the OpenSteer game engine. Results are promising,<br />

and we plan to incorporate other game engine functionality such as<br />

networking and physics.<br />

REFERENCES<br />

[1] Valve. http://source.valvesoftware.com/SourceBrochure.pdf, 2008.<br />

[2] R. Chabukswar, A. Lake, and M. Lee. Multi-threaded rendering and<br />

physics simulation. Technical report, Intel, 2005.<br />

[3] H. Gabb and A. Lake. Threading in 3D game engine basics.<br />

www.gamasutra.com/features/20051117/gabb 01.shtml, 2005.<br />

[4] A. Pang and N. Alper. Mix & Match: A construction kit <strong>for</strong> visualization.<br />

In Proceedings: <strong>Visualization</strong> ’94, pages 302–309. IEEE Computer<br />

Society, 1994.<br />

[5] A. Pang and C. M. Wittenbrink. Collaborative 3D visualization with<br />

CSpray. IEEE Computer Graphics and Applications, pages 32–41,<br />

March 1997. Special issue on: 3D and Multimedia on the In<strong>for</strong>mation<br />

Superhighway.<br />

[6] C. W. Reynolds. Flocks, herds and schools: A distributed behavioral<br />

model. Computer Graphics, 21(4):25–34, 1987.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!