Hi,
I've been messing around with a strategy game set in space, and have been struggling to get my head around movement. There is a bit of context so please bear with me. There are two main parts to my issues.
---
I wanted to have the player place waypoints kinda like in any other RTS, where the points placed would dictate the flight path, but where that path was constrained by limitations of physics (bigger/faster ships = larger turn radii, and ships have thrust limits), and where ships don't magically stop on a dime like Star Wars. By chaining a series of points together, you would get a curved flight plan showing a ship's predicted path through 3D space. The player would be prohibited from adding any points to the plan that are not reachable within these limitations, and the ship would just fly in a straight line after the end of the plan has been reached - they wouldn't just stop in space. The turns and maneuvers along these paths may be many minutes long - the play space is in real star system scale (let's ignore precision/physics ramifications of the scale here), so there could be big, gradual turns over a large space, for example (important consideration if iteratively solving due to the length of time to solve).
In the past, I created a system like Kerbal Space Program, where you can place 'maneuver nodes' on a flight path, manually adjusting 6-degrees of thrust to affect DeltaV and which will change the flight path's prediction from that point onwards (and the actual flight path followed, itself, if the maneuver is 'saved' into the flight plan and thus used in reality when the ship reaches that point). This works well for one ship, but what about 10s of ships, rapidly putting together flight maneuvers in combat? It's just too much to fiddle with. Hence wanting more RTS-like controls.
Imagine this mechanic of placing flight points ( https://youtu.be/lL8ICX67h9E?t=497 ) except without the very short distance limit (they do it due to being turn based), and where you can just click-click-click and chain them together quickly.
To actually predict this path, I can't see how to do it except iteratively, especially if you want to get complex and have the optional ability to set a target speed at each point (e.g. reduce speed to X at point Y), possibly requiring a ship to flip and reverse-burn (which takes time as well - big ships flip slower etc) as well as speed limits - e.g. here are your points to reach but stay below speed X, as well as a game-wide speed limit to save my poor physics system from dying a horrible death. You can't numerically solve this, no? Having to iteratively predict flight paths for 10s of ships or more - and possibly many missiles - sounds scary as hell. I couldn't see how to instead do this with e.g. splines. I also wonder how to tell if a point is unreachable without doubling back on yourself (i.e. if a point is too close and requires a too-tight turn, obviously you could go out and loop back around, but that is unlikely to be what you want). But again, it sounds like you're gonna have to do a lot of iterative solving as the player moves the cursor and thus changes the target flight point.
---
How do other space/flight games handle AI flight for hitting waypoints? I imagine they're not writing complex flight control systems that apply force/torque to get AI ships to fly through them (I've looked into such systems, and they're pretty full-on). Are they just directly touching velocity? What about the common case of different ships with different characteristics? (Bigger/heavier ship = slower / larger minimum turn radius, etc). I imagine that would be emergent if you actually simulated everything and required a ship to genuinely fight its inertia with real forces. But again… complicated to write/solve and a nightmare for gameplay. I'm familiar with steering behaviours, however I can see some difficulty using them in the above flight prediction systems. If I could wave a magic wand and perform every maneuver as just a series of thrusts, prediction and path following become the same thing (assuming iterative prediction). But that seems like a pipe dream. Advice appreciated - happy to bounce things around.
---
Thanks for any input!