Skip to content

18VA: a 'minor' stop is not always minor #547

@erik-vos

Description

@erik-vos

For quite some time I have been working on an issue with 18VA, that basically is caused by the overloading of the stop type 'minor' for giving certain train stops different properties than others.

It is currently used for at least three purposes:

  1. to create two different stop types to enable the use of n+m trains (e.g. 1835, 1837, 18Scan);
  2. to exclude certain stops from being counted against the train length (e.g. 18EU, 1841, SOH);
  3. to have certain trains (optionally or mandatory) ignore certain stop types (e.g. 1826 TGV, 1861).

In most games that overloading does not generate problems, but in 18VA it does.
In 18VA, neither of the following two 'minor' stop types is counted, but

  • 'mines' (in fact represented by towns) may be run through by passenger trains, but do not produce any revenue.
  • 'ports' do produce revenue for all trains (if the required token has been placed).

In the code, the variable ignoreMinors is used for both purposes 2 and 3.
I could fix this in a dynamic modifier, but that isn't neat, and I decided to try a new approach in which that 'minor' overloading will be reduced or even eliminated.

In any case, the contents of the <Score> tag per train type will change.
So far we have <Score towns="yes"|"no" cities="single"|"double" />.
This will be replaced by defining score factors per stop and train type. For 18VA this would give:

  • for goods trains: <Score city="1" town="1" mine="1" port="1" offmap="1"/>( where 'town' refers to 18VA mines, and 'mine' to CMDs);
  • for normal passenger trains: <Score city="1" town="0" mine="0" port="1" offmap="1" />
  • for 4D trains perhaps: <Score city="2" town="0" mine="0" port="2" offmap="2" />, but I'm not yet sure about that, as not only the simple revenue but also the port and offmap bonuses are doubled.

The value "0" implies ignoring a stop, as is currently the case with towns="no".
As "1" will be the default, attributes with that value may be omitted.

In addition I may need a new tag <Count> with a similar structure (and a default "yes" for all):

  • for goods trains: <Count city="yes" town="yes" mine="yes" port="yes" offmap="yes"/>
  • for passenger trains (incl. 4D): <Count city="yes" town="no" mine="no" port="no" offmap="yes"/>
    This way counting and scoring would be separated completely. An alternative approach could be to keep using stop type="minor" to define counting (as 18VA has no '+'-trains).

This all is still in the works. Success isn't guaranteed, as the infamous ignoreMinors permeates much of the route finding and revenue calculating algorithms, which I still do not completely understand.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions