|
Pathfinding (A functions request) Displaying 1-14 of 14 total.
1
Sungam
|
Even if it isn't going to be perfect, a built-in A* function would likely be much faster than one made in VC, wouldn't it?
I'm going to need path-finding one way or another. A lot of us are. I'd be very thankful to have an internal function for it.
Posted on 2004-12-14 15:25:12
|
blues_zodiakos
|
I wonder what kind of pathfinding was used in the Infinity Engine games (like Baldur's Gate)? It seemed to work reasonably well, at least for short distances. It usually got a little wonky if you wanted, say, your character to walk from one side of the map to the other, but other than that it wasn't too bad. Of course, I probably deserve a slap for mentioning that since... it probably was a derivative of A*, hehe.
But it would be terribly awesome, for any number of applications (cutscene setup, automated NPC task scheduling, etc.) to be able to say EntityGoTo(32, 135) and have it do just such a thing. It would be especially wild to say, have 30 different NPC spread out over the screen, issue them EntityGoTo commands in a for loop, and watch them all line up randomly in perfect columns. What a dream.
edit: Is it just me, or are the posts in this thread showing up in the wrong order? O.O
Posted on 2004-12-14 15:26:00 (last edited on 2004-12-14 15:28:49)
|
Interference22
|
Since my main V3 project is mouse-based it's important that by clicking somewhere on the map the user can comfortably expect his avatar to go there, no questions asked.
It's not that easy, though, and currently I'm employing Ragecage's A* lib to do this. It's a valient effort but has some shortcomings that are all too evident, mainly involving it's accuracy.
So, I'm wondering how hard it would be for a pathfinding system to be built into V3, allowing anyone to tell an entity to go somewhere and for VERGE to calculate the relevant path (taking obstructions etc. into account) and dump it into the entity's movecode. This would be WILDLY useful, not just for me but for everyone - particularly for making AI a little more realistic.
Posted on 2004-12-14 15:54:29
|
Zip
|
A* isn't designed for realtime, is the basic problem. Works well for a one-off solution (turn based map for instance), but is just plain bad if you expect 1) no visible delay, 2) path changing along the walk. However, as seen from the terrible path finding seen in even quite modern rts games, an good solution that is 'cheap' enough is not easy to find. They were programming in much faster languages than verge, as well. But... this has been on my to-look-at for a while, so I'll think about it again. Vec could of course do it faster and easier... but...
Zip
Posted on 2004-12-14 16:00:50
|
Ness
|
EntityMove(ent, 'x5y6');
Sends the entity to a specific x y coord (in tiles). It ignores obstructions and does not take the shortest path. Not increadibly usefull for pathfinding tho.
Edit: Blue built a time machine to post that message. Ha!
Posted on 2004-12-14 16:24:17 (last edited on 2004-12-14 16:27:33)
|
RageCage
|
man, my A* is perfectly accurate. I dont know what chu talkin about. The only problem with it might be other entities, or you're just using it wrong =p.
But yeah, A* would be a grand thing to have incorporated into verge!
Posted on 2004-12-14 17:54:06 (last edited on 2004-12-14 17:56:20)
|
Interference22
|
Quote:Originally posted by RageCage
man, my A* is perfectly accurate.
That's the problem, Ragecage: it isn't. Particularly with large entities they bang into obstructions and always end up a few tiles away from where you want them. Plus, if you crank up the accuracy the speed hit while it's thinking can annoy. Still, it's the best out there.
A built-in system would be utterly brilliant. At the very least, I'd like something that got an entity to a static point on the map without them lurching around like someone after a heavy night of drinking.
[Zip: Closed the < quote > tag]
Posted on 2004-12-15 07:03:24 (last edited on 2004-12-16 11:15:23)
|
Wooly
|
I had an Idea about this... Maybe there could be a way to make pathnodes so the chr knows what is the road to follow. I was thinking about that because Unreal used this type of pathfinder.
Maybe it would be too complicated but I think it could work.
Example: A character is in a maze and another character have to follow him. So the follower search for the nearest pathnode that tell him what side he must go, and then he move to this other pathnode that tells him where to go... etc.
Just the sketch of an idea :)
Posted on 2004-12-15 23:46:38
|
hellhound
|
Quote: Originally posted by Zip
A* isn't designed for realtime, is the basic problem. Works well for a one-off solution (turn based map for instance), but is just plain bad if you expect 1) no visible delay, 2) path changing along the walk. However, as seen from the terrible path finding seen in even quite modern rts games, an good solution that is 'cheap' enough is not easy to find. They were programming in much faster languages than verge, as well. But... this has been on my to-look-at for a while, so I'll think about it again. Vec could of course do it faster and easier... but...
Zip
Hmm... maybe your experience with the A* algorithm is very limited. Verge, as all of us know, isn't a multi-tasking engine. Probably you're presumming it isn't the IDEAL solution becuase you have to wait until it finishes its task. To achieve such a goal you have to implement first a multi-tasking engine and then optimize the pathfinding algorithm in a way that fits in this engine.
Something else, A* resolve the problem in cubic polinomic time in the order of O((n^3)*(log(log(n))/log(n))^(1/3)), that is, is the best option for many applications.
There are many other solutions for the same problem but with different approachs, maybe you want to read books and papers:
-'New bounds on the complexity of the shortes path problem', Michael L. Fredman
-'Algorithm 97: Shortest path', Robert W. Floyd
-'A theorem on Boolean matrrices', Stephen Warshall
-'Representation of events in nerve nets and finite automata', Stephen C. Kleene and others.
How about the Dijkstra shortest path solution?
Posted on 2005-01-01 15:47:22 (last edited on 2005-01-01 16:10:37)
|
hellhound
|
man, my A* is perfectly accurate.
A* algorithm is a 50 percent heuristic implementation meaning you can't guarantee a 100% accurate solution.
Posted on 2005-01-01 17:26:06 (last edited on 2005-01-01 17:28:26)
|
RageCage
|
Quote:Originally posted by hellhound
man, my A* is perfectly accurate.
A* algorithm is a 50 percent heuristic implementation meaning you can't guarantee a 100% accurate solution.
I beg to differ. I have never seen a situation where it didn't find the absolute shortest path and the fact its heuristic doesnt mean its less accurate, is just means it has bias towards the most likely path.
As for the Dijkstra shortest path, it is the same algorithm as A* only the path cost of each node is based purely on heurstics instead of including the cost of total number of steps, corners, etc. You can actually use my verge A* library and transform it into Dijkstra by changing a couple values I noted in the readme. It finds the path much quicker than A* but still too slow for verge. Although I'm sure there's some multi-process type things you could do to make it seem fast enough.
Posted on 2005-01-01 18:26:27 (last edited on 2005-01-01 18:33:56)
|
Zip
|
heelhoond: 'A*' as in Rage' lib. Which is does a block solution from point A to point B. Threading the basic algorithm would be an option.
However, if you're 'presumming' you can take that tone with me and not wind me up, think again. Even gannon can manage basic politeness when pushed.
Zip
Posted on 2005-01-01 21:17:10
|
gannon
|
Push me all you want I am not moving because you said so its just because I felt like it.
Posted on 2005-01-01 22:08:30
|
Interference22
|
Quote:Originally posted by Zip
However, if you're 'presumming' you can take that tone with me and not wind me up, think again. Even gannon can manage basic politeness when pushed.
Zip
Politeness is an extention of respect and should therefore be earnt, not expected. Start expecting things and you get disappointed easily. And picky.
Posted on 2005-01-05 16:55:03 (last edited on 2005-01-05 17:00:31)
|
Displaying 1-14 of 14 total.
1
|
|