Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsShowcase → A*
A*
2006-07-04, 4:06 PM #1
OMFG, I can't believe I got this working in just four hours. And it's so fast too.

If you don't know what A* is, well, sucks to be you, huh?

In these images, a red square is an obstacle, a blue square is the path, and a green square is one that was searched.

With a heuristic of 0 -
[http://www.omnisu.com/astar/zero.jpg]

A max-delta heuristic - max( delta_x, delta_y )
[http://www.omnisu.com/astar/max_delta.jpg]

Manhatten distance - delta_x + delta_y
[http://www.omnisu.com/astar/manhattan_distance.jpg]
Wikissassi sucks.
2006-07-04, 4:16 PM #2
OMG is that JK!?
Code:
if(getThingFlags(source) & 0x8){
  do her}
elseif(getThingFlags(source) & 0x4){
  do other babe}
else{
  do a dude}
2006-07-04, 4:28 PM #3
Um, yay?
"it is time to get a credit card to complete my financial independance" — Tibby, Aug. 2009
2006-07-04, 5:09 PM #4
Yay is right. My old implementation took upwards of 30 seconds to run on a 20*15 grid! This one is around 5000% faster!
Wikissassi sucks.
2006-07-04, 5:50 PM #5
Are you pretending to be a smart programmer again?
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2006-07-04, 6:02 PM #6
Can I play?
2006-07-04, 6:52 PM #7
Show screens of it actually pathing around the obstacles.
2006-07-04, 7:01 PM #8
What did you write it in? What language and what program are you using it in?
2006-07-04, 7:37 PM #9
F***IN WOT
2006-07-04, 8:06 PM #10
...What does it do?!
DO NOT WANT.
2006-07-04, 8:58 PM #11
You spelled Manhattan wrong
[01:52] <~Nikumubeki> Because it's MBEGGAR BEGS LIKE A BEGONI.
2006-07-04, 9:17 PM #12
OK, what am I missing?
I had a blog. It sucked.
2006-07-04, 10:05 PM #13
How fast is it?

The thing I don't like about the description of A* is that it says to go over every grid you've got, and just keep recursing (as a first step of implementation), and when that works, you think it's done. You'd think so, because it works. A* technically should work across a really really large number of nodes at next to nil the cost, excepting that on such a large scale, it might return an unexpected path, because it uses heuristics. In a large environment, it's best to do at least some precomputations for your path finding, if at all possible.

Take your starting point and build lists of 'open spots' and keep branching out from them, and finding a happy point for your heuristics to cut off branches, if you get my meaning. I think the largest path I ever computed was across a 16k by 16k grid, and it would take longer for longer distances. I never got around to implementing the precomputations I mentioned earlier, because I mostly lost interest in the project and some guy I was working with kept pitching the idea of warrior slugs, which eventually ground down my will to work on it.
www.wudan07.com
2006-07-04, 11:14 PM #14
:mad:
2006-07-05, 2:14 AM #15
Yeah, splitting up the field into as-large-as-possible free squares should really help in larger maps. If you have like 100+ units doing a pathfind on a 128x128 grid, well, I think you get it...
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2006-07-05, 3:43 AM #16
Mbegger - manhattan is actually spelled right in the code... :)

[http://www.omnisu.com/astar/obstacles.jpg]
Wikissassi sucks.
2006-07-05, 7:15 AM #17
I don't know what this is, but I think it needs more :psyduck:
幻術
2006-07-05, 8:51 AM #18
Originally posted by Isuwen:
Mbegger - manhattan is actually spelled right in the code... :)


You spelled MBeggar wrong
[01:52] <~Nikumubeki> Because it's MBEGGAR BEGS LIKE A BEGONI.
2006-07-05, 2:22 PM #19
No, I spelled it right. You've been spelling it wrong all along.
Wikissassi sucks.

↑ Up to the top!