Time Table Manager - AI Trains?

boleyd

Well-known member
My interest lies in improving the visual aspects of existing routes and then develop scenarios that are totally AI with no customer train driving. In essence a virtual giant model railroad. If I want to get in the cab to enjoy the ride the computer does all the heavy lifting and I simply go along for an executive ride.

The problem this brings up is scheduling. I have seen some scheduling rules and commands but most seem to be directed toward the customer driving a train that may operate amongst various AI trains at the same time. My preference is a tool that allows scheduling of just AI.

Trainz 2010 - 44088
 
My interest lies in improving the visual aspects of existing routes and then develop scenarios that are totally AI with no customer train driving. In essence a virtual giant model railroad. If I want to get in the cab to enjoy the ride the computer does all the heavy lifting and I simply go along for an executive ride.

The problem this brings up is scheduling. I have seen some scheduling rules and commands but most seem to be directed toward the customer driving a train that may operate amongst various AI trains at the same time. My preference is a tool that allows scheduling of just AI.

Trainz 2010 - 44088

Hi boleyd,

That seems like an interesting idea to look into,
I have made some small routes with a few stations and
single track main line and requires wait for trigger by "train"
I have tried the schedule rule but only works for one AI
I don't know how to get multiple ones to work with
few AI's.

-Aaron
 
I use the Wait Until driver command to have trains leave stations per my timetable. If the train is late arriving, it does not stop, so if you need your train to stop, better put a wait command before the wait until. I have been able to keep multiple AI trains running on a timetable schedule with this combination of commands.

Someday, there will be a drive to timetable command, but it is not yet written.

David
 
My interest lies in ... develop(ing) scenarios that are totally AI with no customer train driving. In essence a virtual giant model railroad..

Hi boleyd - That is the way I like to play the game too. Using the existing rules and driver commands is like learning a new language. There are so many and the combinations so interesting but it takes a long time to master enough to get things going the way you want them to be.

If you are serious about programming AI, the make a list of the commands and rules you know and study how they work and how they fit together, just as if you were learning Chinese, for example. Then gradually acquire more commands and add them into your schedule as you get to know them.

If I want to get in the cab to enjoy the ride the computer does all the heavy lifting and I simply go along for an executive ride.

This is a fun way to learn the route and explore the various branch lines. By the way, the commonly accepted term for a customer train is a "Player" train, with the automatically piloted ones being "AI" trains.
Any time I want to monitor an AI train to check that the instructions are correct I usually use external view as the schedule of my train is then visible and I leave the mouse pointed at the command being executed.

The problem this brings up is scheduling. I have seen some scheduling rules and commands but most seem to be directed toward the customer driving a train that may operate amongst various AI trains at the same time. My preference is a tool that allows scheduling of just AI.

The driver commands are directed at all trains whether they are Player ones or AI ones. If there is a command on the schedule then the train will try to obey it unless you use the "Stop Train" menu option. Even the "Drive" option is an AI instruction to keep going until something happens to stop it.

An important rule by Brummfonfel is the Schedule Library (built-in). With this you can set up short or longer strings of schedule commands which can be copied into any driver schedule using a driver command: Copy commands from (Library). You can use the same strings on more than one train as they progress down the line.

One technique is to chain the strings together by having the last command of a string call the next string. This is fine if you want your train to carry out a long schedule.
Another way to do it is to place a series of "Copy" commands in the driver schedule and switch on "Repeat".

A way of finding the rules and commands that worked for me is to use the DLS: I selected catagory "Rule" and left the search field blank. Then a list of all rules came up and I was able to pick out interesting ones for study. Do the same for Driver Commands. (Hope this still works)

Some Timetable rules exist which are for scheduling, but I don't like to be tied down to the trains running at specific times, I prefer more random train movements. (Wouldn't make a very good railwayman, would I?:o)

My Internet window will close shortly so I will end now but will revisit the thread and add more information.

Hope this helps - Trevor
 
Last edited:
Ugh - Dial-up. My sympathies.
I have selected the Brummfondel series of rules. Fixing warnings. Will focus on these for now. Too bad he has left the community.
 
Hi

I use the SCS2006 rule for programming timetables on the S&C route. It allows trains to be programmed to time but also allows an amount of randomness to be built in to simulate late running. I also use the Add Random Consist command (one of the commands in the rule) so each time the scenario runs the consists are made up differently.

There is a limit of 56 threads that can be used in a scenario which means that you can have 1 scenario thread and 55 consist threads but if you need more I've been able to increase this figure by using storage loops at each end of the route to turn some of the consists and send them back the other way when required.

Regards

Brian
 
The problem this brings up is scheduling. I have seen some scheduling rules and commands but most seem to be directed toward the customer driving a train that may operate amongst various AI trains at the same time. My preference is a tool that allows scheduling of just AI.

Trainz 2010 - 44088

Hi boleyd - There are several time-related rules and commands starting with "Wait" such as Wait for Hour, Wait for Minute, Wait for Trigger, WaitX(seconds), Wait until Time, Wait for Random etc.

Another approach is using Messages to communicate between drivers. Atila Barut (username atilabarut, kuid 131986) wrote a number of these like Send Message, Wait for Message, Wait for Message and Clear. I have created my own addition to his list with "Wait for Message to Clear" which I have not yet released.

Atila Barut also created CommWithTTable which combines the above Wait commands. The messages are set up with the InputTable or Work Table rule which allows you to specify any text. There are two versions, one for TRS2006. The reference to Timetable refers to a built-in device which is really a noticeboard for storing any kind of textual information like sticky notices.

Another pair of messaging commands is "Raise Event" and "Wait for event" which have fixed text messages.



Hope this adds to your collection of "Chinese" verbs and nouns.

Trevor
 
I've been working on this for months now, I use schedule library, path rule as the main basis and to get trains to depart at the right time I use a rule that uses minutes past the hour so you don't have to put in the same time for 12 or so hours :).

Also a good rule to observe this is random camera rule. Which means you can just sit and leave it running while the camera changes train and view randomly.
 
Aha, the message passing rules sound great. Example, shunter making up a train in the yard can tell the "dispatcher" (really the other train) it is ready and it can proceed to pick it up. If, perhaps,a message included a trackmark name of which siding the new consist was on, a couple-at-trackmark rule could complete the task.

Thanks


Hi boleyd - There are several time-related rules and commands starting with "Wait" such as Wait for Hour, Wait for Minute, Wait for Trigger, WaitX(seconds), Wait until Time, Wait for Random etc.

Another approach is using Messages to communicate between drivers. Atila Barut (username atilabarut, kuid 131986) wrote a number of these like Send Message, Wait for Message, Wait for Message and Clear. I have created my own addition to his list with "Wait for Message to Clear" which I have not yet released.

Atila Barut also created CommWithTTable which combines the above Wait commands. The messages are set up with the InputTable or Work Table rule which allows you to specify any text. There are two versions, one for TRS2006. The reference to Timetable refers to a built-in device which is really a noticeboard for storing any kind of textual information like sticky notices.

Another pair of messaging commands is "Raise Event" and "Wait for event" which have fixed text messages.



Hope this adds to your collection of "Chinese" verbs and nouns.

Trevor
 
If, perhaps,a message included a trackmark name of which siding the new consist was on, a couple-at-trackmark rule could complete the task.

Thanks

Hi Dick and other interested readers - At the present time there is no "Conditional Execute" kind of driver command available on the DLS other than "Drive to Trackmark List" by pguy, so although the message from train A to train B might say: "Consist ready for collection on Track 5", Train B would have to wait for a message: "Consist ready for collection on Track 5".

If the consist was ready at a track other than Track5 then it wouldn't be able to receive it, as it is waiting for just the Track5 message.

The reason for the italics in the first paragraph is that I have been working on conditional execution commands for some time now and have implemented a system for conditional execution if a trackmark is either vacant or occupied. The command name is "Skip if " with options of "Occupied" or "Vacant".

There is also one in the pipeline called "Skip if Message" but I haven't yet finalised what the source of the message will be. Your suggestion gives me a reason to try it out on "Send Message". Also, it might be better to call it "Execute if Message". The whole process required careful thought as to exactly how to implement the procedure, and sometimes a change of direction is necessary.

One problem with this type of programming is: what does the train driver do if there isn't a message for Track 5? If there are other possible Track x messages, he has to keep checking all the tracks. In programming terminology, there has to be a loop in the program and at some stage the loop needs to be broken. This is where conditional execution comes into play. If there is a message then break out and do some other set of instructions.

My system already handles the looping but involves a few specially made driver commands to do the job. As it could take some time to perfect the message processing command, I suggest you practice using the existing commands until I am ready for beta testing.

The command I refered to at the begining is <kuid2:61392:7000:2> Drivetotrackmarklist by Pierre Guy, but it only handles un-occupied trackmarks. What you want is the opposite, but not quite. Have a look at it anyway, and some of his other rules.

Cheers - Trevor
 
Hello Trev999

I'm very interesting for your upgrades of atilabarut's and pguy's rules and commands

regards
celje
 
Last edited:
Hello Trev999

I'm very interesting for your upgrades of atilabarut's and pguy's rules and commands

regards
celje

Hi celje - Thank you for your interest. I have not modified pguy's rule, I just mentioned that it might be useful. However I do have permission from Atila Barut to release improvements to his work. Up until now, none are released.
I would never release a modification without the author's permission.

The conditional execution commands are all my own work. Please send me a PM stating what commands interest you and I will give you more details.

It is long past my bedtime now.

Regards - Trevor
 
Indeed conditional with a default condition should be good. Can't have a bunch of trains setting around waiting for a message that doesn't come due to the miss application of a different rule. The default might be a query to the "activity" to see if a consist is actually ready, or the loading dock is clear because you haven't heard anything for "n" minutes.

I am guessing but I suspect that a "normal" railroad makes up a consist from available stock or it may have to send an engine out to another yard to get a leased car/wagon. All this should be done on a schedule but that is a foolish assumption for a computer. The train arriving for the new consist might be held at a siding in the yard until the consist is ready. I would hope that someday I could prepare a waybill and a set of rules would be generated to meet the needs of that document. I would rather manage a railroad than drive a train. Messages seem to be an essential part of that objective.
 
I've been working on this for months now, I use schedule library, path rule as the main basis and to get trains to depart at the right time I use a rule that uses minutes past the hour so you don't have to put in the same time for 12 or so hours :).

Also a good rule to observe this is random camera rule. Which means you can just sit and leave it running while the camera changes train and view randomly.
Where do you get the random camera rule? I looked on the DLS, but it didn't show up...Thanks...:o
 
I've been working on this for months now, I use schedule library, path rule as the main basis and to get trains to depart at the right time I use a rule that uses minutes past the hour so you don't have to put in the same time for 12 or so hours :).

Also a good rule to observe this is random camera rule. Which means you can just sit and leave it running while the camera changes train and view randomly.
Well I found the rule. I was searching for it under the Category>Rule filter but found it just under the Name>random camera filter. Anyway I will try using it..Thanks again..:wave:
 
Timetable Challenge was a thread and route that explored various ways to timetable. My 100 Trains session illustrated yet another way. Since we explored those methods there have been some new rules created that have enhanced the possibilities even more.

Segy
 
Back
Top