Road Network Designer & Traffic Simulator

84,965
0
Published 2023-02-04
TURBOWARP RECOMMENDED:
https://turbowarp.org/486632504
(faster and higher resolution)

Design a road network and watch traffic randomly navigate it. The editor functions similar to Cities: Skylines. Click the steering wheel at the bottom-right to drive around.

WASD to move camera or control car
arrow keys / scroll wheel to zoom
G to toggle grid snap
All features can be accessed without a keyboard making it touch screen / mobile friendly.

You can store/share your saves here:
https://scratch.mit.edu/discuss/topic/659021/

Please note this project has many limitations despite already being 17,000 blocks in size...
- There are no buildings. I will not add any as this is out of the scope of the project.
- Vehicles can only see the road segment in front of them. They do not know anything about intersections and crossing paths and will travel through each other. Collisions are both too complicated to implement and computationally expensive. If anyone wants to try, go ahead and let me know when you get it working.
- This project deliberately does little to prevent the user from doing unintended things. This includes drawing roads that intersect or bend sharply.
- Vehicles can only travel along quadratic bezier curves with an optional offset.
- Bridges and tunnels don't exist. Roads can go through each other without making an intersection but there is no grade separation. I didn't want to add extra complexity with this as it would mean many more layers needing to be rendered and the internal data structure / UI / tool functions would need many changes.

This is a complicated project. I can't do it all in a reasonable amount of time which is why such limitations exist. I am not adding anything. This project is not being developed any further. If you want a feature, remix it.

Why did I make it? It was partly because of the AI traffic in Car Parking Challenge and Truck Driving Challenge. Both are games are very limited, as only cars travelling in straight lines are simulated. I wanted to see if I could make something better and possibly allow for more complex driving games in the future.

CREDITS
https://iquilezles.org/articles/bezierbbox/
https://www.shadertoy.com/view/MlKcDD
https://freesound.org/people/MAJ061785/sounds/85516/
https://freesound.org/people/tosha73/sounds/580527/
https://www.nicepng.com/ourpic/u2q8w7e6e6y3r5u2_clipart-top-tree-top-down-trees-png/
https://www.dreamstime.com/stock-photo-palm-tree-isolated-jubaea-chilensis-top-view-see-my-other-works-portfolio-image35414560