Jump to content

switching to craft resulting in NaN errors (fix included)


Recommended Posts

This started off as a question and plea for help, but as I made notes in here I gradually worked my way to a solution, so I thought I'd post it anyway incase it could help anyone else.

I wanted to have a station on a solar orbit with almost the same orbital characteristics as Kerbin (except it is inclined by about 4.4 degrees). So the station basically trails just behind Kerbin, staying just outside of Kerbin's SOI and oscillating up and down relative to Kerbin (I might get into why I wanted this in another post!).  Anyway, after some careful manoeuvring I got the station almost perfectly into place, it has almost the same Ap/Pe as Kerbin and the it's orbital period is only off my 23 seconds. By setting a maneuver node and advancing it in time I could see that it would gradually shift closer and closer to Kerbin, but wouldn't re-enter the SOI for a couple hundred years.  So I was happy with that and left the station with it's two occupants and went to do other things.

ok, that's the preamble, now for the problem. 

Around 200(ish) days after placing the station in orbit I went to check on the station.  Moments after switching to it the game slowed right down and then the station vanished and the altimeter went red and all 0s; a tell tale sign of NaN errors.  And sure enough when I opened the debug console it was just haemorrhaging NaN errors. Like this, but for all parts and constantly repeating. 

[ERR 22:50:29.289] Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "cupola (Midas Array)/model/Squad/Parts/Command/cupola/model(Clone)/collider_base"

On returning to the space station all the buildings were transparent and I had to restart the game.
So I reloaded a save from before I switched to the station and tried again. same result.
Then I thought, maybe some time related calc is resulting in the NaNs, so perhaps if I let some more time elapse it'll sort it self out. So waited around 20 more days and tried again. same result.

I then decided to crack out hyper-edit and see what else I could see.  
I tried hyper-editing another 'test' vessel along side the station. This time the station still vanished and the logs were full of NaNs but I was able to revert flight on the test vessel and KSC wasn't effected. So at least I could keep trying things without restarting the game each time.
Next I tried putting the test vessel in Kerbin orbit and using HE to bring the station alongside the test vessel.  On clicking apply the station appeared and all seemed fine, No NaNs in the logs and no vanishing station.  but various other things are screwy; some parts are misaligned and (very oddly) if I took one of the crew out on EVA I could control their thrusters, but they had no effect, so they'd just drift.  Also EVA crew's power reading was NaN.....and this was the clue that lead to a fix.

I reverted to a save before any hyper edit mucking about and opened the save in an editor (vim), a quick search found that several (but not all) modules on the station had `amount = NaN` for their electric charge resource, so I did a global find and replace for amount = NaN to amount = 5. Saved and then reloaded it in KSP and joy of joys, I was able to switch to my station and all was fine.

Still not sure what the cause was (I have a suspect, but no proof) and I'm not sure if this will be a recurring problem.
Part of the station's mission is a long term life support study.  I'm running with TAC-LS and the station has parts from Universal Storage II that do recycling of LS resources. TAC requires a background processing mod to process LS usage while the ship is unfocused so my guess is that it's some part of that process that's resulted in NaN values.  

 

TL:DR Had a station that would cause NaN errors when switching to it. Found that several of the stations batteries had NaN power available, so edited the save file and replaced `amount = NaN` with `amount = 5` across the whole save and that fixed the problem.

 

Link to comment
Share on other sites

  • 1 year later...

I started getting an error just like this. My power readings are going to nan and soon my tiny station and all my manned spacecraft will disappear. Again.  Don’t like the idea of editing these files, if I can even find them. I’m not a programmer, I’m a player. I’ll probably have to nuke everything and start over again. Ugh. I wish I knew what mod was causing this issue. Never had it until the last patch I instilled. I’m currently one behind. I should never have patched up a few weeks ago. Everything was stable.  It takes so long for this error to pop up, figuring out which mod is the issue might make the game not worth playing

I just want stuff to work. 

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...