Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

PhysX Physics details..


Nemox

Recommended Posts

After many hours of diligence (procrastination), I'm finally reaching a playable point in my PhysX-based universal 3D control system. There's just some issues that are really messing with my head at the moment.

They are subjects I've had trouble with in the past, but now that I understand them a lot more it's a whole different angle of what needs to be done. I figured this would be the best place to get some advice.

I'll underline the real nitty-gritty questions.

The issues are distinct, but interwoven.

1:

Friction. In the past I merely settled for multiplying acceleration by friction. This is terribly, terribly wrong. Friction is not a multiplier, but a hard limit to acceleration, based on the pressure between the character and the ground. Currently, my system works like Sonic GDK; acceleration is constant, even when you're on the ceiling. The only time it ever slows down is when you're going up a wall fighting against gravity.

First off, as I'm not very well versed in physics, how could I translate realistic PhysX friction (0.0-infinity for static, 0.0-1.0 for dynamic: Default value which will be used... by default on most objects would be 0.4) into Sonic-styled gameplay?

2:

In a relatively realistic system, the character would have no pressure while running on a wall or ceiling, and thus couldn't accelerate at all.

(I do plan to have a "traction" variable, which ranges from 0% to 100%, allowing up to full acceleration even with no pressure. Think Mighty the Armadillo, or Espio the Chameleon.)

So in a realistic, emergent system, how could pressure be applied between the character and the wall or ceiling? It would logically come from the very "downforce" that allows Sonic to stick to walls in the first place. The problem?

Sonic's speed really doesn't have to be very high to generate enough downforce to stick on a ceiling. That means at a very low speed (say... 5m/s?), he's generating 9.81 m/s^2 acceleration toward the surface to stay on. On walls, this means at 5m/s, he's got as much pressure as even gravity would allow. On ceilings, he exactly cancels out gravity, and cannot accelerate.

But what about faster speeds, like 10m/s? At that point, he'd have twice the downforce. Though the force could be capped at gravity-like pressure, this would still leave him at 100% acceleration even while on a ceiling. Even still, if a character has enough downforce to stick on a ceiling, he will still accelerate 99.9% of the time. Is this reasonable?

3:

EDIT: Number 3 resolved. Just realized I made the same mistake again as I had made on the previous project; Sonic was twice as big as he was supposed to be, so the loops were twice as big too. There really wasn't much of a problem here after all.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...