Consistent Strike Jet Strafing Run - Keith Babcock


The Problem:

Create a consistent strafing run replicated across networks from a fast moving strike jet that land consistently between clients, and inline with how the user expects the strafing run to land. This is may or may not sound like a difficult challenge from the outside, but I found it to be deeply interesting one with several key nuances I didn't expect going in.

The first issue was consistency between clients and the network, which was an interesting task, as I've done very little networking in the past, so figuring out how to properly divvy the work of spawning, positioning, and physics between the server and the client was totally new to me, however, the more interesting issue to end users is how I got the strafing run to land in a way that feels satisfying and lines up with how I expect the strafing run to land. To solve this issue, I broke down what I knew into three boxes; how do I expect the strafing run to work, what is the simplest solution to this problem, and how would the simplest solution vary from this expectation.

1. The strafing run should hit the ground consistently, each bullet colliding at an even interval, where the first bullets fired are the first to hit the ground.

2. The easiest solution would be to fire projectiles that move at one speed from the strike jet to predetermined points on the ground.

3. Because of the visual speed of the jet, and how close I want it to fly to the ground so it feels like it rushes right overhead, the bullets would hit the ground at inconsistent times because they are shot so far apart, and because of the shallow angle the jet fires the bullets at to be close to the ground, small pieces of cover will block a lot of the bullets making the strafing run feel inconsistent against hordes of enemies.

The Solution:

The solutions I found to these problems are relatively simple: 

1. Linearly interpolate the flight path of the bullets into the ground. This improves consistency as the bullets always start where I want them to, end where I want them to, and fly the air for the same amount of time no matter where from they were shot allowing them to hit the ground at a consistent interval to one another. This may look strange from a distant as the more distant bullets will fly at a faster speed, but in the heat of the moment on the ground the strafe will feel more consistent.

2. Interpolate the height drop on a curve, so that the height can drop to zero quickly at the end allowing the bullets to have a steeper drop angle than the angle they were shot from allowing them to hit closer behind cover than the angle they were shot from should allow. Again, this may look strange from a distance, but the bullets are moving so quickly it would be hard to pick up this drop, and from up close where the strafe is intended to be used, this change just means that every bullet hits where you want it to rather than getting caught on rocks and cliff faces.

Leave a comment

Log in with itch.io to leave a comment.