1. Trouble with the game?
    Try the troubleshooter!

    Dismiss Notice
  2. Issues with the game?
    Check the Known Issues list before reporting!

    Dismiss Notice
  3. Before reporting issues or bugs, please check the up-to-date Bug Reporting Thread for the current version.
    0.35 Bug Reporting thread
    Solutions and more information may already be available.

"Random Config Provider" node sometimes selects a "PropTraffic" vehicle configuration

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by Hash, Dec 17, 2022.

  1. Hash

    Hash
    Expand Collapse

    Joined:
    Apr 21, 2022
    Messages:
    11
    Bug:

    The "Random Config Provider" node selects a "PropTraffic" configuration 4.10% of the time it executes.



    Steps to reproduce bug:
    1. Run the attached example flowgraph
    2. Observe that the values printed in the console approach 4.10
    or
    1. Create a "Random Config Provider" node and connect the flow input pin
    2. Run the flowgraph
    3. Observe that the "config" output pin of the node sometimes starts with "simple_traffic_"



    Notes:

    I guess this one might be considered "working as intended", but I imagine that for most mod developers this will only cause unexpected bugs.

    Another thing to consider might be the "Use simplified vehicles" gameplay setting.
    Currently the node doesn't seem to check this setting while filtering out vehicles.
    While it would be possible to handle it automatically, I think it would be best to add a "allowSimpleVehicles" input pin or something similar.



    modifiednode.png

    I have attached a modified version of the node which I believe behaves in a more straightforward way.
    It should be compatible with flowgraphs created with the current node.
     

    Attached Files:

  2. TStabbert

    TStabbert
    Expand Collapse
    BeamNG Team

    Joined:
    Nov 28, 2016
    Messages:
    66
    Hey! Thanks for the info :)

    The randomConfigProvider node is indeed a bit outdated - iirc it was made before we added the parked and simpletraffic to the game.

    It was originally used in the Garage2Garage scenario, but when we changed it into a missionType, we moved the vehicle pool generation logic out of the node for performance and easier access. If you're interested, you can find the new code in gameplay/missionTypes/garageToGarage/constructor.lua:selectVehicle().

    One issue i see with your code is that the vehicle options are generated in _executionStarted(), but it does use pinIn-values. This means the values cannot be driven by other nodes, only by hardcoded pins. One option to fix that would be to store the generation-settings when generating. In work(), you can then regenerate the options if there are no options, or if the current options are different from the stored options.
     
    • Like Like x 1
  3. Hash

    Hash
    Expand Collapse

    Joined:
    Apr 21, 2022
    Messages:
    11
    Good catch! Thanks for checking my code.
    I will take a look at the new code and see if I want to steal some functions out of it (muahaha)
    I appreciate the support you give to modders
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice