Elvas Tower: Vehicles causing the simulator to close - Elvas Tower

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Vehicles causing the simulator to close Rate Topic: -----

#1 User is offline   VAPOR3D 

  • Conductor
  • Group: Status: Active Member
  • Posts: 268
  • Joined: 15-March 20
  • Gender:Male
  • Location:Barcelona, Catalunya
  • Simulator:Open Rails
  • Country:

Posted 04 March 2024 - 07:46 AM

Hello.
I am trying to use some wagons, .wag vehicles, designed for MSTS, together with a locomotive. The locomotive works perfectly on its own, but when I form a train with these vehicles, when the train starts to move, it causes a crash and the simulator closes. ORNYMG-Rev. 147.

I thought OR was very compatible with MSTS, but I'm finding out it's not. So, I don't quite understand the obsession to maintain compatibility at all costs when generally, at least with vehicles, updates are always necessary, especially for rolling stock.

I am going to attach the text of the .log file referring to the shutdown and also the complete .wag file, in case someone discovers where the error is.
Thank you!

Log:

Error: System.ArithmeticException: Function does not accept floating point Not-a-Number values.
   at System.Math.Sign(Single value)
   at Orts.Simulation.RollingStocks.SubSystems.PowerTransmissions.Axle.Integrate(Single elapsedClockSeconds) in F:\ADRIANA\Carlo\OR_Work\Git_ORTS_source_mio\Source\Orts.Simulation\Simulation\RollingStocks\SubSystems\PowerTransmissions\Axle.cs:line 769
   at Orts.Simulation.RollingStocks.SubSystems.PowerTransmissions.Axle.Update(Single timeSpan) in F:\ADRIANA\Carlo\OR_Work\Git_ORTS_source_mio\Source\Orts.Simulation\Simulation\RollingStocks\SubSystems\PowerTransmissions\Axle.cs:line 836
   at Orts.Simulation.RollingStocks.SubSystems.PowerTransmissions.Axles.Update(Single elapsedClockSeconds) in F:\ADRIANA\Carlo\OR_Work\Git_ORTS_source_mio\Source\Orts.Simulation\Simulation\RollingStocks\SubSystems\PowerTransmissions\Axle.cs:line 283
   at Orts.Simulation.RollingStocks.MSTSLocomotive.AdvancedAdhesion(Single elapsedClockSeconds) in F:\ADRIANA\Carlo\OR_Work\Git_ORTS_source_mio\Source\Orts.Simulation\Simulation\RollingStocks\MSTSLocomotive.cs:line 2871
   at Orts.Simulation.RollingStocks.MSTSLocomotive.Update(Single elapsedClockSeconds) in F:\ADRIANA\Carlo\OR_Work\Git_ORTS_source_mio\Source\Orts.Simulation\Simulation\RollingStocks\MSTSLocomotive.cs:line 2124
   at Orts.Simulation.RollingStocks.MSTSDieselLocomotive.Update(Single elapsedClockSeconds) in F:\ADRIANA\Carlo\OR_Work\Git_ORTS_source_mio\Source\Orts.Simulation\Simulation\RollingStocks\MSTSDieselLocomotive.cs:line 572
   at Orts.Simulation.Physics.Train.physicsUpdate(Single elapsedClockSeconds) in F:\ADRIANA\Carlo\OR_Work\Git_ORTS_source_mio\Source\Orts.Simulation\Simulation\Physics\Train.cs:line 1977
   at Orts.Simulation.Physics.Train.Update(Single elapsedClockSeconds, Boolean auxiliaryUpdate) in F:\ADRIANA\Carlo\OR_Work\Git_ORTS_source_mio\Source\Orts.Simulation\Simulation\Physics\Train.cs:line 1860
   at Orts.Simulation.Simulator.Update(Single elapsedClockSeconds) in F:\ADRIANA\Carlo\OR_Work\Git_ORTS_source_mio\Source\Orts.Simulation\Simulation\Simulator.cs:line 858
   at Orts.Viewer3D.Viewer.Update(RenderFrame frame, Single elapsedRealTime) in F:\ADRIANA\Carlo\OR_Work\Git_ORTS_source_mio\Source\RunActivity\Viewer3D\Viewer.cs:line 762
   at Orts.Viewer3D.Processes.GameStateViewer3D.Update(RenderFrame frame, Double totalRealSeconds) in F:\ADRIANA\Carlo\OR_Work\Git_ORTS_source_mio\Source\RunActivity\Viewer3D\Processes\GameStateViewer3D.cs:line 120
   at Orts.Viewer3D.Processes.UpdaterProcess.Update() in F:\ADRIANA\Carlo\OR_Work\Git_ORTS_source_mio\Source\RunActivity\Viewer3D\Processes\UpdaterProcess.cs:line 131
   at Orts.Viewer3D.Processes.UpdaterProcess.DoUpdate() in F:\ADRIANA\Carlo\OR_Work\Git_ORTS_source_mio\Source\RunActivity\Viewer3D\Processes\UpdaterProcess.cs:line 108
   at Orts.Viewer3D.Processes.UpdaterProcess.UpdaterThread() in F:\ADRIANA\Carlo\OR_Work\Git_ORTS_source_mio\Source\RunActivity\Viewer3D\Processes\UpdaterProcess.cs:line 74
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()


.wag File:

SIMISA@@@@@@@@@@JINX0D0t______

Wagon ( Renfe_UepV_B_balastro
 Type ( Freight )
 WagonShape ( Renfe_UepV_B.s )
      FreightAnim ( AnimU_B_balastro.s 1 1 )
  Name ("Renfe U epV B balastro")
 Size ( 2.95018m 2.31732m 7.852m )
 Mass ( 23.4t )
 CentreOfGravity ( 0m 1.668m 0m )
 WheelRadius ( 0.5m )
 InertiaTensor ( Box (2.95018m 2.31732m 8.11104m) )
 Coupling (
  Type ( Automatic )
  Spring (
   Stiffness ( 1.1e6N/m 4.8e6N/m )
   Damping ( 1.2e6N/m/s 3.4e6N/m/s)
   Break ( 3.4e7N 3.4e7N )
   r0 ( 1cm 30cm )
  )
  CouplingHasRigidConnection ()
  Velocity ( 0.1m/s )
 )
 Buffers (
  Spring (
   Stiffness ( 1e7N/m 0 )
   Damping ( 1e6N/m/s 0 )
   r0 ( 0m 1e9 )
  )
  Centre ( 0.5m )
  Radius ( 1m )
  Angle ( 0.5deg )
 )
 Adheasion ( 0.2 0.4 2 0 )
 DerailRailHeight ( 4cm )
 DerailRailForce ( 52kN )
 DerailBufferForce ( 250kN )
 NumWheels ( 1 )
 Friction (
  237.7N/m/s  -0.1  1.8mph  2.991N/m/s 1.994
  5.1N/rad/s  1  -1rad/s  0  1
 )

 BrakeEquipmentType( "Handbrake, Triple_valve, Auxilary_reservoir, Emergency_brake_reservoir" )
 BrakeSystemType( "Air_single_pipe" )
 MaxBrakeForce( 0kN )

 MaxHandbrakeForce( 0kN )
 NumberOfHandbrakeLeverSteps( 0 )

 TripleValveRatio( 0 )
 MaxReleaseRate( 0 )
 MaxApplicationRate( 0 )
 MaxAuxilaryChargingRate( 0 )
 EmergencyResCapacity( 0 )
 EmergencyResChargingRate( 0 )
 EmergencyBrakeResMaxPressure( 0 )
 BrakeCylinderPressureForMaxBrakeBrakeForce( 0 )

 )
   Sound ( "GenFreightWag1.sms" )
)


#2 User is offline   VAPOR3D 

  • Conductor
  • Group: Status: Active Member
  • Posts: 268
  • Joined: 15-March 20
  • Gender:Male
  • Location:Barcelona, Catalunya
  • Simulator:Open Rails
  • Country:

Posted 04 March 2024 - 08:09 AM

Well, I've figured out what's going on. The problem seems to be the lines referring to the brakes, changing them for these will solve the "problem". Thanks anyway!

MaxBrakeForce( 50kN )

 MaxHandbrakeForce( 35kN )
 NumberOfHandbrakeLeverSteps( 100 )

 TripleValveRatio( 2.5 )
 MaxReleaseRate( 15 )
 MaxApplicationRate( 25 )
 MaxAuxilaryChargingRate( 5 )
 EmergencyResCapacity( 7 )
 EmergencyResChargingRate( 5 )
 EmergencyBrakeResMaxPressure( 90 )
 BrakeCylinderPressureForMaxBrakeBrakeForce( 50 )


#3 User is offline   eric from trainsim 

  • Waste Disposal Engineer
  • Group: Private - Open Rails Developer
  • Posts: 1,580
  • Joined: 30-October 10
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 04 March 2024 - 08:47 AM

My guess is all those zero values caused a division by zero error...

Shouldn't the code handle this?

#4 User is offline   VAPOR3D 

  • Conductor
  • Group: Status: Active Member
  • Posts: 268
  • Joined: 15-March 20
  • Gender:Male
  • Location:Barcelona, Catalunya
  • Simulator:Open Rails
  • Country:

Posted 04 March 2024 - 10:24 AM

View Posteolesen, on 04 March 2024 - 08:47 AM, said:

My guess is all those zero values caused a division by zero error...

Shouldn't the code handle this?


Well, I don't know, the fact is that these vehicles belong to a collection of hopper cars that can be downloaded from here:

https://railclub.es/portal/idx0074/

...and the thing is that other vehicles in the series have that data correct, but the ones I have gone to choose are wrong. Just my luck!

#5 User is offline   pschlik 

  • Conductor
  • Group: Status: Active Member
  • Posts: 350
  • Joined: 04-March 15
  • Gender:Male
  • Simulator:OpenRails - Unstable
  • Country:

Posted 04 March 2024 - 11:40 AM

I have never seen a bit of rolling stock with all the brakes parameters set to 0, baffling that even functioned in MSTS at all.

#6 User is offline   cjakeman 

  • Vice President
  • PipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 2,869
  • Joined: 03-May 11
  • Gender:Male
  • Location:Peterborough, UK
  • Simulator:Open Rails
  • Country:

Posted 04 March 2024 - 12:13 PM

View Posteolesen, on 04 March 2024 - 08:47 AM, said:

My guess is all those zero values caused a division by zero error...

Shouldn't the code handle this?

I think it should report the location of the bad data, rather than the location of the code that tripped over it.

#7 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 04 March 2024 - 12:22 PM

View Postcjakeman, on 04 March 2024 - 12:13 PM, said:

I think it should report the location of the bad data, rather than the location of the code that tripped over it.


That would make things much easier when trying to track down what caused an error.

#8 User is offline   hehl 

  • Apprentice
  • Group: Status: Dispatcher
  • Posts: 13
  • Joined: 09-January 24
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 04 March 2024 - 12:53 PM

If the wagon in question is not to have any braking force, use

	BrakeSystemType( "Air_piped" )


instead and omit the rest of the braking parameters.
***
The cause of the crash is the parameter

BrakeCylinderPressureForMaxBrakeBrakeForce ( 0 )

with a zero value, because it is used as a divider that divides the MaxBrakeForce() value.
The division by zero causes the crash.
The solution is simple, see above.

#9 User is offline   joe_star 

  • Fireman
  • Group: Status: Active Member
  • Posts: 209
  • Joined: 16-January 13
  • Gender:Male
  • Simulator:MSTS
  • Country:

Posted 07 March 2024 - 10:32 AM

Is "air_piped" token working in MSTS? If I recall correctly it does not hence files defined as above with 0kN brake force

I guess it's a question whether such quirks of MSTS should be supported by OR, in the name of ensuring compatibility

#10 User is offline   eric from trainsim 

  • Waste Disposal Engineer
  • Group: Private - Open Rails Developer
  • Posts: 1,580
  • Joined: 30-October 10
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 08 March 2024 - 09:52 AM

Maybe I wasn't as clear as I could have been. When I said the code should be able to handle it, I'm not suggesting that the code apply a hack.

It means testing your parameters before doing the math on them or wrapping in a Try Except, and as Chris said, writing out to the error log that you had an invalid token value.

  • 2 Pages +
  • 1
  • 2
  • 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