Comments (2)
I had another idea on how to tackle this.
When a car stops, it displays it's id behind it, then displays the id shown on the car that blocks it.
Then, if a car sees it's own ID, it knows there's a cycle (and therefore a gridlock) and goes into panic mode and just drives through everything for a couple of seconds.
There are many ways to make this smoother, but this is the gist, and I'm pretty sure it should work. It shouldn't have any impact on performance too.
from egregoria.
Implemented in e96cabe and it works very well :-) here's a video to show the three lock scenario being resolved and a more complicated example where lots of gridlocks appear and are resolved. (thanks github for supporting video!)
2021-01-10_13-05-15.mp4
You might probably think that the 3 grid lock is a bit disappointing because they all start at the same time and run over each other. But this is an artefact of the test since they all start stopped at the same time. In a real situation, some car will stop last and break the symmetry and only one car will start before the others.
from egregoria.
Related Issues (20)
- Cars don't despawn when the road is deleted under them HOT 2
- Most models having black rendering artifacts HOT 3
- Panics immediately HOT 7
- texture not found HOT 3
- Broken TV) HOT 4
- Some NPCs freeze in mid air and are unable to find a path HOT 12
- 10 future Ideas HOT 5
- Error Building on MacOS 14.0 Beta (23A5286i) | M1 MBP HOT 2
- Leaner "Inspect" for cars and people HOT 3
- UX improvement: Automatic "Unfollow" when CMB is dragged HOT 4
- Street lights appearing for deleted Roads and overlapping without blending HOT 1
- Lumber Yard texture to be replaced with rows of growing trees. HOT 5
- Add flatpak support HOT 1
- Tooltips
- 200 seconds per hour? HOT 2
- Doesn't start in release mode HOT 14
- Pblish on crates.io HOT 1
- Tree impostors HOT 5
- Determinism HOT 2
- Asset Manager HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from egregoria.