Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set speed craft exceeded while turning. #909

Open
evertvorster opened this issue Nov 22, 2024 · 8 comments · Fixed by #911
Open

Set speed craft exceeded while turning. #909

evertvorster opened this issue Nov 22, 2024 · 8 comments · Fixed by #911
Assignees
Milestone

Comments

@evertvorster
Copy link
Contributor

Hi there.

This has been ongoing for a while now, and is definitely different from the way that Vega Strike used to play in the old days.
Testing is now done on the latest master of Assets and Engine as of 2024-11-22.

The problem is this.
The Llama, once you applied the first fix, has a top speed of 125. (Of whatever units Vega Strike uses)
If you point the ship in a direction, and apply full thrust, it gets to that speed.
However, if you now turn your ship, the speed increases.
This is a problem, as the speed should stay at the speed limit, and not exceed it.

This is the way that the game used to work, but somewhere in the last year or two this has changed. In theory, your ship's computer should use it's thrusters to change direction, and ensure that the speed limit is not exceeded.

This may be why the autopilot overshoots it's targets, as the ship is doing something that is not expected.

Now, very recently, this effect seems to have gotten worse.
When accelerating to full speed, and then turning into a new direction still pushes the ship past its top maneuvering speed.
When you cut thrust, the ship does not come to a stop at all, and continues on indefinitely at this higher than the speed limit speed.

Here is a youtube video that shows what I am talking about. Volume is a bit low, so you might have to increase the volume to hear my voice.

https://youtu.be/bFDHvAJ1ze0

@royfalk royfalk self-assigned this Nov 22, 2024
@royfalk
Copy link
Contributor

royfalk commented Nov 23, 2024

I've been able to partially reproduce this and this issue has been around for awhile.

Running master (engine/assets), when I fly at 120, turning increases speed up to a point. However, when I stop turning, it slows down.

I went back in time around a year and I've been able to reproduce this.

Several questions and requests:

  1. What branch are you running?
  2. Can you check what happens if you fly at speed, turn and then stop turning. Does your speed slow down to 120?
  3. Start a new game. Does it reproduce?
  4. If not running master, can you reproduce on master/master (engine/assets)?

I think the core issue here is the speed calculation. Let say you fly at 100 in direction x. Now you make an instant turn to y (90 degrees). You start decelerating in x and accelerating in y. If deceleration is really slow, you should reach speed of near 100 in x and y (not realistic example).

The computer than calculates speed as sqrt(xx + yy) ~= 141.

@evertvorster
Copy link
Contributor Author

  1. As mentioned in the initial submission, I am running the latest master of both Assets and Engine, just after the last few merges were made.

  2. No, the speed stays high, as is visible in the video that was submitted. This is new. In the more recent past, when cutting thrusters the speed would go down to 0, now it does not.

  3. This is with a new campaign.

Yes, most definitely it is in the speed calculation.
The calculations need to match what we would like to simulate, and currently it does not.

Paraphrasing the manual, in Vega Strike there are two modes of travel.
MANEUVER and TRAVEL.
In Maneuver, the ships computer enforces a speed limit, which was supposedly picked for each ship based on the capacity of the maneuvering thrusters to deftly maneuver the craft without slip.
There is even a very sparsely documented way of inducing the slip by momentarily disabling the flight computer's corrections. (Press "'", I think)
So, in this mode, flying the ship must feel more like driving a car. It's not really realistic, but this is what feels really easy to fly. Of course, once you overload your ship with cargo controls are much more sluggish, but still there is no passing the speed limit. This mode is supposedly useful for fighting, docking, etc, etc.

In the other mode, TRAVEL, your ship's maneuvering compensation is turned off, and you can typically reach much, much higher speeds (Around 100x, I seem to recall) Now you have permanent slips and all kinds of flight that would be normal for a space ship.

What I think happened sometime in the past, is that this flight model was modified by someone that did not understand the purpose of the two modes of travel, and allowed for surpassing the speed limit that the flight computer was supposed to enforce in MANEUVER mode.

So, to take your example of traveling in a certain direction at a speed of 100, in MANEUVER mode.
To get to a 100, you use the full thrust of your ship. Once at 100, your flight computer decreases your thrust to just enough to maintain that desired speed. (I think it is something like 1% of your main thrust capacity)

As you change direction, thrust is applied in whatever direction is necessary to change your direction of travel. However, your flight computer carefully balances the thrust so as to not exceed the speed limit of the craft.
In other words, your ship can't change direction faster than the force of it's maneuvering thrusters, because the flight computer uses those to change direction and keeps on enforcing the speed limit.

@evertvorster
Copy link
Contributor Author

OK, there was a separate issue that will be solved shortly where Orthogonal acceleration went missing, and this caused your ship to not return to 0 when cutting the engines.

This is completely separate from the ship exceeding the set speed.
This bug is to keep track of the ship exceeding the set speed while turning.

@evertvorster evertvorster changed the title Speed limit of craft not applied. Set speed craft exceeded while turning. Nov 26, 2024
@evertvorster
Copy link
Contributor Author

"The computer than calculates speed as sqrt(xx + yy) ~= 141"

I might be wrong, but if the speed is set to 100, the formula should be more something like this: sqrt(xx + yy) = 100.
Speed along the x axis must decrease to get speed along the y axis.

@royfalk
Copy link
Contributor

royfalk commented Nov 26, 2024

This was more of a guess on my part.

I went back a least a year in the engine versions and this was in the code already.
IIRC, it even happened when I started developing around 2019-2020.

This may be something I am unable to fix. Please remind me in two weeks or so and I'll give it a go.

@evertvorster
Copy link
Contributor Author

Will do.
I also remember this bug from a long, long way back, but, when I started playing Vega Strike at version 0.5, this was not an issue.

@evertvorster
Copy link
Contributor Author

Hi Roy!

Unfortunately, the set speed is still being exceeded when turning.
Tested it against master branches of Assets and Engine 2024-11-28

@evertvorster evertvorster reopened this Nov 29, 2024
@royfalk
Copy link
Contributor

royfalk commented Nov 29, 2024

Sorry. It was closed by accident. I left the auto-close in #911 and when I closed that, it closed this as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants