Elvas Tower: The mysteries of 64 bit operation - Elvas Tower

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

The mysteries of 64 bit operation Rate Topic: -----

#1 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,015
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 09 October 2022 - 04:59 AM

This was reported in an Italian forum, and I could check that it is really so.
With a specific path and a specific route, this is what is seen at game startup in the latest Testing release (but also in the Unstable release and in ORNYMG wher running at 64 bit): everything is OK
Attached Image: Frozen.jpg

but when I press esc to start the run, what is seen outside of the loco is fully black (with the exception of the signal lights)
Attached Image: Started.jpg
In this situation the dark remains also moving the train or changing cameras; the cone of light of the loco doesn't appear if one presses H.

Everything is OK In the Unstable releases preceding the switch to 64 bit, and in the ORNYMG releases when the "Run at 32 bit on Win64" option is selected.

#2 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,015
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 09 October 2022 - 09:23 AM

Math precision leads to many traps. It came out that this calculation
            // Solar azimuth cosine. This is the Z COORDINATE of the solar Vector.
            double solarAzimuthCosine = -(Math.Sin(latitude)
                * solarZenithCosine
                - Math.Sin(solarDeclination)) / (
                +Math.Cos(latitude)
                * Math.Sin(Math.Acos(solarZenithCosine)));

can generate a cosine value that is slightly less than -1 (-1.00....09). This cosine is then used to compute an angle, which becomes a NaN. Therefore the vector of the sun positions has an entry with NaNs, which lead to a completely black picture.
Inserting a boundary check for solarAzimpthCosine solved the problem.
This will be available in next ORNYMG release as well as a PR for 1.5, being a very simple and harmless patch.

#3 User is offline   copperpen 

  • Executive Vice President
  • Group: Status: Elite Member
  • Posts: 3,144
  • Joined: 08-August 05
  • Gender:Male
  • Simulator:MSTS & OR
  • Country:

Posted 09 October 2022 - 11:14 AM

View PostWeter, on 09 October 2022 - 10:11 AM, said:

What NaN means? Not a Number?

Yes

#4 User is offline   engmod 

  • Open Rails Developer
  • PipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 1,787
  • Joined: 26-February 08
  • Gender:Male
  • Location:Eltham, Victoria, Australia
  • Simulator:ORNYMG
  • Country:

Posted 10 October 2022 - 02:59 AM

Well picked up, Carlo.

Thank you.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users