AI and helper engines?

AI and helper engines?

Postby AndiS » Fri Apr 18, 2014 11:25 pm

Has anybody succeeded in creating interesting scenarios with helper engines?


Version 1: AI train arrives without helper, AI helper engine comes from depot and couples to rear (or front). They depart together.

The problem I cannot overcome is this: AI stops half a metre from link 0. If link 0 is not cleared by the other train, it will not enter the block in the first place. Therefore, you cannot trick the helper into coupling to the train by placing an invisible signal right at the rear buffers of the last wagon.

Any ideas/experiences/findings/theories?


Version 2: AI train with helper arrives, helper uncouples.

Any chance to have the uncoupled part do anything during the rest of the scenario? For all I know, what you uncouple falls dead.


Version 3: AI and player train.

We can rule out AI coupling to the player train (assuming the player train is not in its initial location), in part because the player will not stop precisely enough for any tricks, in part because version1 failed anyway.

What are the experiences with player helper engine coupling to AI train? Any success stories?


Version 4: Guided freeroam.

Long ago, Geoff (I believe) introduced this idea of freeroam scenarios where you perform actions according to some script. Did this take off - do people produce such scenarios, do people play them? I like the idea but I am often alone in what I like.

Do triggered messages work in freeroam?


Related question 1: What is the best technique to make AI couple to wagons (without engine) that have moved?

I read you can do it using markers (stopping points). How do you go about without endlessly moving them around trying to match train length and marker locations?


Related question 2: Are the physics of double traction correct after the consist is altered?

If the train is set up ready for departure at scenario start, both engines and all wagons, I would expect the total tractive effort of both engines and the total train mass to be ok. But if you couple the helper to the train after scenario start, is the combined tractive effort taken into account when you go up the incline afterwards?

(This would have to be freeroam, I suppose. Any negative experiences with physics and freeroam?)
AndiS
Top Link Driver!
 
Posts: 736
Joined: Wed Apr 09, 2014 5:48 pm
Has thanked: 268 times
Been thanked: 308 times

Re: AI and helper engines?

Postby Smokebox » Fri Apr 18, 2014 11:44 pm

Interesting that you mention AI in free roam. I did that as a matter of course for the Consolidation scenarios, but when I mentioned it to RSC, they were surprised (said something along the lines of "there's no AI in Free Roam" - well in mine there are). The AI can stop you from having complete freedom about where and/or when to go, but it makes for a much more interesting environment (avoiding the feeling of being all alone out there).

I tried scenarios where the AI would try to couple, but they always crashed no matter how carefully I tried to set up the instructions. I gave up.

As for AI helpers, I just have them stay with me throughout the entire scenario. I couldn't find a way around that.
User avatar
Smokebox
Fit for Firing Duties
 
Posts: 29
Joined: Wed Apr 16, 2014 12:30 pm
Has thanked: 11 times
Been thanked: 23 times

Re: AI and helper engines?

Postby AndiS » Sat Apr 19, 2014 8:16 am

Smokebox wrote:Interesting that you mention AI in free roam. I did that as a matter of course for the Consolidation scenarios, but when I mentioned it to RSC, they were surprised (said something along the lines of "there's no AI in Free Roam" - well in mine there are).

I know where they are coming from and I hope they don't enforce their position by technically disabling AI in free roam scenarios.

The thing is this: AI can get shocked when it sees someone cross its path or otherwise do surprising things and then it falls into endless crawling. RSC decided that they cannot fix it. Free roam scenarios have free in their name, so they are all about doing what you like. So they cannot fault the user for shocking the AI. So they better avoid the conflict at all. But "Don't expect AI to work in free roam" would be a better formulation.

As you say, a bit of AI not crossing the player path is no problem at all and without any AI, you feel just too lonely.
AndiS
Top Link Driver!
 
Posts: 736
Joined: Wed Apr 09, 2014 5:48 pm
Has thanked: 268 times
Been thanked: 308 times

Re: AI and helper engines?

Postby Kernow » Mon Apr 21, 2014 8:23 pm

Hi Andi,
Back in 2012 I had a play with what I called a structured free roam where all of the trains were given instructions but acted as AI until clicked on. This worked quite well meaning that I could take over any of the other trains at any point in the scenario. There were on occasion (inevitably?) some AI clashes but mostly it worked.
I made messages for many tasks. These would only appear when that particular consist was the player train.
Try UKTS29867 Slurry in a Hurry if you have the route and assets and have a look at what I tried to do. The scenario ran fine as a straight forward player train scenario. In it you start out waiting at Lostwithiel for your train to arrive just as you can for a timetable scenario. When the loco arrived you took control by just clicking on it.
I also tried a Oxford - Paddington scenario where you could choose to play any one of 3 early morning newspaper trains from Paddington to 3 different destinations - again using the same process as above. That also worked but I never got around to finishing it. I could package that up and send that to you if you are interested in having a look ?
Regards,
Graham
Kernow
General Shed Duties
 
Posts: 18
Images: 1
Joined: Mon Apr 14, 2014 8:44 pm
Has thanked: 13 times
Been thanked: 10 times

Re: AI and helper engines?

Postby AndiS » Mon Apr 21, 2014 10:01 pm

Thanks Graham,
that is certainly motivating. I only have the default routes. However, it is user experiences that I am collecting, not necessarily the scenarios themselves. I see that the download count is certainly in the upper half of your scenarios. Did you get feedback beyond the friendly remark from Gary (gptech)? (You do own a lot of routes don't you.)

The AI issues you observed can be anything - from route specific to game specific. So I had another try.

In free roam, my Train 1 was standing of two minutes protected by a signal. Train 2 behind it is just a light engine. Both have orders to move on after the stop, spaced by the block signals. It works fine for AI alone. I put Train 3 on a parallel track just to be able to get out of the two.

If I take over train 1 and then another train, train 1 moves on to its destination repeatedly, which is good new.

If I take over train 2 and couple it to train 1, the result becomes train 2. It goes to destination 2. You can drive it yourself or it goes there by itself if I click on train 3 after the coupling. So yes, you can couple a helper engine to an AI train and have it leave as an AI train, which is nice. For the AI train, physic does not matter, so the nasty question whether the tractive effort of both is added does not bug me at the moment. The first engine does keep showing exhaust.

If I uncouple from train 1 again, picking a wagon from its rear, things become disappointing. The engine of train 1 becomes immobile. When you take over, you can release brakes and open the regulator all you want. It counts up RPM in the HUD, but it does not move at all.

This means that scenarios where the player uncouples wagons from an AI train is not even possible if you take over that train to get it moving.

The other thing is that train 2 came back like a rubber ball when I drove it away (as player), then clicked on another train, hoping it would observe link 0 of the signal protecting the train ahead. It would have done as a pure AI train. It crashed into the immobile train repeatedly, no matter how far I drove it away.

So the lessons learnt are:

1) You can couple a helper to a train in a scenario where the train comes and leaves as AI and the helper arrives as AI. You only need to drive it past the signal protecting the train and do the coupling.

2) If you couple to an AI train, the engine of that train will not move again, even as player train. Since AI cannot couple to anything that had moved, it will not couple back to its train if you detach it temporally.

3) This immobile engine becomes invisible for AI which will therefore plough though it. The game terminates if this happens.

Further ideas:
Detaching and moving the engine of train 1 a bit forward before you couple to the rear of the train to pick up a few of the wagons would preserve the chance to couple the it back onto the train after the shunting is done. Unfortunately, I fear that that engine would run to its destination without its train as soon as it feels like. But then again, timetabling it to wait until the shunting is done could help. Ought to be explored on another day.

Thanks for the inspiration and encouragement.
AndiS
Top Link Driver!
 
Posts: 736
Joined: Wed Apr 09, 2014 5:48 pm
Has thanked: 268 times
Been thanked: 308 times

Re: AI and helper engines?

Postby AndiS » Wed Apr 23, 2014 10:30 pm

I took up the idea of player coupling in AI shunting. The following is a preliminary report more than a finished tutorial.

What worked was an AI train arriving and shunting without player intervention at the front end while a station pilot shunted at the rear end, with the user jumping in for the coupling. At the end, the player coupled the train engine with the wagons it had picked up to the train the station pilot prepared and it left.

What did not work was another train passing through after the first train left. AI just got nuts there and I have not pinned down why exactly.

Summary of the findings:

  • You can have complex AI shunting if you do almost all the coupling.
  • You do it in a free roam scenario where AI does everything, but pauses for the coupling.
  • Taking over more of the shunting duties spontaneously can be a mixed bag of experiences.
  • The only thing to avoid is picking wagons from the end of a train while its engine is still coupled to the train.
  • Changing to train spotting mode (with all active trains being AI) is done by placing a dummy engine nearby.

The details:

  1. AI can couple to stock at its initial location unless there was a player intervention on the train end concerned.
    1. If you couple a wagon to an engine (in player mode), then make it go on as AI (which is ok), and the next thing is coupling a different wagon in its original position to the wagon you coupled to the engine, the engine will crash into that wagon if in AI mode as the wagon you coupled first is invisible to it.
    2. It is no problem to have AI pick up several wagons at their initial location without player intervention.
    3. This leads to the rule: Once coupled by player, always coupled by player.
    4. There are two exceptions to the rule: What you couple to one end does not influence the other end at all. And AI coupling may work again after you detached all you coupled to the engine so it the consist has its initial length again. But I have not tested that yet.
  2. As a scenario author, place a stop-at instruction where the player takes over.
    1. If you don't want do turn the scenario into an arcade game, add a stop-at instruction with a generous waiting period near the place where the next coupling by the player is due.
    2. If you want to show an alert to the player telling him what to do, you need to double up the stop-at instruction. First, you stop at that marker for 1 second, then you show the instruction using trigger event, third comes the mandatory stop-at instruction with a decent duration. Even if you postulate that the player has to click on the engine within 10 seconds, it is a good idea to let the duration of the second stop-at instruction reflect the estimated duration of the coupling act performed by the player. This keeps the expectations of the AI in sync with the player action, to a degree.
  3. As a player, you may want to wait until the engine is stopped there, or take it over as it approaches.
    1. It is possible to take over the AI train approaching the place of coupling, before it stops at the marker for the stop-at instruction. However, beware of the initial position of the handles, which can be surprising.
    2. The instruction shown by the trigger event will pop into your face while you approach the wagon to be coupled. Luckily it is semitransparent.
  4. After you coupled to a train, start the movement that follows and do not hand over control to the AI before the train left the marker where you took over.
    1. You can unlink the camera using key 8 to stay where you want.
    2. If you click on another train too early, AI may fall out of a time hole and resume action where you took over, driving back to where you coupled. Or it stops dead in its track.
    3. Whenever I left a train outside the marker where I took over (and running away from it), I always found AI duly proceeding to the next item on the order list.
    4. Taking over more than just the coupling and restarting can lead to mixed results. In my experience, the AI signaller changed the switches for the AI driver more willingly than for the player. Handing over the train to AI when the path does not get set right made the AI driver return to the stop-at instruction where you took over before, but at least I was able to send it away then, and after that, it resume service as it should.
    5. Remember that the AI wants fixed actions taking place. The more player intervention, the greater the chances that one or the other AI driver just walks away in frustration.
  5. If you couple to any consist that includes an engine, that engine becomes a wagon, or non-powered engine.
    1. This is not a problem if you want the joined train to leave to its destination in this configuration, e.g., you couple a banker to the train and they continue their trip.
    2. If you couple a station pilot to the rear end of a train, uncouple the train engine first.
    3. Move it a few metres forward to give the player some leeway. If the wagons get pushed against the train engine due to rough coupling by the shunter, the scenario is spoilt.
    4. The train engine must be coupled back to the train by the player after the station pilot left.
    5. Fetching water might be a prototypical excuse for the uncoupling. Uncoupling from a long train helped the driver stop precisely at the water crane and before the time of air brakes in freight trains, it was not a big deal.
    6. Inventing some shunting duties at the front end is another option.
  6. To change to watching only, you need a dummy engine nearby.
    1. This engine has a driver icon, but no destination, and no orders.
    2. You are free to move it about if you like, but be sure that it does not interfere with any moves.
    3. Since flying is cheap, I prefer this engine to be stapled somewhere nearby, never driving it.
    4. If you are sure you cannot find a spot in your station where you can staple that engine, create an engine that looks like a wagon, by adapting the copy of an engine's .bin files to the shape of a wagon, removing controllers and particle emitters. However, details on this is would fill an essay of its own.
  7. The scenario ends when the train which is the current player train reaches its destination.
    1. Just be sure to get out before.
    2. It is a good idea to give all trains (except for the dummy train) a final destination that takes them a bit away from the scene of action. When you leave them, you should not need to worry about it any more. I.e., it should not be a problem if AI just sends them home.
  8. Avoid crossing paths where the player is involved as much as possible.
    1. Paths of AI trains crossing each other are not an issue.
    2. Simply wait for the AI train to arrive and the AI station pilot to draw near.
    3. An AI train that passes through the station after all the shunting is done and the first train left and the station pilot has withdrawn may be a candidate for trouble. AI is as intelligent as always. Don't expect wonders. Deviations in the timing can shock that last AI train and the scenario may well end with a sour note.
    4. That said, did try it. What happened was surprising. The station pilot operating on the end where that next train would approach started to behave totally nuts. To irregular to make it worth a description. As soon as I took the driver icon from that next train, everything was fine again. And I refer to stupid things happening in minute 2 of the scenario when the departure time of the disturbing next train was in minute 6. So there was absolutely no reason to apply.

So that other train needs more research. I did double up outer home and advanced starter there so the moves of the station pilot were isolated by two block signals in either direction from the waiting AI. The next train had lowest priority, of course. And I moved trains after the changes and reloaded route and all that.

But the layout was quite dense, so I need to explore the effect of space on AI panicking. Some people swear by splitting and rewelding track between signals although I never saw a difference myself. Anyway, I will not give AI more hiding place than the usual distance between inner and outer home and maybe start it a block away. Because if that next train does not show up soon after the first left, no one wants to wait for it anyway.

Notwithstanding this last issue, I guess that a lot of fun can be had with this method for those who prefer to watch a scene unfold, and those who want to run the station pilot.

In the later case, getting the issue with that next train fixed would be great since yon then can shunt one train after the other, even if they arrive on the same track. On double track, you can always have the second train arrive in the opposite direction, if you don't touch that path while shunting the first train. But this, too, might be difficult to achieve in many layouts.
AndiS
Top Link Driver!
 
Posts: 736
Joined: Wed Apr 09, 2014 5:48 pm
Has thanked: 268 times
Been thanked: 308 times

Re: AI and helper engines?

Postby Kernow » Thu Apr 24, 2014 8:11 pm

Hi Andi,
You've been busy - There's alot of stuff to read through there!
I've started trying some of the things out that you've had a play with and if I have any 'Eureka' moments I'll post but I'll be playing catch-up as you are well into this now!
Following this thread with interest..
Regards,
Graham
Kernow
General Shed Duties
 
Posts: 18
Images: 1
Joined: Mon Apr 14, 2014 8:44 pm
Has thanked: 13 times
Been thanked: 10 times


Return to Scenario Creation

Who is online

Users browsing this forum: No registered users and 3 guests