Calculate distance based on - Resistance - Acceleration - Time - Initial Velocity I have been looking at equations that can represent how far something travels given these three variables. Initial Velocity, Resistance, Acceleration, and Time.
The main thing I saw which was similar was a calculation for free falling and air resistance. However, the only problems which I encountered when looking at these were that they included the Gravity variable. Which kind of represents my acceleration variable in this formula. However, there is the possibility for there to be no acceleration acting upon the object, and only a resistance factor. So when I would substitute 0 it seems like the equation wouldn't work.
So there is the possibility for this formula to have 0 values for resistance acceleration. Initial velocity will most likely have a value.
For context: I am working with a game that simply has air resistance. And I am just trying to calculate distance as part of the game loop with a time factor between each loop iteration.

Edit:
To add a bit more context surrounding what I went down. What I found was the when the game loop for the server and the game loop for the client was running at different speeds, it would then give the object a different velocity and location after x time because the resistance was being applied twice as fast as the client. or vise versa. So there was no real resistance applied over a T time per se. And it seemed to be happening at an interval. So I was trying to determine how far something moves, based on the time rather than each interval, so that no matter the speeds each interval is, they are in sync with the location.
I had a look at a couple of these:
Calculate the free fall distance of an object with air resistance
Distance travelled in free-fall
But could not work out how to integrate for example, when there is no acceleration and only a resistance factor (if you were to imagine travelling in space with an air resistance in one direction, (so no gravity)).
 A: So for these kind of problems, I'm no programmer by any means, but the easiest way to proceed seems to be to use Newton's second law, $F = ma$, with $F = Force$, $m = mass, $ and $a = acceleration$. In doing so, I'm assuming that the mass of whatever thing you're considering to be subject to air resistance has constant mass.
So we have to consider the forces acting on our object. We have gravity, which is $-mg\vec{k}$, with $\vec{k}$ the unit vector in the vertical direction. And we also have air resistance, which is typically well modelled by a force of the form
$$-[\alpha v+\beta v^2]\hat{v},$$ with $\alpha$ and $\beta$ constants, which you can set to change the way your game works, $v$ the magnitude of the velocity vector, and $\hat{v}$ the unit velocity vector. This should be a good model unless you need the air resistance to depend on the orientation of the object, in which case things get a lot more complicated, but I can still try to help.
This gives us
$$F = ma = -mg\vec{k} - [\alpha v+\beta v^2]\hat{v}=m\frac{d\vec{v}}{dt}$$
So redefining our constants, we have, for the acceleration
$$\frac{d\vec{v}}{dt}=-g\vec{k} - [\alpha v+\beta v^2]\hat{v}$$
To first order for a small time step $\Delta t$, we get a change in velocity $\Delta \vec{v}$ given by
$$\Delta \vec{v} = (-g\vec{k} - [\alpha v+\beta v^2]\hat{v})\Delta t$$.
Then if $v$ is your old velocity, then after one timestep, the new velocity is $v+\Delta v$. And so the distance moved in the next timestep should be $$\Delta x = [v+\Delta v]\Delta t$$.
