Creation Sharing Diary Of Creating A Route - Toronto Subway Opening Day

Discussion in 'PC Editor Discussion' started by pwilson79, Nov 5, 2023.

  1. gm3161

    gm3161 Active Member

    Joined:
    Mar 20, 2024
    Messages:
    106
    Likes Received:
    185
    Finding this thread truly fascinating and interesting.
     
    • Like Like x 1
  2. Dinosbacsi

    Dinosbacsi Well-Known Member

    Joined:
    Sep 20, 2017
    Messages:
    3,810
    Likes Received:
    9,767
    That interior is really starting to look lovely!
     
    • Like Like x 1
  3. pogodoyle#7387

    pogodoyle#7387 Well-Known Member

    Joined:
    Aug 21, 2021
    Messages:
    427
    Likes Received:
    1,101
    What a fascinating thread! You've inspired me to dust off the UE4 book and have another go myself! I made a start on Workington ages ago, but got bogged down with the buildings, and now that JT are doing Carlise-Whitehaven there's no point anyway.

    I think my learning route has to be my adopted home, so Bath-Bristol it is! I was daunted by the idea of trying to recreate Bristol in particular, but this blosm tool might just be my saviour :D

    Thanks for sharing, and continued good luck with this inspiring project!
     
    • Like Like x 1
  4. pwilson79

    pwilson79 Well-Known Member

    Joined:
    Apr 18, 2021
    Messages:
    443
    Likes Received:
    584
    First of all, thanks for the kind words, gm3161 , Dinosbacsi a and pogodoyle#7387 !

    Unfortunately, half the long weekend has gone by, and I have nothing to show for it. :(

    When I simulate the timetable with an unload instruction, it still gets stuck at "Trigger door lock state 0 for service NewService," which makes me think the systems the AI driver and the tab menu use are the same. I'm starting to think I may not be able to set up the AI or tab menu door operations properly, at least not without somehow getting a look at an uncooked working example of a DoorBaseComponent. These are separate component assets usually named "(routename)_PassengerDoors," saved as a separate asset that gets added to the RVM, with array variables for left and right Rail Vehicle Door Components , and some have arrays for some kind of Model Components for the doors, and/or a reference to the (presumably) owner RVM.

    I think it may be down to the default parent class of the DoorBaseComponent missing functions that working DoorBaseComponent's have, or perhaps me just not knowing what to do with them. I just can't get the tab menu to show buttons for unlocking or locking my doors, using my own DoorBaseComponent.

    I can add another passenger car's DoorBaseComponent to my RVM, and get it to work with the tab menu correctly, but this is something I've been moving heaven and earth to try to avoid.

    If anyone has worked this out, or thinks they may know what I've been missing, please let me know! Otherwise, I may have to set the whole thing aside for a day or two, and maybe circle back to it after working on other parts of my plugin as well.

    Update: Not being one to let sleeping dogs lie, I have made some progress! I think what was needed was actually a VehiclePassengerDoors Component, and maybe a DoorControls component, freshly made from their respective Core parent assets. At least I think I got the names right; It's late, and I don't feel up to firing up the editor again tonight.
     
    Last edited: May 18, 2026
    • Like Like x 1
  5. pwilson79

    pwilson79 Well-Known Member

    Joined:
    Apr 18, 2021
    Messages:
    443
    Likes Received:
    584
    I have deduced that the VehicleDoorControl components are almost certainly created and added to the RVM during runtime, likely by the VehiclePassengerDoors component, something like this:

    ScreenHunter_345 May. 19 18.45.jpg

    I hope I'm barking up the right tree with this approach. Moreover, if more setup is required for tab menu interaction, I'm not sure how to work out what needs to be done. It may take a few days for me to find out in any case; I feel like I've been obsessing over the door problem, so I'm trying to take things a little bit slower.
     
  6. pwilson79

    pwilson79 Well-Known Member

    Joined:
    Apr 18, 2021
    Messages:
    443
    Likes Received:
    584
    Obsessed or not, I've been turning over this door problem in my head quite a bit.

    Recently, I was pleased to discover that by changing the value of an enum or boolean (I forget now exactly which) from the PassengerDoors component, I could get the option to lock to appear in the pop-up menu, whereas before it had been greyed out. I felt like I could be on the verge of solving the problem. My tired mind conjured up an image of me pinning an opponent to the mat in a wrestling ring.

    But then try as i might, I still couldn't find a way to register when a button on that pop-up menu is pressed, so that I can direct the execution flow accordingly! In my mental wrestling match, my pinned opponent now became Curly Howard from the Three Stooges, and started spinning around in circles going "Whoop whoop whoop whoop!"
    curly.gif

    But I see now that there are Event Dispatchers that come with the PassengerDoors component:
    ScreenHunter_346 May. 24 13.24.jpg
    and also this oddity in the Bakerloo 38-Stock PassengerDoors:
    ScreenHunter_345 May. 24 13.09.jpg
    so now with any luck, and depending on how the mysterious and unknown menu widget is set up, I just have to learn everything I can about Event Dispatchers and binding, and delegates, and eventually I will find some configuration that drives execution somewhere, on something, when I press one of the pop-up menu's buttons.

    Oh, and I will still have to somehow make sure it co-operates with the AI for loading/unloading.
     
  7. Daunfr59

    Daunfr59 Well-Known Member

    Joined:
    Dec 8, 2016
    Messages:
    272
    Likes Received:
    658
    Good to hear you are making progress, albeit with discouraging steps along the way as we expect from the Editor.

    I think the Event Bind Door node is part of the Event Dispatcher .

    I've recently been messing about with Event dispatcher for the HUD as it's away to send various parameters from one blueprint to another (or indeed several others) when you send the "message".

    If it would help I could send a screen print of "both ends" of me Event Dispatcher but bit stuck at the moment.(hopefully later today)
     
  8. pwilson79

    pwilson79 Well-Known Member

    Joined:
    Apr 18, 2021
    Messages:
    443
    Likes Received:
    584
    Yes please! Only iwhen you have a spare moment, though. I still don't have much of a "feel" for event binding yet, and any example would be quite welcome!
     
  9. Daunfr59

    Daunfr59 Well-Known Member

    Joined:
    Dec 8, 2016
    Messages:
    272
    Likes Received:
    658
    No problem - just a few real life events getting in the way !

    I used the Event Dispatcher to send all the values from the RVV to the HUD but the "source" blueprint sends out the message (when triggered) and it can be picked up by anyone who is listening.

    In the source blueprint (RVV in this example) you add an Event Dispatcher and give it a suitable name (Update HUD) in my case.
    In the details panel you can add as many variables as you like and these can be floats, integers, booleans or any other type.(I have added four floats and one integer variable for the various readings in the HUD.

    In the Event graph you create a trigger event (I 'm using a timer to call the Update every few second) but I guess you can use any trigger such as a key press or "On Output Change".

    Here is the picture of the event graph in my RVV.

    RVV CallEventDispatcher.jpg

    The red box is the trigger and the stuff in the middle is simply functions which I use to update the variables (get speed etc.).
    The important one is the CALL "Event Dispatcher" at the end which sends the signal out every time the trigger fires. The green dots are the variables I am sending with the message.


    In the receiving blueprint (or blueprints) you need a reference (or a cast) to the source and then you bind to the event dispatcher as shown below.
    I think you are supposed to do this in the Construction Script but as the HUD doesn't have one I used an Event Construct.

    The binding only needs to be done at the start (Construction script or Event begin play) and then the receiving blueprint will listen for the signal.

    HUD_Bind to Event Dispatcher.jpg

    In the Bind Event node you drag off the Red Event node and create a Custom Event for the action you want happen. (in this case update the Boiler Pressure in the HUD).
    I then drag off the boiler Pressure node to get the current pressure sent in the "signal".

    You need a Bind Event node for every variable you want to act on so I have a chain of 5 (each with it's own custom event) but I haven't shown all this as it will just cause confusion.

    The important node is the Bind Event to the despatcher and the custom event you want to happen when the "signal" is received.

    Hope I'm not "teaching my grandmother to suck eggs" and that this will be helpful. Let me know if you need anything else.

    It occurs to me that the Tab Menu which appears on screen is a type of interactable HUD Widget so you will probably use that as the source blueprint and send the "message" (lock/unlock) to the RVM or RVV of the vehicle (or perhaps all of them) so it will be a mirror image of my example.

    Good luck as always. I hope to be following in your footsteps soon with my Auto Coach.
     
    • Helpful Helpful x 1
  10. pwilson79

    pwilson79 Well-Known Member

    Joined:
    Apr 18, 2021
    Messages:
    443
    Likes Received:
    584
    I'm sure you're right, not that I'm any kind of expert on widgets (far from it, truth be told.) So far binding my doors to those event dispatchers does absolutely nothing, though it's entirely possible I'm doing it wrong.

    What's killing me on this is not being able to find the parent class, if there is one, to see what kind of outputs the menu is supposed to produce. It could also be there is no parent class, if the PassengerDoors component generates it on the fly (not impossible, i suppose). I can make blueprint code that will open or close doors or change lockstates easily enough. My problem would be solved if only I knew what kind of output I'm looking for from button presses! Is there a blueprint interface I need to use instead of events...? I saw that there is a Gameplay Task for propagating a door open/close to the other cars in a formation, but right now that whole system just confuses me.

    As it is, I'll have to move on to another part of the plugin for now, to keep from losing ground or feeling discouraged. Yet another area where the absence of official documentation is keenly felt.

    DTG Matt I know you're a busy man and probably won't catch this, but could you point me in the right direction, even if I'm not in the partner program?

    P.S.: Next, I'll see what I can do about this deceptively simple display board setup (the arrows were separately back-lit.)
    ScreenHunter_348 May. 31 20.00.jpg
     
    Last edited: Jun 1, 2026
  11. pwilson79

    pwilson79 Well-Known Member

    Joined:
    Apr 18, 2021
    Messages:
    443
    Likes Received:
    584
    Just posted this on Discord. Thought I'd add it here as well.

    So most of the passenger rail vehicles I've looked at do in fact have their own version of the PassengerDoors component in the RVM, usually found in a "/Simulation/Components" folder. Most have customized variations from the parent class. I made one for my subway car by making a child bp of "Content/Core/RailVehicles/Passenger/VehiclePassengerDoors.uasset." I'm using arrays of RailVehicleDoor components from my RVM, as the Bakerloo 38-stock does. The GetLockState function can be overridden just by selecting it from the list of overrideable functions on the left in the new child bp. My GetLockState function looks like this:

    ScreenHunter_348 Jun. 10 18.11.jpg

    (no left doors because I haven't made any yet!) As you can see, the lock state will return locked unless any of the doors are unlocked. Haven't tested it with an AI service yet. No opening or closing from the quick-command menu or y or u keys yet, but I'm working on it!
     
    • Helpful Helpful x 1
  12. pwilson79

    pwilson79 Well-Known Member

    Joined:
    Apr 18, 2021
    Messages:
    443
    Likes Received:
    584
    Here is a sample of how I use print string nodes to help me sound out how this Door Manager is supposed to function (the bottom two messages are from some separate work I've been doing on a basic PIS system.)

    upload_2026-6-28_10-17-13.png

    At this point I had just removed a DoorControl component from my RVM, as I had unintentionally created it with the one for the DB Talent as its parent class. May need to add a generic one back in because interestingly, the door icons on the HUD no longer reflected the open states on the doors, afterwards.

    One possibility is that desired changes to the per-side lock- and open-states are communicated by changes to the variables in the Door Manager (A.K.A. the PassengerDoors component.) Haven't had a chance to investigate this yet, but I should have some idea in the next few days if this is the case. I need to develop my door evaluation routine a bit further; hence the image above.

    No change there yet...
     
    • Like Like x 1
  13. pwilson79

    pwilson79 Well-Known Member

    Joined:
    Apr 18, 2021
    Messages:
    443
    Likes Received:
    584
    The only change at all that I can observe when I would expect lock/unlock commands to be firing is that the GetLockState function in the VehiclePassengerDoors component is firing. I could treat it as if it were a lock/unlock event, since it specifies a door side, but it seems sketchy as hell, and there's no way that's the intended setup.

    If I do this, and later on I can't get passenger loading to work, there'll be no way of knowing if the PassengerDoors or DoorControl components are to blame.

    It would be nice though to have AI and quick-command door operation "working," and maybe finally shift my focus onto another aspect of the subway car or route for a bit.

    Either way I should make a backup of the plugin in its' current state, if only to have something to refer back to.

    Edit: Just tried it. Turns out it fires GetLockState over and over again, causing the doors to open and shut repeatedly, so that's not really a workable solution. I did discover that my doors weren't set to automatically open on unlocking though, so I got that out of it.
     
    Last edited: Jul 5, 2026
  14. pwilson79

    pwilson79 Well-Known Member

    Joined:
    Apr 18, 2021
    Messages:
    443
    Likes Received:
    584
    My door automation is finally working!!!

    (Proceeds to beat chest while yodelling like Tarzan)
     
    • Like Like x 3
  15. jeffmorris

    jeffmorris Member

    Joined:
    Sep 26, 2023
    Messages:
    75
    Likes Received:
    12
    Don't all the doors open and close?
     
  16. pwilson79

    pwilson79 Well-Known Member

    Joined:
    Apr 18, 2021
    Messages:
    443
    Likes Received:
    584
    They do now! I've only modelled and set-up one door for now (hooray for copy-paste,) but I just worked out how to transmit the lock/unlock request to the rest of the rail vehicles in the formation.
     
  17. Daunfr59

    Daunfr59 Well-Known Member

    Joined:
    Dec 8, 2016
    Messages:
    272
    Likes Received:
    658
    Glad to hear you've finally got the doors working .
     
  18. pwilson79

    pwilson79 Well-Known Member

    Joined:
    Apr 18, 2021
    Messages:
    443
    Likes Received:
    584
    Thanks! It is a huge weight off my shoulders.

    Also a good case example of how documentation would have been invaluable, not to beat a dead horse. The setup I've ended up with is a lot less complex than my attempts to build all the functionality into the thing that I could dig up and just hope it started responding.

    to boil it down, it is mostly looking for a GetLockState function. I think maybe this can be in the RVM itself, but mine's in a VehiclePassengerDoors Component. It also needs a handful of boolean and Enum variables relating to the (open) State and lock States of the left and right sides, and another set representing both. Throw in a setup routine to build arrays for your Rail Vehicle Door components, and an evaluation routine to run when appropriate, after which this:
    ScreenHunter_353 Jul. 09 20.07.jpg
    should have everything it needs for your doors to door doorily, once set up with some side-specific logic and Lock and Unlock nodes. Turns out it was hiding in the Physics Component! I should post some of those routines I mentioned earlier once I've had a chance to clean them up a bit, it would probably be useful.

    On to passenger loading/unloading!
     
    Last edited: Jul 12, 2026 at 6:27 PM
    • Helpful Helpful x 1
  19. pwilson79

    pwilson79 Well-Known Member

    Joined:
    Apr 18, 2021
    Messages:
    443
    Likes Received:
    584
    Well to start off, here's what I've got handling the lock / unlock requests in the RVM. There is some needless duplication, and I don't have any left doors for it to handle yet, but it does the job for now:

    ScreenHunter_354 Jul. 12 12.13.jpg

    And for a change of pace, I thought I'd throw in a photo of my personal project reference library:

    library.jpg

    honorary inclusion, though I can't find my personal copy at the moment:

    blackberry subway jam.jpg
     
    Last edited: Jul 12, 2026 at 8:39 PM
  20. pwilson79

    pwilson79 Well-Known Member

    Joined:
    Apr 18, 2021
    Messages:
    443
    Likes Received:
    584
    ...And of course passengers don't want to get on. Not even at the second station, which I know is set up properly because when I sub in a formation of LIRR M3s for the service, they get right on.

    At this point I should rig up at least a basic brake of some kind, so that I can see if driving the service makes any difference to loading/unloading, not that I know why it would. I don't have door interlocking set up, so there's a remote chance it's getting upset about that.

    I won't have as much time to work on it for the next few weeks (at least if I have any sense) since I have a real-life responsibility coming up that I'm going to need to start getting a more reasonable amount of sleep for.

    I wish the loading/unloading would just work, particularly since it is one of the last difficult hurdles in the project, apart from making sure coupling works. Here, in any case, is the event graph from my VehiclePassengerDoors Component, which may be of some use:

    ScreenHunter_354 Jul. 12 20.26.jpg
     
  21. Thorgred

    Thorgred Well-Known Member

    Joined:
    Jun 8, 2018
    Messages:
    1,080
    Likes Received:
    676
    maybe the passengers are afraid to go in :)
     
    • Like Like x 1

Share This Page