Determining if a force is making a difference

  • Thread starter Thread starter DrSammyD
  • Start date Start date
  • Tags Tags
    Difference Force
AI Thread Summary
A game developer is seeking a solution for determining animation speed based on character movement and interactions with walls and treadmills. The key challenge is differentiating between scenarios where the character's running animation should play or not, depending on their velocity relative to the ground or treadmill speed. A proposed solution involves creating variables for ground speed, character speed, and animation speed, with the animation speed calculated as the difference between the two. The discussion also touches on the importance of position variables and time in determining interactions and collisions. Ultimately, the developer is exploring whether it's feasible to measure the impact of a single force on an object's velocity given multiple forces and past velocity data.
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?
 
Thread 'Question about pressure of a liquid'
I am looking at pressure in liquids and I am testing my idea. The vertical tube is 100m, the contraption is filled with water. The vertical tube is very thin(maybe 1mm^2 cross section). The area of the base is ~100m^2. Will he top half be launched in the air if suddenly it cracked?- assuming its light enough. I want to test my idea that if I had a thin long ruber tube that I lifted up, then the pressure at "red lines" will be high and that the $force = pressure * area$ would be massive...
I feel it should be solvable we just need to find a perfect pattern, and there will be a general pattern since the forces acting are based on a single function, so..... you can't actually say it is unsolvable right? Cause imaging 3 bodies actually existed somwhere in this universe then nature isn't gonna wait till we predict it! And yea I have checked in many places that tiny changes cause large changes so it becomes chaos........ but still I just can't accept that it is impossible to solve...

Similar threads

Back
Top