Jump to content

[1.1.3] Orbital Decay v1.5.2 (17/07/2016) - Total Overhaul


Whitecat106

Recommended Posts

You could store "spent" amount of RCS fuel in database as well. Increase it every tick and really spend it when vessel is focused. Use current "remaining" value from database to calculate estimations and decision making or, to avoid math duplications, transform it to never decreasing "max RCS avalible" value that will be compared with "spent" value for estimations and decision making (refresh with current RCS fuel amount for active vessel). This will transform problem of disappearing RCS fuel into less severe problem of not all RCS fuel available to orbit keeper service.

Link to comment
Share on other sites

Stock core, and the option did come up as it should which I clicked on to maintain orbit. The ship was already in orbit before installing OD. I noticed in the list of ships that the mod creates the RCS fuel was = 1 for every ship regardless if it had MP or how much was on board. No idea if that matters. :) I did also save the log from when the issue was experienced

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

EDIT: Additional testing has shown if a new vessel is built and launched after OD is installed vessels already existing will be recognized correctly that have MP so that they can enable station keeping.

EDIT2: Slightly different problem, it says station keeping enabled, in the space center it show station keeping in the orbit times list, but after launching another ship it seems they are reset and no longer has station keeping.

Thanks for all the information,

The RCS fuel is stored as 1 as a default for all vessels when OD is first installed and their exact fuel is not known by the system, station keeping is automatically disabled and cannot activate if the fuel is exactly 1; when the vessel is switched to the actual fuel value is stored in the config file allowing station keeping afterwards, the value 1 is okay because it is very very unlikely that the drained RCS from a tank will ever equal exactly 1 and not 1.0000213 or something like that so this is a good stationary value rather than zero in case anything tries to calculate anything and ends up with NAN's.

I can see how the system may only like to initialise smoothly with a new save and a new game since as soon as you launch a vessel the config is updated one by one so that information isnt 'stuck on' afterwards, Im not sure really what I can do to change this (I just found the solution to Orbital decay.. Im no good at the coding of everything else! :sticktongue:). Personally I would think of this as remote tech, its kinda something you'd do best to install before a new save rather than patch on midway though, that being said this is only a minor snag and I might be able to code around it.

All reset you say? Hmm that is interesting, can you replicate this again? (I am not currently on a computer with KSP installed) it shouldnt though, is this the V1.0.3 version you are using?

Link to comment
Share on other sites

I can reinstall and try again today. Yes, it's 1.0.3 I was trying. It was like it forgot station keeping had been set.

Reinstall seemed to work but other random problems seems to come up. Not entirely sure if it is a mod issue itself of a compatibility issue with another mod. The line of failures seemed to start with

NullReferenceException: Object reference not set to an instance of an object

at Part.requestResource (.Part origin, Int32 resourceID, ResourceFlowMode flowMode, Double demand, Int32 requestID) [0x00000] in <filename unknown>:0

at Part.RequestResource (Int32 resourceID, Double demand) [0x00000] in <filename unknown>:0

at ModuleCommand.CheckControlSourceState () [0x00000] in <filename unknown>:0

at ModuleCommand.FixedUpdate () [0x00000] in <filename unknown>:0

Will also load without this mod to see if I can get this to repeat that way.

EDIT: Same error after removing so either not related or something is stuck in the save / flight

Edited by JeffreyCor
Link to comment
Share on other sites

I am getting this error in my log when placing a command pod in the editor. This is on the latest relase version. I am using a crap ton of mods so it may be a bad interaction. Let me know if you want logs, though no other relevant info was present.


NullReferenceException: Object reference not set to an instance of an object
at System.Guid.BaseToString (Boolean h, Boolean p, Boolean [0x00000] in <filename unknown>:0


at System.Guid.ToString () [0x00000] in <filename unknown>:0


at WhitecatIndustries.VesselData.CheckIsKeeping (.Vessel vessel) [0x00000] in <filename unknown>:0


at WhitecatIndustries.StationKeepingModule.OnStart (StartState state) [0x00000] in <filename unknown>:0


at Part.ModulesOnStart () [0x00000] in <filename unknown>:0


at Part+.MoveNext () [0x00000] in <filename unknown>:0

(Filename: Line: -1)

Link to comment
Share on other sites

I am getting this error in my log when placing a command pod in the editor. This is on the latest relase version. I am using a crap ton of mods so it may be a bad interaction. Let me know if you want logs, though no other relevant info was present.


NullReferenceException: Object reference not set to an instance of an object
at System.Guid.BaseToString (Boolean h, Boolean p, Boolean [0x00000] in <filename unknown>:0


at System.Guid.ToString () [0x00000] in <filename unknown>:0


at WhitecatIndustries.VesselData.CheckIsKeeping (.Vessel vessel) [0x00000] in <filename unknown>:0


at WhitecatIndustries.StationKeepingModule.OnStart (StartState state) [0x00000] in <filename unknown>:0


at Part.ModulesOnStart () [0x00000] in <filename unknown>:0


at Part+.MoveNext () [0x00000] in <filename unknown>:0

(Filename: Line: -1)

Thanks for that, that's a reasonably easy fix - I forgot to make sure the Part Module doesn't check for background things while in the VAB or SPH (since these are timeless buildings... I think..)

I am still desperately trying to get the resource issue fixed, as for FPS it seems to be a result of the ConfigFile loading so I may tweak the system to store information in a Database like prog mentioned earlier, this will reduce the loading times and hopefully stop the FPS drop.

Link to comment
Share on other sites

Can you set the desired orbital parameters when you station keep? That would be amazing if so and really help with remote tech.

I had planned on making a Remote Tech position fixing plugin, which would follow the Station Keeping aspect but that would be configured a set orbital position and angle between vessels. This will take time though since I am still trying to fix the issues here, if anyone wants to beat me too it they are very welcome, like I said before the VesselManager.cs in my source code contains all the orbital manipulations, for Remote Tech the only thing that would need to be changed would be to fix the Semi Major axis, eccentricity and inclination to a fixed (input) value from the user, all other values could automatically update whenever, this would (if active on all vessels in a network) completely reduce the floating point drift errors that eventually cause precise geostationary orbits to move out of alignment. So it would solve alot of remote tech issues! If anyone wants to beat me too it by all means go ahead, if not then I will start a separate plugin for devoted remote tech support once this mod is fully working!

Talking about this mod.. well I have found some small solutions to FPS drops (having the update time equal to the number of vessels in game (reduces chop for an active vessel)). I have also fixed (temporarily) the decoupler resource issue but I am still not satisfied so I am continuing work on this, I have also made some validation checks for the Station Keeping and Decay code so that a landed/splashed/VAB/SPH vessel is not affected at all.

The FPS drop in the station keeping menu is still there (Im working on it).

As for the issue about launching a new vessel deleting station keeping information; I have not been able to recreate this but I will continue looking into it, there may be a new update tomorrow. - As you can tell by my illiteracy in typing today... I only had 3 hours sleep so bear with me... hooray for insomnia!.. :confused:

Link to comment
Share on other sites

Hello everyone,

I apologise for being out of contact for a few days, irl and everything, equally I will be unable to reply to any personal messages for a few days (phone forum again -_-) BUT I am working on some changes to the code, hopefully I can fix some issues that have been presented, but to be honest, this is a very 'hacky' solution to orbital decay at the moment and real life is really starting to take over at the moment so if anyone (with some good programming skills) would consider a partnership (50/50) of this mod and its development (and any possible donations), I would be very happy to discuss a merger right now! :)

Thanks for the patience everyone! Hopefully this will all get back on track soon!

Just one comment, when using this mod together with CustomAsteroids all the tracked asteroids appears in the GUI of Station Keeping as if they where vessels.

Ahh I can understand, currently my code filters vessels by their "Ast." name if the asteroid is on an escape trajectory, so I suppose if CustomAsteroids spawns asteroids in orbit they may show up, I will try and filter this more (this was not a problem with the Dev version of the mod but I rewrote the code for this Release so I may have forgotten afew bits!

Link to comment
Share on other sites

  • 3 weeks later...

I love the idea of the mod, it adds more depth and challenge to the game, but it currently makes my KSP terrible laggy. Lag spikes of 0.5s every 2 or 3s. It's not totally unplayable, but it's absolutely annoying. Does it looks after all orbiting ships in real time? could it be scheduled to look to a few ships at time, and then sleep for a day?

Link to comment
Share on other sites

I love the idea of the mod, it adds more depth and challenge to the game, but it currently makes my KSP terrible laggy. Lag spikes of 0.5s every 2 or 3s. It's not totally unplayable, but it's absolutely annoying. Does it looks after all orbiting ships in real time? could it be scheduled to look to a few ships at time, and then sleep for a day?

Thanks for the comment, yes everything is handled in real time apart from vessel resources, sadly the limitations of KSP are reached when vessels start moving around, this mod basically forces the game to replace its own orbital predictions with a calculated one from the plugin. I believe that if only there was a way to access the games 'orbital calculator' and effect changes here rather than beyond, changes such as decay would be as smooth as an asteroid passing through the Kerbin system, sadly it is the position forcing (which causes a save to the persistence file every time individually rather than in bulk) that causes the lag spikes.

The lag is what has caused me to loose focus on this mod since it is pretty much unavoidable, it all depends on whether the end user wants a smooth system where each vessel appears to visually decay (necessary for time warp without causing large jumps) or if the user doesn't mind the decay only occurring on each auto save/day update or whatever. I know how annoying it is, I have devised a system of updating the vessels at intervals equal to the number of vessels in orbit, this means that if you have say 3 vessels, every 3 seconds there will be an update (with only a minor drop in frames) and if you have 200 vessels there will be an update every 3 and a half minutes that causes a big lag spike for a few seconds, I am unsure how well this will work though. I have not lost interest in this mod I am simply waiting for a good idea to come along that will make it more playable.

Everything being said, eventually I will create a version 1.1.0 which will fix the issues in StationKeeping (vessel fuel transfer between decouplers) and the lag in the station keeping menu) and will maybe switch to a bulk process rather than individual decay processes which causes continuous lag. Of course the switch to Unity 5 will almost certainly effect this mod and as such Orbital Decay may become impossible in the future. :huh: This mod is just a mess at the moment, I will probably rebuild the entire code for the 1.1.0 release.

Link to comment
Share on other sites

The problem is that I use Scansat and Remote Tech, therefore having a huge number of satellites everywhere, putting a big load on the calc your mod does, as you said. If you could set it to the player to decide whether to update its vessels orbits and when, it could avoid lag in crucial gameplay moments. For instance, if I could say to the mod to update all my vessels orbits right on the KSC screen, when I'm not flying anything and can wait a minute or two with lag, and then have the mod to sleep until I manually update it again or for a pre-programmed time, then that would be fine to me. Its kind of a compromise: real time calculations would be absolutely great but since they are laggy, then the second best option is to have scheduled calculations to when the player is idle... But, one way or another, please, keep on with the mod, it's a great addition to the gameplay. =)

Link to comment
Share on other sites

  • 1 month later...
IS. Don't give up on it yet! :)

Thanks dude!

So an update on development,

As I said before, lag is currently unavoidable, the act of overriding background vessels orbits is a very taxing opperation on the game engine (since it was never designed this way!); furthermore 1.1 will likely cause issues with this mod so alot may be needed to fix things.

I have not given up, quite the opposite! I have come up with three methods of lag busting decay (the third being the most recent inspiration!)

1. Batch adjust all vessel orbits at a rate determined by the current number of vessels (the current method -not popular!)

2. Adjust vessel orbits only on a scene load, autosave and exit. (Smoother but no nice decays visible in timewarp, this would also cause issues with the Resource Handling code)

or 3. Retain method 1 for the map and tracking station views (smooth decays visible) and retain method 2 for everything else except the active vessel (which would decay normally). This would require some coding to remember temporary positions but it may be much less straining on the system (since heavy lag doesnt effect the TrackingStation that much, although some issues with the map view may occour (maybe only use method 1 for vessels inside the SOI of the map view target reference body? - still wouldnt be that great for Kerbin views since you're more likely to have a set of satellites in Kerbin SOI than anywhere else! - but... if they are station keeping then they would be skipped by the decay code anyway... hmmm

But yes! Work is going to recontinue upon release of 1.1, although if there is no update by the beggining of December I will update this to a 1.0.4 to implement method 3, I will also fix the irritating UI, GUI Icon and unneccessary menu lag issues that have popped up! Bad Leo has also mentioned some good points which I shall include if method 3 fails.

So basically, my priorities lie with my Contract Packs and plugins right now rather than Orbital Decay simply because I do not want to invest time into a system that may break within two KSP updates (1.0.5 and 1.1)!

Whitecat :)

Link to comment
Share on other sites

  • 1 month later...
[quote name='Nightmare']Is this working in 1.05?[/QUOTE] I was wondering the same thing. I am going to test it out in a few minutes and ill let you know.

Update: seems to be working fine! Edited by Berlin
Update
Link to comment
Share on other sites

  • 3 weeks later...

Will installing this mid-game mess up my active missions, particularly those currently crossing interplanetary space? That's the only thing preventing me from using it right now. Also, do the orbit lines in map mode account for decay? Finally, does this affect asteroids?

Edited by Mitchz95
Link to comment
Share on other sites

On 8/19/2015, 6:12:05, Whitecat106 said:

Ahh I can understand, currently my code filters vessels by their "Ast." name if the asteroid is on an escape trajectory, so I suppose if CustomAsteroids spawns asteroids in orbit they may show up, I will try and filter this more (this was not a problem with the Dev version of the mod but I rewrote the code for this Release so I may have forgotten afew bits!

I would be much better if you could change the hard - coded name check and replace it with the vesselType reference (SpaceObject).

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...