- Home /
Do I need A* Pathfinding for my simple needs?
Hi,
I need to calculate the shortest route around the edge of a wireframe cube. The cube has 14 nodes in total. One for each corner and each side of the cube has a node in the middle.
The wireframe cube is actually a perimeter for a solid cube, so I need to avoid any routes that would try to pass through the solid cube in the middle. Here is an image of the cube:
I already have the cube setup and an array list of the Vector3 values for each node.
So is this a job for A*? Or does anyone have a suggestion on how to go about this?
Thanks
Paul
huh?
looking ONLY AT the "white" larger cube. is it true that you ONLY want to travel on the SURFACE of that larger "white" cube?
Yeah?
you talk about not touching the inner dark cube (I think). But ANY connection of the green dots -- other than on the surface of the larger "white" cube -- does touch the inner dark cube.
So - the inner cube is irrelevant, you just want to travel on the outer "white" cube SURFACE - is that correct?
or, do you mean that: the "CENTRAL" green points on the outer cube, may, connect directly to the other "CENTRAL" green points on the outer cube. (but not the through-the-middle connection, only the adjacent four in each case)
???
in all events, you can easiyl WRITE OUT THE TOTAL SOLUTION for the shortest path in such a simple set. then just follow that in code.
I think he wants to move between the green points, avoiding collision with the Cube inside the wireframe cube.
Something like the computer Hacking part of Bionic Commando Rearmed.
If not, then my answer is completely wrong :-)
lol guys! You are correct about what my goal is Code$$anonymous$$aster$$anonymous$$ike. Looks like I am having to jump in feet first into A star, probably by using a component. I looked at the wikipedia page for A star and quite frankly, it scared the crap out of me ;)
@Fattie: Any suggestions now that the fog has cleared? ;)
It still seems like overkill for what on the surface seems like a simple task, but as always with game dev, there is always more going on behind the scenes than first realised. Every game I look at these days I find myself asking what is REALLY going on behind the scenes ;)
damn, I don't know that game !!!
i'm pretty sure he can just write out all the solutions. I think there's only bout six categories...
if you're on a point and want to go to a point, it's totally trivial.
point to midthing, three are completely trivial and three are trivial
midthing to point, four are extremely trivial and four are trivial !!!
midthing to midthing, all totally trivial
@UFO ... NOTHING is easy in program$$anonymous$$g. the simplest program$$anonymous$$g is harder than anything else, ever, attempted by $$anonymous$$an.
so first, congratulate yourself!
secondly I think I have outlined the six categories in the previous comment, go get it !
Answer by CodeMasterMike · Dec 10, 2012 at 08:27 AM
My idea would be to use raycast to check for collisions.
Say that you are at Point A, and you want to go directly in a straight line to point B, do a Raycast from Point A to the direction towards Point B. If the ray collides with the Cube, then you can't go that way and need to try another way.
But if you would want to move in a more complex way, by reaching your goal by avoiding the cube but still come to Point B eventually, then you would be better off with using A*.
Good luck!
Your answer
Follow this Question
Related Questions
NavMeshAgent not calculating shortest route. 3 Answers
A* endless loop 0 Answers
iTween, moving to a node on a path. 1 Answer
Custom pathfinding and node-values 1 Answer
Help with a simple AI 2 Answers