Hambone
Level 1
follow on the twitter @The_Hambone1988
|
|
« on: May 03, 2015, 11:11:20 PM » |
|
Here are a few snippets of my orthogonal A* implementation... I am pretty new to path finding implementations but I think after some wrestling around I think I got it! Probably not perfect but I am going to have a anyways! Hambone
|
|
|
Logged
|
Wannabe indie game developer
|
|
|
oahda
|
|
« Reply #1 on: May 04, 2015, 12:29:40 AM » |
|
i was gonna congratulate u but then u mentioned beer so no congrats 4 u!!!!!!
|
|
|
Logged
|
|
|
|
lithander
|
|
« Reply #2 on: May 04, 2015, 04:23:33 AM » |
|
What's the problem with beer? Getting pathfinding to work is always a nice milestone. I'm not sure why everyone seems to start with A* though. Why not start with something heuristic-less like Dijkstra? It doesn't scale so well but it's easier to get working, more flexible and faster for small grids.
|
|
|
Logged
|
|
|
|
Hambone
Level 1
follow on the twitter @The_Hambone1988
|
|
« Reply #3 on: May 04, 2015, 08:44:29 AM » |
|
i was gonna congratulate u but then u mentioned beer so no congrats 4 u!!!!!! people who drink beer cant get a congrats I'm not sure why everyone seems to start with A* though. I had to thanks to my professor.. He dropped us in to the deep. Hambone
|
|
|
Logged
|
Wannabe indie game developer
|
|
|
oahda
|
|
« Reply #4 on: May 04, 2015, 09:43:26 AM » |
|
cuz im not 15 y o !!
|
|
|
Logged
|
|
|
|
Hambone
Level 1
follow on the twitter @The_Hambone1988
|
|
« Reply #5 on: May 04, 2015, 01:04:30 PM » |
|
You aren't 15 or you are 15?
|
|
|
Logged
|
Wannabe indie game developer
|
|
|
gimymblert
|
|
« Reply #6 on: May 04, 2015, 01:29:53 PM » |
|
|
|
|
Logged
|
|
|
|
oahda
|
|
« Reply #7 on: May 05, 2015, 01:03:26 AM » |
|
i wish i was
|
|
|
Logged
|
|
|
|
vinheim3
|
|
« Reply #8 on: May 05, 2015, 05:14:13 AM » |
|
Yeah beer is awful. Spirits are where it's at
That being said, congrats. A* was one of my favourite algorithms years ago because something about pathfinding in different genres was nifty. Simple grid-based like the one you have is still immensely satisfying, it was moreso when I did it in an SRPG involving heights and unit's jump heights. See if you can do it in a platformer or even a flat 3D game, that would be even tighter
|
|
|
Logged
|
|
|
|
Hambone
Level 1
follow on the twitter @The_Hambone1988
|
|
« Reply #9 on: May 05, 2015, 12:51:34 PM » |
|
Here is a small update to what I have been working on... Hambone
|
|
|
Logged
|
Wannabe indie game developer
|
|
|
vinheim3
|
|
« Reply #10 on: May 05, 2015, 01:04:42 PM » |
|
Optimally, the rat should start by going up, and near the end it shouldn't be dipping into that 3-tile length of boxes
|
|
|
Logged
|
|
|
|
Hambone
Level 1
follow on the twitter @The_Hambone1988
|
|
« Reply #11 on: May 05, 2015, 01:33:28 PM » |
|
yeah, you are right, she's not perfect yet Hambone
|
|
|
Logged
|
Wannabe indie game developer
|
|
|
gimymblert
|
|
« Reply #12 on: May 05, 2015, 01:37:29 PM » |
|
There is corner bias no? Manhattan distance?
|
|
|
Logged
|
|
|
|
Hambone
Level 1
follow on the twitter @The_Hambone1988
|
|
« Reply #13 on: May 05, 2015, 02:12:46 PM » |
|
Yeah, I used manhatten, is this issue normal with manhatten?
Hambone
|
|
|
Logged
|
Wannabe indie game developer
|
|
|
lithander
|
|
« Reply #14 on: May 05, 2015, 02:29:31 PM » |
|
Nope, not normal. If it's not finding the optimal path there's a bug!
|
|
|
Logged
|
|
|
|
Hambone
Level 1
follow on the twitter @The_Hambone1988
|
|
« Reply #15 on: May 05, 2015, 02:44:25 PM » |
|
I don't like bugs, real or fake. Ill fix it.
Hambone
|
|
|
Logged
|
Wannabe indie game developer
|
|
|
RandyGaul
|
|
« Reply #16 on: May 05, 2015, 02:49:38 PM » |
|
But it is optimal! Mice IRL hug walls to help hide and avoid predators.
|
|
|
Logged
|
|
|
|
Hambone
Level 1
follow on the twitter @The_Hambone1988
|
|
« Reply #17 on: May 05, 2015, 02:52:47 PM » |
|
Oh never thought about that, maybe if I put that in my write-up my professor will grade me a little easier??? Hambone
|
|
|
Logged
|
Wannabe indie game developer
|
|
|
Hambone
Level 1
follow on the twitter @The_Hambone1988
|
|
« Reply #18 on: May 05, 2015, 03:17:03 PM » |
|
So it is still a little broke, but it looks cool right? BTW, that is me controlling the mouse, not the computer Hambone
|
|
|
Logged
|
Wannabe indie game developer
|
|
|
Sgt. Pepper
Level 1
|
|
« Reply #19 on: May 05, 2015, 03:19:53 PM » |
|
For my ' A* ' (I'm using that term very broadly here, maybe I should call it Z*), I just compare the current x and y and the target x and y and move the object accordingly.
|
|
|
Logged
|
|
|
|
|