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

Trajectory not updating after loading a save with/while a vessel is in atmosphere. #189

Open
Janus1992 opened this issue Jun 27, 2022 · 11 comments
Labels

Comments

@Janus1992
Copy link

In reference to this post:

https://forum.kerbalspaceprogram.com/index.php?/topic/162324-18-112x-trajectories-v241-2021-06-27-atmospheric-predictions/&do=findComment&comment=4148297

There is currently no way to trigger an aerodynamic update via kOS.
This would only be a workaround, as the real bug seems to be unreliable/intermittent auto-updating from within Trajectories, which causes differences in the result when 'update' is pressed.

@PiezPiedPy
Copy link
Contributor

@Janus1992 Does this happen when loading in a save file while there is a craft in the air and/or the save file has a craft in the air ?

A log file would be handy to see, start a new game then perform the actions needed, then exit as soon as possible to keep the log to a minimum.

Install this debug version before you take logs it will provide more details ;)
TrajectoriesDebug-v2.4.4.zip

@PiezPiedPy PiezPiedPy self-assigned this Jun 28, 2022
@Janus1992
Copy link
Author

@PiezPiedPy Exactly, this happens mostly when the craft is in the air.

I already noticed some differences in the behaviour between a number of ksp sessions.
In the first session after loading the save file there was no hud text saying that an auto-update had happened, but in the second, third, fourth and fifth session there was this hud text showing up right after loading. In the fifth session there was this hud text even twice after loading.

There was a difference from session 1-4, and session 5:

Session 1 (also: 2, 3 and 4 are equal to this one):

[LOG 10:26:25.156] [Trajectories] Debug: AeroDynamicModel.InitCache - Initializing cache

Session 5:

[LOG 11:05:48.287] [Trajectories] Debug: Trajectories.AttachVessel - Loading profiles for vessel
[LOG 11:05:48.287] [Trajectories] Debug: Trajectories.AttachVessel - Reading profile settings...
[LOG 11:05:48.288] [Trajectories] Profiles loaded
[LOG 11:05:48.294] [Trajectories] Debug: AeroDynamicModel.InitCache - Initializing cache

Other than those differences there are no differences in the ksp.log (I checked them sentence by sentence for every sentence with 'trajectories' in it).
Are there any other logs I could make?

As far as I can see there is no log message for an auto-update happening. Sometimes it auto-updates, sometimes not.

@PiezPiedPy
Copy link
Contributor

@Janus1992 Thx for the info, Auto-update triggers the cache initialization which appears to be executed. I'll need to have a deeper look.
This problem seems similar to the time-warp update bug in issue #186

@PiezPiedPy PiezPiedPy changed the title No Update method available to kOS, although it exists in the Trajectores API Trajectory not updating after loading a save with/while a vessel is in atmosphere. Jun 30, 2022
@PiezPiedPy PiezPiedPy added the bug label Jun 30, 2022
@PiezPiedPy
Copy link
Contributor

@Janus1992 Are you still getting the same issue using v2.4.4 ?
v2.4.4 has a fix for a similar problem, that being the time-warp update bug, I was wondering if they could be related and maybe the fix has sorted this issue also.

@Janus1992
Copy link
Author

It sounds similar indeed. I am also getting it in 2.4.4, but like before, it only happens sometimes. Last time it happened after I loaded a ship in the duna atmosphere, while the save I opened before was a kerbin atmo save. But I can't discover a pattern yet.
Also the ship I'm using changes shape during atmospheric flight (starship flaps), so having the ability to call for an update from kOS would be highly useful.

@PiezPiedPy
Copy link
Contributor

@Janus1992 Are you using a mod that loads saves the game rather than the stock menu save and load ?
Also are you using the FAR mod ?

@Janus1992
Copy link
Author

No to both! I keep the game as much stock as possible, except for the starship needs. Although this behaviour was already happening when I was still making pure stock starships.

@Janus1992
Copy link
Author

Would it be possible to implement a kOS call I can make to manually update the trajectory from the script? This would perhaps be the most simple solution/work around for the issue.

@PiezPiedPy
Copy link
Contributor

PiezPiedPy commented May 15, 2023

As mentioned before the update method is being called as it should due to its output showing in the log, calling the API manually will not help in this case.

I believe the problem to be in the display of the trajectory rather than the computation.

The API call would need to be implemented into the kOS code base not here in Trajectories. It would also require the kOS developers to release an updated version of kOS that included the needed functionality.

PiezPiedPy added a commit that referenced this issue May 15, 2023
Trajectory not updating after loading a save with a vessel in atmosphere
@PiezPiedPy
Copy link
Contributor

Seems the issue was due to a vessel still being packed while the aero model was initializing. Hopefully now fixed.

@Janus1992
Copy link
Author

Thanks a lot for the help and the explanation on kOS! I will try the latest repository updates out when I have some time in a few days.

@PiezPiedPy PiezPiedPy removed their assignment Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants