PDA

View Full Version : This is my first home grown AI.



Johnny64
February 11th, 2005, 11:33 AM
<o:p></o:p>Hey,<o:p>
</o:p>Cyberathlete gave me the idea for this AI here (http://www.kirupa.com/forum/showthread.php?t=84717). It’s the same concept but I made it smarter.<o:p></o:p>
It’s a path finding AI for a perfect maze.
width=310 height=330
Run: is to run the car throw the maze, Clear: is to clear the map, Edit: is to edit the map (see if you can make the car get lost).
<o:p></o:p>
The Al can get lost if:<o:p></o:p>
1) there are open areas, as in 4 open blocks together. <o:p></o:p>
2) the AI can walk a circles. So it has to be a perfect maze.
I could fix those two point but then it would be a full path finding AI and it would use more cpu power :P.

Here is the fla (http://master64.nl/stuff/Maze_AI_0.9.fla) file
<o:p></o:p>

JoMan
February 11th, 2005, 11:46 AM
VERY creative Johny :thumb:!

OFF TOPIC: I have been seeing these footers that say: 'Get well soon Dave', and out of curiosity, who is Dave?

peace

Voetsjoeba
February 11th, 2005, 03:30 PM
Nice job Johnny ! :thumb:

RyxiaN
February 14th, 2005, 05:21 AM
Very Good Job! I wanna learn that!

Johnny64
February 14th, 2005, 07:34 AM
VERY creative Johny :thumb:!

OFF TOPIC: I have been seeing these footers that say: 'Get well soon Dave', and out of curiosity, who is Dave?

peace

Thanks all =)

the AI in all in one function findPath(m, sx, sy, ex, ey)
where m is a 2d array of the maze
where 0 is not walkable and any thing thats higher is walkable.
sx, sy it the start posistion of the bot
ex, ey is where the bot shoud try to go.
:D

offtopic:
dave is a mod that left because he has problems with his life, search the random forums there's a long thread about it :)

SeiferTim
February 14th, 2005, 11:57 AM
I got the car lost.
I put 8 squares around the entrance, 8 around the exit, and drew a z shape between them:


------|
|
|
|
|------

It just drove in circles.

Johnny64
February 15th, 2005, 02:08 AM
I got the car lost.
I put 8 squares around the entrance, 8 around the exit, and drew a z shape between them:


------|
|
|
|
|------

It just drove in circles.
You broke one of the two rules ;)
The AI doesn't like open areas, the start and finish lines are seen as open blocks too.<o:p></o:p>

I could make it smarter but then I would have a pathfinding algorithm like A*, which is more of a cpu hang :P <o:p></o:p>

icio
February 15th, 2005, 07:04 AM
cool. that's really hot **** :thumb:

nih
February 19th, 2005, 06:53 PM
Wicked :D

I added a new path that would have been quicker for the car to take - yet it went the long way. Specifically instead of taking a short U-turn, it took an identical one a little bit further down. Far from being a problem, that's quite interesting. The biggest problem with AI is predictability (right after running into walls that is) - anything less predictable is good in my books. ;)