Skip navigation
been working on an improved method for detecting navigation obstacles, think I'm onto something now!
0:00 / 0:35

been working on an improved method for detecting navigation obstacles, think I'm onto something now!

festive vector

@festivevector5.2K followers

Visit on X
2,912 likesDownloadOriginal post

160,864 views

been working on an improved method for detecting navigation obstacles, think I'm onto something now! this costs 1 raycast per frame and maintains a 'radar' around the boat that I can use to adjust steering on the fly

10 Comments

Comments from the original post on X (Twitter)

  • festive vector's profile picture

    @festivevector

    So far I’ve made it without cheating in the AI, they have the same physics as you The next step might be to do some subtle physics nudges if a collision looks imminent and isn’t desired (pirates colliding with eachother is fun, your fleet not so much)

    56 likes

  • festive vector's profile picture

    @festivevector

    Some extra context for the video: The green spheres show the extent of the radar, red is where it’s hit something Adjusted direction is the white line/sphere The spinning thing is where radar is currently looking The green line is the desired path as given by the navmesh

    9 likes

  • festive vector's profile picture

    @festivevector

    Seeing a lot of the same questions: - I do use navmesh as well, however the boats will sometimes end up off course from the A* path, in addition to dynamic things like other boats or other obstacles not on the nav mesh

    3 likes

  • festive vector's profile picture

    @festivevector

    - The 360 scan vs scanning just ahead is nice to have because it gives the AI more information about where it can safely turn when obstacles arise - I said it costs 1 raycast per frame, but really it’s more like X raycasts per second, to account for low frame rates

    4 likes

  • festive vector's profile picture

    @festivevector

    This is from my recently released game, Sail Forth! Check it out if this caught your eye

    37 likes

  • GameSpate's profile picture

    @_GameSpate_

    Maybe try an egg shape with the boat placed where I put the X. You’ll have a range behind about the same size as it is now, or a little smaller, and a forward that’s much more predictive. It detected it was doing to hit that rock rather late. A further view would fix that.

    12 likes

  • festive vector's profile picture

    @festivevector

    Cool idea!!

    3 likes

  • Nick 'Toxic Waste Slime Licker' Woll's profile picture

    @YourDMNick

    Game dev is a wild and unruly beast and we love to see it ✨

    8 likes

  • Pat's profile picture

    @PFarnach

    That's clever and I love the use of the gizmos. If it's frame-dependent would lower end devices get lower quality detection? My inclination would be to go by time, say every 20ms or something.

    7 likes

  • festive vector's profile picture

    @festivevector

    This is possible yeah, I could try to do X number of raycasts per second or something along those lines

    11 likes