Jump to content

emergency of KNOWLEDGE


ccoel

Recommended Posts

So I was landing on duna once and I was at angle like that of a slash (/) and with my bottom end towards duma coming down to the surface about at 12.8 m/s and suddenly I touched the surface and blasted out of the Kerbol system in less than a few nano seconds, I was going 8,000 NaNm What is that abbreviation for? also when I went back to the space center you could see the stars through the buildings and through kerbin and the sun never came up. Was I victim to a Kraken Attack? :sticktongue: I need to know!!!

Edited by ccoel
Link to comment
Share on other sites

Best guess knowing other games and KSP's history that the NaN big is when an unacceptable value is used in the game which is self explanatory however this can happen with -1 on such values as distance or speed which are always positive (with there being no reference point). Strictly speaking, a vehicle can't have negative speed as that wouldn't be normally accepted. You can't have a negative value seeing as when you hit 0.0m/s you increase again remaining positive. 

In your circumstance, the game likely entered a value that was negative and therefore caused a value that was Not a Number or NaN.

Link to comment
Share on other sites

3 hours ago, ZooNamedGames said:

Best guess knowing other games and KSP's history that the NaN big is when an unacceptable value is used in the game which is self explanatory however this can happen with -1 on such values as distance or speed which are always positive (with there being no reference point). Strictly speaking, a vehicle can't have negative speed as that wouldn't be normally accepted. You can't have a negative value seeing as when you hit 0.0m/s you increase again remaining positive. 

In your circumstance, the game likely entered a value that was negative and therefore caused a value that was Not a Number or NaN.

-1 is a number, it can occur for many reasons but in this context NaN occurs when a floating point exceeds the boundaries defined by datatype.  The reason this is important is because NaN, despite meaning Not a Number, is the result of what could be an actual number, it's value simply can't be represented.  In other words, it's too big to store in a variable. Other causes for NaN can really be not a number, such as trying to convert a non number string value to a number, but I don't think that is the case here.

Edited by Alshain
Link to comment
Share on other sites

Amazing how everybody skirts around the obvious with euphemisms like "Kraken"...
Seeing NaN anywhere in the game means an invalid or unpresentable value has been generated - and it will usually propagate through a bunch of other calculations and crash the universe.
If it happens in a stock game, it's a bug. Plain and simple.

Link to comment
Share on other sites

4 minutes ago, steve_v said:

Amazing how everybody skirts around the obvious with euphemisms like "Kraken"...
Seeing NaN anywhere in the game means an invalid or unpresentable value has been generated - and it will usually propagate through a bunch of other calculations and crash the universe.
If it happens in a stock game, it's a bug. Plain and simple.

We do not know that this was a stock game.  The OP never said it was.

Link to comment
Share on other sites

5 minutes ago, Alshain said:

We do not know that this was a stock game.  The OP never said it was.

Then I guess it could be a mod bug. It's still a bug.

Link to comment
Share on other sites

22 minutes ago, Alshain said:

-1 is a number, it can occur for many reasons but in this context NaN occurs when a floating point exceeds the boundaries defined by datatype.  The reason this is important is because NaN, despite meaning Not a Number, is the result of what could be an actual number, it's value simply can't be represented.  In other words, it's too big to store in a variable. Other causes for NaN can really be not a number, such as trying to convert a non number string value to a number, but I don't think that is the case here.

It is a number but it's a nonexistent value in relation to distance and absolute value of speed seeing as neither can be <0.

Edited by ZooNamedGames
Link to comment
Share on other sites

20 minutes ago, ZooNamedGames said:

It is a number but it's a nonexistent value in relation to distance and absolute value of speed seeing as neither can be <0.

It doesn't matter if -1 is nonsensical. If the calculation somehow comes up with -1 meter of distance, it will display -1. A NaN value has a specific meaning, that of "either you tried to convert the world salad into a number, or you are too large to hold in the chosen format, or the math is invalid, such as divide by zero." 

Link to comment
Share on other sites

11 minutes ago, Starman4308 said:

It doesn't matter if -1 is nonsensical. If the calculation somehow comes up with -1 meter of distance, it will display -1. A NaN value has a specific meaning, that of "either you tried to convert the world salad into a number, or you are too large to hold in the chosen format, or the math is invalid, such as divide by zero." 

-1 distance isn't nonsensical, it's impossible. 

Regardless of the NaN factor. It's just impossible.

Link to comment
Share on other sites

2 hours ago, steve_v said:

Amazing how everybody skirts around the obvious with euphemisms like "Kraken"...
Seeing NaN anywhere in the game means an invalid or unpresentable value has been generated - and it will usually propagate through a bunch of other calculations and crash the universe.
If it happens in a stock game, it's a bug. Plain and simple.

We call it the Kraken because bugs are like Kraken. Ships would disappear out at sea because of it, and same goes for our spacecraft, except we actually witness the Kraken. If you wish, you can find a part of the Kraken somewhere on Bop. 

And also, I believe a bug is when a computer is given an input which it has not been designed to calculate, thus fails and gives a wrong output, or even crash.

Onto the real topic, @ccoel, were you able to reboot the game?

Edited by EliteGuy3
Link to comment
Share on other sites

20 minutes ago, EliteGuy3 said:

I believe a bug is when a computer is given an input which it has not been designed to calculate, thus fails and gives a wrong output, or even crash.

A software bug is an error, flaw, failure or fault in a computer program or system that causes it to produce an incorrect or unexpected result, or to behave in unintended ways.

--Wikipedia.

Giving a program invalid input is just GIGO, but any competent programmer will include input checking to prevent this anyway.

Nobody is inputting garbage orbital parameters by hand, the software is generating them. It's a bug. I'm guessing (can't see the code) there's a potential integer overflow with no handling in place.

Edited by steve_v
Link to comment
Share on other sites

12 hours ago, ZooNamedGames said:

-1 distance isn't nonsensical, it's impossible. 

Regardless of the NaN factor. It's just impossible.

-1 and NaN are distinctly different things with distinctly different meanings. If you got one vs. the other for the result of a speed calculation, that means your code broke in different ways.

A value of NaN is what should probably be outputted if there is clearly an invalid input/output*, but a programmer may not explicitly check for that, because there is no way that value can ever be achieved with valid inputs, and adding a check for -1 means A, a coder wasted his time checking for that, and B, your CPU is wasting time checking that if condition.

*Though what I would actually probably do is throw a descriptive Exception.

A computer doesn't think about its result, it cannot realize "oh, hey, -1 m/sec is clearly impossible, let me just change that to NaN or an exception-throw instead"; the coder has to check for that nonsensical condition and change the output accordingly.

Link to comment
Share on other sites

1 hour ago, Starman4308 said:

-1 and NaN are distinctly different things with distinctly different meanings. If you got one vs. the other for the result of a speed calculation, that means your code broke in different ways.

A value of NaN is what should probably be outputted if there is clearly an invalid input/output*, but a programmer may not explicitly check for that, because there is no way that value can ever be achieved with valid inputs, and adding a check for -1 means A, a coder wasted his time checking for that, and B, your CPU is wasting time checking that if condition.

*Though what I would actually probably do is throw a descriptive Exception.

A computer doesn't think about its result, it cannot realize "oh, hey, -1 m/sec is clearly impossible, let me just change that to NaN or an exception-throw instead"; the coder has to check for that nonsensical condition and change the output accordingly.

My previous comment was generally speaking.

I wasn't talking about NaN by that point.

Link to comment
Share on other sites

15 hours ago, steve_v said:

Giving a program invalid input is just GIGO, but any competent programmer will include input checking to prevent this anyway.

Ok, ok. Now I understand

Link to comment
Share on other sites

Well, this thread's gone rather off-topic. 

Yes, ccoel, you encountered an old but fortunately rare bug that sometimes happens when a ship or kerbal comes into contact with the surface of a world. That's all it is. 

Link to comment
Share on other sites

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