Contents
An Easy Way Of Solving Complex Mathematical Models: The Finite Difference Scheme
 
 
Printer-Friendly VersionPrinter-Friendly Version
 
Latest News
spacer View All spacer
 
July 4, 2009
 
CyberConnect2 Boss Talks 'Quality Of Life' For Japanese Developers [3]
 
Warner's $33M Midway Acquisition Approved By Judge [7]
 
July's Top 25 Facebook Games Topped By Zynga, MindJolt Titles
spacer
Latest Jobs
spacer View All     Post a Job     RSS spacer
 
July 4, 2009
 
Monolith Productions
Senior Software Engineer, Game Systems
 
Monolith Productions
Senior Software Engineer, Tools
 
Trion San Diego
Terrain Artist
 
Trion Austin
Technical Systems Analyst
 
Monolith Productions
Sr. Software Engineer, Engine
 
Warner Bros Entertainment
Senior Environment Artist
 
Warner Bros Entertainment
Senior Game Designer
 
Edge of Reality
Project Art Director/Art Lead
spacer
Latest Features
spacer View All spacer
 
July 4, 2009
 
arrow The Formation And Evolution of CyberConnect2 [3]
 
arrow Game Design Essentials: 20 RPGs [21]
 
arrow Real-Time Cameras - Navigation and Occlusion [1]
 
arrow Persuasive Games: Gestures as Meaning [7]
 
arrow Sponsored Feature: BattleClinic's Chris Condon On Using Iovation To Prevent Gaming Fraud, Chargebacks
 
arrow A Different Track: Frank Gibeau Talks Strategy [1]
 
arrow Leading The Design of APB [2]
 
arrow Dramatic Play [19]
spacer
Latest Blogs
spacer View All     Post     RSS spacer
 
July 4, 2009
 
How to Monetize Flash Games Efficiently [5]
 
Crowdsourcing Game Audio: Lessons Learnt [3]
 
Thinking Out of the Box [4]
spacer
About
spacer News Director:
Leigh Alexander
Features Director:
Christian Nutt
Editor At Large:
Chris Remo
Advertising:
John 'Malik' Watson
Recruitment/Education:
Gina Gross
 
Features
  An Easy Way Of Solving Complex Mathematical Models: The Finite Difference Scheme
by Raka Jovanovic
del.icio.us del.icio.us digg this! digg this! reddit! reddit! stumble it! stumble it! 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).

Advertisement

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:
 


Submit Comment