This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

Super_Hippo presents ...


Traffic Simulation 4

--- not finished yet --

This is version 4 and a simulation again. You can lean back and watch. No controls at all (so far).
Six intersections instead of only one in the previous versions 2 and 3. No unrealistic influence of the light-signal system as in version 3.

Cars are added based on time. In easy words: many cars in the morning and afternoon, only some at night. One second simulation is equivalent to one minute.
Cars randomly choose a direction for the next intersection so perhaps a car drives in a circle for ever (theoretically). But it actually feels more realistic than choosing one route that exits the world randomly. It would also result in different traffic for some routes. (Between 78 % and 133 % when 100 % is the amount of cars coming from each entrance.)

The only intelligent thing the light-signal system is doing so far is controlling the left turning traffic. When there is not anyone trying to turn left, they won't get green, but they are not skipped yet. They still have a chance if they are a bit "too late". You will see it if you watch closely.

Light gray is the bus lane (not used yet).

Plans for updates in the future:
-- bus
-- intelligent light-signal system with the bus (not going to be easy. I have a plan, but not sure how to implement it)
-- maybe also a way to increase/decrease traffic
-- cars should drive a bit more realistic, especially when following another car
-- maybe increasing the distance between intersections
-- people walking around
-- people taking the bus
-- maybe upgrading the green background a little bit with trees or buildings

3777 views / 1012 in the last 7 days

2 votes | 0 in the last 7 days

Tags: simulation light system traffic road signal cross

Your browser does not support the canvas tag.


Okay, I guess 'darker' and 'brighter' are not working with the HTML5 version.
A new version of this scenario was uploaded on 2017-12-17 21:50:26 UTC Changed colors so it works (should work) in the HTML 5 version.
A new version of this scenario was uploaded on 2017-12-19 20:37:01 UTC Added darkness. Depends on time. Change the time with a click on the displayed time in the top left corner. Then click on the circle to adjust it. Changed traffic light for pedestrians. (One pixel was a bit too small to see. Now it is a small plus.) Several bug fixes.


In the HTML5 version, you can't leave the changing time window with a click on the escape button. (Don't ask me why.) You can exit it with a click in a corner. The displayed time doesn't fit in the image sometimes. Drawing something on images also look very different. With large objects like the ovals in the change time window, it looks better. However, the background image doesn't look very nice in the HTML5 version if you zoom in. (The circles and lines are different.)
A new version of this scenario was uploaded on 2017-12-21 23:40:06 UTC Fixed an error in the light-signal system which caused "hostile green" (if that exists in the english language) and crashs.
A new version of this scenario was uploaded on 2018-02-04 19:13:04 UTC Added busses. Only random waiting times at the bus stops, no passengers yet. Fixed bug with changing lanes. Not perfect yet but no cars are leaving the road anymore. Slower traffic. (It was extremely unrealistic.) Right turning traffic doesn't really detect the bus yet.

Want to leave a comment? You must first log in.

Who likes this?

Heet_Patel Reginold