Allow Ai Locomotives To Couple Up To Stock That Has Moved Since The Scenario Start

Discussion in 'Suggestions' started by albinopigeon, Apr 27, 2023.

Tags:
  1. albinopigeon

    albinopigeon Active Member

    Joined:
    May 7, 2020
    Messages:
    44
    Likes Received:
    115
    As anyone who's dabbled in scenario creation (especially for steam era) before knows, there is a snag in the way that AI trains interact with one another:

    Any rolling stock that has moved since the start of a scenario cannot be interacted with by AI locomotives.

    For modern routes this isn't really a problem, since the majority of passenger trains are formed of multiple units and any loco-hauled stock is usually push-pull, hence there is no need for the locomotive to uncouple from and recouple to its coaches.

    However, for steam-era routes, when station pilots were still widespread up until the late 1960s, proper shunting operations are impossible with AI. With a Free Roam or Timetable scenario, the player can take over for the coupling up, but if you want to do it entirely with AI, it won't work. It is possible, but it is extremely fiddly and takes a lot of work to set up.

    Currently it's impossible for AI locos to:
    • Run around their own set of coaches
    • Drop off coaches and get another AI loco to take them away
    • Shunt & marshal the wagons in a goods consist
    After seeing the first devblog post for the TS Core Update, I thought it would be a good addition to the scenario scripting repertoire. My hypothesis is that one of the lines that LogMate references when the scenario starts could be called by a script to "refresh" the consist positions (since this must be done at the scenario start as AI can couple to stock that has remained stationary since the start of the scenario).

    I hope this gets added to the game at some point, because having a scenario covering an hour or so of operations at a terminus like Bournemouth West could be handled entirely by AI and be a great railfan scenario.
     
    • Like Like x 1
  2. KTL_Rob Powell

    KTL_Rob Powell Well-Known Member

    Joined:
    Aug 18, 2018
    Messages:
    231
    Likes Received:
    296
    Unfortuntaley I don't think this is possible.
     
  3. albinopigeon

    albinopigeon Active Member

    Joined:
    May 7, 2020
    Messages:
    44
    Likes Received:
    115
    This is my hypothesis for how it currently works and how it could be amended by the developers:

    1. By default the dispatcher always sends an AI service to the far end of a track marker to perform an operation (e.g., stop, unload passengers, drop off stock, etc.).
    2. The game, at some point when the scenario starts, generates a log of exactly where each consist is. This enables AI services to couple up to stationary stock without going all the way to the end of the relevant track marker first (and therefore causing a collision which ends the scenario).
    3. It only does this once, I assume because doing it every minute or so was too taxing for computers in 2006 or whenever Rail Simulator was developed. No script function was ever put in place to manually refresh it either in the updates that came between 2012 and 2016.
    This could be added into the game by simply adding either a new scenario command or a script function you can call to "refresh" the consist positions. I hope to see it added in one of the subsequent core updates because it would revolutionise scenarios set at terminus stations.
     
  4. KTL_Rob Powell

    KTL_Rob Powell Well-Known Member

    Joined:
    Aug 18, 2018
    Messages:
    231
    Likes Received:
    296
    I believe what you are asking for requires a bit of a rewrite to the core dispatcher code which could break literally everything ever released. I'm not sure on that front though. The idea however is great in theory.
     
  5. triznya.andras

    triznya.andras Well-Known Member

    Joined:
    Jun 29, 2019
    Messages:
    2,300
    Likes Received:
    2,740
    Let's think out of the box for a second.
    (In the box - the entire scenario is scripted, and in some ways quite static, and simplistic in terms of stopping places, etc.)

    The game could consider an objective where the target is not a route marker but a vehicle number.
    Pick up wagon X and whatever is connected.
    Stop at wagon X. (It has a current position on the route, it's like a marker.)

    Programming these days involves abstractions, and I think route marker can be abstracted in the way hinted. To some extent it already is, since it supports not just markers but portals.

    For the player the game already supports automatic coupling, and minor collisions. Thus the Pick up X objective could be considered exactly the same way it is imagined for hardcore career shunting scenarios: do the math, apply brakes and gently smash into the wagon to be picked. Better yet, with AI having limited simulation, might as well stop a meter short, then approach at 1kph, then stop and couple.

    I agree it's not a blink of an eye, but ultimately should be doable.
     
  6. torfmeister

    torfmeister Guest

    Do not expect core changes - the chances of this breaking everything is 80%.
     
  7. albinopigeon

    albinopigeon Active Member

    Joined:
    May 7, 2020
    Messages:
    44
    Likes Received:
    115
    I still have my hopes. My view of it is simply refreshing the consist locations on command; surely that must be possible through some minor core tweaks, since it always happens at the start of every scenario?
     
  8. KTL_Rob Powell

    KTL_Rob Powell Well-Known Member

    Joined:
    Aug 18, 2018
    Messages:
    231
    Likes Received:
    296
    The fact is, the position of all stock is noted on a on scenario start basis. Something to do with this means that you can't have AI couple to moved stock as it isn't where the dispatcher thinks it should be - I don't know the ins and outs as to why this is the way it is though.
     

Share This Page