Author Topic: Game Physics: Relatively Fixed.  (Read 2515 times)

Offline Morgul

  • GNE Founder
  • Moderator
  • Grand Admiral
  • *****
  • Posts: 2086
  • Karma: +21/-4
  • Godlike Fuzzy Dice
    • View Profile
    • G33X Nexus Entertainment
Game Physics: Relatively Fixed.
« on: February 25, 2006, 09:28:53 pm »
Ok, if you didn't get the joke in the title, I appologize. You'll get it after you finish reading this post. If you still don't go take a physics class, you dolt.

Ok, well, I stumbled onto the solution to our problem with the asteroids not moving correctly. I did this by thinking it was one thing, but then in fixing the fallout from my change, stumbling across a bit of code that made no sense, and was the source of all our problems. We were setting the translation matrix to a dummy matix. I think we'd done this to fix unstable rotations.. but the simple fact is, it broke everythign horribly. Removing that code, and some old, uneeded workarounds for problems now gave us some sweet physics actions! I mean, this shit really works! I shoved the Ar-1 model all over the place... granted, I had to work hard at it, since it's about four times the mass of my little ship, but still! Also, we bounce off the asteroids without doing much... as we should.

Now, however, we ran into some problems with high speed collisions. I think the rotation matrix values are overflowing. 0.o Yeah, not kewl. Looking into that problems, we did soe back of the envolope calculations.

The Ares is 520 kg (in ODE's units). The main engines provide 2,000,000 Newtons of thrust. Therefore, that's an accelleration of about 4,000 m/s^2. Now, ruff calculations lead us to the startling conclusion that in 7 minutes of constant thrust, the Ares would reach the speed of light! Umm... oops?

So, yeah, we're trying to do physics calculations at points where newtonian physics breaks down really badly. This isn't good. We just never noticed it because of how horribly nurfed the physics were. So, now we've gotta put in velocity limiting, and rotation limiting.

Btw, it looks like if we want an appropriate velocity limiting, we use this: v = c tanh U / C (There V is the velocity, U is the velocity it would be if the universe operated souly on Newtonian Physics... aka the velocity wthout limiting, and c is the speed of light in m/s^2). Pretty simple.

Now, for rotational stuff, I think we'll have to break realism, and put in our own form of limiting... just because the phsyics engine can't handle things. Who knows, we might fix the physics engine somewhere down the line.

So, yeah, shit moves now! (Well, more to the point, it DOESN'T move... much. Unless you hit it fast, and even then you go spinning off like there's no tommarow!)

--Chris
"Just because my math may tell lies doesn't mean that I don't understand the quantum mechanics of it all." --Caenus

The popular videogame "Doom" is based loosely around the time Satan borrowed two bucks from Vin Diesel and forgot to pay him back.

"In the beginning there was nothing. And it exploded." --Terry Pratchett

Offline Caenus

  • Married Man
  • Concept Artist
  • Grand Admiral
  • ******
  • Posts: 2351
  • Karma: +5000/-1
  • That, I cannot do.
    • View Profile
    • Art Blog
Re: Game Physics: Relatively Fixed.
« Reply #1 on: February 26, 2006, 12:13:08 am »
I know that Newton's laws dictate that an object in motion will remain in motion until an outside force acts upon it, and that since space is a "vacuum" then there wouldn't be friction - but the inertia and the handling are getting freaking annoying.  Would it be possible to factor in something like inertial dampening thrusters or something so that we don't have the effect of nonstop motion even when you throttle down?  I think the throttle should be connected to thrusters fore and aft to give the effect of earthbound (i.e. friction involved) motion.
Merciful Father, I have squandered my days with plans of many things. This was not among them. But at this moment, I beg only to live the next few minutes well. For all we ought to have thought, and have not thought; all we ought to have said, and have not said; all we ought to have done, and have not done; I pray thee God for forgiveness.

Offline Morgul

  • GNE Founder
  • Moderator
  • Grand Admiral
  • *****
  • Posts: 2086
  • Karma: +21/-4
  • Godlike Fuzzy Dice
    • View Profile
    • G33X Nexus Entertainment
Re: Game Physics: Relatively Fixed.
« Reply #2 on: February 26, 2006, 03:24:58 am »
Weh have that in there. Hold the C key. It stops you. There's a setting *somewhere* to turn that always on.
"Just because my math may tell lies doesn't mean that I don't understand the quantum mechanics of it all." --Caenus

The popular videogame "Doom" is based loosely around the time Satan borrowed two bucks from Vin Diesel and forgot to pay him back.

"In the beginning there was nothing. And it exploded." --Terry Pratchett

Offline Caenus

  • Married Man
  • Concept Artist
  • Grand Admiral
  • ******
  • Posts: 2351
  • Karma: +5000/-1
  • That, I cannot do.
    • View Profile
    • Art Blog
Re: Game Physics: Relatively Fixed.
« Reply #3 on: February 28, 2006, 01:14:03 am »
Interesting.

Here's a suggestion for your next menu tidbit . . . controls.

We need a list of all controls.
Merciful Father, I have squandered my days with plans of many things. This was not among them. But at this moment, I beg only to live the next few minutes well. For all we ought to have thought, and have not thought; all we ought to have said, and have not said; all we ought to have done, and have not done; I pray thee God for forgiveness.

Offline Morgul

  • GNE Founder
  • Moderator
  • Grand Admiral
  • *****
  • Posts: 2086
  • Karma: +21/-4
  • Godlike Fuzzy Dice
    • View Profile
    • G33X Nexus Entertainment
Re: Game Physics: Relatively Fixed.
« Reply #4 on: February 28, 2006, 01:15:17 am »
How about the ability to set them?
"Just because my math may tell lies doesn't mean that I don't understand the quantum mechanics of it all." --Caenus

The popular videogame "Doom" is based loosely around the time Satan borrowed two bucks from Vin Diesel and forgot to pay him back.

"In the beginning there was nothing. And it exploded." --Terry Pratchett

Offline Caenus

  • Married Man
  • Concept Artist
  • Grand Admiral
  • ******
  • Posts: 2351
  • Karma: +5000/-1
  • That, I cannot do.
    • View Profile
    • Art Blog
Re: Game Physics: Relatively Fixed.
« Reply #5 on: February 28, 2006, 01:16:43 am »
That'd be cool too . . .
Merciful Father, I have squandered my days with plans of many things. This was not among them. But at this moment, I beg only to live the next few minutes well. For all we ought to have thought, and have not thought; all we ought to have said, and have not said; all we ought to have done, and have not done; I pray thee God for forgiveness.

Offline Morgul

  • GNE Founder
  • Moderator
  • Grand Admiral
  • *****
  • Posts: 2086
  • Karma: +21/-4
  • Godlike Fuzzy Dice
    • View Profile
    • G33X Nexus Entertainment
Re: Game Physics: Relatively Fixed.
« Reply #6 on: February 28, 2006, 01:27:43 am »
It should be done... soon. Depends on whitelynx... but in the next month or so I figure.
"Just because my math may tell lies doesn't mean that I don't understand the quantum mechanics of it all." --Caenus

The popular videogame "Doom" is based loosely around the time Satan borrowed two bucks from Vin Diesel and forgot to pay him back.

"In the beginning there was nothing. And it exploded." --Terry Pratchett