Jump to content

A* path finding for rovers (map view)


Recommended Posts

Well, other than being able to make an assembly building for rovers(already suggested) except on other bodies than Kerbin, my main thought on how to improve a rover was to add more use for career.

I was thinking maybe rovers especially in career could use an a* pathfinding that's mapped to the map view of a planet/moon. This would add use to rovers because then you could set it to go to another biome with the a* as opposed to driving it manually for days, time warp and then go to your rover collect science and set it to the next mission. This I think would give a purpose to a rover in career other than pure asthetics which is a sandbox thing.

I'd say to prevent exploits, add time warp to the tracking station and only allow the a* to work from there.

In unity squad wouldn't have to make an a* as there is a premade unity version and a free from online.

Oh, and for those who don't know a* is a generic term for a certain type of ai pathfinding, its pretty efficient and therefore its pretty popular

Edited by Specialist290
Merging sequential posts.
Link to comment
Share on other sites

That's why you need an ai like a*...

ok let me just explain a little more how a* works...

you map a grid of points to a surface, either by the script or manual settings, you mark which points can be traversed or not.

Then your ai calculates the shortest navigable path (using the points) which it will travel. The ai will go from point to point until it reaches the goal.

Link to comment
Share on other sites

The problem with any vessel in KSP is that once it gets 'unloaded' from view, it sits on rails. If you have the accelerator turned up while on a ground based vehicle, you can't switch to another location. Since this happens, the next best step would be to find a tool that will do the driving for you, and I think the most recent dev version of MechJeb will let you set waypoints.

It isn't perfect, as the rover does seem to forget it is being controlled by AP and just stops dead in its tracks, but, it at least gets things going.

Link to comment
Share on other sites

The problem with A* is that it's designed around the presumption that you're on a 2D grid of cells. A planet isn't 2D, so you have the problem of how to wrap your 2D pathfinding map around a sphere, and dealing with your rover wandering around the planet and getting near the poles where the top and bottom of the map converge to a point, or toward the seam (meridian if you like) where the two vertical edges of your pathfinding map wrap around and meet each other again.

A* could be useful as part of the solution, but it needs to be a bit more clever than "wrap a massive pathfinding map around the entire planet". Perhaps plot a new map for every N kilometres that the rover travels, centred on its current location, extending for N*2 kilometres from the rover, and scanning the planetary surface for slope angle to determine whether a cell is clear or blocked? This could perhaps be explained as a game mechanic, requiring some kind of radar equipment on the rover before it becomes capable of autonomous travel?

Assuming surface deformations will never, ever happen, it might be possible to bake in fixed nodes and paths on each planet (another pathfinding method, similar to how the Unreal engine does it), and have any rover autopilots steer themselves along those lines?

Link to comment
Share on other sites

Well, for now its only a suggestion, but i'm just happy that my idea's aren't being shot down :D.

Maybe there could be overide code to the "rails" in this case...

Oh, if anything, the "rails" would make things easier. They'd just be a different type of rails to the ones orbiting craft ride on. No need to plot the exact physics of the rover that's a gazillion kilometres away on an orbiting moonlet. Just plot an appropriate course, and have the rover ride the rail until you switch back to it or it comes into view. At which point, rotate the rover to the correct orientation and switch back to physics-enabled autopilot, which would still use the rail for guidance.

Link to comment
Share on other sites

Well, squad has said there will never be terraforming... I thought of something similar, but you summed it up.

But maybe instead of 1 massive grid, there could be say one for each pole and 4 to cover the other chunks.

DEFINITELY HOPE ADMIN SEES THIS.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...