Open originalfoo opened 4 years ago
I think stop signs should cause complete stop regardless of situation. Yield makes sense to reduce. I'd make it a value between 30-90% based on (and these are all values that can be cached after the road is built):
E.g. So,
Any opinions on this?
Yup, that's the key difference between stop sign and yield sign IRL.
Tagging: https://github.com/CitiesSkylinesMods/TMPE/issues/1229 (take a look at the vids in that issue) :)
Tagging: #1229 (take a look at the vids in that issue) :)
The videos in that issue do show the yielding and stopping but they don't have different speeds for yielding when there's no other traffic to force a speed change or a complete stop.
Before I forget, we already have some code for determining speed based on curvature - part of the bulk applicator for roundabouts.
See:
EDIT: Notbly the posts by @scottmcm are the ones we ended up using IIRC: https://github.com/CitiesSkylinesMods/TMPE/issues/793#issuecomment-618121036 (and subsequent comments)
Annnnd, additionally... there's some fast math functions that can make the calcs eat less CPU:
https://github.com/Quistar-LAB/EManagersLib/blob/master/EMath.cs
Annnnd, additionally... there's some fast math functions that can make the calcs eat less CPU:
https://github.com/Quistar-LAB/EManagersLib/blob/master/EMath.cs
No need, most of such "vanilla" functions are inlined because of FPS Booster patch introduced in v 0.7 - you won't see any difference or better, there is a chance that patched vanilla will be faster than this custom solution 😅
The videos in that issue do show the yielding and stopping but they don't have different speeds for yielding when there's no other traffic to force a speed change or a complete stop.
Because in code perspective they don't yield when target and incoming vehicles are on priority road. That's a missing bit + that behaviour does not work on junctions with traffic lights yet.
It looks like I found a bug in the code that completely ignores MaxYieldVelocity
when Simulation Accuracy is >= Medium
. It works correctly on Low
and Very Low
... Time to fix it 😄
Low Simulation Accuracy, at higher setting vehicles on the left side don't care
Nice that there's slowdown but I wouldn't expect a slowdown from 40 to 7. For that kind of junction (angles + traffic), I'd expect a slowdown from 40 to 20~25. But a slowdown is good for realism.
Yeah, I tweaked value because I wasn't sure if it actually works.. I'm not sure if MaxYieldVelocity is that useful, since maybe it would be better to calculate it based on segment speed limit, e.g. 50% speed limit as max 🤔
Yup, i think MaxYieldVelocity
is more of a hack due to the original implementation, and we should seek to abandon that setting.
Ideally approach speed should be based on factors such as:
Road condition has a bigger impact on vehicle speed
option enabled - although this already would affect the road speed so probably no need to check separately )
In #662 the 'cars stopping at yeild signs' bug was solved so well that now vehicles on Yield roads enter junctions too smoothly with no visible difference to cars on Priority roads (other than that they'll yield if necessary).
We can possibly alter
MaxYieldVelocity
global config var (and bump config version to make sure it gets pulled in to existing saves) to make vehicles slow down a little before entering junction so there's some visible effect of the Yield sign working.However, it might be better to have the Yield velocity be a function of road speed (same for Stop velocity too)? For example, Yield could be 60% of segment speed limit, Stop could be 30%? Values would need experimentation to find what looks best. There would likely need to be a min speed so they don't just grind to a crawl.