# blitz3d fps ai need help!

## Recommended Posts

zabo    101
so how do i create the standard fps enemy ai? i want it so that the enemies will shoot at the player be aware of their environments etc. how do i accomplish this in blitz3d? a sample code or a short explanation would help!

##### Share on other sites
namar777    488

Most common would be waypoints, which basically is a dummy node that serves....
this does a better job at explaining:
http://en.wikipedia.org/wiki/Waypoint

A better definition (game related):
http://www.rawcomputing.co.uk/waypoints.html

After you check this out... You can elaborate on precise topics and where you would want to head next!!

Good Luck,

##### Share on other sites
Hi zabo!
First of all, you should try to post questions about Blitz3D in the official BlitzBasic forum. You might get more help. ;)
In B3D, you code your ai like in *every* language.
In fact, a *simple* ai is nothing more than a couple of if-statements.
Like:
For ai.TAI = each TAIif ai.seeplayer = true and ai.range < maxrange thenai.shootplayer = trueendifnext

Or more complicated with a crate to duck&cover:
For ai.TAI = each TAIif ai.seecrate(crate1) = True and ai.candosomething = True thenai.cover(crate1)ai.candosomething = Falseend if

Understood? It's not so much difficult to code a simple ai.
Good luck for you!

##### Share on other sites
zabo    101
Thanks man ill check those out!(wow this site is really helpfull) (:

##### Share on other sites
zabo    101
Quote:
 Original post by FreakForFreedomHi zabo!First of all, you should try to post questions about Blitz3D in the official BlitzBasic forum. You might get more help. ;)In B3D, you code your ai like in *every* language.In fact, a *simple* ai is nothing more than a couple of if-statements.Like: For ai.TAI = each TAIif ai.seeplayer = true and ai.range < maxrange thenai.shootplayer = trueendifnextOr more complicated with a crate to duck&cover:For ai.TAI = each TAIif ai.seecrate(crate1) = True and ai.candosomething = True thenai.cover(crate1)ai.candosomething = Falseend ifUnderstood? It's not so much difficult to code a simple ai.For more understanding, simple ask our good friend google. ;)Good luck for you!

i havnt bought the full version yet so i cant

##### Share on other sites
zabo    101
Quote:
 Original post by FreakForFreedomHi zabo!First of all, you should try to post questions about Blitz3D in the official BlitzBasic forum. You might get more help. ;)In B3D, you code your ai like in *every* language.In fact, a *simple* ai is nothing more than a couple of if-statements.Like: For ai.TAI = each TAIif ai.seeplayer = true and ai.range < maxrange thenai.shootplayer = trueendifnextOr more complicated with a crate to duck&cover:For ai.TAI = each TAIif ai.seecrate(crate1) = True and ai.candosomething = True thenai.cover(crate1)ai.candosomething = Falseend ifUnderstood? It's not so much difficult to code a simple ai.For more understanding, simple ask our good friend google. ;)Good luck for you!

so how do we get the computer to understand how to "see the player" or understand how to "shoot the player"? also how do i set the range and accuracy values? (sorry my education in blitz 3d doesnt go beyond 3d game programming for teens!)

##### Share on other sites
namar777    488
That might be a little hard as you'll need some knowledge on vectors and matrix projections... aim low n then build forward....

##### Share on other sites
zabo    101
Quote:
 Original post by nassimamarThat might be a little hard as you'll need some knowledge on vectors and matrix projections... aim low n then build forward....

so ummmm were can i get info on those? any specific links?

##### Share on other sites
acddklr07    145
Hello,

Vectors and Matrices are usually covered in upper level high school math. I know I learned about matrices in honors algebra 2, and vectors in honors pre-calculus. I would advise you to go to your local library and look through their math section. You would look for any algebra books and see if they cover matrices and if not look in pre-calculus books, or calculus books. Also, you would look for any pre-calculus book or calculus books to see if they cover vectors. I would advise you to work out the problems in the book to make sure you understand. Luckily, vectors and matrices are very easy to pick up on. You might have to look into some physics stuff for vectors too, but I am not sure about that. After you learn it you could possibly look up articles on that stuff related to game programming by searching google.

~Carl J. Loucius

##### Share on other sites
namar777    488
N' If you find that the math is too dry for now, concentrate on blitz3d, as you'll learn many many things that go beyond a 3d engine (ie: state machines, game structure, game mechanics, etc.) then from the top, you can start digging to the abysses of what a game engine is all about.... Again, that is after you do ur library digging.... make that choice....

Good Luck!!

##### Share on other sites
zabo    101
Oh..... THAT sounds fun..... i guess....... :<

##### Share on other sites
zabo    101
Quote:
 Original post by acddklr07Hello,Vectors and Matrices are usually covered in upper level high school math. I know I learned about matrices in honors algebra 2, and vectors in honors pre-calculus. I would advise you to go to your local library and look through their math section. You would look for any algebra books and see if they cover matrices and if not look in pre-calculus books, or calculus books. Also, you would look for any pre-calculus book or calculus books to see if they cover vectors. I would advise you to work out the problems in the book to make sure you understand. Luckily, vectors and matrices are very easy to pick up on. You might have to look into some physics stuff for vectors too, but I am not sure about that. After you learn it you could possibly look up articles on that stuff related to game programming by searching google. ~Carl J. Loucius

i read about vectors (they were also mentioned in my geometry class) and next semester (my swmester ends in a week and a half) im taking algebra2 YAY! but is that stuff only covered in HONOR algebra2 class? if so then ill pick up them books i dont mind im a big nerd anyways!(though im not yet a smart one.....:< )

##### Share on other sites
acddklr07    145
Hello,

I am not particularly sure if it is covered in your algebra 2 class, and I think you misunderstood my statement. I said I learned matrices in my honors algebra 2 class, while I learned vectors in honors pre-calculus. Also, I am not sure if you will cover matrices in your algebra 2 class. It all depends on how your school set up the class. Also, I know I forgotten to mention it in my last post but learning both of those subjects is easy.

~Carl J. Loucius