Outdated Traffic Tool 1.2.1

It's here! Create dynamic traffic on almost any map!

Thread Status:
Not open for further replies.
  1. bob.blunderton

    bob.blunderton
    Expand Collapse

    Joined:
    Apr 3, 2015
    Messages:
    3,290
    the game looks for mods in the following folder:
    documents\beamng.drive\mods
    That's where you put mods you download from this forum into the folder so the game can see them.
    Warning: If you use mods from much older versions of the game, it could make the game crash (example: two of my maps did that before the latest 2 hot-fixes) due to differences between game-versions.


    Work continues on updating Roane County for the Traffic Tool... it will take dozens of hours but it will be done within a week or two. Thankfully, once it's done, it's generally done, not back to fixing...fixing...fixing again, because I can actually test it well with this.
     
  2. Gamergull

    Gamergull
    Expand Collapse
    BeamNG Team

    Joined:
    Jun 3, 2018
    Messages:
    460
    Probably near the end of this week! I ran into some AI bugs; the Australian maps break my custom AI due to the way the decalRoads are done for left hand driving (so my script thinks that they're narrow roads). Also, my custom AI can screw up around curves. Not to worry, this makes for a great learning process.
     
    • Like Like x 2
  3. bob.blunderton

    bob.blunderton
    Expand Collapse

    Joined:
    Apr 3, 2015
    Messages:
    3,290
    Should I be concerned when I see 'didn't get a new spawn point' in the log?

    I was running 15 vehicles + my own vehicle in Roane County TN when I noticed this. 96% cpu use on a 4790k and 8~16fps & 9.25gb of ram use for BeamNG.
    Oh, and just make a 'left hand driving' checkbox bud, that reverses your typical checks for road directions and such, if that helps, from a user-input point. I know it's not that easy.
    Also, consider a 'spawn distance controlled by map size' which would equal terrain square size x amount of squares (this wouldn't work on maps without terrain, which admittedly are very few). 4096 x 5.2m (roane county uses this), a good distance is 400~500m out to spawn vehicles, as you can see for 700~1000 meters and the map is relatively open, conversely, ECA works fine at defaults, you rarely see pop-in with that. Maybe a slider to boost spawn distance would be even easier? Just throwing ideas out, you don't have to honor them, just brain-storming.
     
    • Like Like x 2
  4. Gamergull

    Gamergull
    Expand Collapse
    BeamNG Team

    Joined:
    Jun 3, 2018
    Messages:
    460
    How far apart are your nodes on the highways? That message might be due to a default behavior in the game, where the findClosestRoad function gives up looking for a node after a certain distance. It might be something else, too; I've seen the message happen randomly. I've been tweaking the spawn distance; it now gets magnified depending on how fast your vehicle is going. But yeah, because your map is so vast, even that doesn't do it justice, haha. I'll consider it.
     
    • Like Like x 1
  5. bob.blunderton

    bob.blunderton
    Expand Collapse

    Joined:
    Apr 3, 2015
    Messages:
    3,290
    On turns, the nodes are as often as the striping between the driving lanes, on straighter sections, it might be every other section of broken line, occasionally on very flat straight sections, it's every three or four. I think it was because there were too many vehicles (15). Whenever there's turns or lots of hills or otherwise road changes right/left up/down there's lots of nodes, otherwise the AI will cut corners or slam on it's brakes.
    *on bridges, there won't ever be nodes, because i can't put nodes below the bridge in the river valley or it won't work right... the AI will stop if the node is too far away vertically. So there's only nodes on one shore and on the other.

    I'm currently using these values and it's otherwise working well right now for Roane County.
    Code:
    dynamictraffic.lua  -  lines 39~43 follow below
    
    local nearDist = 20 --Near distance, used for traffic passing and interactions
    local farDist = 450 --Far distance, used for traffic despawning
    local pointDist = 350 --Distance at a point from ahead of player vehicle; used for setting a spawn point
    local readyDist = 100 --Normal distance, used for a variety of traffic and police logic
    local distMultiplier = 15 --Number used as a multiplier for despawn logic
    
    
     
    • Informative Informative x 1
  6. Blijo

    Blijo
    Expand Collapse

    Joined:
    Apr 27, 2016
    Messages:
    2,055
    I really love this mod!
    It is a lot of fun and adds a lot to the game. Sadly, I keep encountering this bug:
    I can't change the parts on my vehicle when this happens :(

    EDIT:
    This happens after changing the player's vehicle with the app running.
     
    #206 Blijo, Mar 4, 2019
    Last edited: Mar 4, 2019
    • Agree Agree x 3
  7. Gamergull

    Gamergull
    Expand Collapse
    BeamNG Team

    Joined:
    Jun 3, 2018
    Messages:
    460
    Hmm, I don't think I can fix that, unless I temporary disable respawning while that menu is open (heh, sounds like a challenge in itself). Dang bugs, I wanna release the next version already!
     
    • Agree Agree x 3
    • Like Like x 1
    • Informative Informative x 1
  8. bob.blunderton

    bob.blunderton
    Expand Collapse

    Joined:
    Apr 3, 2015
    Messages:
    3,290
    That might be a game engine bug.
    I don't think the game engine can currently handle switching the focus off the main vehicle without moving the camera - which the traffic tool might trigger. That's something to ask/show the developers, but not something I'd think they would necessarily put super high-priority (being honest, but hey who knows, they could tell you the magic words to feed the engine to make that not happen, or twitch their noses and make it go away like in Bewitched *dinka-dinka-dink! BWING!* *confused Davin, I mean Darwin, I mean Darren face*).
     
    #208 bob.blunderton, Mar 5, 2019
    Last edited: Mar 5, 2019
  9. Danny Werewolf

    Danny Werewolf
    Expand Collapse

    Joined:
    Mar 31, 2017
    Messages:
    2,268
    I get that sometimes aswell. I often fix it with a few lucky CTRL+R's or just close and reopen the config, maybe hover over some other items.
     
  10. Projekt535

    Projekt535
    Expand Collapse

    Joined:
    Aug 5, 2013
    Messages:
    189
    I just clear the AI before making changes and then respawn and activate them afterwards, or I'll spawn them and make changes on the AI cars before activating them.
     
  11. Jarret Rucker

    Jarret Rucker
    Expand Collapse

    Joined:
    Apr 18, 2017
    Messages:
    456
    So..let me get this straight....you managed to program the cars so they would turn on the lights at night?
     
  12. CN877

    CN877
    Expand Collapse

    Joined:
    Jun 27, 2017
    Messages:
    1,465
    Yea he did :)
     
  13. Gamergull

    Gamergull
    Expand Collapse
    BeamNG Team

    Joined:
    Jun 3, 2018
    Messages:
    460
    I tested it in Jungle Rock Island. Pretty cool experience!
     
    • Like Like x 2
  14. Danny Werewolf

    Danny Werewolf
    Expand Collapse

    Joined:
    Mar 31, 2017
    Messages:
    2,268
    I tried JRI aswell. I can't wait for the better AI for tighter roads, just imagine it on the peninsula
    amazingly I spelled peninsula right
     
  15. Gamergull

    Gamergull
    Expand Collapse
    BeamNG Team

    Joined:
    Jun 3, 2018
    Messages:
    460
    Ooh yeah. Keep in mind that AI might get stuck on rocks or roll down hills when trying to scurry around. Also, I need another day to fine tune the math behind it.
    --- Post updated ---
    New tutorial video! I was getting a bit tired of people asking how to install it. Take a look, though; I show off a new feature for V1.1!

     
    • Like Like x 3
    • Informative Informative x 2
  16. Danny Werewolf

    Danny Werewolf
    Expand Collapse

    Joined:
    Mar 31, 2017
    Messages:
    2,268
    Actually, I would love a way to choose which lane the AI's will always spawn in. Either the right lane or left lane, or even towards or away from the car (Same thing but you get what I mean)

    Just imagine passing challenges on Road Atlanta with this.
     
  17. bob.blunderton

    bob.blunderton
    Expand Collapse

    Joined:
    Apr 3, 2015
    Messages:
    3,290
    I would really make a ratio of how many cars in the 'left lanes' vs 'right lanes', if I was doing it - but that's me.

    This is with the publicly available version to which I had previously modified the values to enable 450meter spawing, testing currently, as I wish not to change too many things at once. Pardon the nice road texture isolated in a sea of less-than-lovely looking map (grass disabled in options menu, it's there, but it glitches on Radeon cards). This is Route 27 in Roane County (not the US 40 highway), Route 27 is the one that you end up on when you spawn in Sprawl-Mart parking-lot, or drive between Harriman and Rockwood, it's that big 18.5 mile long road, the longest single-route roadway in the map, and the AI works beautiful now on the 14~15 miles of it I fixed up tonight. Only dozens on miles of road left to fix *barely audible sobbing* ... It will get done, though, come Harriman or high-water - oh wait we have that, well never-mind, just know I am working on this.
    350~450m spawn distances + 120km speed makes this road a joy.
    --- Post updated ---
    That AI is better at making the jump than I am!

    50% made it!

    I believe I know why the traffic sometimes spawns facing/driving the wrong way. A decal road node is too far from the vehicle's desired spawn-in location. The traffic tool LUA doesn't look far enough to find the node, and it there-for spawns in whatever direction the vehicle previously had, and can tend to drive that way sometimes.
    Happens often south of Rockwood - but does not ever happen (rarely/never) where I re-did the road.
     
    #217 bob.blunderton, Mar 5, 2019
    Last edited: Mar 5, 2019
    • Informative Informative x 1
  18. Projekt535

    Projekt535
    Expand Collapse

    Joined:
    Aug 5, 2013
    Messages:
    189
    @Gamergull Thanks for the video, I can not wait any longer for 1.1! I'm so excited for traffic in both lanes and did I see one pass a slower car in the same lane?! AWESOME. And the police AI looks like it will lead to a lot of fun chases. This is really freaking cool and you've done amazing work! Keep it up! :D

    @bob.blunderton I'm also really looking forward to trying the redone Roane road. I've been enjoying the AI a ton on it as it is, even with the AI driving the wrong way at times. That keeps it exciting haha. I've also had a lot of fun with the Los Injurus map and the AI on there, looking forward to seeing that map grow as well! Keep up the fantastic work! :D
     
  19. Jarret Rucker

    Jarret Rucker
    Expand Collapse

    Joined:
    Apr 18, 2017
    Messages:
    456
    I turned the time into night mode but the cars didn't have their lights on. Is there something I did wrong?
     
  20. Projekt535

    Projekt535
    Expand Collapse

    Joined:
    Aug 5, 2013
    Messages:
    189
    It's not a feature in the current version.
     
Thread Status:
Not open for further replies.
  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