Elvas Tower: Include file standards - 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.
  • 6 Pages +
  • « First
  • 4
  • 5
  • 6
  • You cannot start a new topic
  • You cannot reply to this topic

Include file standards

#51 User is offline   Genma Saotome 

  • Owner and Admin
  • PipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Owner
  • Posts: 13,283
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 16 April 2018 - 12:09 PM

Dunno if this will be informative but I did a quick search of my freight car library for the word Include and then removed the dups.

Note: I'm using the BB Code "spoiler" to hide rather long lists... just click on the white Spoiler box to display the full list

Aimed at Common.Inc\Fleet:
Include ( "..\\Common.Inc\\Fleet\\single_Pipe_AB_Brakes.inc" )
Include ( "..\\Common.Inc\\Fleet\\Single_Pipe_KC_Brakes.inc" )
Include ( "..\\Common.Inc\\Fleet\\Std_Single_Pipe_AB_1_B_Brakes.inc" )
Include ( "..\\Common.Inc\\Fleet\\Std_Tender_Couplers_Generic.inc" )
Include ( "..\\Common.Inc\\Fleet\\Std_Type_D_Coupler_Generic_Draft_Gear.inc" )
Include ( "..\\Common.Inc\\Fleet\\Std_Type_E_Coupler_Generic_Draft_Gear.inc" )
Include ( "..\\Common.Inc\\Fleet\\Std_Type_H_Coupler_Generic_Draft_Gear.inc" )



Aimed at Common.Inc\Models:
Include ( "..\\Common.Inc\\Models\\PS-1_Model_By_Larry_Goss\\PS-1_Fixed_Specs.inc" )
Include ( "..\\Common.Inc\\Models\\PS-1_Model_By_Larry_Goss\\PS-1_MTY_Weight.inc" )
Include ( "..\\Common.Inc\\Models\\USRA_DS_Boxcar_Tim_Muir_Model\\XM_USRA_DS_Fixed_Specs.inc" )
Include ( "..\\Common.Inc\\Models\\USRA_DS_Boxcar_Tim_Muir_Model\\XM_USRA_DS_MTY_Weight.inc" )
Include ( "..\\Common.Inc\\Models\\USRA_SS_Boxcar_Tim_Muir_Model\\XM_USRA_SS_Fixed_Specs.inc" )
Include ( "..\\Common.Inc\\Models\\USRA_SS_Boxcar_Tim_Muir_Model\\XM_USRA_SS_Lumber_LD.inc" )
Include ( "..\\Common.Inc\\Models\\USRA_SS_Boxcar_Tim_Muir_Model\\XM_USRA_SS_MTY_Weight.inc" )
Include ( "..\\Common.Inc\\Models\\X29_&_ARA_Boxcar_By_Tim_Muir\\X29_&_ARA_Fixed_Specs.inc" )
Include ( "..\\Common.Inc\\Models\\X29_&_ARA_Boxcar_By_Tim_Muir\\X29_&_ARA_MTY_Weight.inc" )
Include ( "..\\Common.Inc\\Models\\USRA_DS_Boxcar_Tim_Muir_Model\\XM_USRA_DS_Fixed_Specs.inc" )


Left with the .wag or .engs:
Spoiler

As you can see most of the Common.Inc\Fleet files are for couplers and brake equipment. They are placed here because they are used by many folders in \trainset. Having them separated means they're safe from deletion if you decide to thin your roster and delete a couple of the car folders. The folder name is based on who made the 3d model and which model it is. That way you can take updates from someone and have clear idea of where the files belong.

Most of the files left in the folder with their .wags are fixed_specs and weight.


The combination of fixed_specs, couplers, break equipment, and weight related parameters represent about 75-80% of the lines in a typical .wag, IOW, going from ~60 lines to 12-15.




For locomotives, Include.Inc\Fleet:
Include ( "..\\Common.Inc\\Fleet\\Early_Diesel_Era_Generic_AWS_Monitor.inc" )
Include ( "..\\Common.Inc\\Fleet\\Early_Diesel_Era_Generic_Emergency_Stop_Monitor.inc" )
Include ( "..\\Common.Inc\\Fleet\\Early_Diesel_Era_Generic_Vigilance_Monitor.inc" )
Include ( "..\\Common.Inc\\Fleet\\Generic_Locomotive_Monitors.inc" )
Include ( "..\\Common.Inc\\Fleet\\Std_Early_Road_Diesel_Independant_AB_Brake.inc" )
Include ( "..\\Common.Inc\\Fleet\\Std_Late_Steam_Era_Diesel_Locomotive_Bar_&_Bar.inc" )
Include ( "..\\Common.Inc\\Fleet\\Std_Late_Steam_Era_Diesel_Locomotive_Bar_&_Coupler.inc" )
Include ( "..\\Common.Inc\\Fleet\\Std_Late_Steam_Era_Diesel_Locomotive_Coupler.inc)
Include ( "..\\Common.Inc\\Fleet\\Std_Late_Steam_Era_Diesel_Switcher_Coupler.inc" )
Include ( "..\\Common.Inc\\Fleet\\Westinghouse_24RL_Brakestand.inc" )
Include ( "..\\Common.Inc\\Fleet\\Westinghouse_24RL_Brakestand_w_Dynamics.inc" )


For locomotives, Include.Inc\Models:
Spoiler


For Locomotives, files left in the .eng folder:
Spoiler



As you can see, the common.inc\fleet list is what you'd expect to be the same for most locomotives.

The common.inc\fleet list is much more extensive for locomotives than for freight or passenger cars, largely because the .eng file is more complete. Most of the entries are for payware and ALL of the entries are specific to the physical model and NOT for the railroad that owned them.

The last group, files left in the .eng folder are mostly files that will be specific to one railroad and that one railroad has all of the .eng files in one folder.

I do hope this helps people understand what's going on here and see the need for standards.

#52 User is offline   Genma Saotome 

  • Owner and Admin
  • PipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Owner
  • Posts: 13,283
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 02 May 2018 - 12:02 PM

Another shift.

Previously the folder names under models were some sort of concatenation of the modeler's name and the model name. In hindsight it's clear this was a dumb idea... people (or payware groups) who make model;s tend to make all sorts of models and so I think the better way to deal with this is to add another branch in the directory tree and then simplify the name of the final folder.

For example:
This:
Include ( "..\\Common.Inc\\Models\\USRA_DS_Boxcar_Tim_Muir_Model\\XM_USRA_DS_Fixed_Specs.inc" )

Becomes:
Include ( "..\\Common.Inc\\Models\\Tim_Muir\\USRA_DS_Boxcar\\XM_USRA_DS_Fixed_Specs.inc" )

or even:
Include ( "..\\Common.Inc\\Models\\Tim_Muir\\USRA_DS_Boxcar\\Fixed_Specs.inc" )


Both ways of expressing this change result in shorter paths and really highlight where the model came from, which is important to many payware vendors.

For example:
Include ( "..\\Common.Inc\\Models\\3dtrains\\F3_V3\\F3A_Fixed_Specs.inc" )

Include ( "..\\Common.Inc\\Models\\3dtrains\\F7_V3\\F7A_Fixed_Specs.inc" )


I think this is a positive change that will be appreciated by payware vendors and individual modelers alike.

#53 User is offline   Genma Saotome 

  • Owner and Admin
  • PipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Owner
  • Posts: 13,283
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 24 May 2018 - 08:56 AM

The latest... Here is a typical .wag file using the Include() statement:

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

Wagon ( XM_MILW_703425_Leather
WagonShape ( MILW_USRA_703425.s )
Include ( "..\\Common.Inc\\Models\\Tim_Muir\\USRA_SS_Boxcar\\XM_USRA_SS_Fixed_Specs.inc" )
Include ( "..\\Common.Inc\\Models\\Tim_Muir\\USRA_SS_Boxcar\\XM_USRA_SS_Leather.inc" )
Include ( "..\\Common.Inc\\Fleet\\Std_Type_E_Coupler_Generic_Draft_Gear.inc" )
Include ( "..\\Common.Inc\\Fleet\\Single_Pipe_AB_Brakes.inc" )
Sound ( "genfreightwag1.sms" )
Name ( "XM 40' MILW <USRA SS> 703425 Leather" )

)

The only difference between this car and and empty of the same model is presence of the one line that is shown in bold.

To provide a variety of ladings I've created a bunch of "lading" .inc files, each adjusted for the unique weight of the contents. I use a spreadsheet to produce ALL the lines within such .inc files... it takes about 20-30 seconds per file. For this model I have these "lading" files available:

XM_USRA_SS_Box_Materials_LD.inc
XM_USRA_SS_Burlap_Bags_LD.inc
XM_USRA_SS_Canned_Food_LD.inc
XM_USRA_SS_China_Fixtures_LD.inc
XM_USRA_SS_Fixed_Specs.inc
XM_USRA_SS_Flooring_LD.inc
XM_USRA_SS_Glass_LD.inc
XM_USRA_SS_Guns_LD.inc
XM_USRA_SS_Hides_LD.inc
XM_USRA_SS_Insecticide_LD.inc
XM_USRA_SS_Leather_LD.inc
XM_USRA_SS_Lumber_LD.inc
XM_USRA_SS_Machine_Parts_LD.inc
XM_USRA_SS_Office_machines_LD.inc
XM_USRA_SS_Paper_Roofing_LD.inc
XM_USRA_SS_Pipe_fitings_LD.inc
XM_USRA_SS_Railroad_Car_Parts_LD.inc
XM_USRA_SS_Scrap_Paper_LD.inc
XM_USRA_SS_Tanning_Material_LD.inc
XM_USRA_SS_Tires_LD.inc
XM_USRA_SS_Woodwork_LD.inc


Each one looks like this:
Comment ( XM_USRA_SS_Leather_LD.inc )

comment ( "The value of any weight in this file is correct ONLY for these cars" )

comment ( "Estimated capacity (CAPY) of 100,000lb or 50t-us" )
comment ( "Calculated Load limit (Ld Lmt) of 113,700lb or 56.85t-us" )
comment ( "Empty car weight (Lt Wt) is 47,300lb or 23.65t-us" )

comment ( "Part 2A and 2B are parameters based on presence or absence of a load. " )
comment ( "Parameters for an empty car belong in a Fixed_Specs.inc" file." )
comment ( "Parameters for a loaded car belong in a {Lading Name}_Loads.inc file." )

comment "Part 2A - parameters based on presence or absence of a load.
Mass ( 39.6768 s-t )
CentreOfGravity (1.9m)
DerailRailForce ( 89.9869t )
DerailBufferForce ( 356.8958kn )
ORTSDavis_A ( 169.3897 lbf )
ORTSDavis_B ( 1.8481 lbf/mph )
ORTSDavis_C ( 0.0706 lbf/mph^2 )
ORTSBearingType ( Friction )


comment ( "Part 2B - Unsupported parameters based on presence or absence of a load." )
LadingName ( "Leather" )
LadingWeight ( 13.6078 s-t )





IMO the one line holding the lading information really belongs somewhere else... probably as part of the consist file. Doing so would reduce the number of .wags to just one -- the empty car. Maintaining your .wags would become sooooo much easier w/ one 12 line .wag per mesh file.

#54 User is offline   ErickC 

  • Conductor
  • Group: Status: Active Member
  • Posts: 353
  • Joined: 18-July 17
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 28 May 2018 - 01:51 PM

Well, unless you had separate sounds for loaded and empty cars - which do sound different. Then you'd be specifying a different SMS already. :D

#55 User is offline   Genma Saotome 

  • Owner and Admin
  • PipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Owner
  • Posts: 13,283
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 29 May 2018 - 12:19 PM

I never thought about different sounds based on loaded or empty but if there were sound files for both then I'd move the reference for the sound file from the .wag into the .inc files. The sound for the empty car would go into ...fixed_specs.inc and the one for the loaded car into each of the specific lading files.

Having duplicate parameters is not problem as the OR code simply retains the last one it sees. When there is an Include() fora lading file all parameters whose value has changed because of the lading weight are present; reading the lading file after reading the fixed_specs.inc file means OR keeps the values for the loaded car and tosses out the previous values which were all for an empty car.

#56 User is offline   ErickC 

  • Conductor
  • Group: Status: Active Member
  • Posts: 353
  • Joined: 18-July 17
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 29 May 2018 - 10:42 PM

The reason I point it out is I have been re-engineering the default sounds - actually, I threw them in the rubbish bin and hope to never hear them again. Track sounds, too. But I have separated the end result by load and wheel size (it affects the timing of the flat spots). Your idea about a line in the consist file determining the load got me thinking - wouldn't it be great if we could use car weight as a variable? It'd be a piece of cake for me to randomize the empty/loaded streams and blend them together with a volume curve. Then you could have the sounds dynamically change during load/unload operations. Single WAG, single SMS, huge variety.

#57 User is offline   Genma Saotome 

  • Owner and Admin
  • PipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Owner
  • Posts: 13,283
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 24 June 2018 - 04:18 PM

Continuing my efforts to figure out the wrinkles of using .inc files I recently concluded I was simply fed up with the effort of actually creating all those files... cut this, copy/paste that... too many mistakes, especially when creating .wags that varied only per a different weight.

I came up with this idea: Every car gets one .wag representing everything the game needs to know when that car is empty. It should be a standard .wag, ideally all the same rows with only the name and shape file values varying from one .wag to another.

Having done that the task was to figure out what changes when the car has a lading of some kind. That should be a subset of the first .wag, This too can be a standard .wag -- all the same rows for this type of file.

Because Open Rails will accept multiple occurrences of the same parameter -- it simply throws away all but the most recently read occurrence -- I realized I could use one .inc file to represent an empty car and a second .inc further down to hold only what changed on account of the lading.

This is the result:

An empty car .wag:
Wagon ( XM_SLSF_127149_MT
WagonShape ( FRISCO_Box_127149.s )
FreightAnim ( usra_ss_50xm_parts.s 1 1 1 )
Include ( "..\\Common.Inc\\Models\\Tim_Muir\\USRA_DS_Boxcar\\XM_USRA_DS_Fixed_Specs.inc" )
Include ( "..\\Common.Inc\\Fleet\\Std_Type_D_Coupler_Generic_Draft_Gear.inc" )
Include ( "..\\Common.Inc\\Fleet\\Single_Pipe_AB_Brakes.inc" )
Sound ( "genfreightwag2.sms" )
Name ( "XM 40' SLSF <USRA SS> 127149 Mty" )

)

A loaded car .wag:
Wagon ( XM_SLSF_127137_Lumber_LD
WagonShape ( Frisco_box_127137.s )
FreightAnim ( USRA_50t_parts.s 1 1 1 )
Include ( "..\\Common.Inc\\Models\\Tim_Muir\\USRA_DS_Boxcar\\XM_USRA_DS_Fixed_Specs.inc" )
Include ( "..\\Common.Inc\\Models\\Tim_Muir\\USRA_DS_Boxcar\\XM_USRA_DS_Lumber.inc" )
Include ( "..\\Common.Inc\\Fleet\\Std_Type_D_Coupler_Generic_Draft_Gear.inc" )
Include ( "..\\Common.Inc\\Fleet\\Single_Pipe_AB_Brakes.inc" )
Sound ( "genfreightwag1.sms" )
Name ( "XM SLSF 127137 Lumber LD" )

)


The only difference between the empty and loaded car is the addition of the orange line.


As an aid to quickly calculate the different values of the loaded car I created a spreadsheet (described here) which I will distribute for evaluation and feedback.

#58 User is offline   R H Steele 

  • Vice President
  • Group: Status: Elite Member
  • Posts: 2,290
  • Joined: 14-March 13
  • Gender:Male
  • Location:known universe
  • Simulator:Open Rails
  • Country:

Posted 26 August 2018 - 11:16 AM

Can the include path string be used for loose consist within the activity file?

If so, what's the correct format?


#59 User is offline   Genma Saotome 

  • Owner and Admin
  • PipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Owner
  • Posts: 13,283
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 26 August 2018 - 08:50 PM

Gerry, I was told the Include() statement would work in any file read by OR but the expectation is whatever is in the .inc files must be proper parameters for the specific file type you put the Include statement into. IOW, if you stick an Include() statement into an .act file then what is in the .inc must match the syntax of the .act file itself. Unfortunately the syntax of loose consists is not identical to what is in the .con file so you cannot use any of those for what you want to do w/o making them incompatible with any .con file utility.

For years I've been asking the OR team to do what KUJU should have done -- allow .con files as an alternative form of loose consist definitions -- but that proposal has always been dismissed... either it wasn't MSTS compatible (who cares now??) or it wasn't an interesting task for anybody who worked with the code.

I still think it is a sensible idea but unless you or I learn to code in C# I expect it isn't going to happen.

  • 6 Pages +
  • « First
  • 4
  • 5
  • 6
  • 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