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
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
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
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
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.
- In Step 1 load the activity A-Town to B-City in ActivityChanger.
- Then Step 2 just choose the service B-City to A-Town (only this).
- Step 3 use Chosse Consists for randomized consists.
- Choose as many consists as you like in Step 3a.
- Now choose in Step 4 the time interval between the AI trains. Do not use less then
5 Minutes, because then most AI trains will stop at red signals.
AI trains will start at around this time and at some random time-offset to it. You do not determine the exact timing.
- Step 5 will set the start time of the first AI train. If your player's train will
ride around 35 minutes from A-Town to B-City, the AI trains in other direction
will last this time as well. So use 40 minutes before player here and you can
see first AI train just after the activity starts.
- We have set all values now and can choose Start AI generation now in Step 6.
ActivityChanger will generate AI traffic and
- Step 7 shows the result. Start MSTS and choose your changed Activity.
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
- Start steps 1-5 as in example 1.
- Important: In Step 6 select ServiceSet2.
- Step 2 can be displayed again. Choose service for subway traffic, which uses
third track. We assume this service uses a subway train.
- We want only subway on this service, so in Step 3 we don't choose consists and go on to
- Step 4. As above, do not use time intervals which are too short.
- As the player arrives in C-City around 20 minutes after the activity starts, it isn't
useful to generate AI traffic on this track before this point of time. So we
choose in Step 5 that first train should start 20 minutes after the player.
- That's it.
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!
- In Step 1 load activity A-Town to B-City in ActivityChanger.
- Then in Step 2 select all four services (ServiceAcela, ServiceLocal1,
ServiceLocal2 and ServiceFright).
- Use Step 4 to select the distance between the trains. Selecting 10 minutes
means that approximately (random!) every 10 minutes one of the four services starts
at B-City. Which service starts first and which next is a product of
randomizing. It is possible that the first and second train will be freight or
- Step 5 for the first AI train to start. Time to drive from A to B is around 35
minutes for player, so the other direction will be around this also. So we set
AI start time to 40 minutes before player. With this, the player will meet the first
AI train just after the activity starts.
- Start AI generation.
- Step 7 will show result. Start MSTS and choose your changed 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.
- In Step 1 please load activity A-City to D-City in ActivityChanger.
- Choose service(s) from B-City to A-City in Step 2.
- Select Chosse Consists in Step 3 for random consists.
- Choose consists to use for service(s) in Step 3a.
- Then choose distance between AI trains in Step 4.
- Step 5 defines when the first AI train starts at B-City. We need 15 minutes from
A to B, so AI traffic will need about the same time for the other direction. We should
select 20 minutes here to get AI traffic right after activity starts.
- That's it for first double track area. Now for the second one: Select
ServiceSet2 in Step 6 and back we are in
- Step 2: Select service(s) D-City to C-City here and go on with Steps 3-5 as
for first set of services. Click Start AI generation now and ActivityChanger starts
generating random AI traffic.
- Step 7 will show result. Start MSTS and choose your changed Activity.
On both double-track areas AI traffic will be shown.
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
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