1. Stuck or having problems creating your mod?

WIP Traffic Tool 1.2.1

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

  1. Gamergull

    Gamergull
    Expand Collapse
    Staff Member

    Joined:
    Jun 3, 2018
    Messages:
    295
    View attachment 522772

    Work in progress!

    I figured that my traffic app discussion and progress can go in its own thread. The Traffic Tool will allow you to spawn or set other vehicles as traffic on any map. You can even use vehicles that you spawned from the Vehicles menu as traffic. Various other options can be set, such as speed limit, respawn rate, paint color mode, and AI mode.

    I'm hoping to get this app released within a week. I have a list of bugs and features to take care of. I'll post some other interesting things in this thread, such as how my algorithm works and any improvements.

    To clarify, this is not a release thread...

    Wait, what? Oh yeah, I guess it is now. Get it here! https://www.beamng.com/resources/traffic-tool.7690/

    Learn about more settings here: https://www.beamng.com/threads/traffic-tool.60967/page-14#post-1003927
     
    #1 Gamergull, Feb 12, 2019
    Last edited: Apr 18, 2019
    • Like Like x 51
    • Staff Pick Staff Pick x 1
  2. Gamergull

    Gamergull
    Expand Collapse
    Staff Member

    Joined:
    Jun 3, 2018
    Messages:
    295
    traffic-app-pigeons.jpg

    Look, pigeons!

    Looks like the hard part was yesterday, and things are starting to work just as I envisioned it. I created some new algorithms and they work nicely, now I just have to tweak a lot of numbers for optimal results. My old code for despawning vehicles was a simple distance based one (and it was used as far back as my Hectic Delivery scenario!), but now it's a nifty formula that's adjustable with the respawn rate setting that you can see in this pic.
     
    • Like Like x 14
  3. Danny Werewolf

    Danny Werewolf
    Expand Collapse

    Joined:
    Mar 31, 2017
    Messages:
    2,193
    Can't wait to use this mod...

    …….In a few years because my laptop sucks...
     
    • Agree Agree x 3
  4. Richard

    Richard
    Expand Collapse

    Joined:
    Aug 20, 2013
    Messages:
    38
    I have never been so excited for a BeamNG mod as this. Thank you, seriously, this is much needed.
     
    • Agree Agree x 5
  5. Gamergull

    Gamergull
    Expand Collapse
    Staff Member

    Joined:
    Jun 3, 2018
    Messages:
    295
    Thanks guys :) .

    I spent too many hours on this again, but it looks like I cleared out all the fatal errors. West Coast USA is a nightmare to get working logically, I really think that the map nodes should be revised for the entire map. On the flip side, I'm absolutely ecstatic with how Italy works; you can zoom by tons of cars on the main highway at reckless speeds! It's really cool.
     
    • Like Like x 9
  6. Nicelittle

    Nicelittle
    Expand Collapse

    Joined:
    Apr 27, 2017
    Messages:
    648
    Looks amazing! Can’t wait to give it a go!
     
    • Agree Agree x 3
  7. crashmaster

    crashmaster
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    1,478
    0 regrets in suggesting this.
    Hype, this feels as if a new beamng update has come and it brings a long awaited feature.
    You are amazing. keep up the good work!
     
    • Agree Agree x 5
    • Like Like x 2
  8. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,778
    Is it needed to have adjustment for tool per map or is teleporting working universally as long as decal roads are there?

    At WCUSA with older version of traffic scenario, I found out that traffic cars sometimes spawns to wrong end front, so they reverse and turn around, but sometimes they did like to drive to wrong direction completely. Can't imagine what nightmare that is to get to work, but certainly quite bad nightmare I would think.

    @bob.blunderton's city map was also showing some odd behavior because multilane roads, which made AI cars often spawn wrong way around, but I guess your recent update to scenario had something that addresses that, just haven't had time to sit around enough long to do more experimenting.

    Really incredible though.
     
  9. Gamergull

    Gamergull
    Expand Collapse
    Staff Member

    Joined:
    Jun 3, 2018
    Messages:
    295
    Thanks for the idea! I almost didn't do it because it would be "too hard", but I ended up learning a lot in just one week. Plus, this means that I don't have to do a scenario for each map. Also, thanks to the community for all of the other forward thinking ideas.

    Yes, it works universally for all AI enabled roads. The respawn rate setting may help for maps with smaller areas or tighter roads.

    I thought I got West Coast's traffic working decently, but the more I test it, the more problems I see. It's stressing me out, lol. I could open the map in the editor and rework all of the AI paths, but I want to program a solution instead. I'm toying with the idea of creating a mini neural network that can observe and save proper AI behavior per decalRoad or node (maybe with the help of the player's driving... or not :p ). Maybe I've watched too many neural network videos, heh.

    Anyhow... debug time!
     
    #9 Gamergull, Feb 14, 2019
    Last edited: Feb 16, 2019
    • Like Like x 6
  10. bob.blunderton

    bob.blunderton
    Expand Collapse

    Joined:
    Apr 3, 2015
    Messages:
    2,277
    A lot of the AI routes weren't set to one-way especially on the highways, as the highways themselves (and also the AI routes which differ from what you see graphically, they are separate) pre-dated the ability to use lanes and define them, and predated one-way roads (which were a requested feature from me + lanes for maps like that).
    @Gamergull I will be contacting you in the future, when I have more roads laid out in their final manner for my city project that I am doing, maybe we can work together here making something cool.
    --Shameless plug follows...
    Come see the sights (but not really the sounds yet) of the Los Injurus City map, coming to BeamNG in 2019! This is a supporter-funded project (as software costs me quite a sum of money, some of it monthly & I am on a fixed income), made possible by about a dozen members of the BeamNG community currently contributing via Patreon.
    Featuring over 45 unique miles of highway, over 100 miles of roads total, dozens upon dozens of new houses and commercial buildings, a new modular subway system (built it yourself if you want to, but there's 2+ miles of it in already), with standard-gauge train-tracks, and a modular road-kit (MRK) that allows any mapper to build realistic city roads in realistic manner. Featuring such iconic buildings such as the Frank Douglas towers from the Brewster-Douglas housing project towers, realistic American schools, The Simpson's house, and will feature other landmark buildings soon. Sick of driving but want some exploring? Enjoy crashing about in the first-of-it's-kind abandoned mall that features two floors of mold, mildew, and neglect ready to share with your vehicle & lots of opportunity for crashing, or take to the skies via the new concrete airstrip! You can even do stunts or go for a drive in the large concrete flood-control-canals inspired by Los Angeles / San Andreas.
    Come stop in and see us! This will be 'the largest city' in BeamNG (since I already hold the record for largest terrain-based map...)
    https://www.beamng.com/threads/a-new-city-map-los-injurus.57055/
    Don't think big, think bigger!

    Thank-you for your contributions Gamergull, they mean something to the BeamNG community and it's highly appreciated not having to drive solo anymore.
    --Cheers!
     
    • Like Like x 3
    • Agree Agree x 3
  11. Gamergull

    Gamergull
    Expand Collapse
    Staff Member

    Joined:
    Jun 3, 2018
    Messages:
    295
    Thanks for the shoutout and promo! I love your Roane County map, so I should probably check this out when I get some real free time. Also, yeah, proper lanes are a must, and I'd love better lane support in the game. On a one way 3-lane road, traffic seems to favor only the rightmost lane, and I can't code it to do more (yet, but the BeamNG team should do that, heh).

    I have various bugs and self criticisms to fix now, so I think that Monday will be the release day (plus some waiting on the repo). I have Sunday off, so I can get a ton of work done on that day. I don't even mind, it's freezing outside and I don't want to do anything else.
    --- Post updated ---
    I just spent a few hours making a minimize function for the app. I feel like a noob again.
     
    • Like Like x 1
  12. Jarret Rucker

    Jarret Rucker
    Expand Collapse

    Joined:
    Apr 18, 2017
    Messages:
    467
    Is there a maximum to the amount of AI cars you can spawn.
     
  13. Gamergull

    Gamergull
    Expand Collapse
    Staff Member

    Joined:
    Jun 3, 2018
    Messages:
    295
    Yeah, 20. I know players like Crash Hard could probably spawn more, but hey, it's dynamic spawning, and the roads would already get pretty crowded with 20. If I'm wrong in this way of thinking, then perhaps I'll raise the limit lol.
     
    • Like Like x 3
  14. Jarret Rucker

    Jarret Rucker
    Expand Collapse

    Joined:
    Apr 18, 2017
    Messages:
    467
    Imagine trying to spawn 45 cars on a map like West Coast USA or Italy. My computer would probably implode, then explode.
     
    • Agree Agree x 3
  15. Crash Hard 01

    Crash Hard 01
    Expand Collapse

    Joined:
    Aug 5, 2013
    Messages:
    903
    I have done some testing, and this is so awesome, and I would not mind a max limit of 30 cars ;)
    And I have some questions,
    - when I up the speed limit for the cars, is this updated automaticly for the cars driving around? or must i press any of the buttons in the app
    - and if I up the number of cars spawning, do I i need to hit the spawn button for them to be added?
    - and do the app pick from all the cars ingame when it add the cars that drive around?
    There is one annoying bug I see, but that is the game engines fault (the broken meshes)
    But the broken windows can be fixed by you I hope (The windows in the cars do not get reset if they break)
     
    • Like Like x 3
  16. bob.blunderton

    bob.blunderton
    Expand Collapse

    Joined:
    Apr 3, 2015
    Messages:
    2,277
    Don't feel bad about taking an hour or more to code something simple, it's always the simple things we underestimate. I had to try 3~4 times to configure my specular maps correctly so they didn't reflect BLUE on concrete highways (which are white, with a touch of sand color as concrete SHOULD be), thanks to updates in graphics formats on 0.14x / 0.15x game versions. The fun never ends!
    To quote Tom Hanks on THE MONEY PIT: "Blue?, I hate blue, I want NOTHING blue!" in reference to his hallway area upstairs the carpenters painted blue as the house gets remodeled/fixed.
    I know as of about a year ago on whatever version we were on (0.12? Before they raised limits on vehicle spawning), I ran about 11~12 vehicles on Tail of The Dragon, on a road 'race' (if you can call it that, some were just driving slow with large older cars blocking traffic), and let me tell you, it was some of the most fun I've ever had in this game besides putting a line of pianos to rest with a Combine Harvester (farming mod, I laughed until tears & sore gut).
    So I will definitely want to get in-touch with you when I do my next release of Tail of The Dragon / Deal's Gap map (two weeks, maybe three away?). Could make an awesome race! I drew the limit at 11 vehicles on Tail of The Dragon only because things started getting sketchy performance-wise on 0.12 game version, on my aging i7 4790k / 2400mhz cl-11 ddr3 memory / RX 480 8gb configuration - that's about the comfortable limit as of then. Absolutely sure it's higher now but I'd have to check - surely not going to update a working and otherwise still 'plenty good-enough' computer for affording a few more vehicles in-play. Thinking about updating it with the 'tree of shame' and a new hotel model/graphics (because the contents of the dealsgap/art/buildings/motel directory CRASH the map, delete that & you're golden, for both Tail of The Dragon and Nevada Interstate) around the end of the month. Old models and graphics from back around 0.4x~0.5x game versions will rain on the parade every time. If that's not enough, there's the rather decidedly ambiguous log functions of the game that DO ANYTHING BUT tell you which of the 100's or 1000's of map assets just sent the game "going for-broke" back to the desktop.
    Keep up the great work bud, you make a great contribution here!
    --Cheers!
     
    • Like Like x 2
  17. Gamergull

    Gamergull
    Expand Collapse
    Staff Member

    Joined:
    Jun 3, 2018
    Messages:
    295
    Glad you enjoyed it! I just raised the limit to 30, but I take no responsibility for melted CPUs.
    • The speed limit gets updated automatically whenever the value gets changed
    • Yes, that has to be done. In my test version, I changed some text to make things a bit more clear, and new traffic now auto activates if you already pressed Activate before (until you remove all AI and start from scratch).
    • Right now, the app picks from a small hardcoded list of sensible traffic vehicles. I could make it pick from all vehicles, but I dunno how to do that yet, haha. This will get updated sometime.
    • I'll take a look into the windows
    I made lots of progress today, including rewriting tons of code to keep things neater for the future. If nothing goes wrong, I'll release this tomorrow.
     
    • Like Like x 7
    • Agree Agree x 1
  18. Crash Hard 01

    Crash Hard 01
    Expand Collapse

    Joined:
    Aug 5, 2013
    Messages:
    903
    Thank you for all your hard work, this is so needed, and so time saving :)
     
    • Agree Agree x 1
  19. Projekt535

    Projekt535
    Expand Collapse

    Joined:
    Aug 5, 2013
    Messages:
    187
    Thank you for your dedication to this project! AI spawning has been such a long awaited feature I can not begin to express my gratitude for you doing this! Keep up the amazing work, and I hope to be able to play around with it soon. :)
     
    • Agree Agree x 2
  20. Gamergull

    Gamergull
    Expand Collapse
    Staff Member

    Joined:
    Jun 3, 2018
    Messages:
    295
    Thanks!

    Oof, found some big bugs while testing stuff today. Glad that I found them. I might have to delay the release.
     
    • Like Like x 2
  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