Jump to content

[1.12.x] Trajectories v2.4.5 (2023-08-22) : atmospheric predictions


Kobymaru

Recommended Posts

Before posting feature requests or bug reports, please read the FAQ.

 

Download

Toolbar Controller and Click Through Blocker and SpaceTux Library  are now dependencies of the Trajectories mod. Please install them first.

Description

The mod displays trajectory predictions, accounting for atmospheric drag and lift. Works with the stock aerodynamic model, and with Ferram Aerospace Research (FAR).

With this mod, you can

  1. choose precisely the location where you'll crash. The typical precision is about 6km.
  2. Plan Aerobraking maneuvers that can, for example, put you on intersection trajectory with another body (see point 1 about what you can do from there)

Keep in mind that this software comes without warranty of any kind, and in particular that it may or may not help you survive, reach a specific target, or anything at all. But it usually helps :wink:

FAQ

  • Works with stock aerodynamics and FAR
  • Reportedly works with
    • deadly reentry
    • real solar system
    • Rescaled Kerbin
    • Outer Planets Mod
  • Compatible with Blizzy's toolbar
  • If you see weird spirals or other crazy lines everywhere, double-check you didn't enable "body-fixed mode" by mistake
  • If the predicted trajectory seems inaccurate, check that you set the correct orientation in the Descent profile (or checked Prograde or Retrograde), and that you keep that orientation all the time
  • It's not possible to predict a trajectory for a future stage. We know this is a highly requested feature, but unless we duplicate big parts of the KSP-internal code, we are limited to simulating the current state of the vessel.
  • Parachutes are not simulated (that's usually not a problem if you open it near the ground)

User manual

See your predicted trajectory

  • Open the map view
  • This is it ; trajectory display is enabled by default, you have nothing else to do
  • White is the trajectory in space, red is the trajectory in atmosphere, the red cross is your impact point (that takes the body rotation into account to show the impact point on the terrain, this is useful both for bodies with and without atmosphere)

Disable the trajectory display

  • Click on the Trajectories icon in the stock KSP toolbar (or Blizzy's toolbar if it's installed) to display the main UI
  • Click "Display trajectory" to toggle it on/off
  • Click "complete" to toggle display of the complete trajectory (including parts where it is superimposed with the stock KSP trajectory)

Set a target point (nav ball guidance)

  • Adjust your velocity so that the red cross is located where you want to go
  • Click "Set current impact as target" to enable the green cross
  • Alternatively, there is a button to set the target on the KSC (works on Kerbin only obviously), or you can enter longitude/latitude
  • Go back in flight view, and notice the two new indicators on the nav ball
  • The square indicator shows where you need to point your craft at if you were exactly following the predicted trajectory
  • The circle indicator is a hint about the direction you should go to adjust your actual trajectory to reach the target (this is not necessarily where you need to point, what's important is the direction between the square and the circle, and the distance between them indicates how far you are from the perfect trajectory)

Body-fixed mode

Use this toggle to switch between the regular mode (similar to stock KSP orbits), or body-fixed mode. In body-fixed mode, the trajectory is displayed relatively to the body frame, following the body rotation. This mode makes sense for atmospheric or low terrain fly-by, and also to adjust a geostationary orbit. However, for most high orbits, it will just look funny. This can help you keep occupied for those 2-year-long planetary transfers, but try not to burn up all the fuel to see how it can make funny curved lines.

Manoeuver nodes

You can plan aerobraking or re-entry after manoeuvers, just place your nodes as usual and see the predicted trajectory. Keep in mind that you always place nodes on the stock trajectory, that might be very different from the predicted one, so you may have to place nodes at a point that have an effect somewhere else on the predicted trajectory (especially when planning landing on a body without atmosphere with body-fixed mode). Also, atmospheric prediction can happen only for the body you are currently orbiting, so you can't plan a Kerbin re-entry while you're still arround the Mun.

Support and Bugs

If you have questions and feedback regarding a current release, feel free to post in this thread.

Please post bug reports on the GitHub bug tracker. If you don't know how, don't want to learn or are unsure it's a bug, you can ask in this thread.

Contributions

This mod is a community project! It was originally written by @Youen and is currently maintained by @linuxgurugamer
The following people have already contributed to this project (in approximate order of commits):

  • Youen (Github neuoy)
  • PiezPiedPy
  • Kobymaru (Github fat-lobyte)
  • atomicfury (Github sawyerap)
  • And many others.

You want to be part of this list? Contributions are very welcome! Read our Introduction for Contributors, fork the Repository on Github and have a go at the code!
When you feel that your changes are mature enough to be included, send us a pull request!

It's always best if you work on your "pet problem" - a bug that needs to be fixed or that you personally want to see implemented. Or you could just grab an issue from our Issue Tracker!

Change log

The changelog started with release v1.6.7. For the changes in versions older than that, please visit the GitHub releases page.

Spoiler

Changelog

  • Thanks to github user @Tuupertunut for these fixes
    • Fix wrong trajectory after timewarp/loading in FAR model
    • Fix swapping left and right clicks toggles between four states
    • In-flight overlay now shows the whole trajectory
  • Fixed button icon display when starting to show correct icon (was always showing the Active icon to start, even when it was not active)
  • Replaced logging with KSP_Log (now needs SpaceTuxUtilities as new dependency)
  • Added code to dump config to log file when in debug mode

 

2.4.5.2

  • Added toggle to swap left/right clicks  (replaced the Blizzy option)
  • Fixed toobar button colors
  • More cleanup of old toolbar code
  • Fixed issue of dialog locks activating when dialog was hidden (caused by a typo)

2.4.5
    Adoption by Linuxgurugamer
    Replaced toolbar button code with the ToolbarController (replaced about 1000 lines of code)
    Fixed stock icon being badly formatted
    Removed Blizzy toolbar option from settings
    Fixed test of invalid config xml file, now recovers properly from bad file
    French translation updated
    Changed directory structure of source
    Renamed Plugin directory to Plugins
    Default behaviour for toolbar button now defaults to the stock toolbar
    Method of controlling which toolbar has the button now controlled by the ToolbarController
    Moved textures into PluginData directory
    Downgrade code where it was using Null-coalescing operators
    
    New dependency needed:  ToolbarController


## v2.4.4 for KSP 1.8 to 1.12.x
 - 2021-xx-xx

### Changes since the last release

 - French translations updated thanks to ValiusV
 - Fixed trajectory not updating after loading a save with a vessel in atmosphere (issue #189).
 - Fixed trajectory not updating after time warp (issue #186).
 - Prevent GUI click-through as described in issue #137.

### For Developers


### Known Issues

------------------------------------------------------------------------------------------------------

## v2.4.3 for KSP 1.8 to 1.12.x
 - 2021-10-27

### Changes since the last release
 
 - Fix a potential bug if other mods add renderer's to the cameras.
 - Rendering uses the newer KSP shaders.
 - Try to mitigate issues as described in issue #183 - Trajectories acting as if it isn't installed when
    a mod fails to load. Trajectories will now warn the user with an on screen message that there was a
    problem loading a mod prior to Trajectories loading rather than silently failing. This problem is a
    KSP bug and can't be fixed in Trajectories.

### For Developers

 - Added string and Vector3d types to the Watcher utility.
 - Added a line drawing debug class useful for debugging vectors etc.
 - API method `SetTarget` now correctly targets the active vessels body rather than only the home world.

------------------------------------------------------------------------------------------------------

## v2.4.2 for KSP 1.8 to 1.12.x
 - 2021-09-07

### Changes since the last release

 - Added hotkeys to show/hide the GUI (RightAlt+T) and to show/hide the Trajectory (LeftAlt+T),
    default keys can be changed by editing the config.xml file.
 
------------------------------------------------------------------------------------------------------

## v2.4.1 for KSP 1.8 to 1.12.x
 - 2021-06-27

### Changes since the last release

 - Support for KSP 1.11.x
 - Max decelerating G-force readout now correctly displays the predicted value
 - Targeting vessels that are splashed down is now possible

------------------------------------------------------------------------------------------------------

## v2.4.0 for KSP 1.8 to 1.11.x
 - 2021-02-07

### Changes since the last release
 
 - Support for KSP 1.11.x
 - Dropped support for KSP 1.3.1 to 1.7.2, private builds can still be made from the backport branch.
 - Added individual Prograde/Retrograde buttons for the descent profile nodes.
 
### For Developers

 - Added `GetTarget, ClearTarget` and `DescentProfileGrades` methods to the API

### Known Issues

------------------------------------------------------------------------------------------------------

## v2.3.4 for all versions of KSP from 1.3.1 to 1.10.x
 - 2020-07-12

### Changes since the last release
 
 - Fixed 'Invalid Cast' bug when using FAR

### For Developers

### Known Issues

------------------------------------------------------------------------------------------------------

## v2.3.3 for all versions of KSP from 1.3.1 to 1.10.x
 - 2020-07-09

### Changes since the last release
 
 - Support for KSP 1.10.x
 - OldGui has been removed.
 - Minor graphical changes to the in-flight trajectory, nicer line and markers are now more stable.
 - Added a green target marker to the in flight trajectory.
 - NavBall target and crash markers have been fixed and updated,
   target is now a green circle and predicted crash site is now a red square.
 - Due to performance issues with larger craft, the Cache is now enabled by default. For higher precision,
   it can still be turned off manually.

### For Developers

 - A variable Watcher window has been added that can also use the Telemetry module, see the CONTRIBUTING.md file for more info.
 - The Profiler can now use the Telemetry module.
 - Fixed Profiler entries not updating when the Profiler GUI is re-spawned.
 
### Known Issues

------------------------------------------------------------------------------------------------------

## v2.3.2 for all versions of KSP from 1.3.1 to 1.9.x
 - 2020-06-12

### Changes since the last release
 - Descent Profile angles are now relative to the prograde/retrograde toggles. i.e. old style 135� is now 45� Retrograde.
     Old style angles can still be entered via the text input boxes or the API and will be converted automatically.
 - Descent Profile angles can now be entered via text input boxes.
 - GUI is now clamped to the screen area, eliminating it from being off screen after resolution or scale changes.

### For Developers

 - New API functions added for the Descent Profile `ResetDescentProfile DescentProfileAngles DescentProfileModes`.
 - Profiler is now clamped to the screen area, eliminating it from being off screen after resolution or scale changes.
 
### Known Issues

------------------------------------------------------------------------------------------------------

## v2.3.1 for all versions of KSP from 1.3.1 to 1.9.x
 - 2020-02-25

### Changes since the last release

 - Support for KSP 1.9.x
 - GUI not holding position bug #172 fixed.
 - Target text entry keyboard lockout bug fixed.

### For Developers

 - Profiler GUI disappearing and not holding position bugs fixed, similar issues to #164 and #172.
 
### Known Issues


## v2.3.0 for all versions of KSP from 1.3.1 to 1.8.1
 - 2019-12-03

### Changes since the last release

 - Support for KSP 1.8.x
 - In-Flight trajectory not showing bug fixed by Xyphos
 - GUI disappearing bug #164 fixed thanks to whale2 and mwerle

### For Developers
 
### Known Issues

------------------------------------------------------------------------------------------------------

## v2.2.3 for all versions of KSP from 1.3.1 to 1.7.2
 - 2019-06-17

### Changes since the last release

 - Recompiled for KSP 1.7.2
 - Forces Cache is now disabled by default

### For Developers
 
### Known Issues

------------------------------------------------------------------------------------------------------

## v2.2.2 for all versions of KSP from 1.3.1 to 1.6.x
 - 2019-02-14

### Changes since the last release

 * Support for KSP 1.5.x and 1.6.x

 * Japanese translation updated, thanks to ebigunso
 * Fix drifting target marker when above 100 km (Issue #140)
 * Read KSC location for targeting from the game, instead of a hardcoded value
 * ModuleManager is no longer bundled with Trajectories but it is still a requirement
 * New release format to allow the facilitation of one download zip for all KSP versions from 1.3.1 onwards.
 
### For Developers
 
 * KSP1.3.1 Back port builds can now be built from the Visual Studio Config selector, see CONTRIBUTING.md
 * Support for development on mac now included, also with help in the CONTRIBUTING.md file (Sir Mortimer)
 * API Change: If `SetTarget`'s alt parameter is null or not given, the altitude is calculated from the surface altitude.

### Known Issues

------------------------------------------------------------------------------------------------------

 

# v2.2.1 for KSP 1.4.3 and KSP 1.3.1
 - 2018-04-28

### Changes since the last release

 * GUI window would reset to screen center on a game restart if it was hidden in the previous game, now fixed.
 * In-Flight trajectory ground target marker would sometimes appear on screen when behind the camera view, now fixed.

 

# v2.2.0 for KSP 1.4.2
 - 2018-04-02

### Changes since the last release
 * Japanese translation updated. Many thanks to UresiiZo for correcting the mistakes.
 * Italian translation updated. All thanks go to Brusura for the translation fix.
 * German translation updated. Lots of thanks to nistei for updating the mistakes.
 * French translation updated. Huge thanks to d-faure for correcting the syntax.
 * GUI settings are now persistent again.
 * Black toolbar icons when Texture Settings not set to Full-Res bug fixed.
 * In-Flight trajectory ground target marker covering entire screen when camera is close bug fixed.

### For Developers
 * New API functions added `GetTimeTillImpact`, two for the Descent Profile `ProgradeEntry RetrogradeEntry`
   and some for the Trajectories version. `GetVersion GetVersionMajor GetVersionMinor GetVersionPatch`
  ## v2.1.0 for KSP 1.4.1
 - 2018-03-21

### Changes since the last release

 * Trajectories license has been changed from MIT to GPL-3.0-or-later. Please see the LICENSE.md file for more details.
 * Russian translation updated. Many thanks to Fat-Zer for correcting the mistakes.
 * Chinese translation updated. Many thanks to studentmain for rewriting the translation.
 * Added Japanese, German, French, Italian and Portuguese languages. If you know any of these languages,
   please consider helping out with translations.
 * A big cheers and a beer to Jebs_SY for his help in fixing a rendering issue on the MapView and the Target Waypoint bug.
 * ModuleManager updated to v3.0.6
 
### Known Issues

 * Sometimes In-Flight trajectory ground target marker can cover entire screen when camera is close.

## v2.0.0 for KSP 1.3.1
 - 2018-02-15
 
### Changes since the last release
 * Completely new and overhauled user interface, based on the DialogGUI system.
   Includes (automated) localizations for Russian, Spanish and Chinese (traditional). If you know any of these languages, please consider helping out with translations. Send all Thanks and Kudos to PiezPiedPy for this amazing contribution!
 * In-Flight trajectory vector line and ground marker persistence bug fixed.
 * ModuleManager updated to v3.0.3
 * When combined with FAR, aerodynamic forces calculated on a packed vessel would lead to NRE's.
   Vessels are now no longer calculated when a vessel is in a packed state. Thanks go to Alex Wang for this bug fix.
 * Higher precision and better performance through more advanced numeric techniques using an RK4 integration method.
   Try disabling the Cache for more precise predictions, predictions that should not kill your FPS anymore.
   Courtesy of fat-lobyte aka Kobymaru.
 
### For Developers
 * API changes to help catch NRE's from improper calling of the API methods.
 * New API method `HasTarget()` checks if a target has been set.
 * Flickering entries bug in the Profiler is fixed :)
 * Added Reset averages & Show zero calls buttons, a Framerate limiter, avg calls and frame counter to the Profiler.
 
### Known Issues
 * Sometimes In-Flight trajectory ground target marker can cover entire screen when camera is close.

 

## v1.7.1 for KSP 1.3.1
 - 2017-10-13

### Changes since the last release

 * In-Flight trajectory overlay now uses GLUtils from MechJeb2 for rendering.
 * Fixed In-Flight trajectory for non-atmospheric bodies

### For Developers

 * Added a Jupyter notebook for descent force analysis.
 * Added the Bug Reporting section to CONTRIBUTING.md file.

## v1.7.0 for KSP 1.3.0
 - 2017-07-08

### Changes since the last release

 * Improved precision by accounting for reynolds number in drag. Fixes Issue #84.
 * Fix crash when turning on In-Flight trajectory display while in Map view. Fixes Issue #102. Thanks to PiezPiedPy!
 * Prevent click-through in certain situations. Thanks to PiezPiedPy!
 * Numbers in the user interface don't change as quickly anymore, allowing for better readability
 * Deviation readout now switches from E to W and from N to S instead of just showing negative numbers

### For Developers

 * Added a bridge to the newly created [Telemetry](https://github.com/fat-lobyte/KSPTelemetry) module,
   allowing for nice [graphs](https://user-images.githubusercontent.com/173609/27686194-febdbca6-5cd1-11e7-877d-1ab6e5069fb6.png)
   and better debugging of prediction precision.
 * Updated Profiler UI to new Canvas system. Thanks to PiezPiedPy!
 * Added documentation for contributers in CONTRIBUTING.md file with style guidelines,
   help for building, debugging and much more.

### Known Issues

  * In-Flight trajectory for non-atmospheric trajectories is incorrect and jumpy


## v1.6.8 for KSP 1.3.0

- 2017-06-13

### Changes since the last release
  * Fixed in-flight targeting cross remaining in scence even after trajectory display was disabled.
  * Added toggle for in-flight trajectory display. Fixes Issue #96.

### Known Issues
  * Trajectory prediction is still fundamentally incorrect. See Issue #84.
  * In-Flight trajectory for non-atmospheric trajectories is jerky and jumpy.


## v1.6.7 for KSP 1.3.0

- 2017-06-09

### Changes since the last release
  * This release is brought to you by fat-lobyte (aka Kobymaru on the Forums)
  * Update ToolbarWrapper for blizzy78's Toolbar. Fixes Issue #78.
  * Enable Trajectories window in flight scence.
  * Implement in-flight trajectory line display. Please test and give feedback!
  * Fix Parenthesis silliness in .version file to make it valid JSON again. Thanks, ggpeters!
  * Update Module Manager to v2.8.0. Thanks to PiezPiedPy!
  * Disable Click-through. Thanks to PiezPiedPy!

### Known Issues
  * Trajectory prediction is still fundamentally incorrect. See Issue #84.
  * In-Flight trajectory for non-atmospheric trajectories is jerky and jumpy.
  * In-Flight trajectory leaves targeting cross in the scene, even when disabled.

### For Developers
  * KSP directory path is not hardcoded anymore. You can set up an environment variable in your Operating System named KSPDIR that points to the KSP installation directory.
  * Revamped build scripts for Visual Studio. Thanks to PiezPiedPy!
  * Added simple profiler class. Thanks to PiezPiedPy!
 

License

This mod is under GPLv3 license, feel free to look at the source code: https://github.com/linuxgurugamer/KSPTrajectories/

Edited by Kobymaru
Version update
Link to comment
Share on other sites

@Kobymaru @Youen Hey, I'm having this issue with Trajectories in 1.2.2. I'm running the latest Trajectories version (updated through CKAN). The problem is that the trajectory prediction line is invisible unless time warp is turned on. There's just nothing, but if I turn on time warp (doesn't matter what magnitude), the lines re-appear. If this is not a known bug, let me know what information is needed to determine the cause, and I'll gladly provide it. For now, here's the log.

Link to comment
Share on other sites

10 hours ago, aluc24 said:

@Kobymaru @Youen Hey, I'm having this issue with Trajectories in 1.2.2. I'm running the latest Trajectories version (updated through CKAN). The problem is that the trajectory prediction line is invisible unless time warp is turned on. There's just nothing, but if I turn on time warp (doesn't matter what magnitude), the lines re-appear. If this is not a known bug, let me know what information is needed to determine the cause, and I'll gladly provide it. For now, here's the log.

I have to admit that I haven't seen this kind of issue yet. However, you are running Trajecotires 1.6.6 with KSP 1.2.2, when the most recent versions are Trajectories 1.6.8 and KSP 1.3.0.

It doesn't make much sense to debug old versions, I'm afraid, so please try to reproduce this when you update and then report the issue again.

Link to comment
Share on other sites

2 hours ago, Kobymaru said:

I have to admit that I haven't seen this kind of issue yet. However, you are running Trajecotires 1.6.6 with KSP 1.2.2, when the most recent versions are Trajectories 1.6.8 and KSP 1.3.0.

It doesn't make much sense to debug old versions, I'm afraid, so please try to reproduce this when you update and then report the issue again.

Okay, I will... But it might be a long time before that happens. Most of mods I'm using aren't updated to 1.3 yet.

Link to comment
Share on other sites

I'm about 75% sure this crash is caused by Trajectories.  It happened twice while landing at the Mun in Body Fixed mode.  I used the in-game UI to disable trajectories outright and landed just fine.  Time warping did occur during at least one of the crashes.  I suppose it could just be a big coincidence as well, I'm uncertain.  I am seeing a lot of null references from CC as well.

https://www.dropbox.com/s/7riphki2eqozgu6/output_log.txt?dl=0

Edited by Alshain
Link to comment
Share on other sites

17 minutes ago, Alshain said:

I'm about 75% sure this crash is caused by Trajectories.  It happened twice while landing at the Mun in Body Fixed mode.  I used the in-game UI to disable trajectories outright and landed just fine.  Time warping did occur during at least one of the crashes.  I suppose it could just be a big coincidence as well, I'm uncertain.  I am seeing a lot of null references from CC as well.

Can you make a quicksave and remove as many mods as possible, with the crash still occuring? Because you have got quite a mod list there and I wouldn't even know how to cause a game crash on purpose in C#.

Out of curiosity, how can you be "75% sure this crash is caused by Trajectories" when your mod list looks like this:

Mod DLLs found:
Stock assembly: Assembly-CSharp v0.0.0.0
ModuleManager.2.8.0 v2.8.0.0
000_AT_Utils v1.4.2.0
MiniAVC v1.0.3.2
USITools v1.0.0.0
ActionGroupManager v2.1.0.0
MiniAVC v1.0.3.2
AdvancedTweakablesButton v1.0.3.0
BULB v1.3.4.0
Astrogator v0.7.4.0
CITUtil v1.4.0.0 / v1.0.0.0
BAM v1.3.0.0 / v1.1.0.0
CollisionFX v4.0.0.0
CCK v2.0.1.0 / v2.0.1.0 for KSP 1.3
ContractConfigurator v1.0.0.0 / v1.23.1
RemoteTech v1.8.0.0 / v1.8.7
CC_RemoteTech v1.0.0.0 / v1.23.1
CustomBarnKit v1.1.12.0
DistantObject v1.9.0.10326
Atmosphere v1.2.2.1
CelestialShadows v1.2.2.1
CityLights v1.2.2.1
EVEManager v1.2.2.1
PartFX v1.2.2.1
PQSManager v1.2.2.1
ShaderLoader v1.2.2.1
Terrain v1.2.2.1
TextureConfig v1.2.2.1
Utils v1.2.2.1
_BuildManager v1.2.2.1
Launchpad v5.8.0.0 / v5.8.0
Firespitter v7.3.6354.39102
MiniAVC v1.0.3.2
Fusebox v0.1.11.0
GroundConstruction v1.1.2.1
OneTimeResourceConverter v1.0.0.0
KAS v0.6.3.0 / v0.6.3 for KSP 1.3
MiniAVC v1.0.3.1
KerbalEngineer v1.1.3.0
KerbalEngineer.Unity v1.0.0.0
MiniAVC v1.0.3.2
KIS v1.5.0.0 / v1.5.0 for KSP 1.3
KSPDev_Utils.0.23.0 v0.23.0.0 / v0.23.0 for KSP v1.2
MiniAVC v1.0.3.0
KSP-AVC v1.1.6.2
KSPWheel v0.0.0.0
BetterManeuvering v1.0.3.0 / v3.0
BetterManeuvering.Unity v1.0.3.0
MiniAVC v1.0.3.2
NavBallDockingAlignmentIndicatorCE v1.0.2.0 / v1.0.0.0
NavBallTextureChanger v1.0.0.0
DockingPortAlignmentIndicator v1.0.0.0
DPAI_RPM v1.0.0.0
MiniAVC v1.0.3.2
ModuleDockingNodeNamed v1.0.0.0
PlanetShine v1.0.6121.34655
ProceduralFairings v0.0.4.0
RCSBuildAid v0.9.1.34418
ReentryParticleEffect v1.2.0.0
SCANsat v1.7.8.0 / vv17.8
SCANsat.Unity v1.7.8.0
SmokeScreen v2.7.2.0
Stock assembly: KSPSteamCtrlr v0.0.1.35
Stock assembly: Steamworks.NET v9.0.0.0 / v9.0.0
MiniAVC v1.0.3.2
Strategia v1.0.0.0 / v1.6.0
TextureReplacer v2.6.0.0
Trajectories v1.6.8.0
KerbalAlarmClock v3.8.5.0
TransferWindowPlanner v1.6.2.0
Konstruction v0.0.0.0
USILifeSupport v1.0.0.0
KolonyTools v1.0.0.0
WaypointManager v1.0.0.0 / v2.6.2
MiniAVC v1.0.3.0
[x] Science! v5.7.6355.41035

 

Edited by Kobymaru
Link to comment
Share on other sites

2 minutes ago, Kobymaru said:

Can you make a quicksave and remove as many mods as possible, with the crash still occuring? Because you have got quite a mod list there and I wouldn't even know how to cause a game crash in C#.

Well, I can't remove all of RemoteTech because the probe has an antenna on it.  I could probably remove the DLL, I'll have to copy the whole save game to do it.  Fortunately I had 3 of those probes in orbit ready to land.

Link to comment
Share on other sites

Just now, Alshain said:

Well, I can't remove all of RemoteTech because the probe has an antenna on it.  I could probably remove the DLL, I'll have to copy the whole save game to do it. 

Of course, don't do it in your main save! Back up your main save and do a quicksave.

Yes, you can remove all Mods except for RemoteTech, but you can remove the DLL there. There's also KSPPartRemover, but first focus finding the conditions where the crash occurs.

Link to comment
Share on other sites

30 minutes ago, Kobymaru said:

Of course, don't do it in your main save! Back up your main save and do a quicksave.

Yes, you can remove all Mods except for RemoteTech, but you can remove the DLL there. There's also KSPPartRemover, but first focus finding the conditions where the crash occurs.

Well, I tried with Trajectories by itself and no crash.  I went back to the other games with trajectories turned on in the same way and landed my other two probes without a crash.  It's strange, it crashed twice in a row but when I want it to, nothing.

So... tests are inconclusive.  I guess we will have to see what Nightingale says about the nullrefs but I don't know what else to do here for right now.

Link to comment
Share on other sites

12 hours ago, Mystique said:

Checking "in-flight" button in map view causes immediate crash (even though vessel is in orbit, so nothing much to calculate). Any ideas where to dig?

Which version of Trajectories, which version of KSP and which mods are involved?

Can you reproduce it consistently or does it occur sporadically?

Link to comment
Share on other sites

1 hour ago, Kobymaru said:

Which version of Trajectories, which version of KSP and which mods are involved?

Can you reproduce it consistently or does it occur sporadically?

Trajectories v1.6.8

KSP: 1.3 (Win64) 

Other mods:

Spoiler

1.3 TextureReplacer x.x.x/beta
RasterPropMonitor.0.29.0.beta2
DroptankWrapper
000_AT_Utils - 1.4.4
Toolbar - 1.7.14
USI Tools - 0.9.2
AutoAsparagus - 2.2.6
B9 Part Switch - 1.8.1
Chatterer - 0.9.93.1804
Community Category Kit - 2.0.1
Community Resource Pack - 0.7.1
DMagic Orbital Science - 1.3.0.10
EditorExtensionsRedux - 3.3.13.1
Firespitter - 7.6
RasterPropMonitor - 0.29
Kerbal Attachment System - 0.6.3
Kerbal Engineer Redux - 1.1.3
Kerbal Inventory System - 1.5
Kopernicus - 1.3.0.4
KSP-AVC Plugin - 1.1.6.2
ModularFlightIntegrator - 1.2.4
Docking Port Alignment Indicator - 6.7
NearFutureConstruction - 0.8.2
NearFutureElectrical - 0.9.1
NearFuturePropulsion - 0.9.1
NearFutureSolar - 0.8.3
Procedural Parts - 1.2.12
RealChute - 1.4.4
ReentryParticleEffect - 1.2.0.1
ShipManifest - 5.1.4.3
StageRecovery - 1.7.2
ThrottleControlledAvionics - 3.4.2
Kerbal Alarm Clock - 3.8.5
TweakScale - 2.3.6
USI Alcubierre Drive - 0.6.1
Universal Storage - 1.3.0.1

Reproduction: create any new game, launch anything, go to map, check show trajectory, then check in-flight, crash.

Logs, if it helps:

on Dropbox

Edited by Mystique
Link to comment
Share on other sites

 

40 minutes ago, Mystique said:

Reproduction: create any new game, launch anything, go to map, check show trajectory, then check in-flight, crash.

Thank you for bringing this to my attention, I will take a look at it.

Link to comment
Share on other sites

Edit:

I just see that on the FAR dev repo it says:

Quote

FerramAerospaceResearch   -   Tryfix Trajectories creating phantom aerodynamic force arrows   -   3 days ago

I use this version, but the arrow is still there.

Is this from Trajectories?
BZMTNq5.png

The blueish arrow. It disappears shortly after launch but comes back later for short periods of time then and when...

Later:
OdsfuBh.png

dLSgN9n.png

Edited by Gordon Dry
Link to comment
Share on other sites

16 hours ago, Gordon Dry said:

I use this version, but the arrow is still there.

Is this from Trajectories?

I have not ever seen this in my life, but it looks kinda cool! Where can I get one of these? :wink:

 

10 hours ago, Gordon Dry said:

It also crashes for me when I enable it.

This will be fixed in the next release.

Link to comment
Share on other sites

First off, I want to thank for an awesome mod, which accompanies me in all my KSP games since the moment I found it.

Now, I am myself really interested in simulating and predicting trajectories, but unfortunately I have no idea of C#, so I cannot really understand what the code does. Could you ((I mean the contributors, but anyone who can help is welcome to do so) maybe either explain or even just give me the sources of the maths and algorithms you use in this mod? I am currently working on an ascent trajectory tool and on a low TWR vacuum trajectory tool, both in JavaScript. They could play well with your mod if someone ported them to a KSP mod when I am done. It's the ascent one that needs the aerodynamics maths, but I am also interested in simply your approach to calculating the trajectory, which could be useful to both of them.

Link to comment
Share on other sites

4 hours ago, APlayer said:

First off, I want to thank for an awesome mod, which accompanies me in all my KSP games since the moment I found it.

Don't forget to give Kudos to @Youen who created this awesome mod, I'm just the maintainer :wink:

 

4 hours ago, APlayer said:

Now, I am myself really interested in simulating and predicting trajectories, but unfortunately I have no idea of C#, so I cannot really understand what the code does.

Good point, I could probably write down what the code does.

 

4 hours ago, APlayer said:

Could you ((I mean the contributors, but anyone who can help is welcome to do so) maybe either explain or even just give me the sources of the maths and algorithms you use in this mod?

At its core, the math and the algorithms are actually kind of simple (it's just packed in a confusing way that's necessary for efficiency)

We use a mix of calls to original and duplicated KSP functions to figure out parameters for atmospheric density, temperature, reynolds number, mach, .... from altitude and velocity. We feed these values into the original KSP DragCube functions to calculate the forces on the ship for a given point in the future.

Then we simply aggregate these forces and calculate velocity and position. The "aggregation" part is important, because if you do it wrong (like simply adding up the velocity/position changes over time), you will end up with big errors. Currently this is done by "verlet integration", but I was hoping to implement Runge-Kutta 4 in the medium future.

If you want, I can look up the places of these calculations in the C# code.

4 hours ago, APlayer said:

I am currently working on an ascent trajectory tool and on a low TWR vacuum trajectory tool, both in JavaScript. They could play well with your mod if someone ported them to a KSP mod when I am done. It's the ascent one that needs the aerodynamics maths, but I am also interested in simply your approach to calculating the trajectory, which could be useful to both of them.

Sounds interesting, but the most difficult case here is to calculate the drag from aerodynamic parameters. KSP does all kinds of funny things with the "DragCube" system like occlusion and bonuses for pointiness and maluses for open stack nodes. Trajectories can get away by simply calling the functions inside KSP with the right parameters and interpreting the results.

I think it might be very hard to replicate all these systems in JavaScript, especially since you would have to dig in KSP code (which technically isn't even allowed).

If you have more questions, don't hesitate to ask!

Link to comment
Share on other sites

16 hours ago, Kobymaru said:

We use a mix of calls to original and duplicated KSP functions to figure out parameters for atmospheric density, temperature, reynolds number, mach, .... from altitude and velocity. We feed these values into the original KSP DragCube functions to calculate the forces on the ship for a given point in the future.

I see - so you actually don't do any real aerodynamics maths, but rather use built in KSP functionality. This of course makes sense, but at the same time means I cannot reuse the maths. In this case, I will probably just approximate the drag force with a guess for the drag coefficient with the standard drag equation, which could be based off a basic description of the ship and later refined by the user, who may try the trajectory and check the results. And since my programs will largely simulate prograde burns, I will not really need to account for lift or other aerodynamic forces.

As for the implementation itself, I was helped a lot on the #kspacademia channel, and they indeed recommend using RK4. I may try to help you implement that, but only on the maths and "translating it to a machine" parts, because, as I said, I know no C#, and have only marginal knowledge of OOP. You are also welcome to view my low TWR tool's JS code on GitHub which tries to implement RK4, but do note that it currently fails to calculate anything and finishes with all variables set to NaN.

Thanks for the offered help! :-)

Link to comment
Share on other sites

2 minutes ago, APlayer said:

so you actually don't do any real aerodynamics maths, but rather use built in KSP functionality.

That is mostly correct. We try to re-use the KSP functions as much as possible.

 

2 minutes ago, APlayer said:

And since my programs will largely simulate prograde burns, I will not really need to account for lift or other aerodynamic forces.

Just so you know, the distinction between "drag" and "lift" is a bit silly, because as @Boris-Barboris likes to point out, drag and lift are just components of the same vector. That means you'll run into situations where ignoring "lift" will produce inaccurate results even when you're not classically "flying".

 

2 minutes ago, APlayer said:

As for the implementation itself, I was helped a lot on the #kspacademia channel, and they indeed recommend using RK4. I may try to help you implement that, but only on the maths and "translating it to a machine" parts, because, as I said, I know no C#, and have only marginal knowledge of OOP. 

Thanks for the tips! I think implementing RK4 is not that hard (I believe I did that in C++ once for a class), but integrating it (no pun intended :wink: ) into the mod is the difficult part.

Link to comment
Share on other sites

20 hours ago, Kobymaru said:

Just so you know, the distinction between "drag" and "lift" is a bit silly, because as @Boris-Barboris likes to point out, drag and lift are just components of the same vector. That means you'll run into situations where ignoring "lift" will produce inaccurate results even when you're not classically "flying".

 

The problem here is, the lift calculation requires much more precise knowledge of the vessel shape while being a comparably small effect, and I don't think implementing that outside of KSP itself would be feasible and worth the trouble. What I could possibly do is create this tool in kOS rather than JavaScript, which could account for lift and be precise with drag, though. On second thought, this seems to be the only feasible way to do it, actually.

20 hours ago, Kobymaru said:

Thanks for the tips! I think implementing RK4 is not that hard (I believe I did that in C++ once for a class), but integrating it (no pun intended :wink: ) into the mod is the difficult part.

I am sorry, but I don't think I can help with that. I will be glad to help if there is anything I can do, though! :-)

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...