Date displayed weirdly with negative JD values for time.

Report bugs, bug fixes and workarounds here.
Topic author
Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Date displayed weirdly with negative JD values for time.

Post #1by Vincent » 18.11.2007, 22:02

I've already posted a report about this bug on the Sourceforge tracker, but I'm not sure anybody else has been able to reproduce it so far. That's why I'm posting a bug report here as well...

When time (in Julian days) reaches either negative values (~ year -4700) or positive values that are > INT_MAX (~ year 5 800 000), i.e., the maximum value for an integer, the date in the upper right corner gets buggy:
Image
Image

The following patch fixes the bug on my system:
http://vincent.gian.club.fr/celestia/observer.cpp.patch

It fixes some max/min values for simulation time:
- minimum value is 0 Julian Day.
- maximum value is INT_MAX Julian days.

With this patch, Time can go neither below the Minimum limit nor over the Maximum limit.
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #2by selden » 18.11.2007, 22:07

Vincent, I suspect some people would be upset with those limits. The Julian date needs to be able to go to large negative values in order to display the various paleological Addons.
Selden

Topic author
Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Post #3by Vincent » 18.11.2007, 22:11

selden wrote:Vincent, I suspect some people would be upset with those limits. The Julian date needs to be able to go to large negative values in order to display the various paleological Addons.

Selden,

Of course, I agree...
But can you go below 0 Julian day on your system without getting a buggy date ?

I also suspect that these paleological addons/scripts don't use the real paleological times in their Beginning/Ending definitions...
Last edited by Vincent on 18.11.2007, 22:15, edited 2 times in total.
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #4by Cham » 18.11.2007, 22:13

I confirm the bug, as described by Vincent. Accelerating time by a large factor brings me to some impossible date in the future, something like month 216, day 214748, at year 5874877, etc.

Vincen't patch is working perfectly, stopping everything at a maximum date in the future (around year 5 800 000) or at a min date in the past (around year -4700).

I also suggest to define the min/max dates as some round and simple dates, so any user could learn easily what they are : bounded limits of time. I suggest using midnight of 31 december, year 4 999 999 in the future (or something like this). This way, it would be consistent on ALL systems, and easy to interpret.

It could be great to have a symetrical min date in the past, relative to 2000 as the "middle" (or maybe year 1 AD ?). Something like year -5 000 000 as a limit in the past.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #5by selden » 18.11.2007, 22:27

Vincent,

While time limits are reasonable to prevent wrap-around, it would be best to actually fix the incorrect date representation instead of avoiding it. Paleological Addons do need to be able to specify dates for the major geologic ages.
Selden

Topic author
Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Post #6by Vincent » 18.11.2007, 22:48

Selden,

Finding a solid fix that would allow displaying dates correctly on a large time scale would be great, indeed! :wink:

In the meantime, we only have two alternatives, though:
1) Displaying buggy dates for the geologic ages;
2) Fixing some limit values between which the date is displayed correctly.

I'm personnaly for 2).
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Post #7by chris » 18.11.2007, 22:49

Vincent wrote:Selden,

Finding a solid fix that would allow displaying dates correctly on a large time scale would be great, indeed! :wink:

In the meantime, we only have two alternatives, though:
1) Displaying buggy dates for the geologic ages;
2) Fixing some limit values between which the date is displayed correctly.

I'm personnaly for 2).


While I believe that we should set some reasonable limits for time, fixing at Julian date 0 is too restrictive. I don't think it should be that tough to find a workaround for the problem with negative dates.

--Chris

Topic author
Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Post #8by Vincent » 18.11.2007, 22:57

chris wrote:I don't think it should be that tough to find a workaround for the problem with negative dates.

Good to hear that... :)
I personnaly have some clues, but haven't succeeded yet. I'll give it a second chance...
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3


Return to “Bugs”