I think you have done a poor job of describing your problem. Most likely speeding up the game is irrelevant but you threw those words in there thinking of that as the only solution to whatever problem it really is that you are trying to solve. This has led to you getting very…not-related-to-whatever-you-are-really-trying-to-do advice.

#1: I assume your example of a unit being in range of a tower based on how quickly it can run away to be the true indicator of whatever your real goal is.

If you speed up the whole game, nothing has changed. The same units are still in range. If you double game speed, you double the speeds of everything in the game. That means the bullets, too.

Using your example, if you double game speed, the enemy may be able to cover twice the distance in the same amount of time, but the cannon ball will hit in only half the time (it too will be moving twice as fast), so the enemy still only has time to run 10 meters (assuming a cannon ball takes 1 second to hit normally, sped up to 0.5 seconds).

#2: But let’s assume I am wrong; you really do want to speed up game time (like in Sim City—let time pass more quickly for players) and your example was just a misunderstanding on your part of a hypothetical situation.

If you do want to speed up time, put a multiplier on your timer. Change nothing else. It will automatically cascade into having logical ticks called more often on fixed time steps and you can make it like Perfect Dark where the game speed is smoothly adjustable. Increasing manually the tick rate is not the way to go for 2 reasons: #1, even if you use a fixed time step, passing a constant time delta leads to accumulated drift; you still have to calculate how much time has passed so that occasionally 1 extra microsecond gets added to your delta to account for truncated fractions of a microsecond that accumulate. #2, if a fixed time step is implemented with a constant delta time, smoothly speeding up and slowing down your game is a bit of a pain and a hack. If not, changing the rate of ticks will either just not work or it will cause instabilities in the physics and game simulations that fixed time steps are specifically meant to address.

Based on your wording it is really hard to know what you are really asking.

If you really want something like Perfect Dark smart slow-motion to smoothly speed up and slow down the game, use a multiplier on your virtual timer (the timer used to implement pausing. If you don’t know what that is, search the site for “virtual timer Spiro”). And then you don’t have to worry about the hypothetical range situation; the game logic and simulation will work exactly the same no matter how faster or slow you run your game. All the math ends up exactly the same.

If your range scenario is the real problem you are trying to solve, and for some reason units can be sped up but tower bullets can’t, the solution to finding out of something is in range is still the same math.

If it takes 1 second for the cannon to go 20 meters:

inRange = ((unitSpeed * 1.0f) + unitStartingDistFromTower) <= 20.0f; // Uses speed (not velocity) and assumes the unit will run directly away from the tower as soon as the cannon is fired.

Otherwise if you expect the unit to continue its course (no matter what):

inRange = (((unitVelocity * 1.0) + unitPos) - towerPos).Len() <= 20.0f; // Assumes the unit keeps going straight while the cannon is in the air.

L. Spiro