Hi,
I'm working on a space-based RTS with "Newtonian" physics - or at least, to the extent that ships move forever unless counter-thrusting, they can stop thrusting and coast without burning fuel, etc.
My mechanics are built around the idea of queuing up maneuvers in sequence for your ships and then broadcasting them for execution, so it's not exactly point-and-click as something like Homeworld. These maneuvers are currently executed by ships as e.g. "Burn with force F for N seconds" - they're all just a start and end time + a means of changing position over that time.
Previously, I went with a Kerbal Space Program style, where you placed maneuver nodes with little handles facing along every axis, and the player would pull on those to increase the DeltaV in the direction that the handle represented, and the DeltaV would determine the force the ship would use to perform that maneuver. This was _way_ too fiddly. Here is a video showcasing the old behaviour: https://youtu.be/PD_E1xV7wPo
Now I am looking at a more RTS-like interface. Each ship has a prediction line drawn from it, showing where it will be in the future (for up to N seconds from now). If the player clicks on the line, we create a maneuver at that location, and the player can move their cursor (from which we intersect against a ground plane to get a world pos) to determine where the ship should fly for the maneuver currently being created. Make sense so far? We also obviously change the prediction line to show where the ship would go if the current maneuver is broadcast so the player has some feedback. I have attached an awful diagram to help explain.
My issue is that I'm having trouble translating this 3D position (can be 2D for now) into a "destination" which the ship must fly through, constrained to a per-ship maximum force/acceleration, per-ship mass, etc, i.e. big ships can't take tight turns, and ships going fast also have more momentum to overcome, and where there is a maximum velocity (globally, but also maybe per-ship).
A fellow developer suggested I look into cubic splines, where I can constrain the 2nd derivative to keep acceleration below the maximum, and possibly also being able to constrain the acceptable destination point, e.g. only allowing maneuvers <= 90 degrees, AND keep the top speed below some global limit so I don't tear my physics engine in half.
The turn limit would be similar in interface to this UI (BSG: Deadlock): https://youtu.be/sFUVqYG7Jx0?t=932.
I am a bit confused on how to determine the control points for the spline - I wouldn't want a player to have to adjust multiple points for a single curve like it's Photoshop or something. I am also struggling to find any Cubic Spline implementations which are 2D (or even better 3D).
Let me know if you think I am overthinking it - maybe there's some iterative/physics-y solution, but I wasn't sure how to solve kinematic equations for 2D/3D with a range of possible accelerations (0ms^2 - per-ship-maximum) and where I don't know the final velocity (nor care). Seems a bit more complicated than just projectile motion!
Many thanks.