#Traffic Simulation

1 messages ยท Page 1 of 1 (latest)

sour nova
#

I like it. "Traffic engineering" might be a keyword you could search for.

somber jewel
#

Hi there!

Just wanted to give you all a quick update on the Traffic Simulation project I'm working on. I've made some cool progress โ€“ now, the vehicles can actually stop at junctions and follow the traffic lights. I've also tweaked the steering mechanics to make them smoother.

Coming up next :
Collision Avoidance and Vehicle Following ๐Ÿš™ ๐Ÿš“ ๐Ÿš—

I'd really value your thoughts and feedback on this. Also, if you have any research materials or resources that could help me enhance the simulation, please send them my way. Thanks a bunch!

sour nova
#

Do you use actors for the cars and do the calculations in the tick-event? I think in this type of simulation it's basically about (CPU) performance. I think I would make everything by myself - collision (boxes are enough I guess), moving the (ISMC) cars and so on. Then I could place all data of the cars in an array and with one (complex) algorithm I would calculate everything.

I love this project ๐Ÿ™‚

somber jewel
#

Thank you, I really appreciate that.

These vehicles are literally just vectors.
Along with their positions, the simulation calculates their velocities and goals using a Data Oriented approach.
After I have finished developing the simulation my plan is to create ISMCs and bind them to these vectors. I am also thinking of seamlessly replacing the ISMCs with Actors when they are near the player. The actors will have all sorts of cool stuff like Audio, Suspension etc.

somber jewel
#

Progress Update
I got the Car Following Model Working ๐Ÿš“ ๐Ÿš™ ๐ŸŽ๏ธ ๐Ÿš—

Initally I had to planned to integrate collision avoidance logic, but I have decided I would rather fix the wonky cornering by making the paths smoother.

sour nova
#

Nice. I also made a very small traffic simulation the last days - I've got a job interview on thursday. The company makes - guess what - driving simulators! ๐Ÿ˜„ So I thought I also make a simple traffic/driving simulation to show them. As I only had four days for it, I did not make a complex and efficient algorithm. I used physics simulated cars (ChaosWheeledVehicleMovementComponent) and to drive them a behaviour tree and splines. I think a more algorithmic approach can become very complicated if implementing more and more traffic rules - maybe think of behaviour trees then. They are good for this. You can find a small video here https://www.youtube.com/watch?v=b4oH9bJDkNs and the code here https://github.com/Thilo87/VehicleSimTest if you're interested how I did it.

Keep on with the work - I'm looking forward to updates!

Just a very simple traffic simulation made with UE5 in a few days.

You can download the source code here: https://github.com/Thilo87/VehicleSimTest

โ–ถ Play video
GitHub

Contribute to Thilo87/VehicleSimTest development by creating an account on GitHub.

somber jewel
#

Looks pretty good. Good luck!

#

@sour nova nice to see some appropriately documented code.

pulsar briar
somber jewel
#

Hey there!

Just dropping in with a quick update on my project.
I'm nearly at the finish line and wanted to show off a little demo of what I've managed to pull off so far.
What you're about to see are 100 vehicles all simulated on the CPU. Thanks to its Data Oriented Design, the simulation can easily handle even 1000 vehicles all within 1ms.

For every single vehicle, the sim is crunching numbers on position, orientation, acceleration, and even weaving through traffic with some slick collision avoidance moves. It's all thanks to a Spatial Acceleration Structure that detects obstacles right in front of any vehicle super fast.

There's definitely a bit of polish needed, as you can probably tell from the video. I'm on it, though, aiming to iron out those kinks and get this project up on GitHub shortly. Stay tuned!

(Yes, I used ChatGPT to type this out.)

past bobcat
somber jewel
#

@past bobcat - That looks amazing. Did you ever have to write some logic to free cars stuck in a jam ?
In my sim cars frequently get stuck in jams and I can't think of a way to fix that.

#

I noticed that in GTA V, in some cases cars move in reverse to free themselves.. and in other cases, the game simply removes stuck cars as soon as the camera pans away ๐Ÿ˜†

past bobcat
#

i did notice that too. and thats how i did it. just made it stay broken as you were looking and deleted when you look away. i did try to get cars to back up and go around but couldnt ever get it to work right.

runic grove
past bobcat
#

thank you. i had to take them into blender to chop the doors and headlights. it was tedious.