Diese Seite auf deutsch hier
This site in german here

Ce site en français ici
ActivityChanger for Random AI

This is a short documentation for the ActivityChangers random AI function.
ActivityChanger can be downloaded here: msts.Juliane-und-Torben.de
eMail for problems/hints etc.: Torben Spiegler

Step-by-Step Instructions
Example 1: Simple AI traffic with randomized consists
Example 2: AI on routes with three tracks
Example 3: Special AI traffic for high-speed, local and freight trains
Example 4: A route which has parts with only one track
Known Problems



Step 1: Choose Activitiy for player



ActivityChanger will modify the actual loaded activity and save the original under a different name. So open an activity with ActivityChanger. This activity may have AI traffic or other events. AI traffic will be ignored, but events (pick up trains or speedlimits) will be used.
After loading activity, start randomizing in menu:


Step 2: Choose services


Choose one or more services for the AI traffic. If you choose more than one service, all will be used for AI traffic in random order. They won't start at the same time.

Step 3: Choose if you want randomized consists for the choosen services

ActivityChanger can use the consist as defined in choosen services, or you can choose others, which will be used in random order for the services. If you select Choose consists, you will be directed to Step 3a.

Step 3a: Choose consists

Choose one or (typically more than one) consist, which should be used for the services.

Step 3b: Different possibility for each consist?

If you don't want the same frequency for every consist (which you selected in Step 3a) you can change it here. You will go on to Step 3c.
Warning: You'll be asked to type a number for every consist you selected! Don't click on YES if you have selected many consists!

Schritt 3c: Set proportional frequency for each consist

For every selected consist (Step 3a) you can set the proportional frequency now. You can type any positive (integer) (whole number) value here. Look at these values as if they were percent values. For example: You have choosen a high-speed train, a local train and a freight train. Set value for the high-speed to 20, for the freight to 30 and for the local to 50. Now you have 100%. There will be a few more freight trains than high-speed ones and nearly twice as many local trains. You don't need to calculate exactly to 100%; ActivityChanger will scale your inputs to 100% at the end. (This means: You will get the same output as above if you use values 2, 3 and 5!)
Clicking on Cancel will set the value to 10.

Step 4: Time between the train departures

Choose here how often the trains will start. If you select 10 minutes, then every 10 minutes a train will be generated. It will not be exactly every 10 minutes: there is some randomizing in these, too.
If you use 5 minutes or less, there will be many red signals for AI trains and sometimes AI traffic that doesn't move any more. 10 minutes or more is often a safe value...

Step 5: When should first train start?

In this dialog you can choose when the first AI train will be generated. If you have two tracks and AI traffic on the whole route, the first AI train has to start much earlier than the player so that the AI train will be near the player (after riding whole route) when the player starts. However, if the player meets the first AI train a long time after player's start, there is no need of starting AI traffic too early (you need CPU power for every AI train). So it is possible to choose a starting time after player starts!
In screenshot first train will start 30 minutes before player.

Step 6: Another service-set?

If you click on ServiceSet2, you will go back to Step 2 and you can choose another service set as described.
Why would you want to do that? You can choose more than one service in Step 2, so why again?
Because you can choose a different set of services. You can choose as many sets as you want. This can be useful if you want AI traffic at a area which has a third track. AI trains on a third track can operate independently, so you can use a extra set of services for this. There are many possibilities of using these service-sets.
Note: All of your (in next step) selected services will start with no care to previous services. Please use a service only in one service-sets!

Step 7: Done

ActivityChanger displays how many AI trains were generated.
Warning: Depending on the route, the activity and your computer this may take a minute or more! If you use small distances between AI trains and a long activity, more than 300 AI trains can be generated...
Please wait until message appears!

Start MSTS and choose your changed activity. Enjoy!

(You can always use the "Restore Original Activity File" on the main screen to restore your original activity.)


Example 1: Simple AI traffic with randomized consists

In most cases, there are two tracks: the Player goes from A-Town to B-City and the AI traffic from B-City to A-Town with random consists. You need an activity for the player as template, which has a service A to B. No AI traffic is needed in this activity. And you need a service for the AI traffic, which goes from B to A. Don't worry about the train to be used in this service, it doesn't matter.


Example 2: AI on routes with three tracks

We expand example 1. Now there is a C-City between A-Town and B-City. Around C-City is a third track for a subway. Beside the traffic on the main track, you want subway traffic.



Example 3: special AI for high-speed, local and freight trains

In this example you can see how to generate more realistic AI traffic. As before, player goes from A-Town via C-City to B-City. AI traffic should be high-speed trains, local trains and freight trains. The activity template for the player is as described above from A to B. The high-speed train service (name: ServiceAcela) only stops in B-City, than goes to C-City, where it uses a track which will not got to A-Town. So it leaves the visibility of the player in C-City without driving to A-Town. First local train (name: ServiceLocal1) goes from B-City via C-City to A-Town and stops at every station. Second local train (name: ServiceLocal2) uses same tracks as Local1 and stops at every station, but uses a different consist. Last one is the freight train (name ServiceFreight). Same tracks as local trains, but no stops at stations.
Before starting ActivityChanger's random function, all these services (ServiceAcela, ServiceLocal1, ServiceLocal2 and ServiceFright) have to be built with the MSTS Activity Editor! If you don't know how to do this, use the Internet and look for tutorials for this. These three services-files have to be there, but they do not need to be used in the AI traffic definition of an activity!



Example 4: Route which has parts with only one track

Situation for this example: two Tracks from A-City to B-City, then only one track from B-City to C-City. From C-City to D-City again there are two tracks. We need activity for the player and two services for AI traffic generation: First service goes from B-City to A-City, second service from D-City to C-City.



known problems:

Error "Consist XYZ was placed over Consist ABC"::
You will get this often when you choose time intervals which are too small between AI trains in Step 4. First AI train is still in starting area, when MSTS places second AI train. So use longer distances between trains.
Another possibility: Maybe there are passive trains in the activity-template and one of you choosen service starts exactly on this position. Delete the passive trains before using ActivityChanger on the original activity.

Nothing, but red signals...
ActivityChanger can't verify if generated AI traffic works correctly without blocking each other. Don't use ActivityChanger on sections with only one track.

Every time I start playing a generated activity, all the AI trains are the same? Where is the randomness?
MSTS can't handle random activities! The idea of ActivityChanger is different: The randomness takes place while generating an activity, not while playing it! If you want more randomness, generate a new activity with random traffic.



ActivityChanger by Torben Spiegler, 2002