help with AI

BlitzMax Forums/BlitzMax Beginners Area/help with AI

Jesse(Posted 2006) [#1]
I started to create a tank game with tile maps, but I am at a dead end as to how to get the tanks AI to chase a specific tank. The tanks have to travel up to many times the distances greater then the screen width, with only a basic random tile wall(s). The tiles are 32x32 and the tank is 32 by 32 and moves from 0.0 pixels to 2.0 max speed in pixels, in increments of 0.2, each wall is a block and ocupies a tile size. the tank rotates in degrees in any direction. I have figured everything out except the computer AI for the tanks. does any body have any sample code I could used to figure this thing out or can someone direct me to where I could find relevant information. I have never used anything other than random numbers for AI. Any help would be greatly appreciated. Thanks in Advance.


FlameDuck(Posted 2006) [#2]
You would need some sort of path finding algorithm. Depending on how often stuff in your graph changes you could precalculate all possible routes (using a Shortest Path Tree algorithm) up front and just use that.


Andres(Posted 2006) [#3]
Don't know how much of help of it will be, but Battle Empire has BOTs too.

Heres the full source of the game:
http://battleempire.kylm.com/files/be108.exe

Hopefully you'll understand whats written in there under ai.bb
It's tilebased too so it should be relatively easy to understand though it's written in Blitz+ not Max.


Jesse(Posted 2006) [#4]
thanks Andres I'll check it out.