Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
118 stars 1 forks source link

Gravitational Accelleration is inconsistant at different User Scale #1239

Closed VirgilCore closed 2 months ago

VirgilCore commented 4 months ago

Describe the bug?

When a user is scaled above or below 1, the accelleration by gravity they experience is inconsistant, larger users falling too quickly, smaller users falling too slowly, etc. I suspect that the accelleration units (meters) scale with the user when the units should stay the same scale.

To Reproduce

Be in walk locomotion. Gravity set to the default value of 9.81 (meters per second squared). Fall off of a 10 meter tall ledge. Fall at scale of 1 should take approximately 1.43 seconds. Scale yourself up or down and repeat the fall. Observe the amount of time taken for the fall. When scaled down, the fall will take longer. When scaled up, the fall takes less time.

Expected behavior

Objects are expected to accellarate at the same rate regardless of size or mass.

Screenshots

No response

Resonite Version Number

2024.1.24.834

What Platforms does this occur on?

Windows, Linux

What headset if any do you use?

No response

Log Files

No response

Additional Context

No response

Reporters

No response

epicEaston197 commented 4 months ago

I think this should be an option in the locomotion module as to not break content that relied off of this feature and it would just be a nice option to have too

VirgilCore commented 4 months ago

I like your idea of constant accelleration being a toggle, but we should discuss if it should be on by default

Banane9 commented 4 months ago

I think this should be an option in the locomotion module as to not break content that relied off of this feature and it would just be a nice option to have too

Something relying on a bug should not really be a concern for fixing things.

XKCD: Workflow - fixing something always break's someone's workflow.

VirgilCore commented 4 months ago

Yeah, I agree with @Banane9

epicEaston197 commented 4 months ago

Wait this is a bug??????

Wait so are you saying that a smaller user which should be lighter should not be tossed further than a user that's taller therefore more heavier?

Another example are you saying that a smaller user should fall at the exact same speed as a taller user because that doesn't really make sense the smaller user would be lighter than the taller user

VirgilCore commented 4 months ago

@epicEaston197 weight does not effect the rate at which things fall. Here's an example of this principle.

VirgilCore commented 4 months ago

Additionally, it helps to note that when air resistance is taken into account, things with less mass are more effected (slowed down more) by air due to their inertia being weaker due to having less mass. The air resistance in the locomotion isnt implimented great either, but that should be made into a seperate issue.

To expand on this, Air resistannce doesnt get infinitely stronger the smaller something is, quite the opposite. Small things can fall as fast as a big thing even with air resistance. The important factor for air resistance is Surface Area, which actually goes down as things get smaller

shiftyscales commented 4 months ago

If you want to set up a world in which you modify the default locomotion to act as though everything is in a vacuum- you can already do that. You can adjust every property of a locomotion including how it scales. I don't see how this is a bug.

VirgilCore commented 4 months ago

@shiftyscales Regardless of the locomotion being "adjustable", the default physical locomotion is still set up incorrectly. Additionally, the problem with larger users falling FASTER than users at normal scale is physically impossible in newtonian physics. In game, gravity accellerates things more or less based on size (which it shouldn't). In reality, gravity accellerates things at the same rate, regardless of mass. This issue is not about air resistance, i only brought it up to explain to easton.

ProbablePrime commented 4 months ago

After reading I think this needs a second look, I'll do that. Still not sure its a bug though.

NukiRaccoon commented 4 months ago

I agree that this should be a feature, and probably the default one. Though I think the person we might want to ask is Baxter, as he is the one who does the most stuff I have seen with gravity, and maybe whoever made Gravity Park. (I think it was crimson?)

Banane9 commented 4 months ago

Still not sure its a bug though.

While the falling accelleration being lower for smaller users could be argued about, the accelleration surpassing the set gravity for >1 scale users certainly should be seen as a bug, imo. Conceptually, there's no reason why scaling should affect gravity, as you're changing your own size, not that of the world.

ProbablePrime commented 4 months ago

I understand, what I mean is: I need to look at the code and confirm what's happening to understand if it is a bug or not.

epicEaston197 commented 4 months ago

My main concern is if your scaled down to have like a small tiny miniature world within the bigger world that could cause physics issues with you falling too quickly

NukiRaccoon commented 4 months ago

My main concern is if your scaled down to have like a small tiny miniature world within the bigger world that could cause physics issues with you falling too quickly

That sounds like an issue with the collision checking method, and I don't think it's a concern considering Resonite's engine allows for plane colliders, which have a tangential-width of absolute zero if you hit them head on, which is what's happening when you walk on the perfectly horizontal plane of a grid world.

BaxterOttoman commented 4 months ago

I can add to the discussion that there are other inconsistencies with how Resonite handles gravity and scale where object scales and parenting are involved. I had assumed the gravity being based on user scale was a deliberate choice for dealing with a user being parented under an object that was scaled differently from them. Doing a test however, the gravity responds opposite of how I'd expect. Getting parented under an object that's scaled up, which results in a user being scaled down, seems to increase the force of gravity, leading to tiny hops. The opposite happens with an object that's scaled down.

image Here is a quick overview of my setup. The spheres are just trigger volumes for parenting you under the top object.

Incidentally, if you disable the boolean value "MakeCharacterGravityLocal" in a physical locomotion module, this behavior doesn't happen. This is something I would expect. However, locomotion still seems to exhibit the behavior of having forces scale with the user.

I don't know how things are intended to behave, but I can say that it seems there are many interactions with character controllers and scale that are not being consistently accounted for that are probably going to be worth keeping in mind while looking into this behavior and determining if it's intended or not.

In summation, I think how scaling handles multiplying gravity is inverse to how it may have been intended to behave. Hopefully this is a helpful addition and not just noise to confuse things.

Frooxius commented 4 months ago

The gravity being different depending on the user's scale is intentional behavior. It already is configurable;

On the CharacterController you can find a set of properties:

You can adjust these on the locomotion module templates to achieve the desired behavior you want.

I do not think we should change the default however. While it is physically incorrect, physical realism isn't the goal - rather user experience is.

With physics, ignoring drag (which isn't really simulated anyways, since physics engines are simplified models), objects will all accelerate at the same speed, regardless of their size and mass. So if you have tiny 1 cm object and a big 2 meter one, they will fall at the same speed.

If you look at this from the perspective of a user who has scaled themselves however - if you scale yourself to be tiny, you would have perception that you're falling way too faster than you normally do. Conversely if you scale yourself big, falling will feel sluggish.

These are physically accurate, but from our experience generally undesirable behaviors when users are interacting in social settings. For that reason the default configuration has been set in a way, that gravity will "feel the same" regardless of your scale - it makes it feel as if the world is what changed the scale to the user, rather than themselves. This we found generally more comfortable.

If your experience requires more realistic handling of gravity, simply set "GravityScaling" to "None" on the CharacterController on the Locomotion Template.