'Random' activities
Moderator: Moderators
'Random' activities
I've been following recent threads concerning MSTS limitations / 'wish lists' and had the following idea - I'd try it myself but I'm not sufficiently computer literate!
One of the recurring gripes is that when running an activity, the service pattern is exactly the same every time. My thought is that a utility could be devised to randomise activities by making slight alterations (say +/- 5 minutes) to the timing of AI services within the activity. Mode of operation would be along the following lines:
1. User selects activity to be 'randomised'
2. User selects 'randomisation factors' e.g. +/- 5minutes on AI start times, +/- 5% on AI performence.
3. Utility scans .act file, and modifies AI service start times (numeric values in lines starting 'service definition'). This value is in seconds, so a variation of +/-300 would represent a +/-5 minute variation in start time.
4. Utility scans .act file and modifies AI traffic performance values (numeric values in lines starting 'efficiency') by (say) +/-5% (values are in range 0-1); this would affect performance of AI passenger trains between stations and therefore arrival / departure times.
5. Utility saves randomised .act file (provision to be made for back-up of original .act fiel to be restored at later date).
6. User fires up MSTS and runs activity.
Obviously, this might not work for all activities; single track routes might be particularly sensitive, resulting in 'stand-offs' if service patterns are altered too much. It's also possible that on activities with dense traffic, crashes may be caused by services being superimposed, or too many objects being placed on a tile.
Please add your comments on this proposal; if there is anyone out there with the knowledge to construct such a utility, feel free to have a go! If I have time, I will manually "randomise" an activity or two by manually editing the .act files as detailed above (I'll use a random number generator to amend values) and report back.
One of the recurring gripes is that when running an activity, the service pattern is exactly the same every time. My thought is that a utility could be devised to randomise activities by making slight alterations (say +/- 5 minutes) to the timing of AI services within the activity. Mode of operation would be along the following lines:
1. User selects activity to be 'randomised'
2. User selects 'randomisation factors' e.g. +/- 5minutes on AI start times, +/- 5% on AI performence.
3. Utility scans .act file, and modifies AI service start times (numeric values in lines starting 'service definition'). This value is in seconds, so a variation of +/-300 would represent a +/-5 minute variation in start time.
4. Utility scans .act file and modifies AI traffic performance values (numeric values in lines starting 'efficiency') by (say) +/-5% (values are in range 0-1); this would affect performance of AI passenger trains between stations and therefore arrival / departure times.
5. Utility saves randomised .act file (provision to be made for back-up of original .act fiel to be restored at later date).
6. User fires up MSTS and runs activity.
Obviously, this might not work for all activities; single track routes might be particularly sensitive, resulting in 'stand-offs' if service patterns are altered too much. It's also possible that on activities with dense traffic, crashes may be caused by services being superimposed, or too many objects being placed on a tile.
Please add your comments on this proposal; if there is anyone out there with the knowledge to construct such a utility, feel free to have a go! If I have time, I will manually "randomise" an activity or two by manually editing the .act files as detailed above (I'll use a random number generator to amend values) and report back.
- salopiangrowler
- Very Active Forum Member
- Posts: 7796
- Joined: Mon Aug 12, 2002 8:56 pm
- Location: Shrewsbury
- Contact:
The only way to do this would be to edit the whole activity, and you risk completely messing it up if you do
I try to include an element of randomisation in my activities, depending on how you drive, by having AI traffic which interacts with the player service. Driving slower will have a different effect than driving faster as you may get blocked, lose time etc. But the same basic problem remains, once youve driven it correctly the first time and maybe a couple of times after, it will always be the same
Where it does score slightly though is that sometimes it will take you two or three goes to arrive on time 
- laurie_heath
- Been on the forums for a while
- Posts: 149
- Joined: Sun Jun 06, 2004 7:47 am
- Location: Kingston-Upon-Thames
- ForburyLion
- Very Active Forum Member
- Posts: 1225
- Joined: Fri Jun 14, 2002 7:30 pm
- Location: Reading
Here's an idea
An activity writer makes say 10 variations of the same activity and someone creates a programe that randomly copies one into the activities section of MSTS replacing the existing file of the same name (Too complicated for me, but it may be possible for those with the skills).
The different activities could include adjusted timings, different weather conditions, different stock etc etc.
An activity writer makes say 10 variations of the same activity and someone creates a programe that randomly copies one into the activities section of MSTS replacing the existing file of the same name (Too complicated for me, but it may be possible for those with the skills).
The different activities could include adjusted timings, different weather conditions, different stock etc etc.
- johndibben
- Bletchley Park:home of first programmable computer
- Posts: 14007
- Joined: Mon Dec 03, 2001 12:00 am
- Location: Bletchley
I've now written a tool in MS Excel to allow rapid calculation of 'randomised' AI traffic start times and performance along the lines I detailed at the top of this thread; with this, it took a couple of minutes to manually edit a typical .act file (45-minute activity, 6 items of AI traffic). I'm going to run this a few times to see the effect - I'll report back on progress!
Cheers
Tim
Cheers
Tim
- johndibben
- Bletchley Park:home of first programmable computer
- Posts: 14007
- Joined: Mon Dec 03, 2001 12:00 am
- Location: Bletchley
Not really an adequate test though. Currently im working on a 1:30min activity which has over 50 pieces of AI traffic, all different no repeats, and quite a few more to go as ive only done Southbound traffic, still got Northbound traffic to do, probably 18 - 20 consists/AI services to add.it took a couple of minutes to manually edit a typical .act file (45-minute activity, 6 items of AI traffic).
Since almost every piece involves the train being in a set place at a set time to interact with the player service -especially the northbound services - I dont think it would work - except for very simple activities.
- jbilton
- Very Active Forum Member
- Posts: 19267
- Joined: Fri Oct 10, 2003 12:08 pm
- Location: At home ..waiting to go to Work.
- Contact:
And difficult to keep time.....Baily9531 wrote: and also funny when you expect a 47 and get an 03
Seriously I seem to remember 'Activity Analyser' can alter the time of day ,time of year etc....which is half way there.
It also has an AI service generator, although once written its fixed of course.
Also I think it depends on the type of activity, on TM high speed express activities, often the AI local passing traffic was repeated to cut down on number of consists needed.....and you only see them for around 10 secs.
Cheers
Jon
------------------------Supporting whats good in the British community------------------------


Well, in my opinion changes with respect to the basic activity should be the same you could find in the real world, that is in principle delays in AI traffic (generated reducing the efficiency level of the services and/or delaying the start hour), more people at platforms than expected which means longer pauses of AI and player train at stations...and I think that could be alreadh quite satisfying.
Changing consists and heavily changing timetable is another thing.
Personally I am not interested in a random generator of activities, but in a generator of random (but usual) events within a well defined activity (and the most interesting activities for me are those that follow an official timetable).
Carlo
Changing consists and heavily changing timetable is another thing.
Personally I am not interested in a random generator of activities, but in a generator of random (but usual) events within a well defined activity (and the most interesting activities for me are those that follow an official timetable).
Carlo
I wasn't aiming at the more complex / challenging activities with this thread (I'm a great admirer of Lad491's work and appreciate the challenge that creating these activities presents - particularly with respect to interaction with AI traffic, having tried and failed on numerous occasions myself!) - rather looking for a way to 'tweak' basic activities to present different challenges, without mucking around with the activity editior.Not really an adequate test though. Currently im working on a 1:30min activity which has over 50 pieces of AI traffic, all different no repeats, and quite a few more to go as ive only done Southbound traffic, still got Northbound traffic to do, probably 18 - 20 consists/AI services to add.
Since almost every piece involves the train being in a set place at a set time to interact with the player service -especially the northbound services - I dont think it would work - except for very simple activities.
I've conducted a few tests based on my initial hypothesis above and am experiencing delayed success! Let's just say I'm learning some interesting things about MSTS file architecture, and have now developed an alternative hypothesis on how to achieve activity 'randomisation' - I'll test this tonight before going public again!
Cheers
Tim
