endless-sky / endless-sky

Space exploration, trading, and combat game.
https://endless-sky.github.io/
GNU General Public License v3.0
5.83k stars 1.03k forks source link

(feature) Add turning acceleration to ships to make turning look better #8130

Closed the2nake closed 9 months ago

the2nake commented 1 year ago

Problem Description

Right now, turning doesn't involve acceleration, but instead there is a set turning velocity. This makes some landing behaviour look very strange (ships rapidly turning left and right in small increments), and makes turning in combat very jumpy (particularly for ships with high turn velocities)

Related Issue Links

None that I've seen

Desired Solution

Add a turn acceleration attribute and do a similar calculation as thrust for determining max turn speed.

Though this is unrealistic, the ship should decelerate much faster than accelerating so aiming is still possible.

Alternative Approaches

Have a delay where you can't change turning direction? This doesn't change the jumpiness though.

Additional Context

No response

1010todd commented 1 year ago

I'm actually working on the code to add this (I think it's called angular momentum according to people who actually know physics, which is definitely not me.). The branch is public at https://github.com/1010todd/endless-sky/tree/angular-momentum but I have not PRed yet as it's still a bit rough and I haven't modified the AI to account for it yet. It also still need some tuning and major balance testing because this is quite a major change.

vitalchip commented 1 year ago

This is one of those concepts that I liked the feel of, generally but it was hard work steering the ship and ultimately there were so few uses for it that I decided against implementing it.

Essentially if you want to turn through 90 degrees you hold the turn key for 45 degrees and then hold the opposite turn for 45 degrees. The Ai has to do the same. You could introduce a variant of drag to turning to make the 'slowing' part of the turn shorter but then you either have a linear slowing which simply changes the time ratio between turn and counter turn or you have it like drag currently exists for thrusting and all the calculations become complex (almost unworkable) like we have now and we'll get undershooting on turns like we do with decelerations.

This is, incidentally, what's responsible for the rapid attempts at turning during landing. It's the mis calculation of the stopping time due to drag causing the ship to be rapidly commanded to turn 180 in each direction as the stopping point passes through the ship.

It wouldn't be solved by changing how steering works although it would look a lot less obvious due to the first step of steering being much smaller.

The big question from me was "where will this be useful" and I haven't found much.

1010todd commented 1 year ago

To nerf heavy warships as alternative to just making them very slow to turn. Since turns matter both in combat and while traveling if turn is too slow it might end up making ships too tedious to travel with, turn acceleration with higher max turn will somewhat help with traveling as on average you'd still be able to turn faster for longer turns like 180 to stop but it still won't be able to react as fast in combat.

the2nake commented 1 year ago

@vitalchip I've played around with this a bit already, and basically the (much) faster deceleration allows the ship to drift only slightly off the path you're trying to aim. The AI shouldn't need to adjust much.

As for the uses of this, I could think of a few:

the2nake commented 1 year ago

An interesting mechanic (that's not really in theme with the game right now) could be to increase turn deceleration for older ships, mimicking escorts gaining flight experience.

Naf5000 commented 1 year ago

I think if this effect were subtle it might be quite good. If it's too strong then it will just make ships feel much worse to control, and that's something big, slow ships already don't need. Still, the way ships turn now does, quite frankly, look rather bad. It's easy enough to ignore, and I suspect people who play a lot of top-down space games like this may not even notice it, but the first time I tried the game the way ships turned made it seem far more unfinished than it actually was.

1010todd commented 1 year ago

Problem is most big ships don't turn slowly (nor move slowly in general) at all, just slap on an atomic steering and now you got what's essentially a cruiser-sized fighter, bigger and just as fast. Slow turn overall will reduce speed it can travel around in general while if they have low turn acceleration they will still have high turn for travel but still unable to react as fast as just any fighter.

Naf5000 commented 1 year ago

I'm reluctant to say that problem should be solved by giving big ships sloppy controls. Increasingly-difficult combat encounters naturally drive players towards larger, more durable ships, so they aren't forced to reload when their flagship explodes or make regular trips to the shipyard to replace destroyed escorts. If you make big ships feel bad to fly, then that forces late-game players to choose between one thing that isn't fun and another thing that isn't fun.

If you really want to make capital ships more sluggish without slowing down the player's ability to travel, I think the much more enjoyable solution would be to lower their engine space and give them access to higher fast forward multipliers. There are still a ton of knock-on effects to the balance that would have, but it would at least still let players get from point A to point B without spending too much of their real-life time doing nothing much.

Anyway, I don't really see this as something that should change the balance of the game much, if at all. It's just something to sand down one of the rougher edges of the game's visuals.

the2nake commented 1 year ago

Mobility is a huge part of combat, and often times in the hands of a decently smart player, a more manoeuvrable, less powerful ship can overpower a fleet of heavier warships.

From a game design standpoint, letting a brawler-type heavy warship being the only viable combat ship is pretty boring. Endless Sky already has tradeoffs between weapons and engines in the outfitter system. It doesn't make the game any less fun. To the contrary, I'd say that handling these balances is quite an important part of combat. Extending these tradeoffs to warship classes wouldn't be terribly bad, and the goal is to make all kinds viable in different scenarios, but all generally usable.

It doesn't make any sense for a large ship to hold the same amount of stuff as a small ship. Anyway, having turn have acceleration wouldn't be that difficult to handle in combat. It's more unwieldy, but I'd argue that it makes your ship seems more powerful if it moves slowly and hits hard. Some new graphics effects would help to drive this home as well.

It's not an issue of smoothing down the rough edges alone. It creates significant combat strategy changes. Weak, agile ships and fighter screens are more effective in this way, without nerfing the actual max turn speed of large ships.

Naf5000 commented 1 year ago

Isn't the relative ease with which a smaller ship can defeat a fleet of larger ones a bad thing? Heavy warships aren't Dark Souls bosses, designed to be stomped by sufficiently-skilled players, they're meant to be the ones that stomp, with the payoff being that eventually the player gets a bunch of heavy warships and gets to do some stomping of their own. Sure, there should be cases where a suitably-equipped smaller ship can take out a larger one, but those should be the minority of cases, not the norm. Otherwise, why would anyone be fielding larger, much more expensive warships?

Since you've actually played around with this feature I'll take your word for it that it doesn't make big ships too unwieldy, and I recognize my opinions on how things should be balanced aren't universal, but I still think the bigger draw here is aesthetic.

the2nake commented 1 year ago

It just appeals to different play styles. In reality, you just load any ship with enough long range energy weapons to overcome the shield/hull regeneration, a couple point defence turrets, and you can destroy any fleet with a single ship.

Anyway, skill should play a factor. This concept is even referenced in the description of the Raven, where it can destroy ships much larger than itself due to its agility. It's not a new concept, but rather just making the tradeoffs clearer.

Heavy warships should not be unilaterally better than smaller ones. For example, the engines variant kestrel has enough room for engines to move like a fighter, while packing more weaponry than any other ship in human space. With this change, even with the larger engines, it would never be quite as manoeuvrable as a smaller ship (slower deceleration --> worse handling).