Determining if a force is making a difference

  • Context: Undergrad 
  • Thread starter Thread starter DrSammyD
  • Start date Start date
  • Tags Tags
    Difference Force
Click For Summary

Discussion Overview

The discussion revolves around determining how to measure the impact of forces on a character's velocity in a game physics engine, particularly in scenarios involving collisions and moving surfaces like treadmills. Participants explore the relationship between forces, velocities, and animation speeds in various contexts.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant describes a scenario where a character's running speed and interaction with walls and treadmills affect the animation speed, seeking a variable to quantify these effects based on forces and velocities.
  • Another participant suggests focusing on velocity and position rather than forces, proposing a formula for animation speed based on the difference between the character's speed and the ground's speed.
  • A different participant offers a perspective on using forces, emphasizing the need for constant running force, friction considerations, and collision dynamics, including the application of Hook's Law for collision responses.
  • One participant inquires about obtaining relative velocity in relation to the friction force being applied, indicating a desire to understand the interaction between forces and motion more deeply.

Areas of Agreement / Disagreement

Participants present differing viewpoints on whether to prioritize forces or velocities in solving the problem, indicating that multiple competing approaches exist without a clear consensus on the best method.

Contextual Notes

Participants express uncertainty regarding the necessary information and variables required to accurately model the interactions and effects of forces on the character's movement and animation speed.

Who May Find This Useful

Game developers and programmers interested in physics engines, animation synchronization, and collision dynamics may find this discussion relevant.

DrSammyD
Messages
21
Reaction score
0
So I'm creating a game. I have a physics engine in the game. There's a use case that I've come up with that I don't know how to solve.

Imagine a character is running
1.
---------0 ------------------>
-------------------------------------------

then it hit's a wall
2.
---------0>| BLAM!
-------------------------------------------

now it's no longer moving forward.

now Imagine a character running on a treadmill
3.
---------0>
-----<------<-----<------<-----<------<

Then a wall comes down the treadmill
4.
<-------0| BLAM!
-----<------<-----<------<-----<------<

Or the character is running on a treadmill but not fast enough to keep up
5
-----<--0
-----<------<-----<------<-----<------<

I need a variable that will determine that cases 1 and 3 are the same, and 2 and 4 are the same, when the only information I have are the forces acting on the character (the ground, the box, friction etc.), the force that the character is providing itself (e.g. the running force), and the character's velocity.

I'm trying to determine the speed at which the running animation should be played. clearly in cases 2 and 4, it should not be playing, in 1 and 3, it should be, and in 5, it should be playing, but more slowly than in case 1 and 3. I was multiplying the animation speed by the velocity, but then I realized it wouldn't work in the case of the treadmill

Is this possible with the information I have? If not what other possible information combinations do I need?

The short question is, how do you measure if a single force is changing the velocity of an object given all other forces acting on it and it's current (and perhaps past if I need to record it) velocity, and if so, how much.
 
Last edited:
Physics news on Phys.org
I say don't worry about forces. I don't see how they can help your case here. Just worry about velocity. And, perhaps position.

Make a variable for the speed of the ground (or treadmill): G
Make another variable for the speed of the character: V
Make another variable for the speed at which the running animation should play: A=V-G

You might need to make position variables for the wall, the ground, and the character. The position of each will obviously change depending on their speed and time...so you'll need a time variable as well.
The position of the wall can be fixed to a position of the ground.
Make a case that when the position of the character=position of the wall, then V=G

Simple. I should have been a computer programmer :P
 
If you do want to use forces, here is how you go about it.

1) Running must apply a constant force in specific direction.
2) There must be friction with the supporting surface. Make sure to take relative velocities into account.
3) Collisions must apply forces. This is a tricky one. Simplest thing is to compute how far object A went into object B and use Hook's Law. However, this will generally cause objects to separate with a bit more velocity than they hit. It's a good idea to also apply friction during collisions. It can solve the above problem, and allow you to make slightly different collisions between different materials.
 
Is there a way to get the relative velocity based on the force of the friction it's applying to me?
 

Similar threads

  • · Replies 35 ·
2
Replies
35
Views
5K
  • · Replies 29 ·
Replies
29
Views
7K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 38 ·
2
Replies
38
Views
4K
  • · Replies 41 ·
2
Replies
41
Views
4K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K