Decision making driver commands

Dap

Prototype Operations Guru
Are there any driver commands or session rules that let an AI driver make a decision based on an external situation? For example as an AI train approaches a siding, if there is a car there, have the driver pick up the car. If there is no car there, keep going.

Such a rule or driver command would make AI operations much more interesting.
 
Hi Dap

The only decision making rule that I am aware of is the SCS2006 rule which I believe you have looked at but decided against. What you want to do can be achieved using the If...If Else... If End commands within that rule.

Someone posted about a new rule under developement a few weeks ago which would enable some decision making to be done but I haven't seen it yet. Trainz really does need some form of decision making for the AI to enable really interesting sessions to be made.

The main reason that I use SCS2006 is because it allows such decision making to be used. In your example I would have a Yes-No variable indicating whether the siding was occupied and an If command that would execute one block of commands to collect the vehicle if it was occupied, or a second block of commands to drive straight past if it was unoccupied.

Regards

Brian
 
Some limited decision making can be implemented by means of the "Schedule at Trackmark rule.

Let's suppose you have an interchange track between a short line and a class I railroad,:

Short line ====TM1======\
Class I RR ==TM2===TM3==\================== Yard

The Class I local freight orders shall end with a "Navigate via TM2"

Then, add the following rules:

Check Trackside: if any vehicle stops at TM1
> Variable modify: change "Pickup" to 1
Variable Check: if "Pickup" is equal to 0
> Schedule at trackmark: Navigate to Yard
Variable Check: if "Pickup" is equal to 1
> Schedule at trackmark: Navigate to TM3/Uncouple All/Couple at trackmark TM1/Couple to trackmark TM3/Navigate to Yard
> Variable modify: change "Pickup" to 0

If the short line drops some cars on the interchange track, Pickup will change to 1, and the Class I local freight will pick them up;

The above routine can be refined so that other trains do not activate the "Schedule at trackmark" by indenting it below a "Check trackside" programmed to recognize a certain type of locomotive, or a driver, i.e.

Check Trackside: if any vehicle stops at TM1
> Variable modify: change "Pickup" to 1
Check Trackside: if a GP-38 enters TM2
>Variable Check: if "Pickup" is equal to 0
>> Schedule at trackmark: Navigate to Yard
Check Trackside: if a GP-38 enters TM2
>Variable Check: if "Pickup" is equal to 1
>> Schedule at trackmark: Navigate to TM3/Uncouple All/Couple at trackmark TM1/Couple to trackmark TM3/Navigate to Yard
>> Variable modify: change "Pickup" to 0

In this case, the value of "Pickup" will only be checked if the train entering TM2 is hauled by a GP-38. A through freight led by SD-40s, or an Amtrak passenger train with its P-42, will pass through without receiving new orders.
 
I made one

I have made one out of variables.

So if a train was heading along a railway line to a coal mine with yard.

Then, depending on the type of train, the train would alter a variable via a driver command (I'm sure I ahve used one that does that that was retrieved fromt he DLS) and the train fills up with coal and checks a variable via a rule and a rule executes checking if there is a train already in the siding, assigning the driver with some commands which orders him to park it in an empty siding.

Then, a trigger check rule executes, altering another variable to change (depending on what type it is and if it is loaded).

Then, the train exits and another train enters, and it changes the variable to the type,, then it goes through the same process and this time, it gets commands to couple to the existing rake since variables have changed since then.:D

The needed assets are:
Couple At Trackmark <[FONT=Verdana, Arial]KUID2:[/FONT][FONT=Verdana, Arial]57145:81100:1>
[/FONT]ChangeSVariables <KUID:131986:1005>
WaitUntilSVariable <[FONT=Verdana, Arial]KUID:[/FONT][FONT=Verdana, Arial]131986:1006[/FONT]>
Session Variables <[FONT=Verdana, Arial]KUID2:[/FONT] [FONT=Verdana, Arial]122381:10015:1[/FONT]>
Check Trackside <[FONT=Verdana, Arial]KUID2:[/FONT] [FONT=Verdana, Arial]122381:10011:3>
[/FONT]Driver Schedule Rule <[FONT=Verdana, Arial]KUID2:[/FONT] [FONT=Verdana, Arial]82445:90001:7>[/FONT][FONT=Verdana, Arial][/FONT]
 
Are there any driver commands or session rules that let an AI driver make a decision based on an external situation? For example as an AI train approaches a siding, if there is a car there, have the driver pick up the car. If there is no car there, keep going.

Such a rule or driver command would make AI operations much more interesting.

Hi Dap - I made a set of driver commands that can look at a trackmark and jump over commands depending on whether the trackmark is occupied or vacant. It is called "Skip if trackmark" and takes parameters of occupied or vacant, and a label number.

The label is a driver command which you insert further down the command string to mark the place where you want to skip to. There is also an unconditional "Skip to Label" command for jumping over parts that you don't want to execute.

Further than that, there is another command "Skip if S-Variable" which looks at the value of a session variable and skips if the value compares with a constant using the usual logical operators like "greater than", "equal to", "less than" etc.

It all needs beta testing before being uploaded, although my NZ friend of Lots_Trainz has done extensive testing on the last mentioned command.

Because he needed to use many variables (hundreds) I re-wrote the companion commands "Wait Until S-Variable" and Change S-Variable" to use a new format which is incompatible with the original ones by Atila Barut.

It is past my bedtime now, so I will look for your reply tomorrow.

Cheers - Trevor
 
Wow, Lots of options. Ain't Trainz Great?

I think I'll try them all and see what works best for me.

Trevor, I'd be happy to give your items a beta test.

Thanks everyone.

David
 
I have one more item on my wish list.

I love Smileyman's UnCouplezFrom driver command. However, it seems to be limited to 20 cars. I have sent him an email asking the posibility of extending it to at least 40 cars. I have not heard back. Is there another driver command that will do this?

Thanks.

David
 
besides the regular uncouple rule theyre is a decouple rule which actually allows you to uncouple from a list of all cars on that train.....
 
besides the regular uncouple rule theyre is a decouple rule which actually allows you to uncouple from a list of all cars on that train.....

Thanks for the idea, but it will not work for what I am doing because I don't always know what cars will be in the train. I am creating a multiple day session using Pguy's QuickPortalManagerV2. It will emit a different consist every day at a specific time. It uses the same driver commands for each train in that time slot. The consists may vary to reflect different industry needs, but the same number of cars will be uncoupled, they will just be different cars from day to day.

David
 
Hi Dap

Those Skip if set of commands sure a powerful set of commands, you can AI to just about anything reliably.

Cheers

Lots
 
Trevor, I'd be happy to give your items a beta test.

David

Ok David, I will send you a package. It will take a little while to give them a final checkover.

Have you thought about "Uncouple at Trackmark"? That might work but the number of cars would not necessarily be exactly the same, as the length of the wagons would vary, so the position where uncoupling takes place might not be where you want it.

There is a command "Uncouple Number", but I don't have it and don't know what it does, and my FCT is inactive, waiting for the day I get broadband.

Otherwise I might be able to write you a new uncouple command, but that will take a bit longer.

Trevor
 
Back
Top