Giter Club home page Giter Club logo

Comments (4)

onpon4 avatar onpon4 commented on May 24, 2024

I'm looking at this and I don't think the change you suggest would actually be correct, since that "speed" variable is used elsewhere as well in the exact same way. I also note that this particular code has looked like this for many years; that doesn't necessarily mean it's doing the right thing, but it does mean that it's likely that it was working without noticeable faults until recently.

The only code related to this that I think has ever changed in Naikari's development history is the AI code itself, so it's possible there's some sort of issue with the numbers that has only come to light as a result of those. We'll have to try to figure out what that might be. If it's easy to reproduce, perhaps a git bisect could be in order just to narrow down exactly what change led to this. I'll look into things more closely in a few days, in any case. Perhaps a whole rewrite might even be in order. (Naev actually did a full rewrite, which we tried out with 5112da3, but we subsequently reverted that because it seemed to not work correctly.)

from naikari.

onpon4 avatar onpon4 commented on May 24, 2024

I think my mind on what I think seems correct has changed and I think your initial conclusion seems right, after looking at it for a few more minutes. I'll want to do some checks to verify, thΓ΄, and look into why that "speed" variable is getting set <= 0 (which is almost certainly why it got set to 0.0001), since that could be indicative of a deeper problem in the code.

from naikari.

onpon4 avatar onpon4 commented on May 24, 2024

Ok, so, it looks like our initial reservations were right. That "speed" usage was there for a good reason: because it's the drift speed. Looks like what was happening was speed could become zero if the speed limit was low enough, and that would mean that brake distance actually should be zero (as braking isn't actually needed in that case). So I've changed it so that completely not drifting is less likely, added a MAX call to make sure minbrakedist doesn't return a negative number (returns zero instead), and I'll need to also add a guard in the AI code itself to handle the case of min brake distance being extremely small, probably just by also recognizing being inside the jump radius as a condition to start braking.

πŸ•·οΈ

from naikari.

onpon4 avatar onpon4 commented on May 24, 2024

Just finished adding in that last protection and the totality of the changes seems to make things pretty sturdy now. I didn't specifically test the mission you mentioned, but I did test some generic AI pilots with an extremely small speed limit applied and the fix to them should also work for the mission pilot. Please let us know if the bug persists in the latest git revision. Assuming there isn't a problem with the fix, we'll be pushing out a 0.10.1 bugfix release soon.

Thanks for the report. All the information you provided was also very helpful in more easily solving the bug, so thank you for that as well.

from naikari.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.