Spherical Pathfinding

Im trying to make an NPC walk around a planet (Using EgoMoose’s Gravity Controller) but the pathfinding starts to fail on the edge and just doesn’t work underneath the sphere. It is obvious why it doesn’t work, but I haven’t found anything to fix it.

1 Like

This’ll be a logic issue considering the fact that the pathfindingservice isn’t suited for such an altercation. In this situation you’ll either have to completely make your own pathfinding, or pathfind to the nearest spherical object and just work around that.

3 Likes

I was gonna do that but I wanted to see if there were a simpler solution

is Roblox PathFinding really recommended for that?

This is a simple ray-caster (wall-hugger), which works, but you’re probably gonna have to tweek the ray-cast… Maybe some number, which the Controller returns can be used…?

AI - Roblox

1 Like

I found this GitHub post by Sebastian Lague about spherical pathfinding in unity. I was testing it in unity and made an object chase the ball around. This is exactly what I need, I just need help converting it to LUAU.

3 Likes

Nice!
I like that guy…
But, I can’t see the first link. Or find it in the second… Could you put the code here?

Thanks

I downloaded; tried and tried. I just can’t get it…

Hey, can I see your code for Unity? Don’t know it but I am def interested and will try to translate it…


Its a start


recentered

Sorry, Soviet,
I think that, I got writing another guy thinking it was you… Sorry…
I did finally get to look at that code, but lost you somehow…

You needed an AI which path-finds on a sphere, right? And it is like a Pet, which retrieves items which may be behind a wall, right?

I thought that I told you (But I told the wrong guy…):

The Gravity Script does not work for me, for NPCs.

But, I am making, Spiders for a guy, which walk-up walls anyway. I just stuck their Humanoid State into, platform-stand; then read the surface and walls with a raycast to orient them, which would work on a globe too, I’m pretty sure… The guy says that Animations work in PlatformStand, but you can’t use State to call the animations of coarse…

I would suggest a Ray-caster “Wall-hugger” AI, over writing an A* anyway, as I’m guessing your globe does not have Nodes (MY GLOBE has built-in nodes but I am just using a Fill-Search pathfind, and no Humanoids, as mine is just a board-game)

So, do you still need an AI? Trust me, a Ray-caster is the way to go; for ease (You just raycast in the direction NPC is facing); it’s already made; and works fine as long as there is no very intricate maze (Althiugh, it could be modded for that too)…

Let me know. Hope you are well. Got any wic things you have come up with, you would like to show-off or needs a bit of polishing (I’m good at modding)?

  • Brian
    (The AI guy)

P.S. A “wall-hugger” doesn’t HAVE to hug the wall; you can ray-cast further ahead and take a diagonal, too…

P.P.S. I’m thinking of using; NPC Kit and modding them for future AIs and/or designing them in one of the “Shell” Game templates (with built-in Lobbies and stuff), for more universal, work-right-out-of-the-box standards,
because I just found them today. Do you know or suggest any of them…?

NPC Kit (roblox.com)

Resources (roblox.com)

P.P.P.S. Yes it looks like you may have something there, which may work for nodes,…

Or I have a Cube to Sphere fiunction, which basicaly deforms 6 checker boards into a sphere (I offset each row to make hexagons instead), but then you must mark each hex as Travelable or Not, for A*… All too much work…)
Also, I just read an article about the best way to number each hex so you know where you are and where you are going; on a globe (But I just know each hex’s Neighboors, and find shortest route…)

Um… Just in case you know…

I’m having trouble killing-off Player Character for good in my game; only works sometimes…

(1) Test124c41 - Roblox

Do you know the trick?