question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reduce `MaxYieldVelocity`

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
originalfoocommented, Feb 8, 2022

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 speed ( as you mentioned above )
  • Turn angle ( mentioned earlier in this thread )
  • Weather ( adverse weather should play a role if 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 )
  • Vehicle size ( larger vehicles slow down more? )
  • Reckless drivers ( don’t slow down )
1reaction
krzychu124commented, Feb 8, 2022

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

https://user-images.githubusercontent.com/19638970/153069855-001ce4ed-efaa-4c60-8c8b-ca3b37c00392.mp4

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I limit the maximum horizontal velocity? - ArduCopter
Is there any parameter to limit the maximum horizontal velocity? Preferably different velocities for different flight modes (loiter, auto, ...
Read more >
Is there a way to limit the max velocity of all Rigidbodies in ...
There are probably a few ways to limit it but one i can think of is some sort of if(rb.velocity >= InheritedClass.velocityLimit) then...
Read more >
Calculating max velocity, acceleration, and jerk
Your trajectory will want to command maximum acceleration all the way up until you hit your maximum velocity.
Read more >
How to Calculate Maximum Velocity
Find maximum velocity quickly and easily using calculus or with a calculator. All you need is a pencil, paper and graphing calculator.
Read more >
Maximum Reaction Velocity - an overview
At subsaturating drug concentrations, enzyme induction increases the intrinsic metabolic clearance (Vmax/Km), enhances the total body clearance, and reduces the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found