Slashdot Mirror


Physics For Game Developers

Richard Jones writes: "In my opinion, the most difficult aspect of writing a good 3D game is coding complex physics. If you can take away all the flashy graphics, texture maps, light and shadows from a game, and it's still at least 75% as playable and addictive, then you have an excellent game. But too many programmers seem to be ready to concentrate on the graphics, neglecting the underlying physics which make the game playable. If you compare, say, Re-volt with its fabulously detailed models of remote-controlled cars, and Carmageddon which on the N64 at least has sucky physics, well I know which one I'm still playing." He's contributed his review (below) of a book intended to help game programmers make games that aren't sucky. Physics For Game Developers author David M. Bourg pages 326 publisher O'Reilly rating 8 reviewer Richard Jones ISBN 0-596-00006-5 summary A good introduction to the difficult subject of writing 3D games and simulations with accurate physics, let down by a few minor snags.

Programmers who want to get serious about game physics will love David M. Bourg's Physics for Game Developers. As I've said, the subject is inherently very difficult, and the book assumes that you are already familiar with vector and matrix arithmetic up to college level, integration and differentiation, and at least you hazily recall your mechanics/physics lessons from school. You also won't be afraid to wade through Bourg's carefully documented derivations of formulae for various physical effects, and his well-commented source code.

The book starts off by recapping the basic concepts of mass, centre of gravity, moment of inertia and inertia tensors. Bourg assumes that you have a working grasp of these subjects, and I admit that I had to go back to some of my A-level mechanics text books. He then goes straight into kinematics, where he uses standard (but forgotten!) integration techniques to calculate velocities from accelerations and positions from velocities. His examples are excellent, although a few exercises wouldn't have gone amiss. The chapter on forces covers a great many different types of forces such as springs and buoyancy, but curiously omits the important subject of contact forces (the normal force that a table, for instance, exerts on your computer monitor to stop it falling through the floor). In fact contact forces don't appear until much later in the book. Particles, rigid bodies and impulses (forces from collisions) are introduced in chapters 4 and 5.

At this point I have to say I was a little bit confused. What did this have to do with game programming? Everyone knows that games spend most of their time running round a single big "main loop," working out the forces on each object, looking for collisions and working out which keys the user is pressing. It doesn't seem imaginable that a game programmer could completely solve all the equations of motion by pure integration at the beginning of the game, and then just run the positions of the players through the graphics engine like a movie!

I already knew a little about this from what I'd found from the web, but what most games actually do is calculate all the forces on all the objects (players, scenery, etc.) in the game, and then integrate them at each step. Some of these forces will be generated by human players pressing keys on the keyboard or wiggling the joystick, and that's how the objects end up moving. Pure integration isn't usually possible, so the physics engine performs numerical integration - a kind of fast approximation to the pure "closed form" solution. Numerical integration is itself a tricky subject, but it's the meat-and-veg of good game programming. Surprisingly, numerical integration and a realistic main loop doesn't appear until chapter 11 (172 pages into the book). I skipped straight to this section, and I suggest you do so too...

The chapter on numerical integration is excellent and contains the first realistic gaming (or at least simulation) code. Many games I've examined use simple numerical integration, like this:

// At each step ... A = acceleration, dt = time step
Vx += Ax * dt;
Vy += Ay * dt;
Sx += Vx * dt;
Sy += Vy * dt;

Unfortunately this method (Euler's method) is very inaccurate and unstable: if you tried to simulate planets orbiting around a sun using this method, they'd soon fly off into outer space unrealistically. Bourg gives an excellent introduction to better methods such as the "improved Euler" method and the popular Runge-Kutta method, and he covers them in a context which will make it clear how to use these methods in your own programs.

The book reaches a crescendo with three fully developed simulations: two hovercraft which you can drive around and jolt into each other like bumper cars -- they spin around realistically; a flight simulator; and a 3D car which can be crashed into blocks that bounce around. Again the source code is meticulously commented and generally well written. My only two reservations about the code are: It would be nice if Bourg had chosen to use OpenGL instead of Direct3D so that those of us without regular access to Windows could actually compile and run the examples. The book would make an ideal companion to the OpenGL Red Book. And coming firmly from the Windows camp, Bourg's examples are full of all the horrors of Win32 APIs and Hungarian Notation. But maybe that's just my personal preference :-)

So in summary: The Bad Points:

  • Measurement systems: Bourg moves uneasily between the English/US system and the European SI units. So we get examples which combine ft/s, meters, slugs and kilograms, uneasily converting between the two. He should have chosen one system and stuck with it.
  • A common complaint about computer books: I've just spent 25 quid on a book which will sit open on my desk for months. Is it too much to ask that it be ring bound?
  • Some subjects are not explained in enough depth. Particularly: moments, contact forces, impulse methods. Bourg should probably have written a chapter or three on collision detection.
  • The chapters are presented in a very strange order. Move chapters 6-10 until later, or introduce numerical integration earlier.
  • A few of the illustrations are inaccurate.

and The Good Points:

  • Considerably better than the usual round of maths/physics text books which make up this field. In fact, this is really one of only about 2 or 3 significant books in this area which are pitched for game developers as opposed to mathematicians, and it's certainly the best.
  • The areas which are covered are done well, in significant depth, with a good bibliography where you can find out more.
  • The commentary on the difficult equations is good, and Bourg resists the temptation to derive many of the formulae he presents, instead referring interested readers to other references.
  • Code is well documented and explained.

And now I suppose I have no excuse not to resurrect XRacer :-)

You can purchase Physics for Game Developers at Fatbrain

328 comments

  1. hmmm.... by dedicke · · Score: 0

    me'sa confused - i likes to play pretty games tho sho nuf!

    --
    raretshirts.com - cool vintage t-shirts
  2. Baldur's Gate for PS2 by sam@caveman.org · · Score: 3, Interesting

    i've played a lot of games, and gone 'wow' at some of the eye candy, but if you've played baldur's gate for PS2 you know that the coolest thing that has ever been coded for a game is the WATER for this game. you leave a wake behind you when you walk through it, you splash when you jump in, and ripples interact and reflect from the shore. maybe the physics aren't 'perfect' or whatever, but the realism of the water was enough to really 'immerse' myself into the game.

    -sam

    --
    burn the computers. go back to the abacus.
    1. Re:Baldur's Gate for PS2 by robi2106 · · Score: 1

      I just got that game yesterday and that was one of the first things I noticed about the game play. Agreed. . . very slick water coding. I can't remember if the speed you walk affects the height of the wave generated, but the angle that the water spreads out is realistic (NOTE: . . realistic does not mean exactly physically correct).

      In any case, I am very impressed. The collections of movable objects (mainly boxes) also seem to be modeled well; ie they rotate when pushed from a corner instead of when pushed from the center of a side.

      hummmmmmm that makes me want to play some more of Act II now . . .

      robi

    2. Re:Baldur's Gate for PS2 by sam@caveman.org · · Score: 2

      my main beef with baldur's gate is it was, in the end, an entirely too simplistic game. it was completely linear: go from point A to point B, killing monsters C, D, and E. there is no element of RP that i could find - you could say different things at different times, but none of them seemed to make any 'real' difference.

      also, the difficulty level 'normal' was laughable. 'hard' is still very, very easy, but at least some of the bosses are a little more interesting (but still pushovers).

      i'll agree that the water and the pushable boxes (and the powder kegs!) are pretty cool. they seem to have the engine pretty well down, but this version seems to be a game without an audience: too simple for older gamers, too bloody for younger gamers. but the engine leads me to want more:

      1. more races
      2. more classes
      3. more player customization (names, size, color, etc)
      4. ONLINE PLAY
      5. more non-linear story elements
      6. more puzzles/traps

      but like i said, it is a great first offering on the console for Baldur's Gate. but i hate to disappoint, act I is by far the best act. however act ii has some really nicely rendered caves, and some monsters which hearken back to the days of pen and paper dnd (frost giants, displacer beasts!). i just hope they take the engine to its potential in the next version (ONLINE PLEASE!!).

      -sam

      --
      burn the computers. go back to the abacus.
  3. throw physics out the door... by mrroot · · Score: 1, Interesting

    Somestimes games are actually more fun if they defy the laws of physics. Such as being able to jump 20ft in the air (I can only jump about 2ft myself). Don't get me wrong, it has to be somewhat realistic, but any good game will also be a little unrealistic too.

    --
    I Heart Sorting Networks
    1. Re:throw physics out the door... by SuzanneA · · Score: 2, Insightful
      IMO, the best solution is to have the physics definitions modular, or at least programmable. This is one of the advantages of UT, its physics can be overriden fairly easily.

      Even on games where there doesn't appear to be any need for modular physics, there will always be some mod author that sees a need. Say you are writing a racer, you might think that the physics should be fixed to real-world physics, but the mod author that wants to write a 'dune buggies on the moon' mod, is going to disagree with you, so keep it modular :)

    2. Re:throw physics out the door... by ackthpt · · Score: 1
      Well, yeah, and what happens in reality if you jump off a twenty foot building is you hit the ground fast. Where Mario the plumber has to jump slowly enough so you can follow him on the screen, essentially playing in slo-mo.

      Physics eye-candy is something I've enjoyed in a few games. The actual movement of characters or other objects is smooth, fluid, looks good and might even be coupled with decent sound effects. The last exceptional game I knew by those characteristics was something with an air car on an Amiga. Sadly, I lent the disk to someone who moved and I never saw it again.

      Want to become good at pattern games? Play (and die a lot) at high difficulty levels, then go back and play at medium or whatever. Your reaction timing is improved and you'll do better.

      To achieve the sharpest blade, use the hardest stone.

      --

      A feeling of having made the same mistake before: Deja Foobar
    3. Re:throw physics out the door... by Manic+Miner · · Score: 1

      I know what you mean, but being able to jump 20ft into the air doesn't mean that you've "thrown the physics out of the door", all it means is that gravity is less in that particular world / game.

      Don't get me wrong, I enjoy games that don't stick to realistic simulations. But having objects in the game interact in a way that is based on a real physical environment, albeit with modified constants to keep the game "fun", makes the game much easier to play because the environment behaves in the way you expect, and is predictable.

      --
      If you ever drop your keys into a river of molten lava, let'em go, because, man, they're gone.
    4. Re:throw physics out the door... by Anonymous Coward · · Score: 0

      It isn't necessarily important that the physics rules be the what we expect. I just want them to be consistent. If I can jump 20 ft in the air, I'd like to be able to kick something of a comparable wait a comparable distance. I just want it all to fit together.

    5. Re:throw physics out the door... by Dimensio · · Score: 5, Interesting

      I think that the most glaring physics error commonly seen in many games -- especially platformers and FPSers -- is violations of inertia. Take almost any game where 1) your character can jump and 2) there are horizontally moving platforms of some sort. Stand on a moving platform and jump as it moves. In almost every single game you play your character will jump straight up in the air and the platform will move out from under the character, even though real physics should have the character continually moving in the direction of the vehicle (air resistance isn't that strong or your characters wouldn't be able to move at all).

      I think that I've seen one game (whose name escapes me atm) that actually got it more or less correct -- and I think that was just a game engine quirk that caused it.

    6. Re:throw physics out the door... by Anonymous Coward · · Score: 0

      You must be some serrious lard ass. I weigh 255 lbs, and can jump 4 feet vertically. On a good day, maybe 4.5 feet. I'm also 40.

    7. Re:throw physics out the door... by bloggins02 · · Score: 2, Insightful

      The real solution here would be to stay with real world physics. "Real World" physics work on the moon too. If a physics library would allow you to specify mass instead of weight and also the mass of the main body to witch he is on the surface, this library would indeed encompass ANY physical situation. You could even have a "G-Field" which could temporarily change the value of G (the gravitational constant) or even your mass to make you be able to "defy the laws of physics" and jump 20 feet in the air while you have said "G Field" suit on.

      I think accurate physics MUST be present in most motion-oriented games so that the control feels more natural (i.e. feels like what would happen in THIS universe). You can change masses, gravitational constants, whatever, to make objects in your world to WHATEVER you want them to do, but F=ma should still apply :)

    8. Re:throw physics out the door... by guinsu · · Score: 2

      True, but you need realistic physics as a starting point. Some of the driving and crashes in Midnight Club and GTA3 are certaily unrealiztic, but you can see hoe they are based on a realistic physics model that was tweaked for gameplay purposes.

    9. Re:throw physics out the door... by Anonymous Coward · · Score: 0

      You're either lying, or have no idea how to gauge the height of your jump. Pulling your legs up as you jump doesn't add to the four feet.

    10. Re:throw physics out the door... by mother_superius · · Score: 1
      Well, yeah, and what happens in reality if you jump off a twenty foot building is you hit the ground fast



      Hitting the ground is a high impulse exerted on the ground (and conversely, on your poor legs). Since this guy is talking about being able to jump 20 feet in the air, there's obviously lower gravity. To be able to jump to 20 feet normally, you'd have to decelerate much much slower. Conversely, once you reach the peak of your jump, you will accelerate towards the ground much slower. You will hit the ground at the same speed you left at (neglecting air resitance, which makes sense since with a lot of air resistance, it would be much harder to attain the same height).



      Since he can only jump 2 feet in the air, he is not able to push on the ground very hard. That is the maximum he can push against the ground. If he exerts the same force on the ground at a different level of gravity, he will decelerate much quicker and reach a speed of 0 slowly, giving him more time to rise in the air.

    11. Re:throw physics out the door... by CityZen · · Score: 1

      I totally agree. The "physics" problems in many games are often not really due to things being unrealistic, but rather to things being inconsistent. Game players don't have any problems with weird rules, just as long as they understand the rules.

      I think the biggest problem in most games has nothing to do with physics. It's usually because the "game" aspects of the game aren't so well thought out or developed. I think talking about physics in games is like talking about realism in movies. Making the movies more realistic doesn't automatically make them more interesting. Making them have better plot and better characters usually does.

      Of course there are many industry reasons why some games are bound to be boring and repetitive. Publishers prefer establishing a "brand" and making lots of sequels (can you say "Tomb Raider"?) rather than trying out new concepts (ie, risks). Developers usually have an excessively tight schedule, and don't have time to refine. They're forced to get something working and ship it as soon as possible.

    12. Re:throw physics out the door... by DrPascal · · Score: 1

      > but F=ma should still apply :)

      You do mean F=mv, no?

      --
      DrPascal: Not the language, the mathematician.
    13. Re:throw physics out the door... by bloggins02 · · Score: 1

      No, I mean F=ma. You know, Force equals mass times acceleration. Force does NOT equal mass times velocity. Perhaps you should read Principia Mathematica :)

  4. Physics in games by shd99004 · · Score: 2, Insightful

    I remember a good old game called "4D Stunts Driving" or something... That had a pretty interesting physic. Often it was sufficient to just bump into another car and you would go up in flames and millions of pieces. Or, if you reached high enough speed in the jumps, you could get such an angle, you would fly right into the athmosphere, and if you changed the camera POV, you could maybe see the car as a few pixels high in the sky. I think that, though, is part of the charm with this game. That, and the music :)

    --
    Will work for bandwidth
    1. Re:Physics in games by geekster · · Score: 1

      That and the fast racing car, get it up to maximum speed and it just wouldn't slow down again.

    2. Re:Physics in games by shd99004 · · Score: 1

      yep, that's another funny characteristics of that game!

      --
      Will work for bandwidth
    3. Re:Physics in games by Tycho · · Score: 1

      Reminds me of Driver. Apparently if one car in a collision lands on top of the other, it will fly up with much more kinetic energy than the two car system had before. Once when I was playing a car managed to land on the hood of another car and bounced what would have been 100 feet into the air then to top it off it landed on the hood of a second car and flew what would have been even farther and higher, assuming that the game had not ended before it started to lose altitude. I do not think that the gravity was particularly low on Driver, but when one car lands on the hood of another there will certainly be some flying going on.

      --
      Impersonating Tycho from Penny Arcade since before there was a PA.
  5. How about "extreme game programming"? by YouAreFatMan · · Score: 3, Insightful
    One idea might be to pair up a design-minded developer with a science-minded programmer. Kind of the right-brain/left-brain thing. Not that there isn't overlap, but usually someone is better at one than the other. And even if someone has both good design and scientific skills, it is hard to practice them at the same time. I know I have to take time to "switch" modes when going from creative stuff to more technical stuff.

    So pair up a couple of guys. One to worry about the artistic design, and another to worry about realistic physics.

    --
    Robotiq.com is heavily tested on animals
    1. Re:How about "extreme game programming"? by scott1853 · · Score: 2

      I remember reading a couple years back that some game developer hired an actual physicist to help develop their Golf game. I can't for the life of me remember what company it was though.

      I'm with you on switching modes between creative stuff and technical though. Although I guess it depends on what you're doing. If all you're doing is coding, then since that's all logic, physics should fit right in there with it.

      My biggest problem is switching between programming and graphic design. Oh the headaches.

    2. Re:How about "extreme game programming"? by Mr.+Quick · · Score: 1

      this is a great idea... we implemented XP for our site design... although using J2EE, there is a separatation between presentation layer and logic layer, it turned out that the design of the site worked better when a "holistic" approach was taken... one java developer and one design pro

      of course explaining j2ee methodology to artsies was an exercise in patience... hahah ;)

    3. Re:How about "extreme game programming"? by _Ash_ · · Score: 2, Insightful

      This is already going on between companies. For instance, think about John Carmack. He writes 3D engines and produces games with them. However, his last effort, Quake 3 is a bit mediocre. But after a few months games come out that are a lot better which use the Q3 engine.
      Actually, Half-Life is based upon the Q2 engine and is a lot better than Quake 2 itself.

      Maybe John Carmack should just focus on building 3D engines which game developers could than use to produce brilliant games.

    4. Re:How about "extreme game programming"? by Tim+C · · Score: 2

      If all you're doing is coding, then since that's all logic, physics should fit right in there with it.

      Indeed it does. I am a senior programmer currently working at a web agency, but have no formal programming qualifications. My degree is in Physics and, while I did take some programming modules during the course of it, all of these stressed the numerical/physical aspects above the coding ones. In fact, the only language I have ever been taught is Fortran; I taught myself C, C++ and Java. (and BASIC, a smattering of assembler, perl, etc, of course)

      I can imagine that it would be just as easy for a CS graduate to pick up at least basic Physics on their own. There isn't really anything that tricky in the sort of mechanics that would be required for most games (fluid dynamics not withstanding, but I have yet to see really realistic water in a game anyway :-) ), and the maths is pretty straightforward too.

      Cheers,

      Tim

    5. Re:How about "extreme game programming"? by Happy+Monkey · · Score: 2

      Maybe John Carmack should just focus on building 3D engines which game developers could than use to produce brilliant games.

      Isn't this what he does? He also has a quick&dirty design team to make a bare-bones engine demo (The Quake series) which is also fun.

      --
      __
      Do ya feel happy-go-lucky, punk?
    6. Re:How about "extreme game programming"? by Banjonardo · · Score: 1
      extreme game series: critically aclaimed to be the worst game series of all times. Some games are extreme paintball, extreme mountain biking and extreme rodeo. I swear, I've never seen them get more than a 30% on a review.

      Go to IGN and look it up. You'll laugh your head off.

      --

      -----

      Score 3? For what? Being wrong, at length? - smirkleton

    7. Re:How about "extreme game programming"? by jmischel · · Score: 1

      I was on the team that created Jack Nicklaus Golf 4 for Accolade. When the game was released in the fall of 1996, it had the most realistic physics of any golf simulation. That physics engine lasted through Jack 5 and Jack 6--perhaps longer...I haven't kept up with the game.

      Our physics guy wasn't a physicist, but rather an engineer with a very strong physics and math background. He spent months studying the physics of golf and building a simulation system to test it long before we had a game that he could plug it into. Creating the physics for that game was quite an education for him, and for me because we'd talk about the issues that come up. As somebody else in this thread mentioned, the equations get you most of the way there, but the computer simulation is working in discrete time steps, and the equations break down at some point. Then you have to fudge it.

      If all you're doing is coding, then since that's all logic, physics should fit right in there with it.

      In my experience, it takes a very good programmer to understand and simulate a physical system. Most programmers try to fudge it from the start rather than apply the physical equations. The result is typically very convoluted code with lots of exceptions and an unrealistic system. There's a huge difference between implementation logic (programming) and a consistent and logical overall systems design.

    8. Re:How about "extreme game programming"? by scott1853 · · Score: 2

      The problem with any programmer "fudging" a system from the start is probably comes from knowing that you have to fudge something, and they just aren't sure what to fudge during the design process. I'm sure a programmer that worked on several projects involving physics engines would get better over time just because they'd learn from their mistakes. But this is the same in any area of development, not just games and physics engines. The same could be said of database engines. It all comes down to effeciently managing the resources of the computer. Once they learn the key variables that can't be fudged, they can plan on what can be fudged for performance/time constraints.

      I still maintain that any programmer can understand physics and program the appropriate formulas into a computer. That was my main point anyways, not they'd do it perfectly on the first try, but that both programming and physics share some common mental processing traits that would allow a master of one to easily understand the other.

      Just curious, what was your position on the team?

  6. Physics isn't everything by alen · · Score: 3, Insightful

    Some people aren't into super realistic physics. Some don't want to read a 300 page manual for a flight sim and spend weeks figuring out the flight model. They would rather just grab a joystick and start playing like in Wing Commander.

    1. Re:Physics isn't everything by arkanes · · Score: 4, Interesting

      The space sim Terminus is great in this regard - when you start the game, you can select the level of reality in your physics - anywhere from (almost) 0, to full Newtonian. So if you just wanna blow stuff up, go for 0, and if you want to have to worry about carefully calculating your path so you take maximum advantage of gravity and don't waste fuel on course adjustments, you take full. Great stuff. I reccomend the game, BTW, fantastic gameplay even if the graphics lack by todays standards.

    2. Re:Physics isn't everything by foobar104 · · Score: 2

      Some people aren't into super realistic physics. Some don't want to read a 300 page manual for a flight sim and spend weeks figuring out the flight model. They would rather just grab a joystick and start playing like in Wing Commander.

      Whether the physics model is realistic or not, every game has to have one. Even if you choose to calculate position, motion, and reaction and stuff in a way very different from the one that applies to the real world, you have to calculate those things somehow.

      That's the point of this book.

    3. Re:Physics isn't everything by Anonymous Coward · · Score: 0

      The book isn't titled "Physics for the Game user". The book is about making games comply to real world physics. The user shouldn't have to understand shit.

      That being said, I'd like to see a real vessel (like in Wing Commander) accelerate to 400kps (kilometers per second) in 4 seconds, and not mash the pilot to a bloody pulp.

    4. Re:Physics isn't everything by oddjob · · Score: 1

      I also enjoy Terminus, but I think it is an example of acurate physics being detrimental to game play. The problem is that in combat under full Newtonian physics, there is no way to gain a positional advantage on an opponent. They can always rotate their ship faster than you can re-position yours, so there's no sense moving your ship a particular direction -- just move at random to be harder to hit -- then point and shoot. Any time spent with your guns pointed away from the target so you can manuver is a waste, which makes combat pretty boring. With Wing Commander, the physics are not at all realistic, but they force more varied tactics, which makes combat much more interesting.

    5. Re:Physics isn't everything by arkanes · · Score: 1

      Well, thats a pretty realistic simulation of space combat :p Incidently, you CAN maneuver even if you're facing a different direction - just turn off the inertial compensators.

  7. A better book to read for Game Physics... by FortKnox · · Score: 3, Insightful

    Its called "Physics for Scientists and Engineers".

    Lets face it, the best physics is REAL physics.

    If you want your game to have good physics, then slap a good physics engine (based on real formulae) into it!

    --
    Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
    1. Re:A better book to read for Game Physics... by ChazeFroy · · Score: 2

      Physics for Scientists and Engineers, 5th edition.
      ISBN: 0030317169
      Price: $143.00

    2. Re:A better book to read for Game Physics... by Anonymous Coward · · Score: 0

      Geez, when I was in school, we were on the 3rd edition (or was it 2nd?). Now I feel old.

      But it was a great physics book!

      -FK

    3. Re:A better book to read for Game Physics... by whatnotever · · Score: 2, Insightful

      You can't use real physics. Real physics lives in the continuous time domain, with differential equations and such. Games, on the other hand, live in a strange land of discrete, variable-sized time-steps. You can't just throw your differential equation at it and say "Be realistic!"

      Sure, the formulas used are *based* on the regular "scientist" formulas, but they *have* to be approximations. The book tells you how to use do those approximations.

      If you give a coder a standard physics textbook and tell him to code a physics engine, he'll either implode or spend ages working out numerical methods for approximating real physics... exactly what is in this book.

    4. Re:A better book to read for Game Physics... by Imabug · · Score: 2

      Numerical Recipies I think would also be a good addition to a game programmer's library wanting to introduce more realistic physics. It covers a good deal of numerical computing algorithms from integration to simulation.

      Physics texts cover the physics behind the action, but a book like Numerical Recipies goes over the implementation and would be a very good complementary book.

      The other thing to keep in mind is that the more accurate the physics gets, the more computationally intensive the game becomes, so a game may not be able to achieve those 150 fps everybody seems to want when doing accurate physics simulations.

      --
      "For I am a Bear of Very Little Brain, and Long Words Bother Me"
    5. Re:A better book to read for Game Physics... by gowen · · Score: 2
      Numerical Recipies
      The trouble with that is I'll either have to by another copy of the book or code my first-person-shooter in FORTRAN...
      --
      Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
    6. Re:A better book to read for Game Physics... by Imabug · · Score: 2


      Numerical Recipes in C : The Art of Scientific Computing

      Comes in a variety of flavours including C++ and Fortran.

      --
      "For I am a Bear of Very Little Brain, and Long Words Bother Me"
    7. Re:A better book to read for Game Physics... by Anonymous Coward · · Score: 0

      I happen to have both of these books on my shelf and, to be honest, Numeric Recipies is overkill. It's more geared for real scientific computing.

      On the other hand, Bourg's book is designed specifically for games and applications in which such scientific accuracy is unecessary. In fact, Bourg spends some time talking about throwing away minor forces and effects for the sake of performance. For example, in the first chapter, he talks about certain cases when you can 'fudge' the moment of inertia because one of the terms dominates the other.

      It's good, practical knowledge.

    8. Re:A better book to read for Game Physics... by eMilkshake · · Score: 1

      Hello! Get it in paperback for $22.95.

    9. Re:A better book to read for Game Physics... by yatest5 · · Score: 2, Funny

      Yeah, let's have real physics! Your in-game character will be a 23-stone sweaty short-sighted nerd and the first time he falls off a platform the forces exerted on his body will destroy his spine in the game, so you'll only be able to die once in your game, ever.

      --
      • Mod parent up! [a] by Anonymous Coward (Score:5) Thurs, June 31, @13:37
    10. Re:A better book to read for Game Physics... by Anonymous Coward · · Score: 0

      You can take any symbolic differential equation and solve it numerically. So what's the deal ?

    11. Re:A better book to read for Game Physics... by Woodmeister · · Score: 1
      Ah yes. The book a few of us undergrads used to refer to as "The bible". I own a 3rd edition copy from 1993.

      If there is a book where almost all physical concepts are covered with a good dose of calculus treatment, this is it.

      --

      Quando Omni Flunkus Moritati
      -Possum Lodge Motto
    12. Re:A better book to read for Game Physics... by Anonymous Coward · · Score: 0

      Ah yes. The book a few of us undergrads used to refer to as "The bible".
      Hey, everybody knows the bible is the K&R C book. Or was that that the Dragon compiler book? Maybe Foley & vamDam?

    13. Re:A better book to read for Game Physics... by Anonymous Coward · · Score: 0

      You, sir, have obviously never had any expericence with physics or math above calculus, or else you would know how simple it is to do approximations.

    14. Re:A better book to read for Game Physics... by GuavaBerry · · Score: 1

      If you want your game to have good physics, then slap a good physics engine (based on real formulae) into it!

      Trolls are the quickest to get scores of 3, aren't they?

      Mind you, the other consideration besides accuracy is performance. Modern computers can only do complex math by either look-up tables or doing the calculations 'by hand' with a Riemann Sum/Taylor series, which can hog memory and CPU time. Neither is a problem with programs that don't need to finish with any hurry (Matlab, Mathematica), but is a severe problem with a videogame meant to provide quick responses to user input.

      Graphics programmers achieve realism using researched shortcuts like the ones mentioned in the book. Hell, they don't even use the textbook formulae for rasterizing basic geometric shapes (not even lines and circles. Google for "Bresenham" and "Circle" and you'll see what I mean). So let's not get snippy and clamp down on game programmers for not using "Pure" physics. I mean, c'mon. Video games.

    15. Re:A better book to read for Game Physics... by Anonymous Coward · · Score: 0

      Hello! That's the "Pocket Guide to Accompany Physics for Scientists and Engineers" -- I know you can't judge a book by its cover, but still...

    16. Re:A better book to read for Game Physics... by Anonymous Coward · · Score: 0

      Since this book seems to cover only mechanics, I sugest you to read Goldstein's Classical Mechanics,or Landau's Mechanics.

      They cover almost all an undergrad wants to know on the subject.

      Complement them with any book an numerical analysis and you know a lot more than this game book has to offer.

    17. Re:A better book to read for Game Physics... by Nehemiah+S. · · Score: 2

      Or just compile the physics code as a fortran library and link it. You'll probably gain 25-50% in execution speed as well, since fortran is much better suited to numerical programming.

      neh

      --
      ... and there is no doubt, that one day he will be
      where the eye of his telescope has already been
  8. Carmageddon by Professeur+Shadoko · · Score: 1

    IMHO the game has good physics, if you don't count the car handling himself (who sucks, really)

    1. Re:Carmageddon by British · · Score: 2

      I just started playing Camageddon 3 TDR again(with the cheats ON sice I wanted to try out the missions), and I didn't observe until now, but your car falls in slow motion, ALL THE TIME. heh. Still,, fun game.

    2. Re:Carmageddon by simetra · · Score: 1

      Carmageddon is great. The physics are real enough (i.e., if you fall really far, you get hurt). Plus, there are some fun powerups, like helium-filled zombies, which tweak the physics aspect as well, or Gravity From Jupiter, which makes your car very heavy. This is all on the pc version, I don't know (or care) about console version.

      --

      "Would it kill you to put down the toilet seat?" -- Maya Angelou
    3. Re:Carmageddon by Anonymous Coward · · Score: 0

      The best powerup of them all was, of course:

      SOLID GRATNITE CAR!

      Man. Nothing like hitting a backhoe at 100+ MPH with your mass boosted to 20 tons. In case you haven't had the chance, it hurtles through the air for five or six blocks and then bounces off of highrises like a pinball for a while, 20 stories or so up.

      Carmageddon (the first one) has great _game_ physics.

    4. Re:Carmageddon by GigsVT · · Score: 2

      Carma 2 had fun physics on the PC too.

      The N64 version sucked, bad, as far as physics. That is what the original poster was complaining about.

      --
      I've had enough abrasive sigs. Kittens are cute and fuzzy.
    5. Re:Carmageddon by oflanigan · · Score: 1

      The physics in the original PC game were absolutely dreamlike, but in the sequel they were worthlessly mundane. Let's remember that "good physics" does not necessarily mean "realistic physics".

  9. Don't need to be that exact by joshv · · Score: 2, Insightful

    I really doubt that your method of numeric integration is going to be that critical an influence on the quality of game play. In fact I think that you ability to simulate physics without really doing the math would be more important. I doubt anyone is going to be timing a car's drop off of a cliff in Carmegeddon to determine what gravitational constant is used in the game.

    I think it is more important to include as many effects as you can: gravity, linear momentum, angular momentum, elastic/inelastic collisions, friction (surface and wind), than it is to model the effects perfectly.

    In fact one could argue that it is to the game designer's benefit to use an innaccurate and exaggerated physics model. Most real world collisons with the guard rail on a race course are relatively unspectacular (by design) - but that would be oh so boring in a racing game now wouldn't it?

    -josh

    1. Re:Don't need to be that exact by FortKnox · · Score: 1

      You bring up one extremely important point.

      Games need to be fun.

      Lets look at Revolt and Carmaggedon again. Carmaggedon is a more popular game. Not because of the physics engine, but because it was a more fun game.

      With that in mind, its best to decide if physics is important to the game. For stuff like flight sims, yeah, good physics. For stuff like Doom.... not really.

      --
      Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
    2. Re:Don't need to be that exact by MrFredBloggs · · Score: 1

      Too much realism is boring...thats why we play games.

      When did you last see a film that conformed to reality? I dont think i`ve ever seen any sort of stunt - from cars flying off roofs to something as simple as a guy jumping forward and shooting a gun - without it actually involving a number of cuts/edits; ie the guy jumps forwards, you see him coming down again - suddenly it cuts to another camera and hes now moving down *and forward*.
      It doesnt matter! The problem with games isnt that they are unrealistic (!), its that most of them are *me too* games.

    3. Re:Don't need to be that exact by foobar104 · · Score: 2

      I really doubt that your method of numeric integration is going to be that critical an influence on the quality of game play.

      If your game lacks a good physics model, players are going to find that it "feels funny." They don't mean that it isn't realistic, rather they mean that your game isn't consistent.

      People are incredibly good at figuring out their environment, even if it's a different environment from the one they grew up in. But if the environment isn't consistent (read, "the math is isn't very good") you can tell intuitively.

      That's why a good physics model is important.

    4. Re:Don't need to be that exact by skoda · · Score: 5, Insightful

      There's a difference between "unrealistic" and "unstable".

      Unrealistic suggests that it doesn't behave as in the real world -- but that doesn't mean it isn't modeled on the same principles (acceleration, momentum, etc.) And you still want to simulate it consistently; it should "feel" right.

      But an unstable computation method can "blow up", regardless of realistic or unrealistic "physics."

      Consider:
      Jump pads in games like Quake or Unreal are "unrealistic". But they are modeled at least partially on physics. But to make them work right, in all their unrealistic glory, the computation method must be stable.

      If it wasn't stable, then you might something like:
      - Multiple, successive jumps on one would lead to a "blow up" where the player would be wildly, and unexpectedly shot through the roof and to the outer edge of the game universe.

      For both realistic and cartoon physics, you need accurate and stable computation methods.

    5. Re:Don't need to be that exact by Warvi · · Score: 1

      I think it is more important to include as many effects as you can: gravity, linear momentum, angular momentum, elastic/inelastic collisions, friction (surface and wind), than it is to model the effects perfectly.

      And books like this tell you how to implement them (and how to do it right). If you implement a physics engine, you can do a (semi)realistic one. It doesn't take that much more time to do it right. Even more people (me maybe) would have bought carmageddon if it had felt just a little bit more like driving a real car.

      --


      Consistency is overrated.
    6. Re:Don't need to be that exact by koogydelbbog · · Score: 1

      -josh
      >Most real world collisons with the guard rail on
      >a race course are relatively unspectacular (by
      >design) - but that would be oh so boring in a
      >racing game now wouldn't it?

      the thing i hated about Gran Tourismo 3 was the collisions, the cars hit the barriers like a wet fish and neither the cars or the piles of tyres moved an inch. pah. give me Driver any day 8)

      andy

    7. Re:Don't need to be that exact by Forkenhoppen · · Score: 1

      Down at iD, new Doom division:

      Carmack: *looks up from his computer, where he's reading Slashdot* Whew! Okay guys, we won't need that guy we hired to do physics. Looks like they won't care.

      Stephen Hawking: *rolling out of the back room* Damn.. you.. Slashdot..

    8. Re:Don't need to be that exact by AndyofHartford · · Score: 1

      Jackie Chan

    9. Re:Don't need to be that exact by Gary+Yngve · · Score: 2, Informative

      No, the integration scheme is *very* important.
      My background is in physically based modeling
      in computer animation, so here is what I know:

      The integration scheme can have such a strong
      influence on the stability of the system that
      it can mean going from an integration timestep
      of a microsecond to a hundredth of a second.
      That's a speedup of 10,000. Generally, the
      finer the spatial resolution of you simulation
      (how fine your cloth mesh or fluid volume is),
      the faster a timestep you need.

      The brief description of the book cites the
      Runga-Kutta method as a preferred technique
      over basic Euler integration. The former
      is a fourth-order method, the latter a
      first-order method. Three orders of magnitude
      is nothing to laugh at.

      The big breakthrough in cloth deformations came
      because Witkin and Kass figured out how to
      simulate cloth with a large timestep (they use
      implicit integration techniques). Jos Stam
      did some nice work with real-time fluids that
      relied on a semi-Lagrangian integration scheme
      with a vorticity term to undo the artifical dissipation caused by the coarse numerical
      simulation.

    10. Re:Don't need to be that exact by Anonymous Coward · · Score: 0


      Three orders of magnitude is nothing to laugh at.


      "Fourth Order" refers to the truncation error exponent, not to the order of magnitude of error. Explicit (Forward) Euler is O(dt). The error arising from the integration approximation is some constant times the size of the timestep. If you half the timestep, you will half the error. The 4th-Order RK scheme has a truncation error of O(dt^4). Half the timestep and you reduce the error by a factor of 16.

      Stability of the scheme is related but not synomous with accuracy. As you point out, implicit schemes are sometimes needed to allow reasonably large timesteps depending on the stiffness of the underlying physics.

      Sorry for picking nits.

    11. Re:Don't need to be that exact by Anonymous Coward · · Score: 0

      Camageddon was more popular because it had a) gore and b) better marketing. I got them both at the same time and I think I played Camageddon like three times. I played Re-Volt till 4am for weeks.

      If you'd ever played Re-Volt, you probably wouldn't be claiming Carmageedon was "more fun".

    12. Re:Don't need to be that exact by Gary+Yngve · · Score: 1

      Yeah, you're right... got caught being a little
      too laymanish. So allow me to nitpick:

      Technically, an nth order method means that
      locally the error is a (n+1)-degree polynomial.
      Global error depends on convergence and stability;
      it's even possible for performance to get worse
      by doubling the timestep.

    13. Re:Don't need to be that exact by Daengbo · · Score: 0

      Yeah, you've got to respect an aging actor that STILL does all his own stunts!

  10. Great... by ackthpt · · Score: 1
    I've been lugging my college physics book (Fundamentals of Physics, 3rd Edition, Halliday and Resnick) around for the last week attempting to reassemble my knowledge of physics for my own take on Scorch. Of course both books offer what I need, however college textbooks without the notes (I swear I still have them somewhare) are often difficult to use, as there are gaps, which the lecture usually fills in, which this handy book _should_ cover, thus saving me from reassembling the few equations I'll need.

    OTTOH, I'll either need or just make up constants for elasticity, friction, etc., which I used to do to accomdate display restrictions, like on a VT52 or a 600x400 screen. Adapting real math often produces bizarre simulated behavior on the small screen, so fudging is often called for.

    --

    A feeling of having made the same mistake before: Deja Foobar
    1. Re:Great... by superflex · · Score: 2, Informative
      holy crap.. everybody uses Halliday & Resnick (& Walker, too, I think)... :) I used the 5th edition a couple of years ago, and I know people who are using the 6th now... those guys must be so crazy rich...

      In the summer i took a numerical methods course using "Introduction to Numerical Methods and MATLAB: Implementations and Applications" by Recktenwald. If you can use procedural languages, you can read/write Matlab scripts. I'd give the link to the course website, but the prof changes the password every term; it's a damn shame, too. He's a fellow of the IEEE, really smart guy. Had good course notes.

      --
      sigs are for suckers
  11. Animation and the Cartoon Laws of Physic by Anonymous Coward · · Score: 0

    Better check out the Cartoon Laws of Physics. It always amazed me how Chuck Jones and Max Fleischer had such an instinctive, albeit exaggerated, understanding of the laws of physics in their cartoons. You can't be a good animator (or game designer) without understanding of the Cartoon Laws of Physics.

  12. In defense of Carmageddon... by HaveBlue · · Score: 1

    The PC versions of the Carmageddon games (the console versions came out later) have superb physics. It's fun just to explore the course in search of ramps and hills to jump off of. If I remember the game notes correctly, the development team for the first game included someone with a Phd in physics. Heck, the engine for the second game even allowed for magnetism, but the feature never got enabled in the released version (there was a big electromagnet on a crane in the junkyard that you would have been able to drive under and get stuck to - the video that the dev team released looked fantastic). But at any rate, I must agree with the fact that good physics can make or break a game.

    1. Re:In defense of Carmageddon... by Pfhreakaz0id · · Score: 2

      Yeah, the technology wasn't always realistic (how exactly did the balls of flame track down and chase the pedestrians -- I mean zombies) but it was a CONSISTENT model.

      I loved pondering... "OK, so I need to get the speed up powerup and hit this ramp at such a speed at this angle to bounce off the wall of the building and fly JUST over the tower to get that platinum power up and land on the building over there."

    2. Re:In defense of Carmageddon... by Gehenna_Gehenna · · Score: 1

      Nothing against carmaggeddon, which is an enjoyable game in it's own right, but if we talk about physics and cars in video games we msut speak on Gran Turimo 3. Superb control , superb physics, superb graphics. GT# is a great example of how realistsic physics can be well incorprated into a game and still keep it fun.

      --

    3. Re:In defense of Carmageddon... by HobNob · · Score: 1

      Yep - I actually know the guy who did the physics for Carmageddon 1 & 2 (at least the PC version) - I shared a house with him at university. He was a damn good programmer, had an Acorn Archimedes IIRC. He has a Ph.D, though in lasers, not mechanics.

      I strongly suspect that Carmaggedon's physics model can be traced back to a programming project on car suspension modelling in Imperial College's 1st year physics lab.

  13. Greatest game of all time... by Iamthefallen · · Score: 2, Funny
    If you can take away all the flashy graphics, texture maps, light and shadows from a game, and it's still at least 75% as playable and addictive, then you have an excellent game.

    Is it just me, or does that describe Pong perfectly?

    Note: Greatest game of all time referes to the classic version, 2 controls, 1 console, 1 tv, 1 wasted childhood.

    --
    Wax-Museum Fire Results In Hundreds Of New Danny DeVito Statues
    1. Re:Greatest game of all time... by Anonymous Coward · · Score: 0

      I'm too young to have played that. I think it got out in 1974, right?

    2. Re:Greatest game of all time... by Iamthefallen · · Score: 1

      According to this page it was 1972 :-)

      --
      Wax-Museum Fire Results In Hundreds Of New Danny DeVito Statues
    3. Re:Greatest game of all time... by Daengbo · · Score: 0

      Or, even still addicting (to me): the original arcade version of Space Wars. Man I dropped my entire allowance into that game the moment I got it for years.

    4. Re:Greatest game of all time... by esonik · · Score: 1

      The most stripped down version - or the most advanced - depending how you see it, is probably this one.

  14. on numerical integatration in programming.. by Andreas(R) · · Score: 0, Informative

    It was actually pretty interesting to see how this aricle mentions that numerical integration is done in computer games by means of Eulers method. But: Good old Euler is slow and inaccurate!

    Simpsons method is more accurate method to integrate, since it creates a exponential polynome that more accurately represents the function. The method follows:

    S(n) = dX/3(y(0)+4y(1)+2y(2)+4y(3)+ ... + y(n))

    Use this in your gameengine the next time, and impress!

    1. Re:on numerical integatration in programming.. by boltar · · Score: 0

      I'd love to ... if you'd care to mention what
      the variables in your equation actually stand for.

    2. Re:on numerical integatration in programming.. by Gary+Yngve · · Score: 2, Informative

      It amazes me how people can drool through a
      calculus course and then proclaim themselves
      experts on slashdot.

      First of all, Simpson's method does not
      create an "exponential polynome." It models
      a curve locally as a parabola.

      Second, this method is useless in many situations
      where one integrates over time. Simpson's rule
      is designed to find the area under a curve.
      Yes, distance is just area under a velocity
      curve, but you are not given the velocities
      a priori. You have to solve for them on the
      spot, and even worse, velocities can be
      influenced by the current position. In fluids
      and soft-body deformations, things can get
      even uglier. Some of the better methods for
      numerically integrating through time involve
      estimating the next values in time and solving a
      system of equations using old and new values to
      get a more accurate result (very hand-wavy explanation).

    3. Re:on numerical integatration in programming.. by Anonymous Coward · · Score: 0

      Simpson: Integrate a function over an interval.

      Euler, Runge-kutta et al: Integrate (read find an aproximate solution) to a differential equation with initial value conditions.

      Almost apples to pears.

  15. Well... by Anonymous Coward · · Score: 1
    "In my opinion, the most difficult aspect of writing a good 3D game is coding complex physics."


    This beleif is why CompUSA is filled with games that suck. This is because, quite simply, the most difficult aspect of writing a good 3D game is NOT coding, it's coming up with a good idea and having good artists and map makers so that the game is worth playing in the first place. This is why the PSX and Game Boys are still popular, even though they have "primitive" graphics.

  16. Grand Prix Legends by Anonymous Coward · · Score: 2, Interesting

    The game may be three years old, with (originally) dodgy graphics, but it had the best car physics engine of any PC driving game. You could actually get a feeling for what the car was doing, how it was sliding etc, and in a '67 F1 car, which slides a lot, that was a big help.
    It's still one of the most popular games in the driving sim community, with new mods and graphics appearing almost daily, but in the end it's the physics that draws people in. Yah it's hard to drive, but it should be hard to drive, and once you learn it, you'll never look back.

    1. Re:Grand Prix Legends by Mr+Thinly+Sliced · · Score: 1

      They really went to town on the physics didn't they.
      They even went so far as to model the rotational momentum of the engine/prop shaft correctly, so when braking engine speed had to be taken into account too.
      In an interview with the developers, they mentioned that this extreme realism was, they feel, one of the reasons why it didn't sell like hot cakes.

      It was too hard for people

    2. Re:Grand Prix Legends by Spacecase · · Score: 2, Informative

      Papyrus used the GPL (Grand Prix Legends) engine in thier newer Nascar 4 racing game. The physics engine is even more refined, and the game takes into account the heat of the tires and the aerodynamics of cars being close to you. All in all it is a very good simulation of a car going in circles at 190+ MPH. As machines get faster and faster more and more of the "static" or aproximated calculations will be replaced by "real" calculations in real time. This will allow games (especially ones that use well known physics, like cars and planes) to be modeled extremly closely. If Intel and AMD are right, and we will be seeing 15+ gHz computers by 2006, I can only imagine how realistic a quad processor 15 gHz machine would be able to simulate a race car. Heck you might even need an airbag on your computer ;)

      Spacecase

  17. i just bought this book online.... by Mr.+Quick · · Score: 3, Informative

    ..although i picked the cheapest form of delivery so it won't be here for a bit more time...

    i read thru the sample chapter [here] it's all about particle physics. i was quite impressive, i enjoy the *conversational* style that most o'reilly books have.

    i implemented all of the examples in java using java3d.

    i hope the book meets my expectations....

  18. Producing position from LatG, LongG, and FwdV by DG · · Score: 2

    Maybe this book has an answer to a question that's been on my back burner for a while, and for which I've been unable to find a good answer for while surfing.

    Suppose you have a device that records lateral acceleration, longnitudnal acceleration, and forward velocity, with 100 samples per second, and stores them in a text file, one sample per line, one value per column.

    Given the file parsing routine is a gimme and thus provided the values for elapsed_time, LatG, LongG, and FwdV, produce a function that will return the current X and Y co-ordinates of the vehicle, so that its ground track can be represented in a diagram.

    Anybody got any good sources of information (or better yet, an existing library) for how to do this?

    No, this is not an exam question. ;)

    DG

    --
    Want to learn about race cars? Read my Book
    1. Re:Producing position from LatG, LongG, and FwdV by SamBeckett · · Score: 1

      You can only do a position function if you know the initial position. The rest is easy-- just use the numerical integration techniques the book talks about. It's simple calculus.

    2. Re:Producing position from LatG, LongG, and FwdV by DG · · Score: 2

      Hrm, m/"Calculus" and "simple"/"oxymoron"/ for some people, including me.

      My attempts at reproducing this from my old numerical methods textbook produced unrecognisable squiggles

      Assume the start position is the origin. Can you post (or link to) example code?

      .

      --
      Want to learn about race cars? Read my Book
    3. Re:Producing position from LatG, LongG, and FwdV by ackthpt · · Score: 1

      Ever tried this with polar math? I'm considering doing something this way and wonder if I'm off my rocker.

      --

      A feeling of having made the same mistake before: Deja Foobar
    4. Re:Producing position from LatG, LongG, and FwdV by interiot · · Score: 2

      There's a variant of that problem used for weapons systems and such... If you combine an intertial sensor with GPS, you get a very accurate version of GPS, without the accumulated integration error. Here's a random link to an intertial GPS system. The algorithm is somewhat laid out on page 5, but you may be able to find more by looking into this topic.

    5. Re:Producing position from LatG, LongG, and FwdV by SamBeckett · · Score: 1

      I tried posting sample code, but the lameass lameness filter caught it. Anywho, Calculus is easy. Here is a quick and dirty tutorial:

      If you have a polynomial in x, f(x) = a_0 + a_1 x + a_2 x^2 + ..., then

      The integral of f(x), F(x) is
      a_0 x + (a_1 / 2) x^2 + (a_2 / 3) x^3 + ...

      The derivative of f(x), f'(x) is
      2 a_1 x + 3 a_2 x^2 + 4 a_3 x^3 + ...

      Using this, you can translate that into psuedo code or whatever.. Just remember...

      If your acceleration is a(t), your velocity is v(t) = Integral of a(t) plus your initial veloctiy, your position s(t) = Integral of v(t) plus your initial position.

    6. Re:Producing position from LatG, LongG, and FwdV by AJWM · · Score: 2

      Remember, d = 1/2 a * t^2 (plus v * t given an initial nonzero v, plus whatever d you start with). However, you don't define "forward velocity" -- is that longitudinal velocity or the vector sum of long and lat velocity? The latter makes most sense, but then you have to specify the direction vector as well as the speed, and work backwards from that (sin and cos) to get the lat and long components of the forward velocity.

      For a crude approximation just take the instantaneous LatG and LongG for your 'a' values, for a better approximation average the current and previous values. This ought to be "good enough" for reasonably low values of jolt (rate of change of acceleration).

      --
      -- Alastair
  19. Who needs physics.... by Wells2k · · Score: 1

    ...when you can turn on the "Winds of Space"

    --Steven Levy fans will understand...

  20. Decision Making by 3141 · · Score: 2, Interesting

    I agree, in some games, realistic physics can make a big difference. I remember when I first played Super Mario Bros. 1 on the NES, seeing how the fireball bounces along in a straight line until it gets to a hole, and actually falls down, I was rather impressed. (Small things, small minds, whatever. I liked it.)

    However, in modern 3D-type games, it's important to pick and choose where you spend your time coding in the physics. In a racing game, it's a lot more important to spend time making sure the cars handle correctly than how realistically the trees sway in the background.

    Unfortunately, there just isn't the time to make everything about the game perfect, and it's sad to see when a program has missed it's spot because of delays in implementing useless features.

    1. Re:Decision Making by onion2k · · Score: 2

      In a racing game, it's a lot more important to spend time making sure the cars handle correctly than how realistically the trees sway in the background

      In my new game the exact opposite is true.. I really hope Ultra Mega Pine Sim is a success..

  21. Not just for games by iiii · · Score: 0

    I'm not a game programmer, but my current project is a simulation with lots of trajectories, global coordinates, points of view, and interactions. This sounds like the perfect reference for what I've been doing. It's going on the xmas list. I only wish the reviewer had told us what language the examples are in.

    --
    Light cup, beer drink, thin so chain, neck turtle fat, man I won't say it again
    1. Re:Not just for games by Anonymous Coward · · Score: 0

      I think the example are all in C or simple C++. What else are you gonna use? FORTRAN?

      Seriously...I just spent the weekend digging through 45,000 lines of Fortran. Sucks, but at least it pays well.

  22. more fun blowiung up stuff with accurate physics by thex23 · · Score: 3, Interesting
    Realistic physics? Yes, please!

    I want a FPS that lets you blow holes in walls, accurately representing physical damage from weapons. Imagine Counter-Strike with realistic bullet physics: ricochets, windage, and weapon recoil that isn't predefined.

    Hacking physics though, now that's a job and a half: figuring out a quick and dirty method of approximating the complexities of the real-world, and still have it look natural, making it look like a real environment filled with objects that have familiar properties and behaviours. And then blowing them up, REAL GOOD.

  23. Richard Jones? by Anonymous Coward · · Score: 0

    Wasn't Dick Jones shot out a window by RoboCop?

    Damn, that guy's tough if he's still able to write book reviews.

  24. Halo - worst physics I've ever seen by Anonymous Coward · · Score: 0

    Is it only me, or Halo (on Xbox) has some of the worst physics engine I've EVER seen? (did you try driving the "jeep"? This thing handles like crap).

    1. Re:Halo - worst physics I've ever seen by boltar · · Score: 0

      Maybe you have to find a garage and get a mechanic to give it a service pack :)

    2. Re:Halo - worst physics I've ever seen by drsir · · Score: 1

      That's what I thought until someone pointed out to me that you steer with the right analog stick and control the speed(the more you push forward the faster it goes) with the left analog stick (or is the other way around?). Anyway, as soon as I tried this it steered perfectly.

    3. Re:Halo - worst physics I've ever seen by UnknownSoldier · · Score: 2

      > Is it only me, or Halo (on Xbox) has some of the worst physics engine I've EVER seen?

      It's just you. ;-)

      When you're in the jeep, look for the blue carat ^ in the middle of the screen. What makes the jeep so difficult to drive at first, is that arrow points to where your jeep will go, irregardless of where your wheels are pointed. If you grok that, handling the jeep is just 2nd nature.

      Cheers

  25. Looks interesting, but could be disappointing by akiaki007 · · Score: 1

    Well, while it covers an important topic which many look over, I don't think that it's going to teach me anything new.

    If you are at the stage where you are game programming, I would hope that you know the basics of Newtonian Physics. If you don't, then you didn't really do anything in college, or on your own (whichever way you were educated). In reality, you should have basic understanding of how things work, and be able to code this as well.

    You shouldn't be forced to read a book that tells you how to create physics models in your game world. I am hoping that this book does more than just implement the basic acceleration formulae.

    --
    "Time is long and life is short, so begin to live while you still can." -EV
  26. articles on physics & collition detection etc by acomj · · Score: 2
    check out gamasutra has a lot of feature articles on many aspects of game design. Dig around them, they are good to read and usfull. I think they require a registraction now to read the articles...

  27. Carmaggedon's physics by Telastyn · · Score: 1

    The game had wonderful physics, just not *realistic* physics. The wildly over the top game would've suffered quite a bit if it was limited by 'the real world'.

  28. Numerical Integration Methods by Ivan+Raikov · · Score: 1

    I believe one of the most accurate numerical integration methods is the famous LSODE (Livermore Solver for Ordinary Differential Equations), an implementation of which is available at http://www.netlib.org/odepack/.

    Another one is VODE, which is based on LSODE. http://citeseer.nj.nec.com/1230.html. I think both are more accurate than Runge-Kutta.

    1. Re:Numerical Integration Methods by Anonymous Coward · · Score: 0

      It may be "better" than Runge-Kutta, but the nice thing about techniques such as Runge-Kutta is that it is fast as well. I would guess a large number of the integration techniques in the ODEPACK package are designed not to be fast, but to be accurate. I'm so glad I took that numerical analysis course in high school...

    2. Re:Numerical Integration Methods by Ivan+Raikov · · Score: 1

      It may be "better" than Runge-Kutta, but the nice thing about techniques such as Runge-Kutta is that it is fast as well. I would guess a large number of the integration techniques in the ODEPACK package are designed not to be fast, but to be accurate.

      Well, okay, I was just thinking of accuracy, without realizing that some people may not have a bajillion MHz at their disposal... Of course, you have a tradeoff between speed and accuracy.

  29. or try a free one by bcrowell · · Score: 1

    Either pay $143, or try a free book here.

  30. Mmm. Dead. by JMZero · · Score: 1

    Dead reckoning like this produces bad results. Unless you have a laser gyro or something crazy. Any loss in angle measurement is going to compound fast (unless you take angles in some constant way, like via gps - in which case why are you dead reckoning). What sort of project are you doing? I'd make sure you don't have some other way of finding position.

    --
    Let's not stir that bag of worms...
    1. Re:Mmm. Dead. by DG · · Score: 2

      I agree with you on the ever-compounding inaccuracy of dead-reckoning.

      The good news is that I only have to do it for 30-60 second stretches.

      I've also heard that one can correct somehow the wander/error from the integrated acceleration values by examining the forward speed value (which is produced by a separate sensor) - ie, work out the velocity from the accelerometers, and then compare the magnitude to the forward speed sensor, and correct the ground track from that. I haven't a clue on how that works, but I've seen evidence that it can be done.

      As for what the project is... see farnorthracing.com :)

      .

      --
      Want to learn about race cars? Read my Book
  31. Tribes 2 by Apreche · · Score: 2

    Tribe 2 has the best game physics ever in my opinion. It's a shame that there arne't people playing it anymore. The only reason it went down the tubes is because there aren't enough non-mod servers. Just about every server runs some variant on the game. As soon as I get a new computer I'm setting up a non-mod Tribes 2 server and me and my friends will rock the house again.

    --
    The GeekNights podcast is going strong. Listen!
    1. Re:Tribes 2 by British · · Score: 2

      The Shifter mod for Tribes 2 made the game not even worth bothering playing. All the weapons were way too powerful, negating any sort of weapons skill. There were also an excessive amount of classes that seemed to make little sense(Team Fortress Tribes?) and goofy items like the all-white jetpack made the game grossly unbalanced. One seasoned player could keep capping the flag over and over while everyone else was trying to figure out the weapons, classes, and strangely named items.

    2. Re:Tribes 2 by Gehenna_Gehenna · · Score: 1

      That is why, oh my friends, that the orignal tribes continues to *ROCK*.

      --

    3. Re:Tribes 2 by swv3752 · · Score: 1

      Most of the mods don't change the basic physics and some seem to only add new maps. The ones that add overbalaced weapons suck.

      --
      Just a Tuna in the Sea of Life
    4. Re:Tribes 2 by ErikZ · · Score: 1

      Really? And all this time I thought it was the bugs made the game unplayable.

      --
      Democrats or Republicans. They are both taking us to the same place and they are not afraid of us anymore.
  32. Different Constants by ZigMonty · · Score: 2
    Some people are saying that games are meant to be unrealistic: jumping higher, unrealistic strength etc. This doesn't mean abandoning physics, it just means changing a few numbers. Lower the gravitational acceleration constant you're using and the player will jump higher while the jump will still look right. Most of the exagerations games use can be done in this way. One exception is being able to change direction while in mid air. In some games it works, in others it just looks really stupid.

    There was a good article a while back in one of the mags (Scientific American?) i get about a team putting even more physics into games. If you shoot someone in the shoulder, they spin a bit etc. They were trying to make bullet hits look more real (as in reaction not gore). Anyone have a link?

    1. Re:Different Constants by arkanes · · Score: 1

      I see alot of "change direction in midair" to be an approximation of activity that is difficulto simulate via controls - for example, moving forward while you jump to represent jumping farther. Always jumping the same distance, in the direction you were facing when you jumped, would get very old very quickly.

    2. Re:Different Constants by ZigMonty · · Score: 2

      I'm all in favour of run-jumps and the like. I'm talking about games that let you change direction in mid air. Like if, in the air, you see that your jump will take you over the edge of a cliff, you hold down the "left" button and you land short of it. Not very realistic, unless of course you have some sort of thruster pack!

  33. Must be available as a library by The+Cat · · Score: 2

    As fascinating as the book sounds, individual developers or teams that are writing (and debugging, and debugging, and debugging) code to calculate the acceleration of a mass on a curved path are not using their time productively.

    These functions are based on laws of physics, and should be the last thing to be reinvented.

    Game development as a whole will be of a far higher quality when games don't have to be developed one molecule at a time.

    1. Re:Must be available as a library by Ivan+Raikov · · Score: 1

      You can probably try Netlib -- http://www.netlib.org. It's a collection of mathematical software, including of course many differential equation solvers. The only problem is that a lot of these implementations are written in Fortran, so you may have to use the F2C translator.

    2. Re:Must be available as a library by Gary+Yngve · · Score: 1

      Netlib's code is as rock-solid as it gets.
      Someone earlier here mentioned Numerical
      Recipes. It's a mediocre book, and some
      of its routines do not work as well as
      versions in Netlib.

      And a personal pet peeve: NR coded a SQR macro
      is something like:

      float _secret;
      #define SQR(x) (_secret=(x),_secret*_secret)

      Anyone well versed in the ANSI C spec will
      notice that bad things happen when you do
      norm=sqrt(SQR(x)+SQR(y)).

      Netlib has LAPACK, which solves most any
      linear algebra problem (they come up in physics)
      better than your or I will ever be able to
      figure out.

      Yes, most of that code is Fortran, but so what?
      First of all, the compiled Fortran code will be
      much better optimized because there are no
      annoyances such as pointer aliasing. Second,
      it is easy today to compile the Fortran code
      as a black box and link the library in with your
      C/C++ code.

    3. Re:Must be available as a library by Ivan+Raikov · · Score: 1

      Yes, most of that code is Fortran, but so what? First of all, the compiled Fortran code will be much better optimized because there are no annoyances such as pointer aliasing. Second, it is easy today to compile the Fortran code as a black box and link the library in with your C/C++ code.

      Those are perfectly valid points, and I agree that in 99% of the cases, you can either link with the Fortran code, or use F2C.

      However, I recently had to figure how to get differential equation solver code to work in a real-time thread under Real-Time Linux.

      I don't know whether you are familiar with RT Linux, but its essential premise is that all real time tasks are lightweight kernel threads (i.e. you have a POSIX thread interface, with some extensions for the real time stuff). That means all your real-time code runs in kernel space, and of course you don't have the standard C and C++ libraries, and all the goodies you are used to in user space.

      So anyway, to make a long story short, it turned out (for me at least) to be very difficuly to make the Fortran code work in kernel space -- it's just that it depends on too many user-space libraries, and porting them is a non-trivial and probably rather lengthy process.

  34. if only I studied physics instead of cs... by jodonn · · Score: 1
    The situation is improving, but unfortunately many CS programs at universities still don't require physics. Physics was optional at mine, so of course I didn't take any, not knowing how critical it could be later in my career.

    On the other hand, the inherent problem with domain-specific software is that those who know how to program the software are the ones who don't understand the domain. Computer programmers can't be expected to study everything in the case that they might someday be called upon to code a gene sequencing program or a complex financial application or psychological model. This tends to result in bad software written by people with no training and little experience in software development.

    Don't get me wrong--I don't mean to be elitest here, but in the few times that I've had to work on domain-specific programs written by domain-specific people, I've found that the existing code was very difficult to maintain.

    1. Re:if only I studied physics instead of cs... by boltar · · Score: 0

      Most CS people (aside you from it seems) have done science at school. Physics is not a big
      deal really , just find the equations from a book then code them up. Just like any other sort of
      maths problem. The HARD problems are ones where there is no "simple" plug-in-an-equation type
      solution.

    2. Re:if only I studied physics instead of cs... by Anonymous Coward · · Score: 0

      Hell, yeah. Just "coding them up" will result in 3 FPS games fuckwit.

  35. Games aren't about realistic physics by Captain_Frisk · · Score: 4, Redundant
    I've noticed alot of comments here about realistic physics in games.

    I remember reading an article with a game developer a while back, who pointed out that the key for physics in a game wasn't realism, but consistancy.

    He was developing a racing game, and says in order to make the game more fun, he had to sink the center of gravity for all of the cars several feet below the pavement, so that the cars wouldn't tip over when making hi speed turns.

    As long as all the cars behaved the same way, it didn't matter that you were "cheating".

    When playing your game, the user is entering your world, and learns a new set of rules. As long as you present your set of rules as consitant, it doesn't matter if they don't correspond with how things behave in "real" life.

    Captain_Frisk - wannabe game designer.

    1. Re:Games aren't about realistic physics by Ivan+Raikov · · Score: 1

      I remember reading an article with a game developer a while back, who pointed out that the key for physics in a game wasn't realism, but consistency.

      Exactly. Your physical constants may be different than those on Earth, but the principles, the laws of physics remain the same.

    2. Re:Games aren't about realistic physics by Zathrus · · Score: 2, Insightful

      Of course they're not about realistic physics.

      But, guess what - even if your computer game has a G that would crush humans, or elasticity that makes super balls look tame, or centers of gravity below the pavement, it still needs to be CONSISTENT.

      And being consistent means modeling real world physics. With tweaks.

      If you don't model real world physics properly though you're going to end up with erratic behavior that will either lead to frustrated players or exploitation by players (which often trivializes the game).

      And while I never thought about it, now I understand the purpose behind some of the abysmal math courses I took in college. I guess it's a good thing I don't do game coding, since I certainly don't recall much at all from those courses. (Another reason why math profs should come out of their theoretical world and mention real world uses for some of the stuff upon occasion).

    3. Re:Games aren't about realistic physics by Cosworth · · Score: 1

      When it comes to racing games there are two kinds, arcade games and simulators.

      Many people like racing game like Need for Speed, Carmagedon (sp?), but to me they just feel like toys. I seek out games that have the most realistic feeling phyics engine because they provide more real and fun racing simulation.

    4. Re:Games aren't about realistic physics by GospelHead821 · · Score: 1

      Absolutely! I always feel this way when people start discussing how unrealistic CounterStrike is. I have to agree with them. Of course it's unrealistic, and it's more fun as a result! Nobody can take an entire clip from a glock in the chest and survive. And nobody who's at "1%" of their total possible health will be moving around like that. It's a game though, and so long as it always obeys the same rules, it will be an entertaining game. Conformity to reality is the stuff of simulations, which represent only a small subset of games.

      --
      Virtue finds and chooses the mean.
      Aristotle, Ethica Nichomachea
    5. Re:Games aren't about realistic physics by synth7 · · Score: 1

      That may have solved the problem, but it will create a whole new set of problems should the car ever leave the ground... it's center of mass will now be so out of skew that the car will flip oddly when it finally does leave the pavement and take flight.

  36. Chris Hecker's Physics tutorials are FREE! by strags · · Score: 5, Informative

    http://www.d6.com/users/checker/dynamics.htm

    provides an excellent, and free alternative to purchasing a weighty tome on the subject. Chris covers the details of rigid body mechanics in a thorough, but light manner.

    I went to a physics lecture at GDC, the most memorable part of which was Chris saying:

    "Here's how it's going to go... you're going to write your first rigid body dynamics simulator. You're going to simulate a cube dropping onto a plane. You'll run the program, the cube will drop, hit the plane... and disappear."

    So, so true.

    1. Re:Chris Hecker's Physics tutorials are FREE! by Onionesque · · Score: 1

      I read Chris Hecker's tutorials, and several others, and made these toys.

      I also hacked his excellent 2D demo program to use the cross-platform SDL for rendering. But I could not locate him to see if he wanted it back for distribution. Anybody have any idea as to where he is?

  37. Super Mario Brothers by M4d+D0nkie · · Score: 1

    Games do not need good physics, they need to be fun. Anyone remeber playing Super Mario endlessly? Remember all the jumping forward and pulling yourself back in the air? That game would be damn boring if you couldn't reach half the powerups because it had real physics.

    1. Re:Super Mario Brothers by kallisti · · Score: 1

      Yes, but that ability to "pull yourself back in the air" was due to physics. If it worked sometimes and not other times, you would get annoyed, right? There are tricks to making sure that the physics always works correctly, that is what this book is concerned about.

      There isn't anything in a good physics model which requires everything to work exactly as it does in the real world. Tony Hawk, for example, allows insane hang times for doing tricks. This is not realistic physics, but since the engine is based on a real physics model, you can know exactly what will happen under given inputs.

  38. Carmageddon by CaseyB · · Score: 3, Interesting
    Carmageddon which on the N64 at least has sucky physics,

    Excepting the possibility that the N64 version is completely different from the PC version, you are completely clueless. Carmageddon, of ALL the games you could have chosen, was a pioneer in game physics. It was the very first game that I played that had a real rigid-body simulator built into the engine.

    Say what you will about the gameplay, or the physical settings (gravity was too low), but you can't say it had sucky physics. The cars and environmental objects interacted in an incredibly realistic manner. It was miles ahead of Re-Volt in that department.

  39. Games vs. Simulations by dreadpiratemark · · Score: 5, Interesting

    I don't know that I really agree with the idea that physics need to be wildly realistic in the 'games' that I play. Honestly, I don't want to know what kind of recoil the rocket launcher in Half-Life would inflict on my character. I'm happier just watching the rocket track nice and straight towards my target instead of attempting to pick myself up off of the ground where I slid to a stop from the highly realistic recoil.

    On the other hand, when I play a 'simulation' the physics are quite important. The best physics I've found in a sim are in a 3-year-old game: Grand Prix Legends. You're racing 1967-era Formula One cars, which means skinny tires, no downforce, high powered...which is a combination for difficult driving. But the physics engine is spectacular: you touch the gas when in neutral, you can feel the torque twist the body of the car; each wheel has its own model; touch the gas a bit to hard in a corner and be prepared to swap ends of the car, etc., etc.

    The graphics are what you'd expect for a 3 year old game, but a dedicated community has sprung up to support the sim with everything from replay analysers, new tracks and graphics, and even a movie maker!

    It seems that if you make a sim with good enough physics behind it, the fans of it can create new 'eye candy' to keep the sim looking good. But if you have crappy gameplay (see: Andretti Racing) and good graphics, the game will quickly be relegated to the bargin bin when something prettier comes along.

    -Mark

    1. Re:Games vs. Simulations by Anonymous Coward · · Score: 0

      Rocket launchers are derived from 'recoilless guns'. That's the whole point. Effect of recoil would be insignifigant. A 30mm cannon, however, is not a rocket, and would be silly if not modeled realistically.

    2. Re:Games vs. Simulations by dmeiz · · Score: 0

      i'll second that. i have yet to see a better driving sim than gpl. the sound is great too; it provides usable feedback. and that thing's been out forever.

      -dan

    3. Re:Games vs. Simulations by BugMaster+ChuckyD · · Score: 2

      The new EA Sports F1 game (F1-2001) has excellent physics, much better than the 2000 edition, byt with modern high downforce 850-900hp cars. Its a blast, but very difficult to drive the cars right on the edge for an entire lap.

    4. Re:Games vs. Simulations by CaptnMArk · · Score: 1

      GP3 is still one of the best and most realistic modern-F1 simulators.

    5. Re:Games vs. Simulations by Anonymous Coward · · Score: 0

      Especially significant considering that the type of rocket launcher simulated in Half-Life is of the "soft-launch" type, in which the rocket is first ejected from the tube by a small charge, and then the main rocket motor ignites.

  40. Who wants realistic physics? by Junta · · Score: 5, Insightful

    I'll bet that in at least 90% of the games out there realistic physics would completely ruin the whole fun. What is the point of interacting with a fake environment when the environment reacts the exact same way real life reacts? Racing games are a good example. People want cares to handle well, generally. They don't want realism, in real life operating cars at high speeds is a lot more difficult than most games.

    And in *any* game where people jump, realistic jumping becomes completely pointless. People want to be superhuman. Imagine quake with realistic physics....

    Realism is not the high mark of games in all aspects, that is the whole point of games, to escape reality...

    --
    XML is like violence. If it doesn't solve the problem, use more.
    1. Re:Who wants realistic physics? by RobertFisher · · Score: 3, Insightful

      This is a good point, and a valid one.

      It is true that in some games -- a combat flight simulator, for instance -- one design goal would be to achieve the most realistic physics possible. The average kid popping quarters into an arcade game isn't looking for realism, but some folks certainly will.

      However, I think the importance of _self-consistent_ physics is quite critical. You can invent your own set of "physical laws", which may be similar to those we are familiar with (ie, with moon gravity instead of Earth gravity) or completely and utterly different (ie, with Matrix-like time and space distortions or a Tolkien-like world replete with magic). However, the world you put forth should appear at once both plausible and self-consistent. Indeed, knowing real physics and the numerical methods to treat it would certainly help game programmers in their own constructions, if only by serving as an intricately balanced example which can serve as a launching point for their work.

      Bob

      --
      Science, like Nature, must also be tamed, with a view turned towards its preservation.
    2. Re:Who wants realistic physics? by uweber · · Score: 1

      Well I don't think it is really about realistic physics but about consistent physics. Sure cars in raceing games should handle easier than in the real world, but things should still move as they do in the real world. Your example with jumps illustrates this best because if the trajectories are calculated wrong you would never end up where you expect and I sure wouldn't like that.

      So basically it boils down to this: In any game the laws of nature need to apply although the game designers are free to change the basic conditions (gravity , friction, etc.).

      --
      --Ulrich
      On no accounts allow a Vogon to read poetry at you
    3. Re:Who wants realistic physics? by ansible · · Score: 2

      Well, I occasionally want realistic physics.

      It's been a long time since I've run a real R/C car, but I've played Re-Volt a lot. It's fun.

      You're getting to do something that you wouldn't normally be able to. This is especially true with Re-Volt. You get to race some nice cars, over some really wild race courses, with a point-of-view right over the car itself. No worries about charging batteries either.

      I think realistic physics adds a lot to the game. Learning how to handle the different surfaces. Learning how to bump off the wall just so without flipping your car. Learning how to power-slide. I would have ruined a dozen real cars just trying out jumping and stunts.

      It helps that the game uses R/C cars instead of real ones. Because of mass-scaling laws, they have a much greater power-to-weight ratio than full-size cars. That adds a lot to the fun factor.

      And maybe realistic physics would ruin other games, like Half-Life. Well, if you want super-jumps, fast running and so on, let's make a game with armored mechas instead of humans. You can have your rocket-jumps and realistic physics too.

    4. Re:Who wants realistic physics? by rootmonkey · · Score: 1

      The point is that you need to have a physics engine for games (simple, complex, whatever). After you have one you can tweak the variables involved like gravity etc., and you can make your game world behave any way you want. Remember don't program things out. Make a good engine and let other people use it new ways.

      --

      Yes but every time I try to see it your way, I get a headache.
    5. Re:Who wants realistic physics? by Anonymous Coward · · Score: 0

      I think you are escaping reality on this point. We don't mean physics of this world, but something simmilar as in things react and manipulate others in the environment. I think some of you are confused on the term. It must have rules, even if that rule is
      if
      (bounce_off_object){
      propelin(rnd())direction
      }.

      And please no noe bitch about C syntax as this was made to express the point some are missing.

  41. Quake II low gravity level by acomj · · Score: 2

    Has anyone else seen the quake II secret level that has less gravity. Jumping, the remains of oponents, those bouncing gernades.. everything was like it was on the moon.. Lots of fun..

    Now thats physics

    1. Re:Quake II low gravity level by Anonymous Coward · · Score: 0

      that was Quake, not Quake II: level E1M8, Zigurrat Vertigo...

    2. Re:Quake II low gravity level by JatTDB · · Score: 2

      You could actually do that at pretty much any time you liked...just bring up the console and set sv_gravity to some number significantly lower than the default (the value of which escapes me at the moment). Also fun to turn the gravity up super-high...even the smallest falls hurt.

      --
      "That's Tron. He fights for the Users."
    3. Re:Quake II low gravity level by Stonehand · · Score: 1

      You could do that in Quake I as well, if memory serves.

      For a really twisted out-of-control game, you could set negative friction, and use a map with a fair number of wide open spaces...

      AieeeeeeeeeeeeWHAM.

      --
      Only the dead have seen the end of war.
  42. there are companies making this by cornjones · · Score: 1

    my pool-teammate's buddy from ireland (sister's former roomate) works w/ a company (in ireland) that produces physics engines for applications. well I guess it is really one physics engine that they license out to anybody who wants it. obviously game co's are interested but engineering and modelling progs use it too. sorry but I don't remember the name.

    1. Re:there are companies making this by Anonymous Coward · · Score: 0

      havok

    2. Re:there are companies making this by Anonymous Coward · · Score: 0

      There is Havok and MathEngine.

      The latter at least I know has a freely downloadable, fully working version that you can play with. It does collision and dynamics (ie. movement) and also allows contacts (things on other things), friction and constraints (this thing hinges to that thing). There's some very simple demonstrations with source, I wrote a couple of simple demos within a week. Neato.
      It's pretty stable too, if you tweak it right.
      Looks like the underlying mathematics is incredibly complex -- probably due to contacts, friction and constraints.

      Try it out. Lets not (re)invent the wheel!

  43. Re:more fun blowiung up stuff with accurate physic by jsonic · · Score: 1

    Try Red Faction. You can blow holes in the ceiling, floor, walls...the game actually depends on you doing this to advance through the levels.

    Really fun in deathmatch mode since you can blow a hole in the wall and hide in it.

  44. Grenade toss gone wrong! by jeff13 · · Score: 1

    Return to Castle Wolfenstein has great physics, as all QuakeIII and such gamers know. But I find the grenade toss of the game somewhat limp. Last night, under heavy fire while a teammate tried to get the M60 firing. I tossed a grenade into a alcove to keep incoming Nazis from cutting us both down. Oops!?! My grenade hit the wall right beside me (but, but, I'm beside the wall!?!? How could I possibly have ... KA-POW!

    Game physics. Priceless. ;-D

    1. Re:Grenade toss gone wrong! by Anonymous Coward · · Score: 0

      I'll have to agree on that point.. I can throw a grenade much farther than RTCW characaters can. They throw like girls.

  45. the age old realism in games debate by Anonymous Coward · · Score: 0

    its a fallacy to believe
    realistic physics realistic gameplay fun game

    some 'old' games are still interesting today and hence being played for no other reason then that their physics system is fundamentally flawed (e.g. the original Quake or QuakeWorld; released over 5 years ago). learning how to exploit these flaws efficiently is what makes those games fun today, with new 'defects' being discovered on a weekly base.

    make a game with perfectly realistc physics and it will be perfectly boring; why not do the real thing instead?

  46. how about human motion? by cvd6262 · · Score: 2

    In my opinion, the most difficult aspect of writing a good 3D game is coding complex physics

    IMNSHO, getting good human motion is the hardest. Sure, EA does great motion capture for their sports sims, but where else do you see this in the industry? Download the Wolfenstien single player demo and see how stiff the models look (especially in the intro).

    I think getting realistic physics is important, but, since most of it can be reduced to math anyway, GHz machines and loads of memory, combined with good programming, should be able to get it right. Making motion look good is far more important to my enjoying the game, and much more difficult.

    On a side note....

    Has anyone else noticed how this seems to be what sets WETA's effect in LOTR apart from the rest? Instead of generating a digital army, they film a bunch of guys walking in armor, then copy/paste/randomize to make a realistic hoard of warriors.

    The cave troll, while the rendering was supurb, was entirly motion-captured. They had some actor plodding around with a big stick and ping-pong balls taped to his joints. They seem to understand that they can make everything look perfect in a still image, but the motion will still look fake.

    --

    I'd rather have someone respond than be modded up.

    1. Re:how about human motion? by Onnimikki · · Score: 1

      Motion capture is not the final solution. Breaking down realistic human motion into mathematical equations is. Just ask the folks at Boston Dynamics. I saw a demonstration of one of their models (programmed by a graduate from my lab) and it was superb.

    2. Re:how about human motion? by Anonymous Coward · · Score: 0

      <I>Instead of generating a digital army, they film a bunch of guys walking in armor, then copy/paste/randomize to make a realistic hoard of warriors.</I>

      Err, crowds are a mix of practical and CGI. Do a search for "MASSIVE" which was written by Stephen Regelous the crowd super.

      ./sam
      sam.wiggerz.net

  47. Velocity Verlet algorithm by edremy · · Score: 2
    Here's the Velocity Verlet algorithm for this setup. (I have to use the VV algorithm: my PhD advisor invented it :^)

    1. Start with a set of positions r and velocities v at time t, r(t) and v(t) We'll move them in some small timestep of length dt.
    2. Compute the forces F(t) on the particles at position r.
    3. Compute the accelerations a(t) on the particles by F(t)=m*a(t)
    4. Compute new positions at time t+dt by r(t+dt) = r(t) + dt*v(t) +0.5*dt*dt*a(t)
    5. Advance velocities by v(t+1/2dt) = v(t) + 0.5*dt*a(t)
    6. Compute forces at new positions, F(t+dt) and accelerations a(t+dt)
    7. Finish updating velocities by v(t+dt) = v(t+1/2dt) + 0.5*dt*a(t+dt)
    8. Goto step 4 for as long as your CPU doesn't melt.



    The VV algorithm has a lot of advantages: it's simple, stable provided dt is small enough, and unlike straight Verlet is self-starting given an initial velocity set.

    Eric

    --
    "Seven Deadly Sins? I thought it was a to-do list!"
  48. Basing a whole game around the physics by iainl · · Score: 2, Insightful

    Some of my all time favorite games are great because they move 'right'. Can you imagine playing Spindizzy or Marble Madness with crap physics? I can, on a dire MM ripoff. It was frankly painful. The unexpected coolness that can result from engines that do things properly is very nice - although they cheated on the amount of kickback to do it, rocket jumping would never exist if they hadn't used impulses and momentum to control movement rather than old style 'move forward if the player pushes forward' arcade method.

    --
    "I Know You Are But What Am I?"
  49. Physics Fighter by voiceofthewhirlwind · · Score: 1

    What I'd like to play (or code myself when I get out of college) is a fighting game that incorporates a lot of physics:

    Instead of a hit just causing the victim to go into a canned fall down sequence, the force imparted by the blow would be computed and the proper response of the impacted body would result in a unique reaction for blows landed on different parts of the body with different ammounts of force.

    In addition to reaction to hits, all the moves should be based on biokinematics rather than canned sequences- the fighter would not execute perfect flying whatevers every time, but some phsyics model would cause them to attempt the move and the result would vary by the conditsions it was executed under.

    More physics in any kind of game makes for much more interesting and varied play, if the alternatives is just as many sequences as the designers bothered to record.

  50. Carmageddon's physics by rreay · · Score: 1

    Carmageddon didn't have sucky physics, it had goofy cartoony physics. I mean seriously, asking for realistic physics in a game about rocketing through a city at 200 mph running down pedestrians and picking up powerups is just plain silly.

    -Rob

  51. It's about what you want for the end result.... by mr-spam-uk · · Score: 1

    Whenever a game is produced it is decided how much physics will go into the game, this is dictated by a lot of factors, some of which are (in no particular order):
    1) Possible cost. (Do you buy a prebuilt physics engine? Or spend developer time on it?)
    2) How realistic does the game need to be?
    3) How realistic can you make the game? With given platform constraints.

    It won't be long before people begin to notice not just the graphics/game engine (Such as the famous Q2 and Q3 engines) but also who's physics/mechanics engines are being used...

    Background:
    I've got a degree (BSc Hons) in Physics, I work at a games development house as a programmer.

  52. Working out the forces of objects by Anonymous+Canuck · · Score: 2, Interesting
    "Everyone knows that games spend most of their time running round a single big "main loop," working out the forces on each object, looking for collisions and working out which keys the user is pressing."

    Actually, the game is not working out the forces of each object. This is why most objects in 3d fps games are static. Beyond basic collision detection, there is no interaction with the objects. If there are interactive objects in your game, the math involved in calculating the physics of a 3d pack of cigarettes or a 3d can of cola would not only take an enormous ammount of coding to bring to light, but also put undo load on the CPU.
    When we worked on Ghost Recon, one of the big problems with physics involved calculating the way the trees swayed in the wind(believe it or not). Part of the solution involved going from multiple wind directions to a single one. The users wouldn't notice it. Heck, we could have made the trees static, thus relieving the system of about 40% of it's performance hit, but we wanted some level of realism in the background and atmosphere.

    1. Re:Working out the forces of objects by iainl · · Score: 1

      Not to knock you for this cool game, but practically everyone has commented on the major-league system requirements for it. Did it really slow down that much with swaying trees? If so, I don't suppose turning them off is an option?

      --
      "I Know You Are But What Am I?"
    2. Re:Working out the forces of objects by Anonymous Coward · · Score: 0

      So *you're* the bastard that completely ruined my sniper skills. :)

      "Let's see, just hunker down, hit the scope, and watch for movement. Hey... wait... everything's moving..."

    3. Re:Working out the forces of objects by Anonymous+Canuck · · Score: 1

      When you see how many trees there are in some of the levels, you'll know what I mean.
      From a 'wow' factor, the objects themselves aren't exactly state of the art. The polygon count per object is fairly low. It's the volumetric explosions, animated objects(like the trees) and most of all, the map textures that kill your performance.
      Alas, no. Turning off the tree animations is not possible. But setting the map detail to low will make enough of a difference that the latency created by the trees will be almost non-existent.

  53. XtremeG by sketerpot · · Score: 1
    In XtremeG (or some name like that) there was an interesting challenge with the physics: in order to do cool loops in the track, the direction "down" had to be relative. Every objet would have its own gravity (or perhaps just the motorcycle has its own), but it was interesting to hear about.

    Perhaps a game would be really successful if it had totally screwed up physics, but screwed up in cool ways, like paths that can twist around so you're upside-down but still gravity pulls you toward the path. Add flashy surreal graphics, and you've got something I'd like to play.

  54. Um by autopr0n · · Score: 1, Interesting

    The ability to jump 20 feet into the air has nothing to do with whether or not you're using a realistic physics model, just how much acceleration from gravity is present and how hard you jump.

    Things don't need to be exactly as they are here on earth, but having 'no physics' I don't think would be very much fun.

    --
    autopr0n is like, down and stuff.
  55. One thing great about this book by akiaki007 · · Score: 2, Insightful

    Is that it gives you all the important physics equations that I learned throughout freshman and sophomore years of college all in one place. They equations are easy to find (though the variables used aren't the traditional ones in physics).

    The book is a good reference to have. To me this would be good to have because I already "learned" all of this, but like most don't remember all of it. Having all these equations right in front of you will enable you to remember everything swiftly and apply what you need to.

    Like most O'Reilly books, this is a good reference to have, and I think it should be bought by people that already know most of the basic physics stuff.

    --
    "Time is long and life is short, so begin to live while you still can." -EV
  56. HL by autopr0n · · Score: 2, Informative

    Half life is based on a heavily modified quake 1 engine with some quake2 code thrown in for good mesure.

    --
    autopr0n is like, down and stuff.
  57. LordOfTheRingBound? by alephnull42 · · Score: 2, Insightful

    Quote: "A common complaint about computer books: I've just spent 25 quid on a book which will sit open on my desk for months. Is it too much to ask that it be ring bound?"

    The book is not ring bound because it costs 25 quid (= British Pounds).

    'Twould be far too easy to stick it through a photocopier or scanner if it were.

    --
    Not confused enough? http://translate.google.com/translate?u=www.slashdot.jp&hl=en&ie=UTF8&sl=ja&tl=en
  58. Compromises... by telbij · · Score: 1

    Aside from the obvious compromises that must be made to achieve decent framerates, I think playability requires design decisions that are more complex than just realistic vs oversimplified physics.

    The challenge in game design is figuring out how you want it to feel, then determining what kind of physics model best achieves that.

    Take a game like Gran Turismo 3... the greatness comes from an extremely realistic physics model. But that same principle shouldn't be applied to all games. Grand Theft Auto 3 is an equally great game that uses oversimplified physics to make the game flow better.

    I think one of the greatest games is Halo, which for those of you who haven't played is a FPS with vehicles. The physics aren't overly realistic. Inverse kinematics are used to give a sense of realism, but gravity, traction and flight are decidedly unrealistic in the interests of playability.

    Halo also has fantastic controls which illustrates another good point, which is that physics are just the tip of the iceberg on playability. More important are the ergonomics of the controls. One other thing that's also more important than physics in my mind is environment robustness. There needs to be a critical mass of weapons/enemies/missions/goals/secrets to keep things interesting.

  59. Speaking about Cartoon Physics... by taliver · · Score: 1

    Yes, you can have a world where the physics don't behave as our world. However, you still need to be somewhat consistent. Imagine a game based off the Coyote and Roadrunner (I really don' know if a recent one exists,)

    Your rules would be much different.

    First person game... you can run over empty space as long as you don't look down, or hadn't been there before.

    Once you start falling, your legs generally go down a lot faster than the rest of you body until it catches up, and you quickly assume a very fast constant speed.

    Tunnels can be painted, but only used by the one who didn't paint them.

    Extremely laughable motors can give extraordinary kicks, and small balloons can carry enormous amounts of mass.

    Now, as long as these rules are consistent, you can have a very fun game. Note that things should still arc (hence some rules of our world physics are still there), but things like static friction aren't as significant until they need to produce a lot of heat.

    While this book is important to know how to code rules of physics, more importantly, a consistent or at least consistently inconsistent rule set makes a game great fun.

    --

    I demand a million helicopters and a DOLLAR!

  60. Unless you're in the Navy by Anonymous Coward · · Score: 0

    which still uses dead reckoning to guess where the ship is in the middle of the ocean.

  61. Cartoon Physics by devnullkac · · Score: 5, Funny

    I'm still waiting for Physics for Cartoon Developers: just how long should a character remain suspended after realizing he's in mid-air? We'll need pure math computation methods for ordinary cartoons and numerical methods for interactive cartoon games.

    --
    What do you mean they cut the power? How can they cut the power, man? They're animals!
    1. Re:Cartoon Physics by fellini8.5 · · Score: 1

      Yeah, well here it is! Timing for Animation
      :)

      Actually, on a serious note, being a slave to physics isn't the recipe for a good game any more than it is for a good cartoon. It's the "Suspension of Disbelief". Animation has stretch & squash, anticipation, release, & followthrough, all exaggerated not just for comic effect, but a lot of the time when you don't really notice it, because that's the stuff that makes things seem _alive_

      --
      Kineska: Cinema, soapbox, music & musings
    2. Re:Cartoon Physics by Anonymous Coward · · Score: 0

      I've just spent the last two years of my life working on inteartive Cartoon Physics for
      "Cel Damnage" It was a lot of fun to make, but not as easy as one might expect.

      David Wu

  62. Physics? Yes. Game development? No. by Junks+Jerzey · · Score: 2

    This is a refresher course in high school physics, sometimes freshman college physics, but the author does not have any kind of perspective on game development. It's easy to pick up a book about physics and implement what's in there. The equations are well known. But that kind of implementation is much, much, too hardcore for game use, where you need to devote 15% of each frame to physics calculations.

    The trick is coming up with a way to seem like you're doing much more than you really can. The book gives little help there, as trickery and non-traditional techniques can buy you a lot more than just implementing standard mechanics.

  63. quaternions by Anonymous Coward · · Score: 0

    I have a quaternion question thats been buggerin me.

    A 4x4 rotation matrix describes an arbitrary rotation about an arbitrary axis. But some combinations of rotations cannot be represented by a single rotation about an axis. For example, rotate the Earth 90deg about an equitorial axis, then rotate 90deg around the N-S poles axis. The final orientation can't be done in a single rot about a single axis.

    My question is: Can quaternions handle this? With a single 4 parameter quaternion, can I describe this combined rotation?

    1. Re:quaternions by Phil+Wilkins · · Score: 1

      > some combinations of rotations cannot be represented by a single rotation about an axis.

      That's a false assumption. All combinations of rotations can be described as a single rotation around an arbitrary axis.

      In your example the rotation is 120 deg around an axis at 45 deg lat and long (assuming your equatorial rotation axis is at 0 deg).

      I reccomend you try this one with a six sided dice. After two 90 deg rotations around adjacent faces, you should be able to return to your original orientation by rotating around two points.

      For conversion from an abitrary rotation matrix to a quaternion check Ken Shoemake's article in 1987 SIGGRAPH course notes article "Quaternion Calculus and Fast Animation".

  64. It's for the *developer*, not the player by Anonymous Coward · · Score: 0

    This book is not aimed at the gamer, it's aimed at the game developer.

    You want to jump right in and play a game? Then you'll find it easiest if it has fully realistic physics, as that's what you are used to.

    ac.uk

  65. Did he mention wind resistence by snatchitup · · Score: 1

    95% of all the problems I did in physics started out with: "Assuming you're in a vacuum"....
    Then you simply used..

    d(t) = 1/2at^2 + vt + d0

    But with wind resistence, acceleration is inverse logorythmic proportional to wind resisteance (which is proportional to velocity), so (A) is not a constant, or at least you need to make the above a much more complicated differential equation.

    Not to mention when g = a (gravity)... In a vacuum you'd fall so fast, but maybe you're on a different planet where the atmosphere is much thicker and (g) granvity oh so much smaller. Instead of reaching a maximum falling velocitry of 200MPH, maybe it's only 30MPH.

    Conservation of energy should be observed for sure, but friction, and wind resistence make projectile flight mapping much more inexact without a beowulf cluster of crays and some bang-up fluid dynamics simulation.

    Let's not even touch relativity. If you're writing a space shoot em up, and you kick in your thrusters and approach (c) the speed of light, do your enemies get shorter? Does the universe begin to collapse.. And oh yeah, w.t.f. is hyper-space? A black hole super-nova?

    Do we grow beards while playing? It's been proven on fighter pilot's atomic clocks that they travel in time (albeit on the order of millionths of seconds).

  66. My favorite example by r_j_prahad · · Score: 2

    I am a flight-sim junkie, and a former military pilot (before anybody asks, I am NPQ, not physically qualified to fly anymore). I have owned maybe two dozen different flight simulator programs over the past fifteen years.

    My favourite for a long time has been Austin Meyer's X-Plane. X-Plane uses an engineering process called "blade element theory" to approximate the true behaviour of an aircraft in flight. And it does this fairly well; I think X-Plane does the best job of any of the PC-based sims at mimicing the actual feel of the aircraft.

    X-Plane doesn't have the "eye candy" of MSFS-2002 or any of the Flight Unlimited series, but as far as accurately modeling flight physics, X-Plane is head and shoulders above the competetion.

    1. Re:My favorite example by Anonymous Coward · · Score: 0

      Ever try WarBirds?

      Flight sims are the ne plus ultra of the gaming/physics intersection.

  67. OpenGL by Gambit-x7x · · Score: 0

    hi, this look like relative topic to what i am doing, also, i know i have faced that i had to remember all the college physics.... on the other note, i am creating a small 3d-game for my self which involves a lot of rewriting the things that are done... like i would like to use a open GL 3d-engine with the distributed computation, but the problem is i need to find the open sourced one with right to use it freely.... any help would be appreciated...

    --
    Who controls the information, controls the world...
  68. Runge-Kutte? Give me a break! by pclminion · · Score: 3, Informative
    First of all, let me say that I will be getting my degree in physics in a few months, and I'm well versed in physical simulation. Not in the game arena, but in the applications arena.

    Runge-Kutta is a complex method for quickly and accurately solving differential equations by numerical means. It is used instead of simple Euler iteration because it is equivalent in speed and gives much more accurate results. It works by adjusting the timestep dynamically to skip over regions where the system is changing slowly, and to integrate more carefully when the system is changing quickly.

    This is all well and good when you are trying to do something important, like simulating heat flow within in a heatsink. But for simulating the orbits of planets around a star, for example? What a waste of time! The orbit is elliptical, so just simulate a freaking ellipse!

    What about space missiles? Do you need Euler integration? No! There is a closed-form solution to the linear acceleration problem -- it's a quadratic. This procedure does not give low error. It gives zero error.

    I read this guy's articles several months ago. I thought he was off his rocker then, and I still think so now.

    1. Re:Runge-Kutte? Give me a break! by elh102 · · Score: 1

      Using the closed-form solutions is all well and good if you are simulating a fairly static universe. In an interactive game, player actions and inputs are going to influence the game universe. Using closed form solutions in the physics model quickly becomes impossible, and some form of numerical integration is required.

      In other words, with closed-form solutions, you can have your planet moving in an ellipse in the background, while the player's space ship fires missiles which move in a straight line. But how do you model the motion of the player-controlled space ship realistically?

    2. Re:Runge-Kutte? Give me a break! by Hittite+Creosote · · Score: 1
      OK, being unnecessarily complex is nearly as bad as being over-simplified. But while a simple iteration would work adequately for simulating the orbits of planets around a star, this only applies as long as nothing more complex was going on. If you were trying to simulate orbits around a star during planet formation, when you have planetesimals hitting each other, getting slung into the sun and out of the solar system, etc. etc. , you'd need to be able to handle a bit more complexity.

      I suspect he is right that Runge-Kutta produces a more stable game if you have complex interactions going on, but his example should have been better chosen.

    3. Re:Runge-Kutte? Give me a break! by pclminion · · Score: 3, Insightful
      What do you mean by realistically? If you mean, for example, that the sun in your game solar system attracts the spacecraft, and if you wait long enough you'll unfortunately fall into the sun, then I'd say your game is a bit too realistic. The gravitational force on a spacecraft at any significant distance from a star extremely slight in comparison to the forces acting on the craft locally, such as thrust and collisions.

      Even if the gravitational force were extremely strong, it wouldn't make much difference in space battle. You still point the missile at the enemy and shoot it. You, the missile, and the enemy are all accelerating toward the sun at equal rates. The fact that a G-field is present makes absolutely no difference, since the field is uniform, at least when you are quite far from the sun and the spacecraft are relatively close to each other. In a fun game, the craft will not be far apart, since it's not much fun to fire on an an enemy when you can't see the pretty explosion.

      Look, I'm going on and on about a specific example, when my real point was much more general. "Realistic" behavior of objects can be very closely approximated with very simple methods. The player will not know the difference. Problems such as integrations "blowing up" can be easily avoided simply by looking for the blow-up and correcting for it.

    4. Re:Runge-Kutte? Give me a break! by elh102 · · Score: 1

      Maybe realistic wasn't the best choice of words. As has been pointed out in other comments, the important thing is that the physics model be consistent so the motion is predictable and "feels right" to the player. Certainly, there is room to make simplifying assumptions, such as assuming uniform gravity fields (in your example).

      I think you missed my point about the necessity of at times using some form of numerical integration to model physics in a game. Returning to the "space battle" example we've been using, I agree that no integration, Runge-Kutta or otherwise, is required to represent the motion of planets, or missiles moving in a straight line. What about motion of the player-controlled spaceship, though? There are several ways this motion can be modelled:

      The simplest approach is something like "If joystick goes right, spaceship goes right". This is how ancient games like Defender and countless other side-scrolling shoot-em-ups worked. If this is the approach you want to take, there is no need to perform any complex numerical integrations.

      What if you want to add another layer of complexity, or (dare I say?) realism, to the game. What if joystick motion controlled the amount of thrust produced by engines on the spaceship? In this case, the joystick is essentially controlling acceleration of the spaceship, through the forces created by the thrusters. To get velocity and position from this information, some form of numerical integration is required. A closed-form solution (like for the planets or missiles) is not an option, since the forces acting on the spaceship (joystick input) are not known explicitly. It doesn't have to be a full-blown 4th-order Runge-Kutta solution, but some form of numerical integration is necessary. A simple trapezoidal rule might do nicely.

      The necessity of calculating the forces acting on an object and integrating to find position becomes even more obvious in a less celestial environment, like a flight simulator. Unless you want to dogfight like the planes did in Combat! for the Atari 2600 :)

    5. Re:Runge-Kutte? Give me a break! by pclminion · · Score: 2
      In this case, the joystick is essentially controlling acceleration of the spaceship, through the forces created by the thrusters.

      Ok. Well, I had taken this part somewhat as a given. "Press left go left" is so simplistic I hadn't even thought of it. I've written a few space shooters (with graphics so bad I'm embarrassed to mention it), and the various objects in the universe were modelled with the following properties: mass, velocity (vector), position (vector), angular momentum (vector), moment of rotational inertia (assumed to be isotropic). Spacecraft in this model have linear thrusters that can change the linear momentum -- i.e., they produce a force line that passes through the center of mass. They also had rotational thrusters which provided torque (force line perpendicular to center of mass). In fact all forces were calculated relative to the center of mass. Projectiles impacting the spacecraft produced linear and angular accelerations which were quite easy to compute. To be more complex than that seems like a waste of time.

      I never ran into problems with this method. I integrated four times per frame, and it worked quite well. Actually, I've never played a space shooter that really took account for angular momentum. Once you got spinning out of control in my stupid little game, it was quite difficult to get back into a sane orientation :)

    6. Re:Runge-Kutte? Give me a break! by Gary+Yngve · · Score: 1

      > (joystick input) are not known explicitly. It
      > doesn't have to be a full-blown 4th-order Runge-> Kutta solution, but some form of numerical
      > integration is necessary. A simple trapezoidal > rule might do nicely.

      But Runge-Kutta is *not* that much more work.

    7. Re:Runge-Kutte? Give me a break! by mOdQuArK! · · Score: 3
      This is all well and good when you are trying to do something important, like simulating heat flow within in a heatsink. But for simulating the orbits of planets around a star, for example? What a waste of time! The orbit is elliptical, so just simulate a freaking ellipse!

      That's only true in a two-body system.

      What about space missiles? Do you need Euler integration? No! There is a closed-form solution to the linear acceleration problem -- it's a quadratic. This procedure does not give low error. It gives zero error.

      Only if you assume a flat earth with constant acceleration at all altitudes - which is an incorrect assumption when you're trying to model intercontinental ballistics.

      I read this guy's articles several months ago. I thought he was off his rocker then, and I still think so now.

      Apparently, your soon-to-be degree in physics doesn't imply a degree in common sense.

    8. Re:Runge-Kutte? Give me a break! by pclminion · · Score: 2
      I really don't understand all the responses to my post: I was merely pointing out that when one is writing a freaking video game, it is a waste of time to use such methods to perform accurate physical simulation. How does a "flat earth," or "intercontinental ballistics" have anything to do with space missiles?

    9. Re:Runge-Kutte? Give me a break! by blowhole · · Score: 0

      How about Global Thermonuclear War?

      Wouldn't you prefer a good game of chess?

      --
      "Ask me about Loom"
    10. Re:Runge-Kutte? Give me a break! by mOdQuArK! · · Score: 1

      Making your virtual objects behave like real objects allows people to use their own physical intuition to play the game. You can't just inject different "physics" solely because it's easier to implement - if you want people to feel comfortable in your environment, then the physics have to make sense to them. Even though we might not understand the subject in terms of mathematics, our 'custom-grown' neural networks (brains) are very good at realizing when something isn't behaving naturally, although the people might not be able to tell you anything more specific than "this doesn't feel right".

      As far as space missiles go, you have two "realistic" options - either you're shooting missiles in the context of a planet, in which case you've got to deal with the gravitional field of a planet, or you're shooting "space" missiles in deep space - in which case the trajectories are straight lines anyway. In neither case is the resultant trajectory quadratic. To get constant acceleration behavior (with quadratic trajectories), you are no longer using "space" missiles.

    11. Re:Runge-Kutte? Give me a break! by pclminion · · Score: 2
      I didn't mean that the trajectory is parabolic. I meant that the equation which describes the position of the missile (under the influence of a thruster) after some given amount of time is quadratic: x(t) = 1/2*a*t^2+v*t+x0.

      Yes, this does not account for the fact that the missile's mass is changing as the fuel is consumed. I don't feel like working it out right now but that also has a closed-form solution if you assume that the fuel is burned at a constant rate.

    12. Re:Runge-Kutte? Give me a break! by pclminion · · Score: 2
      Actually, screw that, I did work it out:

      x(t)=(b^2*(v0*t+x0)+F*(b*t+(ln(M/(M-b*t)))*(b*t-M) ))/b^2

      Where F is the constant force produced by the thruster and b is the rate of fuel burn in kg/s.

  69. Re:more fun blowiung up stuff with accurate physic by Anonymous Coward · · Score: 0

    Check out Red Faction. It has a feature called GEO-MOD that allows you to do just this. It has similar game play to Half-Life. IMHO, it has gotten far too little attention by gamers. The one annoying thing now, is that cheating is rabid on multiplayer games, allowing peple to tly and shoot 60 rail shots per second...

  70. Re:articles on physics & collition detection e by robbway · · Score: 1

    I turned off my moderator points awhile ago, but I agree. Gamasutra is a very professional site for game developers that has resources that any independent game programmer could really use. Especially new game programmers. They have many in-depth articles on physics and realism.

  71. The results are what matter by Rogerborg · · Score: 2

    So there I am trying to solve a ballistics problem for a game. I need to drop artillery shells on target, based on launch speed, required horizontal distance and gravity, but not, thankfully, air resistance or other accelerations. We need this to work right, but more than that, we need it to work quickly for an imminent product demo, so a co-worker is thrown at it as well. He has his Halliday and Resnick Fundamentals of Physics Extended Third Edition, and a couple of years of college maths.

    So we get to work. I do a quick napkin calculate and can solve for the range based on the speed, angle and gravity, but I can't figure out how to solve the equation for the angle. It's fairly easy, but I'm an absolute duffer at maths (it nearly dropped me out of college). My coworker has started right, trying to solve it for the angle.

    Five minutes later, I'm done, and I mean done. I'm dropping shells within spitting distance of the target. "Oh, you solved it then?" asks co-worker. Heh, not exactly. I'm pumping angles into my napkin equation and doing a bsearch until I get a distance that looks close enough.

    Coworker is outraged! It's inefficient, he claims, which is technically true, but it's a few iterations happening every few seconds at most, which isn't even worth our time profiling. It's not perfect, which is also true. But our engine is using cheap and nasty "X += dX * dt" anyway, so even a perfect calculation wouldn't be accurate.

    My points: it's hitting the target. We hit the time target. It's a game.

    Sure, physics has a place, and it's aesthetically appealing, but as long as you get the results that you need, the method isn't important. The games that you think have great physics? Probably fudged nine ways from Sunday to make them feel great.

    --
    If you were blocking sigs, you wouldn't have to read this.
    1. Re:The results are what matter by Anonymous Coward · · Score: 0

      Damn, I wish I had moderator points. This is the only response so far to explain how real games are made. Cheat whenever possible, use the "real" equations when all else fails.

  72. various rules of thumb by drenehtsral · · Score: 2, Interesting

    I've found in my limited (hobby only) game programming experience that real physics make for boring run 'n' jump games, but they make for wonderful projectile games. Think ballistics (Scorched Earth, Quake, etc...).

    Another pet peeve i have is that a lot of these sort of things never really mention one killer point. When computing whatever delta t for updating a scene, it is best to use a moving average of the last n frames (i use 32, kept in a rotating ring buffer), because that keeps an unusually long or short frame from fucking up any calcultions.

    --

    ---
    Play Six Pack Man. I
    1. Re:various rules of thumb by big_hairy_mama · · Score: 1

      That may have applied 5 years ago, but now, almost all games are at least 3D, which means that the player kind of expects some sort of realistic physics. Maybe "modified" physics (as discussed in earlier posts, where there is less gravity or something like that), but still following real-world models.

  73. I know this is a joke, but... by djohnsto · · Score: 2

    Actually, some of the people I work with have been doing research on trying to simulate cartoon physics, it's VERY difficult! It's basically research into getting game characters to stretch or compact realistically when accelerating or colliding with walls/floors. In terms of "real" physics, this is close to soft-body dynamics, which is MUCH harder than the rigid-body dynamics presented in this book...

    --
    Dan
  74. Two Words by Anonymous Coward · · Score: 0

    Kalman Filter

  75. HL:Counter-strike/ UT:Tactical Ops... by GiorgioG · · Score: 1

    I'd like to see some mesh deformation when a grenade gets tossed into a room. But more than just deformations I suppose. Walls should be able to collapse, etc. Am I dreaming? I don't think so. This technology should be available in a couple years at best. In fact, I don't think anyone knows how to do it well yet, and that's why it doesn't exist (afaik) - because processors are fast enough to handle this sort of thing I imagine. I'm not saying I need perfect simulation, far from that.

  76. Realism and such... by Bullschmidt · · Score: 2

    Just because this book tells you how to program more realistic models, does NOT mean they have to be realistic. For example, you can set gravity to 9.8m/s^2, or hell set it to 4.9m/s^2 and have it be the moon. Or if you JUST want higher jumps, increase the force you apply when jumping.

    The important thing this book (I assume) lets you do is generate better MODELS. These models can be parameterized on all sorts of things. The outcome doesn't have to be more realistic, but the interactions will be more consistent and reliable. In this way, the interactions of the forces (even if gravity is half or what it is normally) can still be realistic.

    --
    "Of all days, the day on which one has not laughed is the most surely the one wasted." -Sebastian Roch Nicol
  77. Re:... accurate physics by madbovine9 · · Score: 1
    One thing to realize is that most of the time phyics is just a close approximation anyway. In quantum mechanics ONLY the 2 body problem (basic hydrogen atom) can be solved. Everything else is just too damn complex. Most real physics is finding a good method of approximation that will acuratly predict real events.

    Many of these methods are numerical in nature and lend themselves to computer calculations. Taylor series, perterbation theory, iteration methods, hell ALL of statistical physics is this way.

    I think that the programmers can go past the "quick and dirty" methods and with just a bit more effort come up with wonderful physics models, and it looks like this book is trying to do just that.

  78. A course in mechanics by shaunak · · Score: 2, Insightful

    For those of you interested in the physics of motion (mechanics), I would suggest you pick up the books "Vector Mechanics for Engineers" by Prof. Beer and Prof. Johnston. It is easily the best book for mechanics I have personally read. And it is modular in the sense you can skip some chapters if they're not interesting without going "DUH" while reading the later ones. Although it says 'For engineers,' the books are understandable even if you haven't got too much math experience. If you're scared of vectors, they also have a "Mechanics for Engineers."

    --
    -Shaunak.
  79. A course in mechanics - addendum by shaunak · · Score: 1
    --
    -Shaunak.
  80. flashbacks to highschool by hawk · · Score: 2
    The phyysics of a game should be playable; there's no need for them to be accurate. If Aristotelian physics work better, use them . . .


    I'm reminded of folks in high school who would get hot under the collar arguing that the Arduin rules for magic and hit points were more realistic than the D&D versions, or the realism of different types of dragons . . .


    hawk

  81. Re:more fun blowiung up stuff with accurate physic by Anonymous Coward · · Score: 0

    Try Infiltration, at http://www.planetunreal.com/infiltration

    Oddly enough, it is a community driven project, and anyone with demonstrated programming skills is free to offer contributions.

    Bullet holes based on surface type and round caliber are slated for the version release in January, but a current partial list of features includes a breathing system (must hold your breath for greater accuracy), leaning, lying down, inertial running system, no crosshairs (you aim with the iron sights on the weapon), weapon physics (kickback, sounds, take-down power, etc.) taken directly from the actual weapons and ballistics data.

    It's a lot like Counter Strike, minus the ridiculous video game aspects. It's a mod focused on realism where nearly every design issue is resolved around the question, "What would be more realistic?"

  82. and that's not new by hawk · · Score: 2
    A couple of years ago, I stumbled across an old "Walt Disney Presents" from the 50's or early 60'sl with a discussion of this. They really spend time on the plausibility and the twist that makes it "believable"


    hawk

    1. Re:and that's not new by porges · · Score: 1

      A couple of years ago, I stumbled across an old "Walt Disney Presents" from the 50's or early 60'sl with a discussion of this. They really spend time on the plausibility and the twist that makes it "believable"

      Probably "The Plausible Impossible". There's also a book called (maybe) "The Art of Disney", which talks about the concepts of "squash" and "stretch" in characters when they move.

  83. Aha! I think I just made a breakthrough by DG · · Score: 2

    I think I just figured out why my ground tracks are such a bloody mess.

    The acceleration values I have are taken _with respect to the vehicle's axis_ not the world co-ordinates' axis.

    So I somehow have to translate the co-ordinate systems before I can apply the acceleration to the vehicle....

    Any ideas on how to do that?

    .

    --
    Want to learn about race cars? Read my Book
    1. Re:Aha! I think I just made a breakthrough by edremy · · Score: 2
      Is your vehicle rigid?

      If yes, it's just a bit of trig. You can do it two ways: keep the positions/velocities/accelerations of your vehicle in world coordinates or keep them in vehicle coordinates. I'd highly recommend the former: I assume that the forces on your vehicle are a collection of ones generated internally (by an engine, for example) and externally (by collisions with other moving objects, gravity, etc.) Only the former will need to be converted.

      If your vehicle is on a plane (such as a car on a flat surface) it's easy. Define an angle theta which is the angle between the world xaxis and the direction your car is pointing. Then the components of your vehicle's acceleration a are just a(x) = a*cos(theta) and a(y) = a*sin(theta). (This assumes no slipping, of course.)

      In 3-d, it's a lot easier if you have thrust only on one axis. (I.e., you have a cylindrical rocket with an engine in the tail.) This lets you ignore roll and then you only need 2 angle variables, theta and phi (aka pitch and yaw): phi runs between 0 and 2*pi and theta from 0 to pi. (Convince yourself that this covers the sphere- it does.) The conversions to take an acceleration a and two angles to cartesian (xyz) coordinates are just the usual ones to convert from spherical polar coordinates to cartesian

      • a(x) = a*sin(theta)*cos(phi)
      • a(y) = a*sin(theta)*sin(phi)
      • a(z) = a*cos(theta)

      If you want thrust coming from any axis at any time (aka spaceship with side thrusters), you'll need to include roll. I'd have to go look these up- they're hairier.

      If your vehicle is not rigid, let me introduce you to the wonderful world of constrained dynamics. I've got lots of references. (Constrained velocity Verlet= RATTLE, another of my advisor's algorithms.) Hint: if you don't know what I'm talking about, don't go this road! It's far more CPU intensive and the code is uglier.

      Eric

      --
      "Seven Deadly Sins? I thought it was a to-do list!"
  84. Twisted Metal 2 by Anonymous Coward · · Score: 0
    To see the difference good physics makes to a game, get each of the Twisted Metal games for the Playstation and PS2.

    The only one worth playing is TM2.

  85. Filter by JMZero · · Score: 1

    The anonymous coward above is correct - a Kalman filter will help smooth out some errors.

    That said, I'd invest in a fancy pants GPS or two. Or a black box sort of solution. If you do need Kalman filtering - I suggest downloading a library to handle the mess.

    --
    Let's not stir that bag of worms...
  86. "Realistic Physics" by Life+Blood · · Score: 2

    The main problem with realistic physics in video games is that it really isn't possible to do it.

    What's that you say? But this whole post is about how you can do it? Nope sorry, but I don't know of any games today that really model what is going on in terms of 3D solid mechanics. Once one body interacts with another the calculations get staggering complex. Likewise do you really think that the flight sim calculates the flow around the aircraft to get it to behave right? Of course not.

    What most games actually do is model everything as a point mass and then add a handful of other parameters to take into account solid body rotations. Collisions and other more complex events are handled with simple rules of thumb. Or in other words they are fudged. Provided they are fudged well it doesn't really matter. This is what many simulation games do (like Terminus). If you are very lucky they may actually calculate the stall of an aircraft using bernoulli's principle at a few key points. However it far easier to supply a stall angle and stick with that.

    So when we talk about "game physics" keep in mind that some of the best game physics of all is completely fictitious. It just has to look and feel right, it doesn't have to be right especially when being right would take way to much processor power.

    --

    So far I've gotten all my Karma from telling people they are wrong... :)

  87. Game Programming Tutorials by non · · Score: 1

    one of the best on the subject, apparently in the minds of others as well, is Andre LaMothe's The Black Art of 3D Game Programming. It covers vector mathematics and matrix multiplication in a fairly accessible way, and more importantly goes through the optimization necessary to turn conceptually correct algorithms into something that will churn out FPS.

    _______________________________________________

    --
    ...vividly encapsulates that post-Watergate/pre-punk/coked-up moment when you could trust no one, least of all yourself.
  88. Forgotten downforce? by Maddog+Batty · · Score: 3, Informative
    Sure the game developer may have found that changing the physics model made the game more fun to play but one possibility is that (s)he had forgotten to model downforce. An F1 car produces a downforce higher than its own weight (cue comment about F1 cars being able to drive on the ceiling). Without downforce, a car would flip going around a corner at F1 speeds.

    A very simple (*) way to model downforce is to drop the centre of gravity of the model so that it is below the ground. Other variables such as tire grip also have to be changed as well but these are generally constants.

    (*) Downforce changes with vehicle speed so this is a very simple model.

    --
    wot no sig
    1. Re:Forgotten downforce? by karb · · Score: 1

      That's what I was thinking. One of my racing geek friends told me that F1 cars lose about 80 mph just by *letting off the accelerator*, such is the trememdous downforce.

      --

      Jack Valenti and the MPAA are to technology as the Boston strangler is to the woman home alone

    2. Re:Forgotten downforce? by aallan · · Score: 2

      ...but one possibility is that (s)he had forgotten to model downforce.

      That would be my guess as well...

      Al.
      --
      The Daily ACK - Eclectic posts by yet another hacker
  89. Lara Croft by Stephen · · Score: 5, Funny

    Realistic physics in games will never catch on. Lara Croft would keep falling over forwards.

    --
    11.00100100001111110110101010001000100001011010001 1000010001101001100010011
    1. Re:Lara Croft by spood · · Score: 1

      Then they can just make her ass bigger.

      --
      ---- Just another spud server.
  90. Is this a second duplicate in a row? by sopwath · · Score: 1

    This appears to be more of a review so it's not as bad but this story covered the same book.

    Come on editors

  91. Why game physics is hard by Animats · · Score: 3, Informative
    I'll have to take a look at this new book, but from the description, it looks like the author doesn't address the hard problems. Alternatively, the reviewer may not know what to look for.

    As someone else pointed out, there's a straightforward way to approach game physics, based on what you learn in a first-year dynamics course, and it won't work. Free flight is easy. Contacts and collisions are hard.

    Detecting contacts between objects is complicated, but well-understood. There are several free collision-detection engines available, and many research papers. The time bounds are quite good; only slightly worse than O(N) with the better algorithms. Writing a collision detection system is a big job, but the theory is tractible.

    Taking appropriate action when you detect a contact is the hard part of the problem. Bouncing balls are easy. Multiple irregular objects with multiple contacts, slipping and sliding, are hard. Most current games simplify their collision geometry down to cubes or spheres and botch the hard cases ("But my sword went right through him and he didn't even notice!") The latest generation of games is just starting to get contact right. In another year, correct contact handling will be a "must-have" for commercial games.

    If you simulate contacts between objects with a spring and a damper, you run into numerical stiffness during integration. Soft objects at slow speeds will bounce fine. In a hard collision, the forces become huge for short periods. The simple integration algorithms will result in huge errors, and the objects will go flying off into space.

    If you simulate contacts between objects as impulses (an impulse is an infinite force applied for zero time, but with a finite energy transfer), two objects bouncing off each other will work great. More than one contact per object doesn't work too well. Resting contact doesn't work; objects may fall through each other. And everything bounces like it's a pool ball, because all collisions take zero time.

    If you try to do everything with constraints, resting contact works. But combinations of sliding and resting contact result in wierd corner cases that are hard to get right. Trying to solve contact, rather than simulate it, leads to static indeterminacy. (Think of a table with four legs, slightly different in length. How the table behaves is very sensitive to small changes in leg length. Numerical solutions of multipoint contact problems become similarly sensitive). This is the approach Baraff preaches at SIGGRAPH, but few others have been able to implement it.

    After a few years on the problem, I developed Falling Bodies, which successfully solves this problem well enough to simulate a human figure falling down a circular staircase. It can be done. I hammered through the spring-damper problem by using unusual and robust integration techniques. This is computationally expensive, but sound.

    If you're developing a commercial game, and need working physics, go with the Havok engine. They have a rigid body engine, a soft-body system, and a specialized vehicle simulation engine. (Yes, vehicle physics in games typically has fake components. In most racing games, the tires are impossibly good and the vehicle CG is impossibly low. But you need a real physics engine to fake it properly.) It's not cheap, but you're not going to solve this problem in a few months. Major developers have blown years on this problem and failed. Trespasser, from Dreamworks, went down the drain that way.

    1. Re:Why game physics is hard by Anonymous Coward · · Score: 1, Informative
      From your Falling Bodies page: The technology behind Falling Bodies is now patented. This broad patent covers most spring/damper character simulation systems. If it falls, it has joints, it looks right, and it works right, it's probably covered by our patent.

      Fuck you too. Or to put it another way - did you really invent the whole idea of simulating springs and dampers? If so, good for you. If not, you're an opportunistic asshole.

    2. Re:Why game physics is hard by MikeBabcock · · Score: 2

      Looking at, for example, your mecha toss example (which looks great, btw), how much computation time is required?

      Also, how difficult would it be for your algorithms to be changed to allow for dynamic forces to be inserted (such as motor movements attempting to right the mech as it hits the ground on three of its feet)?

      --
      - Michael T. Babcock (Yes, I blog)
    3. Re:Why game physics is hard by Animats · · Score: 2
      Looking at, for example, your mecha toss example (which looks great, btw), how much computation time is required?

      That one is just about real-time on a 1GHz CPU. But the time isn't evenly distributed; it's far faster than real time in flight, and much slower during the early parts of collisions. For game work, not only do you need good average speed, you need adequate worst-case speed. There are ways to achieve this, although they involve a certain amount of "cheating" internally. For the animation plug-in application, we don't cheat, which generates the best-quality motion. Games will usually choose to cheat a bit, and some motion will look a bit off. Generally, if you cheat in a way that loses energy, it looks OK. The eye is very sensitive to gains in kinetic energy. That's a basic recognizer for attacks. If you make an error that gains energy, people will notice.

      Demo story: When Falling Bodies was first shown at the Softimage user group meeting at SIGGRAPH 1997, I gave a talk, then let people try it in public. One user keyframed an upward jump of the big mecha, with it on the ground at the first frame and moved upward by its own height in the second. They then turned control over to Falling Bodies. That jump of 20 meters upward in 1/30 sec launched the creature upwards at about Mach 2, and the simulator showed it getting smaller and smaller until it dwindled to a point and disappeared. But the frame counter kept ticking along, and I said, "wait, it will come back", and after a while, down it came. I'd never tried a collision that hard. The creature is 20 meters high, has the density of water, and hit the ground at Mach 2. At the moment of contact, the simulator crunched for thirty seconds on one frame, then the creature bounced a few times and collapsed in a heap. The Hollywood types liked it.

      Moral: Proper handling of extreme cases is worth it.

    4. Re:Why game physics is hard by Animats · · Score: 2
      Also, how difficult would it be for your algorithms to be changed to allow for dynamic forces to be inserted (such as motor movements attempting to right the mech as it hits the ground on three of its feet)?

      Take a look at these QuickTime movies. (Note that Windows Media Player won't play them, because they were authored on a Mac. Windows Media Player grabs the .mov extension, but doesn't have a full set of QuickTime codecs. You'll need QuickTime.) Did those in 1994.

      We'll see that kind of technology in games soon. At last, we have the MIPS.

    5. Re:Why game physics is hard by MikeBabcock · · Score: 2

      I must say, seeing an object actually fall apart properly would be great in, for example, a racing or mech simulator ... I'm tired of having cars in a racing game bump off walls and each other as though they were made of ice ... ;-)

      --
      - Michael T. Babcock (Yes, I blog)
  92. Virtually all undergraduate mech. engineering... by chrisatslashdot · · Score: 1

    ciriclum includes statics, dynamics, and mech. of materials. The first two are basically the physics of rigid things and the latter goes into how things squish. Statics and Dynamics are offered at many community colleges and I would highly recommend them for programmers who want to a better understanding of how F=m*a applies to the world.

    --


    Simple people talk of people, better people talk of events, great people talk of ideas.
  93. Red Faction by robson · · Score: 1

    Actually, a PC/PS2 game called Red Faction featured something it called "Geo-Mod" technology, which was basically real-time boolean subtraction to simulate holes in walls, etc.

    It wasn't as interesting as it could have been, from a game-play perspective. The problem is that we game developers are used to making environments *very* static -- often based on BSP-trees and such. This saves the engineers a lot of headaches, but guarantees rock-solid, unchanging environments.

    What you're talking about, with full structural physics and everything... it's going to be a while. I'd love to see an area where, if you destroy enough pillars/supports, the floor above you comes crashing down. Unfortunately, that's a sh|tload of math, and the environment would have to be created in such a way that it doesn't close off any critical paths when collapsed, etc etc etc.

    It's a tough problem. But consider this: We're just now starting to get shadows that move when you move lights around! (That's what Carmack's working on right now...)

    1. Re:Red Faction by GiorgioG · · Score: 1

      I wouldn't even mind if walls broke into "generic" pieces (large & small chunks, etc - still acted like shrapnel as well).
      I considered the structural collapse of floors/buildings, etc. But that's a far away dream I think. BSP trees are used to make sure you don't draw non-visible elements (if I recall correctly), but isn't it about time somebody comes up with a better/dynamic solution? Hell, I don't know if you can link multiple BSP trees together, but why not even have "animated" BSP trees. One for pre-blown up wall sections, one post. Update the game-bsp state as needed. Am I just talking out of my ass? =)

    2. Re:Red Faction by MrResistor · · Score: 2
      the environment would have to be created in such a way that it doesn't close off any critical paths when collapsed

      Why? If somebody does something stupid and they get stuck it's their own fault. That's how it is in real life, why should we expect anything different from a realistic game? Otherwise you have to define what can and cannot be destroyed, and you end up with something just like the "deformable" terrain we currently have in some games, except it's got a whole lot of unnecessary math chewing up your clock cycles.

      --
      Under capitalism man exploits man. Under communism it's the other way around.
  94. Re:Physics in games (4D Stunts Driving) by Zangief · · Score: 1

    That was really funny game! The physical model was horrible, so much, than when you crashed into another car and went flying at amazing speeds, you did fly in a parabolic trayectory (as newton says), but it had a positive gradient, not negative, as in the real world!!!

  95. Re:Physics? Yes. Game development? No. by nlh · · Score: 2

    This is a very interesting point -- I imagine that a lot of modern game development has to do with squeezing as much as possible out of each frame....and for the same reasons that 3D graphics programming is more than just "calculate primative, raterize, clip scene, etc." but actually uses well-designed algorithms to make this process more efficient.

    Do you have any links/books/info on the "trickery and non-traditional techniques" that game developers might use?

    --Noah

  96. Simulation vs Games by namespan · · Score: 2

    I picked up this book just last night at Borders... flipped through it, and thought it was really interesting. I'm not particularly interested in programming games, but I am interested in doing simulations. Can anyone recommend any other books that would get one into this?

    --
    Libertarianism is rich wolves and poor sheep playing gambler's ruin for dinner.
    1. Re:Simulation vs Games by bucky0 · · Score: 1

      A simulation is just a game without a story line/AI etc... I 'm sure the same prinicples would carry over.

      --

      -Bucky
  97. if you don t know you defy, you don t defy ! by Anonymous Coward · · Score: 1, Insightful

    In order to willingly take 'programmatic' licence with kinematics, you have to know it. Just like a poet needs to know the language very well before he can successfully use poetic licence.

  98. Re:Virtually all undergraduate mech. engineering.. by rootmonkey · · Score: 1

    I agree. Infact any eningeering degree will cover what you need to know. A computer science degree probably won't, but thats what computer engineering degrees are for.

    --

    Yes but every time I try to see it your way, I get a headache.
  99. Re:articles on physics & collition detection e by namespan · · Score: 2

    As it turns out, the book cites several gamasutra articles as references.

    --
    Libertarianism is rich wolves and poor sheep playing gambler's ruin for dinner.
  100. Re:... accurate physics by Zilya · · Score: 1

    Guess what: quantum mechanics is also approximation in nonrelativistic limit. Only 1 electron (Dirac) problem was solved so far without any approximation (with latest model of universe)

  101. Not inaccurarte and unstable by Junks+Jerzey · · Score: 3, Informative

    Unfortunately this method (Euler's method) is very inaccurate and unstable

    This is only true if you're simulating a standalone system (like the orbiting planet example). In real games, the player is constantly pressing the controller, collisions are occurring, and the "AI" is making decisions. Stepwise integration makes perfect sense in that case. Calling it "inaccurate and unstable" shows a lack of game development experience.

    1. Re:Not inaccurarte and unstable by ottffssent · · Score: 2

      And the bitch of it is, he's right. Euler's method works fine if the steps are small compared to the second derivative but when the function you are integrating varies wildly, it becomes horribly inaccurate for reasonable-sized steps.

      Example: a sine wave. The derivative of a sine is known, but for this example, it isn't. Instead, we're running through Euler's method. Steps are taken at fixed intervals and the function evaluated. Put those steps 2*pi radians apart, and you'll get an answer that has no bearing on reality. Put your steps pi radians apart, and you'll get zero.

      This is why hard collisions are difficult - the forces are near zero while the object is careening towards something, and then they spike up very high very fast and go back to nearly zero very fast. The zero part is uninteresting, but the spike has to be very carefully calculated. If time steps are too coarse, the game will be erratic - most objects will collide very poorly and the few percent of collisions where the sample takes place near the peak of the force curve will accelerate wildly away.

      If it weren't finals week, I'd make a graphic showing an original function and that function reconstructed from the derivative found by Euler's method with varying step sizes. It would clearly show the worst thing about Euler's method, namely that error accumulates instead of cancelling.

    2. Re:Not inaccurarte and unstable by strags · · Score: 2

      Hmmm.

      Trying to correctly simulate a bunch of cubes colliding with each other, and eventually coming to rest in contact with each other (and the ground) will convince you pretty damn quickly that Euler integration isn't sufficient for proper physics simulation.

      The point you miss is that as time goes on, more and more developers are incorporating some form of "proper" physics simulation into their games, since pre-canned animations can only take you so far. Thus, Euler integration becomes less and less suitable.

      I wouldn't make sweeping statements regarding the other guy's game dev experience - it sounds an awful lot like all you've done is springs and bouncing balls. Rigid body mechanics is a whole different world, and is likely to play a larger and larger part in videogames as CPUs become more and more capable of dealing with it.

  102. Feynman Lectures on Physics by Anonymous Coward · · Score: 0

    Just read Feynman's lectures on physics...the best.

  103. ReVolt by __aawwih8715 · · Score: 1

    yes, Revolt for N64 had good physics but...

    It was _unplayable_ because of the terrible framerate.

    I just wish it would have had a decent framerate like on dreamcast.

  104. Barely mechanics.Surely not covering the subject. by Anonymous Coward · · Score: 1

    I find the title with "physics" a bit pretentious when it is only an introduction to mechanics and a few methods of numerical analysis.
    To cover the subject would require for instance: -Optical effects (refraction, interferences and moires )
    -fluid dynamics (for smoke, fire, waterflows...)
    -condensed matter ( relations between thermal, electrical and optical properties of matter, cristal/amorphous, phase transitions) for calculating textures.
    -electromagnetics (realistic fade of a radio signal, for instance in a first person shooter)
    -acoustics (delay effects with distance, effect of fog and other materials on phase/frequency, doppler shifts ...)

    and this could go on and on.
    Some things are expensive, but some are probably not and would give an extra presence to the games that would be worth lots of brute-force (frames per second, polygons, or other usual rendering issues)

  105. Re:Physics in games (4D Stunts Driving) by shd99004 · · Score: 2

    I wonder why I didn't have a better subject line. Hm. Anyway, you're right, the cars could be flying in weird trajectories, it made the game very funny, very playable!

    --
    Will work for bandwidth
  106. Fantasy is better than reality by roman_mir · · Score: 2

    Carmageddon is an addictive game not due to the physically simulated space but due to the simple fact of being able to crash someone's eye balls after you run them over with your truck over and over and over and over and over again! (the sound of crashing bones is what makes that game addictive)

  107. Re:Runge-Kutta? Will you be getting degree? O my g by Zilya · · Score: 1

    Where is the world going? The orbit simulation is probably the most complex problem for integration ordinary differential equations. 3-(or more)-body problem does not have closed form solution and can have attractors with fractal dimenstions. This kind of problems are very difficult to integrate numerically. 16-th and higher order methods (opposed to usual 4-th order runge-kutta) are most common. On the other hand, "simulating heat flow within in a heatsink" is usually done with no more than 4-th order schemes and 2-nd order are most common. (Partial differrential equations have other problems, of course)

    Good luck with your degree... ;)

  108. Materila Characterstics need to be included too... by raam · · Score: 1

    Getting the physics model right is something very important. However, to go along with this would be a nice model of the materials involved in the game. Wodd colored textures should give, dent, and mold like wood. Skin whould flake, scrape, and change color when abraised, etc. Steel should ...well, you get the idea.

  109. Re:Runge-Kutta? Will you be getting degree? O my g by pclminion · · Score: 2
    Do we need high-order simulation of planetary orbits in a space shooter? These attractors and other phenomena only emerge after immense periods of time -- much longer than the time periods in a typical game of blow-the-crap-out-of-Buster.

    Not quite sure how to take your comment on my degree :) I'm also getting a degree in CS so it's a lot of juggling to be doing. I'm putting the priority on CS.

  110. From a developer... by pixel_bc · · Score: 1
    You'll find that fun physics aren't neccesarily correct physics. Granted, there's a certian coolness to having coded a correct system -- but in practice nothing (fun, at least) ships with a system like that.

    Most often then not, the game is tweaked by a producer with an app that has a few sliders that allows him to change anything from gravity, to acceleration, to, well... you name it. Think about it - when was the last time you had fum driving an normal car? No way man! You want mega jumps, you want to turn on a dime... etc etc etc.

  111. What about Square? by fatcow · · Score: 0

    I'd really really love to hear about the physics of FINAL FANTASY.

    Let's see --

    Cloud 70Kg.
    Big badass sword 40Kg.

    Height of jump 30 meters.

  112. Other good reads by twisted_pickle · · Score: 1

    I've dabbled a bit in 3d graphics and physics, though I'm not a professional developer or physicist, just a student. But I have read some good books that were really useful for physics programming, and 3D programming in general. I recommend reading a good textbook on linear algebra with matrices or sitting in on a course. There are a lot physics uses for matrices, and you can write a pretty good 3D engine based on them. My recommendations for reading:

    Cutting-Edge 3D Game Programming with C++, by John DeGoes. Publisher: Coriolis Group Books, 1996.

    This book, although probably not cutting edge any more, is a good introduction to 3D programming (polygons, lighting, shading, optimization, physics, a little bit on AI, etc). The code is written in c++ and the examples in the book require Borland C++'s power pack (these were written before DirectX, OpenGL etc. were widely used, probably because not many people had exclusive 3D hardware back then). Although today it's probably too much of a waste of time to code your own 3D engine, as there are a lot of good code libraries out there that work just as good, reading this book walks you step by step through the development of a 3D engine, so you can get a good understanding of how things work.

    Introduction to Linear Algebra, by Johnson, Riess, Arnold. Fifth Ed. Publisher: Addison-Wesley.

    This was my college textbook for matrix algebra. I still refer to it, there are a lot of really useful applications for matrices in physics, and computer graphics, especially when you have to deal with huge systems of equations--matrix algebra solves these problems pretty easily. This book isn't too dry imho, probably just because I'm a geek though.

    --
    4-bit adder: A snake made of 1's and 0's
  113. Better getting a comp methods physics book... by Brand+X · · Score: 2

    This is a subject on which I am as close to a world expert as it's possible to get. If you are familiar with MMOG development, you may have heard of MUD-Dev. If you do a search for my name and "physmud" you'll turn up hundreds of articles on the simulation of physics in a game engine. I used to simulate multi-day trajectories of orbital and ballistic bodies for SDI purposes for a living. I know just about all there is to know about this kind of modeling, and where you can take a shortcut, how to do a numerical approximation in n or nlogn steps when possible, what the inaccuracies introduced by each approximation would be... sometimes, I know how to do an exact solution to a transformation in a far smaller amount of time, using a jacobian transformation on complex geometries with an angular integration... but the reason I know this is, I learned on the job, and I took a degree (plus a bit) in physics, and I read all the books I could find. So, it is with regret that I say this book was not terribly good. I've seen better in a text entitled "An Introduction to Computer Simulation Methods, Applications to Physical Systems", a not too well written textbook with source in BASIC, but at least featuring a fair breakdown in the nature of algorithms, numerical integration, efficiency and accuracy, etc. A much better choice, IMO, would be "Numerical Recipies in C", though it's a little more advanced... "Numerical Methods for Physics" is hard to find, but very good. "Numerical Methods for Scientists and Engineers" is not the same book, and while very good for numerical analysis, it isn't an ideal book for learning simulation techniques. If you're interested in related fields, try looking on Amazon under Books/Subjects/Science/Mathematics/Applied/Compute r Mathematics. There's stuff on 3D graphics algorithms, signal processing, crypto, genetic algorithms, organic and physical chemistry sims, and more... just be aware that there are a lot of books on using Matlab/Mathematica/Maple/etc.

    --
    -- Still waiting for the Nike endorsement
  114. Re:Red Faction (now off-topic) by robson · · Score: 1

    Well... where I work, that's called an "A bug". We can't allow situations where the player can render the game impossible to finish.

    Imagine this: You collapse said ceiling, then save your game. Now... you didn't know that this would block your only path out, so it's not really your *fault*. But now that you've saved the game, and you've made it impossible to finish, you'll have to start over (or, more likely, throw the game in the trash).

    Along with bad crash bugs, this is the worst sort of game bug.

  115. Re:Runge-Kutta? Will you be getting degree? O my g by Anonymous Coward · · Score: 0

    I'll second this!
    This guy is getting a degree in physics, and clames to know something about numerical methods, but doesn't understand the first thing about ballistic trajectories.

    Case in point:
    "The orbit is elliptical, so just simulate a freaking ellipse!"

    Lets just assume for the moment that it is a simple 2 body problem with the mass of the second body being neglible. What is the speed of the object at different points on the ellipse? How long does it take to get from one point to another? You need actual astrodynamics to work that stuff out. I remember a space game simulation (sorry, can't remember the title) that had the object traveling at the same speed over the entire ellipse for a highly elliptical orbit! What a joke.

    Now throw in multi-body dynamics, etc. and even your simple ellipse goes out the window.

  116. Troll? by autopr0n · · Score: 3, Informative

    How is this a troll?

    Hrm. Seems my last five comments have each been modded down one point. Fortunetly for me, I could care less.

    --
    autopr0n is like, down and stuff.
    1. Re:Troll? by skotte · · Score: 1

      just thought i'd mention: i meta-modded this 'troll' rating as unfair. seems pretty clear to me. wtf.

      (although, as a personal note, your sig might be the cause of the 'troll' modding. just a guess)

  117. I think we're getting somewhere... by DG · · Score: 2

    So now, given the theta angle, we can transform the car-coodinates accelerations into world-coordinates accelerations, and then we process the Verlet algorithm to get positions.

    Soooo then... how to determine the theta angle, given that there is no compass on the vehicle?

    I don't think I've defined the problem clearly enough:

    Imagine you have a car, parked on a flat plane of infinate size. The car is stationary, at the origin, with the nose aligned with the Y axis (so, for the moment, the car axis and the world axis are aligned)

    Inside the car is a pair of accelerometers (one along the car's x axis, the other along the car's y axis), and a speedometer (which provides car-y-axis velocity) The car is then driven around in a path, while the accelerometers and speedometer record values at a fixed sample rate.

    Given the resulting data stream, and assuming no slip, give the stream of world (x,y) coordinates that correspond to each car (x-accel, y-accel, y-velocity) coordinate.

    Seems like we're modt of the way there...

    .

    --
    Want to learn about race cars? Read my Book
    1. Re:I think we're getting somewhere... by edremy · · Score: 2

      You can fake the compass (see below) but you need 3 instruments for 3 degrees of freedom.

      For a generalized rigid body in 3-space, you have six degrees of freedom (x,y,z as "external" coordinates, rho,theta,phi (roll, pitch, yaw)as "internal"), so you'll need *6* accelerometers.

      For your car, you have x,y and theta, so you'll need 3. You've got 3 instruments. X,y are fine since you have accelerometers for them. The speedometer could be used to back compute the current theta- you'll have velocity given by that (v) and you'll have computed v(x) and v(y) using the accelerometers, so again v(x) = v*cos(theta), but this is really clumsy. Better to just have the position described by x,y and theta. Note: if you have to do this inverse trig functions are usually really, really slow unless you have a good math library. (No, the standard math libraries in any language you care to name are *not* good.) Consider using a lookup table if absolute accuracy isn't needed.

      Is this a real world problem? You seem to be thinking about this in terms of engineering rather than as a simulation. If it's just in a computer just track 6 position, velocity, acceleration and force variables (1 for each DoF) and be done with it.

      Eric

      --
      "Seven Deadly Sins? I thought it was a to-do list!"
    2. Re:I think we're getting somewhere... by DG · · Score: 2

      This is in fact a real-world problem - thus all the extra work.

      Math and processor time are cheaper than sensors, especially things like electronic compasses and high-res, high-sample-rate GPS.

      .

      --
      Want to learn about race cars? Read my Book
  118. xracer by Anonymous Coward · · Score: 0

    xracer? As far as I recall, after trying it out and even having a look at the source code, there was no physics behind xracer.

  119. Don't forget ... by UnknownSoldier · · Score: 2

    .. that the physics-based formulas are just *one* part of a physics engine.

    Collision Detection (CD), and more importantly Collision Response (CR) determine the "feel" for your game. You can have the most accurate physics in the world, but if your CD/CR sucks, chances are, you're bringing the game down too.

    Check the archives of Game Dev Algorithms if you want more info.

  120. Re:Red Faction (now off-topic) by Anonymous Coward · · Score: 0

    Okay, so what if the player saves the game when his character has 1% health and there is a rocket two meters behind him and speeding directly towards him? The player can't see the rocket that's behind him, so it's not really his *fault*, after all...

    Would your company consider this situation a "game bug" too?

    Does your company specialize in making games which are impossible to lose?

    (If so, I'm pretty impressed--I've never seen anyone who worked at Squaresoft post on /. before :))

  121. Amen. by Anonymous Coward · · Score: 0

    Of sorts. As one posted said, "..games are more fun when I can throw physics out the window and jump around in the air."

    Yeah, Matrix-like action is still amazingly fun after all this time.

    Anyway, I agree with one thought here. Graphics do not matter. But, in reality, they do.

    Look at Square. Story? Why, it's our good hero, Cumulonimbus, off to fight the evil (Insert a Biblical-sounding name here), and along the way, his girlfriend (dies/marries him)! The only thing Square has going for it is graphics, nowadays.

    Lo and behold, look at all the people who flock to Square's banner because of their flashy graphics.

    It's like Top 40 radio. It sucks. I know it sucks, you know it sucks, but the rest of your block thinks Britney Spears actually has musical talent.

    Unfortunately, games, like music, like movies, like books, are becoming more 'mainstream' - and that means companies sell to the lowest common denominator, because that section makes up the bulk of the population, thereby netting them the most profit.

    I mean, look at Star Wars. First came, "No, Luke, *I* am your father." I can't count the number of times I've seen evil guy = good guy's father because of The Empire Strikes Back. Even in Video Games, it's *there*. Shining in the Darkness and Seiken Densetsu 3 quickly spring to mind, though there's plenty of others.

    Lord of the Rings? LCD! LCD! The audience wouldn't understand Bombadil, of course! Arwen? Why, all the feminazis would bitch if we didn't have more than Eowyn kicking ass.

    (Note: Not ragging on Jackson here. If I had been handed $300 mil, I'd want to make sure it appealed to as wide an audience as possible. LCD, folks.)

    You know what? I was playing Castlevania 2 the other night.

    And I found myself wondering, "How in the name of Hell did they fit a game like this onto a Nes cartridge?"

    The music in CV2 was excellent (Considering the hardware), and so were the graphics. Yet those weren't the most impressive things.

    The single most impressive part of the game was *gameplay*.

    Sadly, like the dinosaur, like 8-bit consoles, gameplay as an important feature is now extinct.

  122. Re:more fun blowiung up stuff with accurate physic by MindStalker · · Score: 1

    You just have to be willing to look for a good clan server to play on. Many have setups where if you cheat you are immediently banned, and it works pretty well. (Went through a short time after punk-buster stopped developing that cheating was horrid, but that has pretty much been fixed) If you want more info, email me, I'm not about to post the game server on slashdot, we really don't want the slashdot effect.

  123. Re:Red Faction (now off-topic) by GiorgioG · · Score: 1

    alright guys..calm down ;-) I'm mostly talking about team-based online UT:TO/HL:CS type games. We can generally shoot each other no prob. Ok, sceneario: a wall is blown away and blocks stairs that separate both teams, or a floor gets destroyed. Obviously someone will notice the impass, either 1 team or both teams - a user his tab, votes "restore/remove wall/floor piece", little popup window of the offending piece shows up on other still-living players with a 'yes/no?' option...there. all done. problem semi-fixed. Sure, not a good solution for single player games...

  124. Not having seen the book... by cr0sh · · Score: 2

    If it is done like most books today, it is simply glued. If color isn't a necessary component of the printing, you could "break" the spine, carefully remove the leaves (I think that is the term) or pages (if it is real cheap), from the book, photocopy them, and ring-bind or spiral bind it yourself.

    If it is well bound (ie, with sewing, cloth, hardback, etc), then cut the pages out and photocopy them, then ring-bind it.

    Now, I am not one for destroying books in this manner (or any manner - I love books), especially such an expensive one - but if you really need ring-bound books...

    --
    Reason is the Path to God - Anon
  125. Re:Runge-Kutta? Will you be getting degree? O my g by Zilya · · Score: 1

    >Do we need high-order simulation of planetary orbits in a space shooter?

    It depends. If you want to stay on the same orbit after 10 loops - yes, you need all accuracy you can get. If you have a crazy gamer who presses keys every millisecond - no, right parts of equations will have bigger effects than any integration errors you can have. Sometimes high-order schemes can produce worse results.

    >Not quite sure how to take your comment on my degree
    Sorry being nasty. But you need better feeling what is the right method for a problem.

  126. The real problem isn't with the programmers by deinol · · Score: 1
    I don't think there are many programmers out there that didn't have to take a year of physics or so. The real problem is that the game publishers don't want to spend the development time on real physics (usually). When the people paying the programmers say 'spend a few weeks making the physics better' then we'll have good physics in games. It is much more a matter of desire (and unrealistic deadlines) than capabilities.

    --
    Got Apathy?
  127. "real" physics?! by TopherC · · Score: 3, Insightful

    First, physics is inherently descriptive and approximate anyway, so if there is a "real" physics, it has yet to be discovered. Physicists are always working with approximations and numerical methods, but it's best to go as far as you can with "exact" solutions and generalities. Then, when you need to start doing numerical work, you have some place to start from. You can't do numerical integration unless you know what to integrate.

    Second, the usual 100-level undergrad textbook in physics tells you a lot of things that you probably don't need to know when designing games (like E&M and some quantum mechanics), but also leaves out the more practical aspects of classical mechanics when dealing with less-than-ideal objects. Once you work with the motion of objects that are not spherically symmetric, you need mechanics at the next level, and you need to work with matrices and vectors. This stuff isn't difficult, but it's not in the typical undergrad textbook. And it does require a bit of mathematics, like most things that are worthwhile.

    So it sounds to me like this book does have an important niche to fill, combining undergrad classical mechanics, a sampling of junior-level classical mechanics, and some numerical methods to boot.

  128. Gameplay Relativity by Anonymous Coward · · Score: 0

    Personally, I'd like to see a game that let you travel at 0.9 times the speed of light and have it render the distortions of the world correctly

    1. Re:Gameplay Relativity by esonik · · Score: 1

      check out this list. these are not games, but very interesting nevertheless.

      What I would really like to see, is relativistic correct space simulations (think of Elite or Final Frontier) esp. including the effects of local nature of time. I wonder, nobody mentioned this apparent application/problem of physics in games. Playing such a game would really improve the grasp of special relativity for us.

  129. I want realistic physics... sometimes. by Shoden · · Score: 1
    Some of your points are valid, especially for arcade style games. However, when it comes to something like a racing/driving simulation, I want it to be as realistic as possible. I enjoy the challenge of driving a car fast, and doing it in a game/simulation is a lot less expensive than doing it for real. I've already got 2 sports cars (last week it was 3, but my 1996 Nissan 300ZX was stolen and burned last Thursday night) and although I could afford a few more, it would seriously cut into my funds. It's much more reasonable to play a game and try out all the high priced exotics that I might never be able to afford. Plus, it's also a lot less painful to wreck a simulated Porsche 911 at 180mph than it would be to wreck a real one.


    Basically, even if physics are realistically modeled in a game, you can still do stuff in that game that you couldn't (or wouldn't) do in real life.


    And I admit that sometimes I do prefer playing arcade style racing games... it all depends on my mood.

  130. Nitpick by Anonymous Coward · · Score: 0

    Euler's Method is a first-order (rectangular areas)Runge-Kutta method. The Improved Euler's Method (trapezoidal areas) is a 2nd-order Runge-Kutta Method. Runge-Kutta is a class of numerical integration techniques. I think the author is refering to a fourth-order method when he says Runge-Kutta. The higher the order, the better the top of the integration slice fits the integration curve. The trick is to get the best fit for the least amount of computation.

  131. Re:Red Faction (now off-topic) by MrResistor · · Score: 2
    My answer to that is have some way to go back to a point before the mistake was made. Maybe a sort of checkpoint that autosaves before you get to an area where destroying something will make the game impossible. Maybe a back buffer of saves that the player can select from.

    Or maybe, since we're talking about games with realistic physics, give them some way to remove/get around the obstacle, such as being able to climb over it, or blast it with an improvised explosive which would perhaps cost them a lot of their ammo, or dig their way out with a shovel.

    Or, there could be limits placed on what can or cannot be destroyed based on the difficulty level the user selects.

    My point is that there are plenty of other ways of dealing with these sorts of problems. They may cause a lot of headaches for the coders, but so will realistic physics.

    Where I'd personally like to see realistic physics is in space flight simulators. It really iritates me that the majority of them ignore the basic mechanics of movement in the absence of gravity and atmosphere. Given that gravity and atmosphere produce most of the complications in dynamics, it doesn't make much sense to me why they do that, other than that it's cheaper to slap new graphics over an existing flight sim engine than to create a new one that actually works right.

    --
    Under capitalism man exploits man. Under communism it's the other way around.
  132. I hate PC Golf games. by Beechmere · · Score: 1

    When using real physics in PC golf games, I'm disappointed that the result of the hit is dependant on the user's dexterity with a mouse. A slight deviation from the precise swing path, and the "real" physics causes the ball to hook or slice wildly. For me, this is totally unfair. As a real golfer, I can hit most shots fairly straight, and even a mishit will not result in anything as exaggerated as what a PC golf game can dish up. I'd like gold games to have an option where 50% of all shots finish on the fairway, 50% of all shots are at the optimum distance for the club selected, and 50% of all putts are going to finish within tap-in distance. Until PC golf games can deliver this, I won't bother playing them.

  133. bad physics v. unrealistic by spectatorion · · Score: 1

    my best example of such a distinction is super smash brothers for n64. the physics are completely unrealistic, as characters can "rejump" in mid-air, send other players blasting off the screen, and other ridiculous things. this is not necessarily bad physics, just programmers taking liberty with the laws of dynamics. it is not confusing and makes game play that much better.

    it is bad physics, however, when i punch someone and instead of that person following the direction of the impulse that should have been imparted by the impact, he travels in the opposite direction. this is just confusing and makes the game annoying at time. still, it's a kick-ass game :-).

    that being said, i am done with mechanics for the rest of my undergraduate carrer (which mind you

  134. Carmageddon physics are that way for a reason by SuperKendall · · Score: 2

    I have to say I've only played the PC version, but in Carmageddon the physics are very "floaty" and it's that way for a reason!

    As Carmageddon is all about massive jumps and stunts and air time (as well as crashes and pedestrians), they made the physics of the game enhance the gameplay aspects they wanted to emphisize.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
  135. Pinball by Krellan · · Score: 1

    I would love to find how to model the physics for a pinball machine.

    Bumpers, posts, and the like are easy. The hard part is the flipper, of course.

    It's angular movement, and overall the flipper accelerates as it moves up. This acceleration allows the flipper to maintain contact with the ball and push the ball away. The angle the ball leaves the flipper is dependent on when the flipper meets the ball, and the ball position at the time of the flip.

    Does anyone have some good pinball physics that could be used? There are more elaborate situations as well, such as balls hitting flippers that are in the process of being lowered (a "drop catch").

    Krellan

  136. Meh. by sprayNwipe · · Score: 2

    In my opinion, the most difficult aspect of writing a good 3D game is coding complex physics

    And here I was thinking the hardest parts of writing a 3D game were managing oodles of content as fast as possible, creating believable AI that doesn't get instantly panned, creating tools for designers and artists that are not only easy enough to not cause lost time but also complex enough to do everything they require, and generally trying to make a game fun based on an unproven concept (ignoring genre cookie-cutting games).

    The most important part of making a game is making it fun. People aren't going to give a rats ass if a game has decent physics if it's a bore to play. Case in point, Trespasser - the most complex physics system seen in a game, and also the biggest flop and butt of game developer jokes for years to come (although that could just be because of Seamus Blackley, but I'm not going to go onto a tangent).

    My point is, games are fun first, realistic second. If a game is extremely realistic, it's a simulation. Some may not see the difference, but I'm guaranteed you would after playing an hour of both Railway Tycoon II (Turn-based game based on railroad era) and Microsoft Train Simulation/Trainz (Simulations where you drive a train). The difference here is that one is fun and non-realistic, the other isn't fun to non-trainspotters but is extremely realistic. I'll let you imagine which one makes more money.

    1. Re:Meh. by MikeBabcock · · Score: 2

      Trespasser's game engine would been a great sell for MMORPGs though, in which player-object interaction is so much more valuable.

      --
      - Michael T. Babcock (Yes, I blog)
  137. One thing's for sure.... by Mr.Pumpkin · · Score: 1

    Physics never bothered the guys who coded the hooters on the fems in the "Dead or Alive" PS games....

  138. well by Anonymous Coward · · Score: 0

    if ya want physics you gotta go download Pontifex from Chronic Logic. That's one good bridge building game!!!!!! Also I recommend Elasto Mania(for a while, until it gets boring and impossible to beat) for it's insane physics.

  139. Re-Volt! Yes!!! by LaserBeams · · Score: 1

    Finally it got a mention on Slashdot, and above all things, for its outstanding physics engine. If you like realistic racing games, then Re-Volt is for you.

    I know this post is mostly pointless.

    --
    Karma: \Kar"ma\, n. [Skr.] (Buddhism) One's acts considered as fixing one's lot in the future existence.
  140. Realistic physics in a modern game? = Jumpgate! by fruity · · Score: 1

    Check out http://netdevil.com/jumpgate for realistic Newtonian physics! Makes pilot skill something to work for! fruitito

  141. The next problem isn't geography, it's biology by GrassyNoel · · Score: 1

    Notice how symmetrical are the faces of Princess Fiona, Lara Croft and Aki Ross? You can construct a face out of as many polygons or whatever as you like but if they're the same ones on both sides you're not trying.

    --
    Plus ça change, plus c'est la même chose.
  142. Reading it now by Anonymous Coward · · Score: 0

    For me one of the big advantages that this book has over classic physics text books is that it includes C implementations of the formulas, rather than just listing equations.
    I find it much easier to understand an equation when I can look at an implementation of it.

    Also, has anyone found the 'trajectory of missiles including the effects of fuel burn off' thats mentioned on the back cover?

  143. ultimate physics for games implementation: by coockie · · Score: 1

    //this is meant for developers so:
    if (no money available)
    {
    if (not smart or no time)
    {
    //bad luck
    download_ode_solid_swift_dynamo();
    } else
    {
    //good luck
    read_baraff_mirtich_barenbrug_vandenbergen();
    do_magic();
    }
    }
    else
    {
    //thanks
    buy_commercial_engine();
    }

    --
    -------------- I don't speak for my boss. My boss can speak himself.
  144. sorry just testing by marc987 · · Score: 0

    sorry just testing if it happens again

    (why did i get a "0" on my last post before any moderation)

    1. Re:sorry just testing by marc987 · · Score: 0

      Am i now evil or have the rules changed?

  145. Chaotic behavior in games by SimCash · · Score: 1
    Multiple, successive jumps on one would lead to a "blow up" where the player would be wildly, and unexpectedly shot through the roof and to the outer edge of the game universe.
    I cannot be the only one here who remembers running around in Quake and suddenly finding myself orbiting several hundred meters outside the known universe (I could see the whole structure, but could not get back, nor do anything about it). And the first game I coded (an orbital mechanics-based game on an HP9825 using a paper plotter as a display) suffered from exactly the orbital problems discussed since I used a simple 2nd-order approximation to a numerical solution. It was never worth the bother to use better integration (e.g., Runge-Kutta) because the ships were maneuvering enough that the imprecisions were "lost in the thrust".

    On the other hand, when we did ballistics analyses for ICBMs, we used the best approximation methods we could afford.

    When I moved to Northfield, I visited Papyrus Software, who were working on extremely accurate head-to-head racing programs to be played by phone connection useing the then-uncommon 9600 baud dialup. They had a room full of 486's tied to a bank of modems. Their big physics modeling problem was that their customers knew how tires warmed up and became "slick", and their players wanted to be able to set up their cars the way the real drivers did. I suspect that most gamer first, then fanatic, players of games requiring any physics are more interested in unrealistic rail rides (ride your board down the Eiffel tower!) than they are interested in realistic physics.