Fix to the AI behavior of City of Thames that I want to share

General discussions

Moderator: senjer

Post Reply
User avatar
Nicolas
Posts: 166
Joined: 22 Jan 2020, 23:18

Fix to the AI behavior of City of Thames that I want to share

Post by Nicolas »

First of all, I apologize to the devs Michiel and Sjoerd for continuing to be so painfully insistent with this subject, but I want the rest of Metro Sim players to be aware of this, and be able to get this issue addressed. After peeking a bit on the data files of the City of Thames route, I did a small adjustment in one of the timetable files, and that apparently has fixed an AI issue that existed since the release of the map (along with Metro Sim 3.16) last year. I'm creating a thread of its own, hoping it will gather a bit more of attention. I'll try to explain below.

On any activities that involve AI traffic on the Yellow Line, certain trains arriving at the platform 2 of Oxford Cross will get stuck on it, as a result of doing something wrong. Instead of stopping, opening their doors and shutting off the cab, they will try to continue past the platform towards the Oxford Cross yard. There is a shunt signal guarding this yard, permanently in danger aspect. The trains are not cleared into this yard, but yet they will try to continue, getting a SPAD and therefore becoming stopped there, unable to go back to their duty. This causes the platform to be partially occupied, and therefore unusable by AI trains.

Image
Image

This has bothered me for a while, so I decided to start looking into it. First I picked an activity (Afternoon 501 in my case, as it starts in Oxford Cross) and I checked which is the first train that does this, to get to know what route is supposed to take. Turns out it's train 5037OG.

Image

I went into the activity file to get a clue of this train's duty. Until now I didn't know much about how activities work in this game, but I'm starting to understand some things. I couldn't get any reference to this particular train (5037OG) but I did find something regarding 5037GO, which I think it's the service that's supposed to start with this train in the opposite direction, towards GWR Station. This train uses timetable 503, so I went to check the timetable files.

Image

On CircleMorningYellow.xml I could find references to this service, and the routes it should take. According to this file, the train should go back and forth using the routes "Yellow-GAO" and "Yellow-OQG". Other services also mention a "Yellow-GQO" route. I opened the RoutesYellow316.xml file to see if all these routes do exist, and it turns out there are five routes listed: "Yellow-OAG", "Yellow-OAY", "Yellow-GAO", "Yellow-GAOs" and "Yellow-GAZ". No sign of OQG and GQO.

At this point I started to assume this was a syntax error during the creation of the activities. Or maybe OQG and GQO are routes that will be in a future version of CoT. I don't know just yet, but I wanted to try something. I replaced OQG with OAG, and GQO with GAO on all instances of this timetable file, and tested the activity. Turns out the trains that arrive at Oxford Cross platform 2 now do the right thing every time: stop, open the doors, turn off the cab, and eventually depart on the opposite direction when their duty requires.

The only problem that persists (but I don't deem it as a major issue) is that in this same activity I picked for testing (Afternoon 501) if you leave the player train do its duty in AI mode, and you happen to get into the cab at the very end of the activity without disabling AI mode, it will try to do the same thing trains like 5037OG did before; SPAD the signal and get stopped in the same location. This doesn't happen if you leave the player train do its service without ever entering the cab. To me, it seems like entering the cab of this train seems to alter its AI behavior even if you don't disable the AI mode. I couldn't find the cause of this, but because this is supposed to be the player service, I think I can give it a pass.

I must clarify, all of this is based on my own experimentation with the game. I'm not sure if this happens to everybody, but at least to me, it did happen the way I describe, and doing this small edit seemed to address the issue. I'm playing Metro Simulator 3.16.1 with the latest versions of all the London-related content, in Windows 10 Pro 64 bit with these specs. I would like to hear from other people experimenting and talking about their results.

I'm pasting here the code I edited, in case anyone is interested. You should paste this into the CircleMorningYellow.xml file, in "Metro Simulator/Data/LUI/Activities". I hope you find this useful.

Code: Select all

<trains>
 <train code="501">
  <duty code="501" number="5017OG" route="Yellow-OAG"      time="07:24:45" ai="true"/>
  <duty code="501" number="5017GO" route="Yellow-GAO"      time="07:36:30" ai="true"/>
  <duty code="501" number="5017OG" route="Yellow-OAG"      time="07:54:45" ai="true"/>
  <duty code="501" number="5017GO" route="Yellow-GAO"      time="08:06:30" ai="true"/>
  <duty code="501" number="5017OG" route="Yellow-OAG"      time="08:24:45" ai="true"/>
  <duty code="501" number="5017GO" route="Yellow-GAO"      time="08:36:30" ai="true"/>
  <duty code="501" number="5017OG" route="Yellow-OAG"      time="08:54:45" ai="true"/>
  <duty code="501" number="5017GO" route="Yellow-GAO"      time="09:06:30" ai="true"/>
  <duty code="501" number="5017OG" route="Yellow-OAG"      time="09:24:45" ai="true"/>
  <duty code="501" number="5017GO" route="Yellow-GAO"      time="09:36:30" ai="true"/>
  <duty code="501" number="5017OG" route="Yellow-OAG"      time="09:54:45" ai="true"/>
 </train>
 <train code="502">
  <duty code="502" number="5027OG" route="Yellow-OAG"      time="07:29:45" ai="true"/>
  <duty code="502" number="5027GO" route="Yellow-GAO"      time="07:41:30" ai="true"/>
  <duty code="502" number="5027OG" route="Yellow-OAG"      time="07:59:45" ai="true"/>
  <duty code="502" number="5027GO" route="Yellow-GAO"      time="08:11:30" ai="true"/>
  <duty code="502" number="5027OG" route="Yellow-OAG"      time="08:29:45" ai="true"/>
  <duty code="502" number="5027GO" route="Yellow-GAO"      time="08:41:30" ai="true"/>
  <duty code="502" number="5027OG" route="Yellow-OAG"      time="08:59:45" ai="true"/>
  <duty code="502" number="5027GO" route="Yellow-GAO"      time="09:11:30" ai="true"/>
  <duty code="502" number="5027OG" route="Yellow-OAG"      time="09:29:45" ai="true"/>
  <duty code="502" number="5027GO" route="Yellow-GAO"      time="09:41:30" ai="true"/>
  <duty code="502" number="5027OG" route="Yellow-OAG"      time="09:59:45" ai="true"/>
 </train>
 <train code="503">
  <duty code="503" number="5037GO" route="Yellow-GAO"      time="07:16:30" ai="true"/>
  <duty code="503" number="5037OG" route="Yellow-OAG"      time="07:34:45" ai="true"/>
  <duty code="503" number="5037GO" route="Yellow-GAO"      time="07:46:30" ai="true"/>
  <duty code="503" number="5037OG" route="Yellow-OAG"      time="08:04:45" ai="true"/>
  <duty code="503" number="5037GO" route="Yellow-GAO"      time="08:16:30" ai="true"/>
  <duty code="503" number="5037OG" route="Yellow-OAG"      time="08:34:45" ai="true"/>
  <duty code="503" number="5037GO" route="Yellow-GAO"      time="08:46:30" ai="true"/>
  <duty code="503" number="5037OG" route="Yellow-OAG"      time="09:04:45" ai="true"/>
  <duty code="503" number="5037GO" route="Yellow-GAO"      time="09:16:30" ai="true"/>
  <duty code="503" number="5037OG" route="Yellow-OAG"      time="09:34:45" ai="true"/>
  <duty code="503" number="5037GO" route="Yellow-GAO"      time="09:46:30" ai="true"/>
 </train>
 <train code="504">
  <duty code="504" number="5047GO" route="Yellow-GAO"      time="07:21:30" ai="true"/>
  <duty code="504" number="5047OG" route="Yellow-OAG"      time="07:39:45" ai="true"/>
  <duty code="504" number="5047GO" route="Yellow-GAO"      time="07:51:30" ai="true"/>
  <duty code="504" number="5047OG" route="Yellow-OAG"      time="08:09:45" ai="true"/>
  <duty code="504" number="5047GO" route="Yellow-GAO"      time="08:21:30" ai="true"/>
  <duty code="504" number="5047OG" route="Yellow-OAG"      time="08:39:45" ai="true"/>
  <duty code="504" number="5047GO" route="Yellow-GAO"      time="08:51:30" ai="true"/>
  <duty code="504" number="5047OG" route="Yellow-OAG"      time="09:09:45" ai="true"/>
  <duty code="504" number="5047GO" route="Yellow-GAO"      time="09:21:30" ai="true"/>
  <duty code="504" number="5047OG" route="Yellow-OAG"      time="09:39:45" ai="true"/>
  <duty code="504" number="5047GO" route="Yellow-GAO"      time="09:51:30" ai="true"/>
 </train>
 <train code="505">
  <duty code="505" number="5057GO" route="Yellow-GAO"      time="07:26:30" ai="true"/>
  <duty code="505" number="5057OG" route="Yellow-OAG"      time="07:44:45" ai="true"/>
  <duty code="505" number="5057GO" route="Yellow-GAO"      time="07:56:30" ai="true"/>
  <duty code="505" number="5057OG" route="Yellow-OAG"      time="08:14:45" ai="true"/>
  <duty code="505" number="5057GO" route="Yellow-GAO"      time="08:26:30" ai="true"/>
  <duty code="505" number="5057OG" route="Yellow-OAG"      time="08:44:45" ai="true"/>
  <duty code="505" number="5057GO" route="Yellow-GAO"      time="08:56:30" ai="true"/>
  <duty code="505" number="5057OG" route="Yellow-OAG"      time="09:14:45" ai="true"/>
  <duty code="505" number="5057GO" route="Yellow-GAO"      time="09:26:30" ai="true"/>
  <duty code="505" number="5057OG" route="Yellow-OAG"      time="09:44:45" ai="true"/>
  <duty code="505" number="5057GO" route="Yellow-GAO"      time="09:56:30" ai="true"/>
 </train>
 <train code="506">
  <duty code="506" number="5067GO" route="Yellow-GAO"      time="07:31:30" ai="true"/>
  <duty code="506" number="5067OG" route="Yellow-OAG"      time="07:49:45" ai="true"/>
  <duty code="506" number="5067GO" route="Yellow-GAO"      time="08:01:30" ai="true"/>
  <duty code="506" number="5067OG" route="Yellow-OAG"      time="08:19:45" ai="true"/>
  <duty code="506" number="5067GO" route="Yellow-GAO"      time="08:31:30" ai="true"/>
  <duty code="506" number="5067OG" route="Yellow-OAG"      time="08:49:45" ai="true"/>
  <duty code="506" number="5067GO" route="Yellow-GAO"      time="09:01:30" ai="true"/>
  <duty code="506" number="5067OG" route="Yellow-OAG"      time="09:19:45" ai="true"/>
  <duty code="506" number="5067GO" route="Yellow-GAO"      time="09:31:30" ai="true"/>
  <duty code="506" number="5067OG" route="Yellow-OAG"      time="09:49:45" ai="true"/>
 </train>
  
 <train code="521">
  <duty code="521" number="5217OG" route="Yellow-OAG"      time="07:15:45" ai="true"/>
  <duty code="521" number="5217GO" route="Yellow-GAO"      time="07:34:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="521" number="5217OG" route="Yellow-OAG"      time="07:45:45" ai="true"/>
  <duty code="521" number="5217GO" route="Yellow-GAO"      time="08:04:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="521" number="5217OG" route="Yellow-OAG"      time="08:15:45" ai="true"/>
  <duty code="521" number="5217GO" route="Yellow-GAO"      time="08:34:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="521" number="5217OG" route="Yellow-OAG"      time="08:45:45" ai="true"/>
  <duty code="521" number="5217GO" route="Yellow-GAO"      time="09:04:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="521" number="5217OG" route="Yellow-OAG"      time="09:15:45" ai="true"/>
  <duty code="521" number="5217GO" route="Yellow-GAO"      time="09:34:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="521" number="5217OG" route="Yellow-OAG"      time="09:45:45" ai="true"/>
 </train>
 <train code="522">
  <duty code="522" number="5227OG" route="Yellow-OAG"      time="07:20:45" ai="true"/>
  <duty code="522" number="5227GO" route="Yellow-GAO"      time="07:39:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="522" number="5227OG" route="Yellow-OAG"      time="07:50:45" ai="true"/>
  <duty code="522" number="5227GO" route="Yellow-GAO"      time="08:09:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="522" number="5227OG" route="Yellow-OAG"      time="08:20:45" ai="true"/>
  <duty code="522" number="5227GO" route="Yellow-GAO"      time="08:39:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="522" number="5227OG" route="Yellow-OAG"      time="08:50:45" ai="true"/>
  <duty code="522" number="5227GO" route="Yellow-GAO"      time="09:09:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="522" number="5227OG" route="Yellow-OAG"      time="09:20:45" ai="true"/>
  <duty code="522" number="5227GO" route="Yellow-GAO"      time="09:39:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="522" number="5227OG" route="Yellow-OAG"      time="09:50:45" ai="true"/>
 </train>
 <train code="523">
  <duty code="523" number="5237OG" route="Yellow-OAG"      time="07:25:45" ai="true"/>
  <duty code="523" number="5237GO" route="Yellow-GAO"      time="07:44:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="523" number="5237OG" route="Yellow-OAG"      time="07:55:45" ai="true"/>
  <duty code="523" number="5237GO" route="Yellow-GAO"      time="08:14:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="523" number="5237OG" route="Yellow-OAG"      time="08:25:45" ai="true"/>
  <duty code="523" number="5237GO" route="Yellow-GAO"      time="08:44:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="523" number="5237OG" route="Yellow-OAG"      time="08:55:45" ai="true"/>
  <duty code="523" number="5237GO" route="Yellow-GAO"      time="09:14:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="523" number="5237OG" route="Yellow-OAG"      time="09:25:45" ai="true"/>
  <duty code="523" number="5237GO" route="Yellow-GAO"      time="09:44:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="523" number="5237OG" route="Yellow-OAG"      time="09:55:45" ai="true"/>
 </train>
 <train code="524">
  <duty code="524" number="5247OG" route="Yellow-OAG"      time="07:30:45" ai="true"/>
  <duty code="524" number="5247GO" route="Yellow-GAO"      time="07:49:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="524" number="5247OG" route="Yellow-OAG"      time="08:00:45" ai="true"/>
  <duty code="524" number="5247GO" route="Yellow-GAO"      time="08:19:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="524" number="5247OG" route="Yellow-OAG"      time="08:30:45" ai="true"/>
  <duty code="524" number="5247GO" route="Yellow-GAO"      time="08:49:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="524" number="5247OG" route="Yellow-OAG"      time="09:00:45" ai="true"/>
  <duty code="524" number="5247GO" route="Yellow-GAO"      time="09:19:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="524" number="5247OG" route="Yellow-OAG"      time="09:30:45" ai="true"/>
  <duty code="524" number="5247GO" route="Yellow-GAO"      time="09:49:00" ai="true"><station code="QCS"><time>75</time></station></duty>
 </train>
 <train code="525">
  <duty code="525" number="5257GO" route="Yellow-GAO"      time="07:24:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="525" number="5257OG" route="Yellow-OAG"      time="07:35:45" ai="true"/>
  <duty code="525" number="5257GO" route="Yellow-GAO"      time="07:54:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="525" number="5257OG" route="Yellow-OAG"      time="08:05:45" ai="true"/>
  <duty code="525" number="5257GO" route="Yellow-GAO"      time="08:24:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="525" number="5257OG" route="Yellow-OAG"      time="08:35:45" ai="true"/>
  <duty code="525" number="5257GO" route="Yellow-GAO"      time="08:54:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="525" number="5257OG" route="Yellow-OAG"      time="09:05:45" ai="true"/>
  <duty code="525" number="5257GO" route="Yellow-GAO"      time="09:24:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="525" number="5257OG" route="Yellow-OAG"      time="09:35:45" ai="true"/>
  <duty code="525" number="5257GO" route="Yellow-GAO"      time="09:54:00" ai="true"><station code="QCS"><time>75</time></station></duty>
 </train>
 <train code="526">
  <duty code="526" number="5267GO" route="Yellow-GAO"      time="07:29:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="526" number="5267OG" route="Yellow-OAG"      time="07:40:45" ai="true"/>
  <duty code="526" number="5267GO" route="Yellow-GAO"      time="07:59:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="526" number="5267OG" route="Yellow-OAG"      time="08:10:45" ai="true"/>
  <duty code="526" number="5267GO" route="Yellow-GAO"      time="08:29:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="526" number="5267OG" route="Yellow-OAG"      time="08:40:45" ai="true"/>
  <duty code="526" number="5267GO" route="Yellow-GAO"      time="08:59:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="526" number="5267OG" route="Yellow-OAG"      time="09:10:45" ai="true"/>
  <duty code="526" number="5267GO" route="Yellow-GAO"      time="09:29:00" ai="true"><station code="QCS"><time>75</time></station></duty>
  <duty code="526" number="5267OG" route="Yellow-OAG"      time="09:40:45" ai="true"/>
  <duty code="526" number="5267GO" route="Yellow-GAO"      time="09:59:00" ai="true"><station code="QCS"><time>75</time></station></duty>
 </train>
</trains>
Last edited by Nicolas on 19 Aug 2021, 19:06, edited 1 time in total.
User avatar
Michiel
Site Admin
Posts: 2469
Joined: 11 Sep 2011, 13:32

Re: Fix to the AI behavior of City of Thames that I want to share

Post by Michiel »

That file is just a leftover from a test and is not actually being used, hence it has nothing to do with this issue. The issue has been known for a long time and cannot be fixed from any xml file or whatever.
User avatar
Nicolas
Posts: 166
Joined: 22 Jan 2020, 23:18

Re: Fix to the AI behavior of City of Thames that I want to share

Post by Nicolas »

The trains do work correctly with this modified file, so the game must use it somehow. I've tested it several times with each instance of the file (original and modified by me) and there is a clear difference. I'm using the latest version of Metro Sim, 3.16.1, and the latest version of the London.000 package from the Central Line route.

There's something from the OP I must rectify, though. The bug of the player train skipping the station at the end only happens if I enter the cab, but do not deactivate AI mode. If I let the train do its thing without jumping into the cab, it will work fine. Somehow, getting into the train alters the AI behavior, even if I don't actually deactivate the AI mode itself. But once again, I'm making these conclusions based on my own experimentation.
User avatar
Nicolas
Posts: 166
Joined: 22 Jan 2020, 23:18

Re: Fix to the AI behavior of City of Thames that I want to share

Post by Nicolas »

Today I did another activity, this time on the Green Line, and I encountered this issue again. Oddly enough, the small edit I made had an effect on the very first activity I tried, but seemingly not in others. I tried looking for other files, but honestly I think I should just leave this as it is.

Does this happen because the Yellow line platforms at Oxford Cross aren't really meant to be used as terminal platforms? Hopefully one day the Yellow line will go full circle and trains will go in a permanent loop in both directions like the Glasgow Subway. I noticed GQO and OQG are codes for routes towards Queen's Cross, where the Yellow line should exchange with the Red line.
Post Reply