My Message close
GAME JOBS
Contents
Sponsored Feature: Fluid Simulation for Video Games (Part 1)
 
 
Printer-Friendly VersionPrinter-Friendly Version
 


Part of:



Latest Jobs
spacer View All     Post a Job     RSS spacer
 
May 21, 2013
 
Kabam
Senior 3D Environment Game Artist
 
Kabam
3D Environment Game Artist
 
N-Fusion Interactive
Game Designer
 
Trendy Entertainment
Community Manager
 
Six Foot
Community Manager
 
MegaMada
Lead Game Designer
spacer
Latest Blogs
spacer View All     Post     RSS spacer
 
May 21, 2013
 
Using Small Studios As Stepping Stones In Your Career [1]
 
How Can You Find Jobs At Blizzard if You're an Artist?
 
Let’s produce HTML5 games with a serious approach.
 
An Object Of Lust [1]
 
Gamasutra Blog Guidelines - Updated and open for discussion [13]
spacer
About
spacer Editor-In-Chief:
Kris Graft
Blog Director:
Christian Nutt
Senior Contributing Editor:
Brandon Sheffield
News Editors:
Mike Rose, Kris Ligman
Editors-At-Large:
Leigh Alexander, Chris Morris
Advertising:
Jennifer Sulik
Recruitment:
Gina Gross
Education:
Gillian Crowley
 
Contact Gamasutra
 
Report a Problem
 
Submit News
 
Comment Guidelines
Sponsor
Features
  Sponsored Feature: Fluid Simulation for Video Games (Part 1)
by Michael Gourlay [Programming, Visual Computing]
5 comments Share on Twitter Share on Facebook RSS
 
 
October 15, 2009 Article Start Page 1 of 5 Next
 

[This sponsored feature, part of Intel's Visual Computing site and written by Dr. Michael J. Gourlay of the University of Central Florida Interactive Entertainment Academy, begins a multi-part series that explains fluid dynamics and its simulation techniques.]  

Introduction to Fluid Dynamics

Video games appeal to our desire to explore and interact with our environment, and adding real-world phenomena-such as fluid motion-allows game developers to create immersive and fun virtual worlds. Recently, physical simulations have become more realistic, but the simulations have largely been limited to rigid bodies.

Pervasive simulations of continuous media like cloth and fluids remain uncommon, largely because fluid dynamics entail conceptual and computational challenges that make simulating fluids difficult. This article begins a three-part series that explains fluid dynamics and its simulation techniques. The article culminates in an example of a fluid simulation algorithm suitable for use in a video game.

To get started in fluid simulations, you need to understand the fundamentals of fluid dynamics. Let's start by covering some of the basics.

What Is a Fluid?

A fluid is any substance that flows (in other words, a substance that can take the shape of its container) and does not resist deformation (meaning that it slides when dragged). People often use fluid and liquid interchangeable, but technically, the term fluid can refer to either a liquid or a gas. A gas fills its container completely, whereas a liquid has a distinct "free surface" whose shape does not depend on its container. (Often, when you use computer graphics to visualize a liquid, you render only its surface-for example, ripples on a pond or a stream of water.) The distinction between liquids and gasses can influence how you model the fluid, but both obey the same basic fluid formulae and share similar properties.

But what about smoke? Smoke seems to behave like a gas but also appears to have a kind of surface, although perhaps not as distinct as that of a liquid. The answer is that smoke is really a combination of a gas and tiny suspended particulates, and the combination of these particulates is called an aerosol. Those particulates follow the motion of the gas (and let game players see that motion) without necessarily influencing the motion. You can usually treat smoke as a kind of gas, where one of its properties-for example, density or composition-varies.

Varieties of Physical Simulation

Whereas fluid dynamics might not be as familiar to most video game programmers, some forms of physical simulation have become commonplace. For the sake of context, let's see where fluid simulations fit into the spectrum of physical phenomena:

Particles are points that have position, mass, and velocity but (in principle) no size or shape, as Figure 1(a) shows. The relationship between forces and motion is linear. Particles are easy to simulate but rather uninteresting.

Rigid bodies have shape and orientation in addition to position, mass, and velocity-for example, blocks and balls. If you add the notion of "shape" to a particle, you get a rigid body, as Figure 1(b) shows. Rigid bodies are still easy to simulate: Most of the difficulty comes from detecting and responding to collisions. Stacks of bodies are usually the most difficult to solve, because everything in the stack continuously collides with everything else in the stack-even if nothing moves.

Articulated bodies, shown in Figure 1(c), are connected networks of rigid bodies-for example, character models. These bodies behave identically to rigid bodies that are continuously involved in a form of collision where the points of contact have a limited variety of ways in which they can move (called constraints).


Figure 1. Simple physical phenomena: (a) particles, (b) rigid bodies, and (c) articulated bodies

Deformable bodies can change shape but retain their connectedness and adjacency of various points on the body. Think of this as a model where the edges between vertices never change which vertices they connect, but the locations of the vertices can move. Their type depends on their dimensionality:

  • 1D. Thread, string, rope, chain, hair, and so on, shown in Figure2(a)
  • 2D. Cloth, as shown in Figure2(b)
  • 3D. Soft bodies, like the jiggly bits of a character model, as shown in Figure2(c)


Figure 2. Deformable bodies: (a) thread, (b) cloth and (c) soft bodies.

Fluids have lots of freedom of motion. The motion is nonlinear (more on that later), and their shape and topology can change, as shown in Figure 3. Fluids require specialized simulation techniques: Because fluids take the shape of their container, they are always in collision with everything around them, including the fluid itself. So a collision with one part of the fluid effectively means that the whole body of fluid must respond.


Figure 3. Fluids: (a) liquid and (b) smoke.

 
Article Start Page 1 of 5 Next
 
Top Stories

image
Xbox One is Microsoft's biggest move for living room domination
image
Opinion: Xbox One is a desperate prayer to stop time
image
Xbox One isn't always-on but it will require a regular connection
image
Xbox One's preowned games strategy involves a single-use code
Comments

Andrew Hopper
profile image
Loved this article because I believe that (with some re-evaluation, experimentation, and tweaking) fluid mechanics can also be used to create some interesting movement patterns for any kind of swarm-based systems, like legions of zombies or a hive of killer attack bees. By examining how swarms of free-flowing particles interact with each other on a natural level, we can better understand how to create more natural movement for larger scale swarms.

Berk Atabek
profile image
very nice intro :)

Bo Banducci
profile image
The first line...



"Video games appeal to our desire to explore and interact with our environment."



Do we really have such a desire? Look around...

Michael Gourlay
profile image
I just wanted to mention that despite what the text in the second paragraph of this version of the article indicates, the series has more than three parts. So far, 5 have been written and 2 more are planned. Inteil has simply only by now published the first three.



(Originally it was planned to have 3 parts, but it grew as we realized better ways to organize the topics, and that we could use the subject to explore related avenues.)

Arshad Hussain
profile image
A very helpful article to the programmer interested in soft body/fluid programming.

Thanks a lot!!


none
 
Comment:
 




UBM Tech