'Random' activities

General MSTS related discussion that doesn't really fit into any of the other specific forums.

Moderator: Moderators

User avatar
tialho
Established Forum Member
Posts: 312
Joined: Tue Mar 04, 2003 10:45 pm
Location: Swindon

Post by tialho »

Success!

My latest hypothesis on how to 'randomise' traffic was correct - the answer is to alter parameters in the .trf (traffic) file rather than the .act file (not entirely sure why the AI start times / performance figures are in the .act file - don't appear to be doing a lot!). I've run the test activity twice using different random start times for AI traffic (in range +/-5 minutes) generated via the Excel tool I was working on yesterday, with significantly different results on each run with respect to the default activity (passed AI traffic at different locations, signal delays etc).

I'll run a few more tests tomorrow; when I'm happy, I'll publish more extensive notes on how I've done this; I would also like to make the Excel tool available for wider evaluation / development if people are agreeable.

Regards,

Tim
csantucci
Been on the forums for a while
Posts: 101
Joined: Sun Nov 17, 2002 9:31 am

Post by csantucci »

That's nice! :D :D Could you alter also number of people on platforms? This would vary also stop time of player train (and of course also of AI trains) in stations. Moreover it would be nice to have the possibility to select or deselect services to be varied. Some services maybe should be left fixed (e.g. invisible trains).

Carlo
User avatar
tialho
Established Forum Member
Posts: 312
Joined: Tue Mar 04, 2003 10:45 pm
Location: Swindon

Post by tialho »

Could you alter also number of people on platforms? This would vary also stop time of player train (and of course also of AI trains) in stations. Moreover it would be nice to have the possibility to select or deselect services to be varied. Some services maybe should be left fixed (e.g. invisible trains).


Although I can't physically adjust the number of people on platforms for AI services within the current framework, departure times can be varied (which would have the same effect) - I'll look at this for the next series of tests.

As my current system is dependent upon manual editing of the .trf file (the tool is a 'number cruncher' to calculate randomised values) it is of course possible to decide not to amend specific AI services.

Cheers,

Tim[/quote]
User avatar
mjt222
Well Established Forum Member
Posts: 868
Joined: Sat Nov 08, 2003 4:23 pm
Location: Here and There

Post by mjt222 »

This sounds very interesting, and your findings around the trf file are most intesresting, lets hope you bottom this one out :)
User avatar
tialho
Established Forum Member
Posts: 312
Joined: Tue Mar 04, 2003 10:45 pm
Location: Swindon

Post by tialho »

OK, I've now tested 2 activities from different routes (one each from GR vol 1 and Irish Enterprise). I ran the original activity, then randomised 3 times and am pretty happy with the results; no crashes, and significant differences in AI pattern on each run (I used a start time variation of +/-5 minutes for both activities).

Down to details: the modifications are made purely within the .trf (traffic) file (no modification to the .act (activity) file is required). AI Start times are recorded on each line of the .trf file that starts 'Service_Definition' and is represented in seconds from 00:00:00 (midnight) - usually a 5-digit number. Altering this number alters the AI service start time - my spreadsheet tool will calculate random values within a set range from the original (e.g. +/- 5 minutes), which the user can then enter into the .trf file using WordPad.

For freight AI services (and non-stop passenger) that's it - as far as I can tell, the service will run at line speed or maximum speed for the consist, with no possibility to adjust further. For stopping services, however, performance between stops can be varied by adjusting values on 'ArrivalTime' and 'DepartTime' lines (format as for start time). Again, my spreadsheet will calculate randomised values for a given performance range (e.g. +/-5%). It should be noted that for many services in .trf files, Arrival/DepartTime is not calculated (the same value is shown throughout the service); in this case, other than altering start time, it is not feasible to alter performance.

I think I've now taken this line of enquiry as far as I can. I will work on making my spreadsheet a bit more user friendly, and write up a detailed instruction manual on how to use it, and will then upload it to this site for others to try (hopefully within the next day or so). As I said at the top of the thread, the ultimate aim would be for someone to develop a tool that will edit the .trf file automatically - I hope that my work might help someone with more computing ability to do this!

Regards,

Tim
User avatar
systema
Very Active Forum Member
Posts: 3829
Joined: Mon Sep 08, 2003 8:00 pm
Location: The Heart of Cheshire

Post by systema »

Tim,

Maybe MSTS is cleverer in some ways than often thought in allowing this randomisation.

The activity file defines the general activity parameters and the player traffic defintion plus the AI service defintions which effectively show what the AI trains are and where they start, but not when. The only timings in the activity file are for the start of the activity and the player definition.

The traffic file only contains the traffic defintions for each AI service and as you have found out allows possibilities for infinite variation subject to the dreaded standoffs occuring on complex activities and single line stuff.

I can't identify where the alteration to passenger numbers at stations is shown. I would conclude therefore that the only effect this has is when calculating stop times at stations in AEs timetable which is notoriously unreliable, and this is edited into the player and traffic service definitions as arrive/depart times.

These can be randomly altered but I do not believe AI trains run to the calculated timetables as such, because it is possible for a traffic definition to have any arrive/depart times and the AI service still runs. In other words the AI service just uses the route default platform passengers numbers to decide its waiting time and the route speed limits multiplied by efficiency to decide how long between stops. So I suspect there would be no point in randomising the passenger numbers or the arrive/depart times. If I am right I think the only number worth randomising is the one that follows the traffic service definition such as 58800 in the following example. 58800 merely defines the time the AI service appears in the activity (seconds after midnight?).

Service_Definition ( YorkDownNS 58800

This is a test service for MideastPlus where all the arrive depart times are set at 58800 and it works perfectly well.

So in conclusion it may be worth experimenting with randomising player arr/dep times in the activity file as well. Traffic files may only need randomisation of the first line of the service definitions. The other arr/dep times have no actual effect as far as I know. This could simplify the procedure greatly if my theory is correct. Might be woth trying if just altering the first line is all thats needed.

A promising development here to give drivers a bit more variety and more realistic variations. 8)

Mick Clarke
csantucci
Been on the forums for a while
Posts: 101
Joined: Sun Nov 17, 2002 9:31 am

Post by csantucci »

Mick and Tim,
my medium experience as activity writer has taught me that intermediate arrival and departure times for AI trains are not considered by the simulation; therefore randomising them has no effect. Platform passengers instead have effect on stop time not only on player train, but also on AI trains.
Referring to where platform passengers are stored: they are stored at the end of the .act file, in the PlatformNumPassengersWaiting block. Here an example from one of my acts:
PlatformNumPassengersWaiting (
PlatformData ( 4149 70 )
PlatformData ( 4144 100 )
PlatformData ( 4142 60 )
PlatformData ( 4133 50 )
PlatformData ( 4137 80 )
PlatformData ( 5810 30 )
PlatformData ( 257 350 )
)

You see that data are stored only for Platforms with non-default value (20).

Carlo
User avatar
tialho
Established Forum Member
Posts: 312
Joined: Tue Mar 04, 2003 10:45 pm
Location: Swindon

Post by tialho »

From Mick's post:
Traffic files may only need randomisation of the first line of the service definitions. The other arr/dep times have no actual effect as far as I know. This could simplify the procedure greatly if my theory is correct. Might be woth trying if just altering the first line is all thats needed.
To be honest, I was having some doubts about 'randomising' arrival/departure times - the maths I was using was tending to even out over a number of stops so not actually producing much variation, unless I got silly with the level of variation allowed (say +/- 50%).

From Carlo's post
You see that data are stored only for Platforms with non-default value (20).
If the value is only stored for non-default stops, it would be hard to randomise - I'm assuming that if an activity writer has altered the default value it is for a specific reason.

I think I'm going to remove the elements of the Excel tool relating to train performance,and stick with randomisation of service start times only - it makes it a lot more user-friendly! Also, the tests I ran were only really looking at this side, and gave pretty good results.

Cheers

Tim
csantucci
Been on the forums for a while
Posts: 101
Joined: Sun Nov 17, 2002 9:31 am

Post by csantucci »

Tim,
I agree that you remove intermediate arrive/departure times, while I would leave variations on train performance. But this of course is your decision.

Carlo
User avatar
systema
Very Active Forum Member
Posts: 3829
Joined: Mon Sep 08, 2003 8:00 pm
Location: The Heart of Cheshire

Post by systema »

Tim & Carlo,

Well spotted Carlo, I missed these platform entires because they were at the bottom of the file and not all activity files have passenger number changes so there is no entry in these cases.

I have just done some tests in Plus and can confirm the following.

AI Train loading times ARE affected by the platform passenger numbers defined in the route TDB and if modified, in the activity as indicated in the activity file.

Changes to the platform passengers are only detailed in the activity file if they are different to those specified in the route TrackDatabase. It is not based on whether they are default value changes.

Timetables are not maintained by AI traffic.

Note: AI Train speed between stops is determined by the consist parameters for max speed and acceleration and the line speed set in the route.

I would suggest therefore that if any activity file paramameters are to be randomised you should stick to passenger numbers only at one or two stations only, since these changes affect all trains that stop at those platforms. This could be difficult to achieve automatically since new line entries will have to added to the activity file.

In conclusion the simplest method of randomisation is just to modify the AI service start times in the traffic file. Hopefully this alone will give enough added interest and variation for drivers.

Mick Clarke
User avatar
tialho
Established Forum Member
Posts: 312
Joined: Tue Mar 04, 2003 10:45 pm
Location: Swindon

Post by tialho »

I have just uploaded the Excel tool to the file library - should be available in the next day or so. I have included detailed instructions and an example of the effects of randomisation on a simple activity. Please feel free to experiment and report back on your findings!

Cheers,

Tim
cherryville
Getting the hang of things now
Posts: 38
Joined: Wed Jul 21, 2004 8:35 pm

Post by cherryville »

Hi Tim. I have downloaded the activity randomiser and tried it on two trips on one activity. The activity chosen was Gerat Victoria St to Belfast Central which is a short run on Enterprise.

Both runs were totally different which is a nice touch especially on a short trip.

I did however find something strange....

On the second run arriving at Belfast Central I noticed that the liner train had not appeared as it was running late and an 80 class local was running ahead of it. The 80 class stopped in the platform and a couple of minutes later the late running liner arrived and collided with the local at the platform.

I then got an 'activity ended car derailed' message despite the fact that my train was stopped 2 platforms away from the collision !!


Mick.
User avatar
spikeyorks
Very Active Forum Member
Posts: 1641
Joined: Sat Jan 03, 2004 10:03 pm

Post by spikeyorks »

I then got an 'activity ended car derailed' message despite the fact that my train was stopped 2 platforms away from the collision !!
You get this message if anything derails. It doesn't have to be the player service.

With regards to your comments about the activity once it had been "randomised" I would advise caution before using it on any of my activities. Even on the short GVS to Central activity there is a fair bit of AI packed in and alot of it is dependent on each other.

For example quite often short paths are used to get around MSTS "bugs". Start an AI service a minute earlier or a minute later and you may well find a train appearing or vanishing in front of you.

Stopping passenger services are started earlier than freight or express services to count for the waiting time at station stops. Again start a stopper slightly later and then an express slightly earlier and you may well end up with two services in the same section....or even running the wrong way around giving the results you have seen.

Finally waiting points and double reverse points are often used "out of sight" to make an AI service appear at a certain time. Tweak the start times and you may well see services doing "funny things" before your very eyes.

If you would like multiple versions of the same activity just ask the activity creator and he will probably be able to knock them up fairly simply. :)

Regards David
Lad491
Very Active Forum Member
Posts: 10013
Joined: Mon Aug 11, 2003 9:25 pm
Location: West Sussex

Post by Lad491 »

Davids comment above is the reason why i think his idea will not work at all, except on the most simplest of activities. Changing start and end times of AI services will almost always mess the activity construction up - at least on my activities it will. I spend hundreds of hours testing timings to make sure everything runs spot on and if you change anything, even by a few seconds in some cases, the activity will more often fail.

I think it was a good idea in theory but isnt workable in practice - except as i say, for the simplest activities.

A better idea - and one im hoping will be available in KRS when it arrives, is just to have a set path and let the sim select services at random from consists available and set them off at a predetermined interval. So if i have 100 consists and want an AI service every 5 minutes it will just spew out trains at random - much like a car spawner now.
Locked

Return to “[MSTS1] General MSTS Discussion”