Well yes, I forgot to mention the speed of the bullet in my example. The plane must be traveling faster than the bullet for this particular problem to result (again, wouldn’t happen in the real world, but could definitely happen in a videogame where you need to be able to see projectiles traveling onscreen).
To bring it back towards a game and the specific potential undesirable situations I’m thinking of:
- ship is facing right (positive)
- ship speed = -10 px/ts (px = pixels, ts = timesteps)
- bullet speed = -10 + 10 = 0 px/ts
You end up with a bullet going nowhere, which you probably don’t want. The ship continues to drift away from the bullet, but the bullet will have the same position on the screen (given that it has no velocity at all).
- ship is facing right (positive)
- ship speed = -30 px/ts
- bullet speed = -30 + 10 = -20 px/ts
- ship stops
You end up with the bullet flying out through the back of the ship, also something you probably don’t want. Imagine if you fire 5 bullets when going that speed, then press the down arrow to hit the breaks, and watch all the bullets come out the back. If the bullets already appeared to leave the gun (the player has had the opportunity to see the bullets leave at the correct velocity) then this makes sense because the bullet velocity will continue as-is. However, if the user hasn’t had a chance to see the bullets moving along their path and then stops (and say it’s a very fast but not instant reduction in velocity) then you’ll see all 5 bullets going out the wrong end at seemingly different speeds.
A much more common and potentially more important example:
- ship is facing right (positive)
- ship speed = 30 px/ts
- first bullet speed = 10 + 30 = 40 px/ts
- ship is reducing speed as it fires
This will have the bullets appearing to travel at completely different speeds. Logically this makes sense because the ship’s velocity was reducing as each bullet fired, but the user will see weirdness with 5 different bullets all fired at about the same time going completely different speeds. And in the reverse situation where the ship is accelerating as it shoots, the user will see the later bullets overtaking the first ones fired. That’s especially weird for a player and could even cause gameplay problems (say you fire your freeze missile first and then your concussion missile which only works on frozen targets, and your concussion missile arrives first).
Am I making sense now? Obviously this is pretty moot because Wildern’s situation is not one of the ones I’m posting, but it’s a very real problem to worry about in any game with projectiles. I can think of far more games that do not add in the shooter’s velocity when firing, because it is much more important to have constant bullet speed (as perceived by the user) then to have completely real physics. And with good reason, too, because as I mentioned before a bullet in the real world moves more or less instantly whereas one in a game must be visible, and therefore move very slowly. And if it’s moving very slowly, then it’s likely that a moving ship or player can make a large perceptible difference in the speed of the bullet, which would never happen in real life with a real bullet because I can only run 10 m/hr whereas a bullet flies 800 km/h.
Really the question is: which will look best in your game? Which aids the mechanics better?
So… that is why I said in the beginning not to use the ship’s velocity at all. Do I make sense yet?
PS - Have a look at these videos (only used these examples because they’re ones I know of):
In Super Metroid, even when running quickly the laser stays ahead of Samus. i.e. they decided to add Samus’s velocity on.
In Megaman X, the bullets appear to go nowhere when you’re going quickly, because you’re overtaking them. i.e. they don’t add Megaman’s velocity.