AI and path finding challenges
Moderator: Coders of Rage
- M_D_K
- Chaos Rift Demigod
- Posts: 1087
- Joined: Tue Oct 28, 2008 10:33 am
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C/++
- Location: UK
AI and path finding challenges
This is a "testing the water" type deal. I have a few challenge ideas relating to well see title.
And no point in posting them if no one will do them(or even try) so quick show of hands who would be interested.
And no point in posting them if no one will do them(or even try) so quick show of hands who would be interested.
Gyro Sheen wrote:you pour their inventory onto my life
IRC wrote: <sparda> The routine had a stack overflow, sorry.
<sparda> Apparently the stack was full of shit.
- MarauderIIC
- Respected Programmer
- Posts: 3406
- Joined: Sat Jul 10, 2004 3:05 pm
- Location: Maryland, USA
Re: AI and path finding challenges
interested dunno if i'll do them
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
- Spikey
- Chaos Rift Cool Newbie
- Posts: 98
- Joined: Sat Dec 13, 2008 6:39 am
- Programming Language of Choice: C++
- Location: Ottawa, Canada
- Contact:
Re: AI and path finding challenges
I actually have an assignment thats due next week about the A* algorithm. I've never done this before, so I'm up for the challange...
Re: AI and path finding challenges
So when is this coming?
(thats what she said.)
(thats what she said.)
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
Dad, "Yea well I have a fan belt in street fighting"
- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Re: AI and path finding challenges
Personally I'm not a very competitive programmer, but I'm very interested to see solutions to common AI problems.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
Re: AI and path finding challenges
I do loves me the AI and UI elements of a game
- Spikey
- Chaos Rift Cool Newbie
- Posts: 98
- Joined: Sat Dec 13, 2008 6:39 am
- Programming Language of Choice: C++
- Location: Ottawa, Canada
- Contact:
Re: AI and path finding challenges
Working on my homework, actually due later today...
Turns out I wasn't supposed to use A* algorithm, but rather a linked list routine.
In my project, I have a class called MazeNode, which represents 1 spot on a map/maze. My nodes have pointers to 4 other nodes, 1 for each direction (North, East, etc). Each node can point from 1 to 4 more nodes, which those can also point to more.
Once a map/maze is constructed, we start at the first node aka Start node. From here we check each direction to see if there is node linked, if there is a node in a direction, we check to see if we have visited there, if not then go to that node. If node has visited all of its directions or has no nodes to advance to, then we go back to previous node. Keep this up until we find our goal node aka End node.
Did I make no sense? Check out the readme.txt and source to see step by step comments and notes:
http://subversion.assembla.com/svn/schi0102/
Goto trunk for latest source, goto branch for binary ( .exe )
Right now, (Apr 9, `09 - 4AM) Everything works except for RandomMaze.h, I still need to make a routine to generate a random maze... But pathfinding code is all good as far as I can see.
...I can has cheezburger?
Turns out I wasn't supposed to use A* algorithm, but rather a linked list routine.
In my project, I have a class called MazeNode, which represents 1 spot on a map/maze. My nodes have pointers to 4 other nodes, 1 for each direction (North, East, etc). Each node can point from 1 to 4 more nodes, which those can also point to more.
Once a map/maze is constructed, we start at the first node aka Start node. From here we check each direction to see if there is node linked, if there is a node in a direction, we check to see if we have visited there, if not then go to that node. If node has visited all of its directions or has no nodes to advance to, then we go back to previous node. Keep this up until we find our goal node aka End node.
Did I make no sense? Check out the readme.txt and source to see step by step comments and notes:
http://subversion.assembla.com/svn/schi0102/
Goto trunk for latest source, goto branch for binary ( .exe )
Right now, (Apr 9, `09 - 4AM) Everything works except for RandomMaze.h, I still need to make a routine to generate a random maze... But pathfinding code is all good as far as I can see.
...I can has cheezburger?
Re: AI and path finding challenges
Nice design, Spikey, but do you realy stop once you reach the goal for the first time? cause that will find a path to the distanation, but that path could be going around the entire map.
for example you want to go from A to B on that map
*****************
*****************
***A************
***B*************
*****************
your salution (if i understand it correctly) may come back with the following path:
v<<<<<<<<<<<
>>>>>>>>>>v^
***A<<<<<<<<^
***B>>>>>>>>^
*****************
Or am i missing something?
for example you want to go from A to B on that map
*****************
*****************
***A************
***B*************
*****************
your salution (if i understand it correctly) may come back with the following path:
v<<<<<<<<<<<
>>>>>>>>>>v^
***A<<<<<<<<^
***B>>>>>>>>^
*****************
Or am i missing something?
- Spikey
- Chaos Rift Cool Newbie
- Posts: 98
- Joined: Sat Dec 13, 2008 6:39 am
- Programming Language of Choice: C++
- Location: Ottawa, Canada
- Contact:
Re: AI and path finding challenges
Your right, this version does not stop when it finds the goal. Thats a easy fix, from the solvemaze function, 'return' after finding the goal. It was intentionally left off, because I wanted to see what would happen if the path never found a goal. It could also be useful for finding multiple goals or future optimization for shortest route.
I don't think the path will ever loop, each passed node is pushed onto a stack and each node is marked whether the path has been there already or not.
I'm not sure what you're trying to say with your diagrams... If you havent already, check out the exe, solving the test map with details showing, this will output every push, pop, check, detail, etc while solving. Hopefully that helps.
I don't think the path will ever loop, each passed node is pushed onto a stack and each node is marked whether the path has been there already or not.
I'm not sure what you're trying to say with your diagrams... If you havent already, check out the exe, solving the test map with details showing, this will output every push, pop, check, detail, etc while solving. Hopefully that helps.
- MarauderIIC
- Respected Programmer
- Posts: 3406
- Joined: Sat Jul 10, 2004 3:05 pm
- Location: Maryland, USA
Re: AI and path finding challenges
A* should always return most efficient path, iirc, as long as your heuristics are right.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
Re: AI and path finding challenges
that's what i was saying:
Instead of going strait up, which is what A* should return if i remember correctly.
Instead of going strait up, which is what A* should return if i remember correctly.
- Spikey
- Chaos Rift Cool Newbie
- Posts: 98
- Joined: Sat Dec 13, 2008 6:39 am
- Programming Language of Choice: C++
- Location: Ottawa, Canada
- Contact:
Re: AI and path finding challenges
Ok, understood. Ya I wasn't really going for effeciency here, just glad I was able to get from point a to b. This assignment is done, I've handed it in as is, I was working on a random map generator and it seems to work most of the time....
-
- Chaos Rift Junior
- Posts: 209
- Joined: Thu Feb 12, 2009 8:46 pm
Re: AI and path finding challenges
Not always, according to the article that lies behind this magical text. It also states what constitutes a path finding method as A*, not that you asked.kostiak2 wrote:that's what i was saying:
Instead of going strait up, which is what A* should return if i remember correctly.
Since the assignment is finished and already handed in, this is my solution (Not that many of you care, I'm sure):
Click here to see the hidden message (It might contain spoilers)
- M_D_K
- Chaos Rift Demigod
- Posts: 1087
- Joined: Tue Oct 28, 2008 10:33 am
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C/++
- Location: UK
Re: AI and path finding challenges
lolz no official challenges have been posted by me. This thread was just to see if people would be interested. Thats why there is a poll.
BTW who the fuck said voted "WTF is AI"
BTW who the fuck said voted "WTF is AI"
Gyro Sheen wrote:you pour their inventory onto my life
IRC wrote: <sparda> The routine had a stack overflow, sorry.
<sparda> Apparently the stack was full of shit.
- MarauderIIC
- Respected Programmer
- Posts: 3406
- Joined: Sat Jul 10, 2004 3:05 pm
- Location: Maryland, USA
Re: AI and path finding challenges
Oh, there's a poll.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.