Get it here: https://www.beamng.com/resources/east-coast-dynamic-traffic-gull.7478/ I kicked things up a notch with traffic in BeamNG. Now, traffic can spawn on any valid road without the use of manually placed spawn zones. This scenario is a proof of concept, but I have bigger ideas for later. Issues or feedback can go here! Let me know what's up!
I have a question/suggestion for you. Do you think its possible to make a ui app instead of a scenario for us to play in free roam with cars spawning at will in free roam? Being able to set a few options like how many vehicles and which configs to load as well could be an addition. I love the scenarios they are really fun, laggy but fun.
That is a really good idea! I've never made a UI app before (and I love scenarios a bit too much!), but perhaps this will be the next thing that I will work on.
In a quick test, I pumped up the number of unique AI vehicles to 7. Wow, it got intense; the road was rather busy at times. My CPU got a bit stressed, but the game still ran at around 30 FPS. Edit: With more traffic vehicles, a new bug showed up. I'll have to improve my spawn code to fix it.
I'm enjoying this scenario a lot so far, as well as the others you've released. You're doing great work! I agree with crashmaster, if this could be made into a UI app, that would be amazing. In the mean time, would you be at all wiling to share how to change the number of cars? I understand I run the risk of crashing the game, but I think it would be fun to play around with. PM me if you prefer!
Sure. You have to move the .zip file to My Documents/BeamNG/mods/unpacked, and unzip it there. Put it in a unique folder (so the path will go like this: mods/unpacked/eca_traffic/levels/...). Open the .lua file and edit the trafficNames line by adding vehicle names. Also, open the .prefab file and copy and paste the vehicles lines. You can rename the object names, models, and configs, if you know how. I hope this works; I typed it on mobile while at work. I'll upload a test version with more traffic and bug fixes this evening, so if you can wait, there will be a new file here about six hours from now.
Ignore my instructions in my previous post, it would've failed because I didn't do any error handling for the vehicles' color switcher. Gimme half an hour and I'll post a test file with 7 AI cars, and with better error handling! --- Post updated --- Ugh, so many posts. Last one for today! Here's the 7! http://gamergull.com/East_Coast_Dynamic_Traffic_BETA_EX.zip Warning: Quite buggy! I didn't figure out why the Burnside refuses to start at first, and vehicles might rarely spawn into each other. I intentionally left a color array out of the code to ensure that things work, so the Ibishu 200BX gets painted in random colors. Also, the fail screen won't show up unless you honk the horn after you stalled. I'm hungry... gonna go eat, then fix some code!
heyo gull! long time no see i have an idea- will it be possible to make the code able to spawn modded cars? granted without changing the colors, but like i could be cruising and see a Gladiator around town? (it would work that everytime you re-selected the scenario, it would randomize a car, then a config of that car to spawn. rinse, repeat with about 5/6 cars. Not sure if this is possible, but just an idea.
That should be possible. It would cause a bit of loading lag at the start UI of the scenario (and I don't think I could run the script while the map is loading), but I will definitely try it out. I want to do something similar in my next scenario anyways. Optimized some of my code this morning. Right now, I'm working on making the AI aware of what's in front of them, so they won't play bumper cars as much. --- Post updated --- My AI awareness works ! But the code is ravioli, so I gotta clean it up before I do my next release.
“Code is ravioli” Lmao Best analogy I’ve ever heard for messy code. Anyway it’s good to know that that might become possible.
Well Done!!! It works great, and exactly what I hoping for. This is awesome. I’ll trust you when you say you have more great ideas, because this is great fun as is. By the way, I used the super tac-gnat helicopter to scope things out from the air. Now I can patrol the skies of East coast looking for any bad guys to eliminate. Good fun!
The script works with air vehicles!? I didn't even expect that to work! That's so awesome. I still need to optimize my aware AI stuff. Currently, it's running too hard and causing game sounds to cut out for some reason. Tired now, more work next time.
i dont think the audio bugs are your AI stuff recently the audio has gone to crap with more than 5 vehicles out. i think its a Beam problem
http://gamergull.com/East_Coast_Dynamic_Traffic_BETA_EX.zip Updated link. Now with bug fixes and rudimentary "aware AI". Please note, the AI doesn't work as intended all the time. The van in particular likes to plow into stopped traffic anyways. Also, vehicles may be either too cautious or too unaware. I think I need a better way to code it; I might do some AI research online. I'll update the repo version later today, likely. I'll add the option to have either less or more traffic. Also, yes, I am slowly working on the traffic app, but it's still tricky for me to understand. I haven't done much coding outside of scenarios.
can you mix this mod with the "Random Tour" Scenario? This scenario is outdated, but probably you get it to work and with traffic its would be awesome!
This is incredible, running perfect 60fps without any issues. To have actual traffic, it is really new kind of driving experience that adds a lot to gameplay and East Coast has lot to drive so it is really nice match. You might get hired by BeamNG, tdev posted some time ago on forums that they want to make traffic, but gave no promises, but Gamergull deliver traffic already, I think they would get great head start to official traffic by hiring you Is there simple way to adjust max vehicles, is it variable passed to function or more complex adjustment needed? I was curious of how many traffic vehicles I could run without dropping below 60fps. This work you have done adds a ton of gameplay value to many players, really appreciate that you are willing to donate your time to build these scenarios. Now I try new beta of aware AI, my only worry is that they are smarter than me --- Post updated --- Aware AI is bit laggy for me, I'm not sure if LUA part of game uses threading or how much it uses that.
Sounds like a fun idea, and it would be somewhat easy, too! However, my priorities are updating this mod and working on the app, so we'll see how that goes. Haha, thanks a ton for the praise! I don't think my coding skills are at dev level yet; I do this as a hobby and only have a little bit of experience from school (several years ago). As for adjusting the number of vehicles, I realized that I kinda hardcoded the vehicle names in the .lua file, and I can work on a much better approach soon. I also debugged some things in my head while at work; I'm gonna fix a few AI bugs in a few minutes. I might be short on time tonight, but I'll get a fresh update out by the end of Sunday. I'm also gonna try hard to get a traffic app done. Ooh, so many challenges, so little time! Edit: I managed to crash the game entirely with a line of code . Also, learned something new; deleting a vehicle via code breaks the scenario.
Improved the spawning algorithm and fixed yet another bug so traffic is a bit smarter (dang van though, what's wrong with that driver?). The spawning algorithm now uses a segmented line to choose a road node, so it's more likely that traffic will spawn on the same road that you are on. Also, cars can now stop at the gas station .