Our Properties: Gamasutra GameCareerGuide IndieGames Indie Royale GDC IGF Game Developer Magazine GAO
My Message close
Contents
An Easy Way Of Solving Complex Mathematical Models: The Finite Difference Scheme
 
 
Printer-Friendly VersionPrinter-Friendly Version
 
Latest News
spacer View All spacer
 
February 10, 2012
 
Analyst questions validity of unusual January NPD results [3]
 
DICE 2012: Blizzard's Pearce on World Of Warcraft's launch hangover
 
DICE 2012: Insomniac's Price on Quality Of Life, ditching the 'Loser' badge [2]
spacer
Latest Jobs
spacer View All     Post a Job     RSS spacer
 
February 10, 2012
 
Sony Computer Entertainment America LLC
Audio Tools Engineer
 
Sony Computer Entertainment America LLC
World Wide Studios Technical Product Manager
 
Sony Computer Entertainment America LLC
Senior Software Application Engineer
 
Sony Computer Entertainment America LLC
Senior Gamer Insights Specialist
 
High 5 Games
Technical Artist
 
Airtight Games
Art Director
spacer
Latest Features
spacer View All spacer
 
February 10, 2012
 
arrow Principles of an Indie Game Bottom Feeder [18]
 
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? [12]
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
  An Easy Way Of Solving Complex Mathematical Models: The Finite Difference Scheme
by Raka Jovanovic [Programming]
Post A Comment Share on Twitter Share on Facebook RSS
 
 
June 18, 2008 Article Start Page 1 of 3 Next
 

[In this technical article, veteran coder Jovanovic looks at dynamic game-related effects like heat distribution models, explaining useful mathematical formulas that should help decrease the amount of programming.]

In games today, more and more realistic effects are expected, and the best way to get them is by using the correct physical models. The problem many of these models share is that they are represented with partial differential equations (PDE).


The solving of this type of equation is often avoided by using different types of tricks. It is sad to say, but in the end tricks are just tricks, and they don't give the correct solution - just something that looks like it.

There are two main reasons for using tricks. The first one is that they are usually much faster - but with the increase of CPU power we can give up some of the speed to get more reality. The second reason is that most people think solving PDEs is very complicated, and in many cases this simply isn't true.

In this article we'll show a standard method of solving PDEs and how to implement it. This method is called Finite Difference Scheme (FDS). It is not the most exact and stable method that exists, but is much better than using tricks, and it is the easiest to understand and implement.

A game example of the use of PDE

Let us try to show the advantages of using a mathematical model with PDE and the FDS method in a game. Let's say we wish to have a trampoline, or something like a rubber sheet that represents a wall that moves with the wind. How would it be implemented in a game? The approach in games today is to use a spring system.

Anyone who programmed spring systems knows this isn't the simplest task in the world. We have to create classes for nodes, springs, the hole system; and than calculate the forces from all the springs, and than apply the sum of forces corresponding to each node. And after all that work we get something that can often become numerically unstable.

Spring systems are actually great and very complex objects can be modeled with them, but in this case we don't need them. There is a much easier way.

The behavior of a trampoline, or the vibrating membrane, is one of the standard physical problems and one of the basic PDE. The equation that represents it looks something like this:

When someone sees something like this the natural reaction is "I'll stick with spring systems, since it's surely much easier." This is wrong for a couple reasons.

First, the implementation will be simpler; less programming will be needed. Second, the final result will look better because we used a better mathematical model, or in other words we modeled a trampoline and not just a bunch of nodes connected with springs. Third, there will be less calculation which means the code will work faster.

 
Article Start Page 1 of 3 Next
 
Comments


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.