forums

TNT Basic Forums > Programming Q&A
AI in space game
< Last Thread     Next Thread >
Author
Thread        Post A Reply

01-22-2004 00:36

Posted by:
EvolPenguin

Location:
Chicago

Click Here to Email EvolPenguin   Find more posts by EvolPenguin

I have a problem. How would i create artificial intelligence for a space ship to fly around and shoot at the player without being extremely stupid and just charging at him? I have no idea. Maybe the problem is my limited knowledge of AI but any ideas?

Alex

01-22-2004 05:07

Posted by:
eekaydee

Location:
CA, USA

Click Here to Email eekaydee   Find more posts by eekaydee

I've never really implemented any AI myself, but from what I figure it's just a bunch of if statements that determine what to do right? The enemy would have to try to dodge attacks, back off when you move toward it, pursue if you run, watch out for obstacles and maybe use them for cover. Dodging should be easy; just make sure you have access to the direction, position, and velocity of projectiles and move to the side of them. Backing off and pursuing should be even easier, just see what direction the player is moving in and copy it. Avoiding obstacles might be a little harder, you have to access the coordinates of each obstacle. Once you have that, it shouldn't be too hard to get the enemy to put the obstacle between it and the player.

02-04-2004 18:06

Posted by:
Dr. light

Location:
USA

Click Here to Email Dr. light   Find more posts by Dr. light

Get a point a certain distance behind the player, have him move towards that. Couple that with a way to stay out the the forward firing arc of the player, and you've got yourself a simple and effective AI.

02-05-2004 09:57

Posted by:
matteo

Location:
Venice, ITALY!

Click Here to Email matteo   Find more posts by matteo

yeah, that you'll never beat ;p

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.