Elvas Tower: Experiment: Debug compilation for Unstable Version - Elvas Tower

Jump to content

Posting Rules

All new threads will be started by members of the Open Rails team, Staff, and/or Admins. Existing threads started in other forums may get moved here when it makes sense to do so.

Once a thread is started any member may post replies to it.
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Experiment: Debug compilation for Unstable Version Rate Topic: -----

#1 User is offline   James Ross 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 5,490
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 10 October 2021 - 03:43 AM

Currently, all versions of Open Rails we produce automatically are "Release" builds - that is, all optimisations are enabled and most debugging is disabled.

When you build with Visual Studio, the default is "Debug" builds - the opposite, limited optimisations are enabled and all debugging is enabled.

One of the things which is enabled only in "Debug" builds is the System.Diagnostics.Debug class, which is fairly similar to the System.Diagnostics.Trace class we use for logging, but it has a few extra methods which we use in selected places.

The most useful is "Debug.Assert", which validates a condition and will deliberately crash the application if the condition is not met. This is called "asserting" and is generally a good idea when validating data from another part of the application that should never be incorrect. (It is not suitable for validating content/user supplied data.)

The other useful one is "Debug.WriteLine", which will write to the log file, similar to "Trace.Trace..." methods.

Enabling the "Debug" methods in the Unstable Version could allow people to get greater reach in validating their changes, should they choose to use "Debug.Assert" and "Debug.WriteLine" in their code.

#2 User is offline   cjakeman 

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

Posted 10 October 2021 - 05:15 AM

View PostWeter, on 10 October 2021 - 04:30 AM, said:

So, mister Ross, if I understood you right, the idea was to make TESTING version with extended debug capabilities and reduced optimization, wasn't it?

No. It's the Unstable Version that will gain the extended debug capabilities. The Testing Version will remain as it is and continue to be fully optimised.

#3 User is offline   James Ross 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 5,490
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 10 October 2021 - 12:43 PM

View PostWeter, on 10 October 2021 - 04:30 AM, said:

So, mister Ross, if I understood you right, the idea was to make TESTING version with extended debug capabilities and reduced optimization, wasn't it?
Alt+F3 will take effect there? ;)

The title was a mistake; the change is for the Unstable Version, as described in the message.

This has nothing to do with Alt-F3 (Debug Physics Form) or any other debug features in-game.

#4 User is offline   James Ross 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 5,490
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 10 October 2021 - 01:33 PM

View PostWeter, on 10 October 2021 - 12:48 PM, said:

So, Alt+F3 does not work at testing versions, and that is not my PC's problem?

This thread is nothing to do with Alt-F3. If you have a problem with Alt-F3 I recommend you start a new thread about that.

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