Our Properties: Gamasutra GameCareerGuide IndieGames Indie Royale GDC IGF Game Developer Magazine GAO
My Message close
Contents
Sponsored Feature: Fluid Simulation for Video Games (Part 1)
 
 
Printer-Friendly VersionPrinter-Friendly Version
 


Part of:



Latest News
spacer View All spacer
 
February 10, 2012
 
Road to the IGF: Lucky Frame's Pugs Luv Beats
 
Analyst questions validity of unusual January NPD results [4]
 
DICE 2012: Blizzard's Pearce on World Of Warcraft's launch hangover
spacer
Latest Jobs
spacer View All     Post a Job     RSS spacer
 
February 10, 2012
 
Beachhead / Activision
Senior Operations Engineer
 
Sony Computer Entertainment America LLC
Manager Quality Assurance
 
Beachhead / Activision
Senior Front End Web Engineer
 
Beachhead / Activision
Senior Back End Web Engineer
 
Beachhead / Activision
User Experience Lead
 
Sony Computer Entertainment America LLC
Senior Software Engineer
spacer
Latest Features
spacer View All spacer
 
February 10, 2012
 
arrow Principles of an Indie Game Bottom Feeder [19]
 
arrow Postmortem: CyberConnect 2's Solatorobo: Red the Hunter [1]
 
arrow Jerked Around by the Magic Circle - Clearing the Air Ten Years Later [39]
 
arrow Building the World of Reckoning [4]
 
arrow SPONSORED FEATURE: TwitchTV - How to Build Community Around Your Game in 2012 [13]
 
arrow Happy Action, Happy Developer: Tim Schafer on Reimagining Double Fine [9]
 
arrow Building an iOS Hit: Phase 1 [11]
 
arrow Postmortem: Appy Entertainment's SpellCraft School of Magic [5]
spacer
Latest Blogs
spacer View All     Post     RSS spacer
 
February 10, 2012
 
Audio Passes: Success Through Layering
 
What the current RPG can learn from Diablo 1
 
Double Fine's Kickstarter Windfall: Will Patronage Supplant Traditional Game Publishing? [5]
 
The Principles of Game Monetization
 
Did DoubleFine Just break the publishing model for good? [14]
spacer
About
spacer Editor-In-Chief/News Director:
Kris Graft
Features Director:
Christian Nutt
Senior Contributing Editor:
Brandon Sheffield
News Editors:
Frank Cifaldi, Tom Curtis, Mike Rose, Eric Caoili, Kris Graft
Editors-At-Large:
Leigh Alexander, Chris Morris
Advertising:
Jennifer Sulik
Recruitment:
Gina Gross
 
Feature Submissions
 
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
 
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 Techweb
Game Network
Game Developers Conference | GDC Europe | GDC Online | GDC China | Gamasutra | Game Developer Magazine | Game Advertising Online
Game Career Guide | Independent Games Festival | Indie Royale | IndieGames

Other UBM TechWeb Networks
Business Technology | Business Technology Events | Telecommunications & Communications Providers

Privacy Policy | Terms of Service | Contact Us | Copyright © UBM TechWeb, All Rights Reserved.