Jump to content

Very basic AI

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
Arterie

Arterie

    Newbie

  • Members
  • Pip
  • 2 posts
Ok as the title says i want to create a very basic ai. It should find its way in a 2D map. The map is stored in a textfile like this

111111111
1A0000001
100110101
100110101
1000000B1
111111111

1 represents a wall and 0 is walkable space...and i want my bot to find the fastest way from point a to b. It would be nice if you could push me in a good direction.

#2
Andrew.G

Andrew.G

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 395 posts
Posted via CodeCall Mobile i really have no idea, but im pretty sure you should have some way to make your bot aware of whats around him.

#3
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
We've got a solution to this exact problem on this forum from about 6 months ago... My recommendation was that you start at a and label it's distance 0. Then go to each adjacent 0 and mark their distance as 1. Then each adjacent to those as 2, then 3, then ...
When you hit B, you know the distance.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#4
Arterie

Arterie

    Newbie

  • Members
  • Pip
  • 2 posts
Ok thanks i searched for the wrong term. i found the thread. ill read it and maybe post some questions if i still have some. Thanks for your help!