Hey guys,
I’m new to the engine and my knowledge is probably inaccurate, so I’m not completely sure what the question is in the first place. I’ll give you a brief description of what the problem is:
Trying to create simulations of missiles, and precision in timing is rather important (or my stuff misses by a few hundred meters). I’m trying to create the simulation to be frame-rate independent. Here the available information seems to be a bit conflicting.
It’s being said that “Apply force” is frame-rate invariant, and with the following setup, it does indeed perfectly counteract gravity, regardless of frame rate.
However, if I want to apply a force over time, I’d assume I use a timer:
Assuming that ‘time’ itself is frame invariant, I’d think the later case should produce the same result. However, depending on the timer frequency the amount of force applied actually changes, and setting a -G acceleration on an object with 1kg mass, does not make the object hover.
Similarly, if I use a timer to fire an otherwise ‘good’ (supposedly tick invariant?) thruster for a brief time, like this:
I get a massive invariance in the force being totally applied. (In the above example with a force = 8000, time = 1, the 1 kg object without linear damping reaches a maximum altitude anywhere in between 1500 and 2400 meters.)
This makes me think that either
- apply force is actually not framerate-invariant, but it’s broken in the same way as gravity, so when used together they appear to work correctly.
- or time itself is not framerate-invariant?
The second case seems to be the logical explanation that I can think of, but that would defeat the point of using timers in the first place. If a unit of time elapsed is proportional to the number of ticks being calculated instead of the actual time elapsed I fail to see how in-game time is supposed to be used (practically timers are simple tick counters that fire with the ticks?).
I might be missing something here, so first of all what could be the actual problem? Given that, what do you think is a suitable workaround? (to make sure the amount of force applied is always constant, and the time period is close to constant)