I've been thinking about buiding a 2d dogfight style game using cocos2d with chipmunk.
Does anyone know of any AI algorithm for controlling the CPU planes? Thanks.
Dogfight AI
(6 posts) (4 voices)-
Posted 2 years ago #
-
Interesting. You could try to create a heuristic function (a function that evaluates how 'good' a game state for a the CPU player is). With this function you can determine the best move every frame or second or whatever. A less complex solution would be to make the CPU plane always fly behind the players plane and shoot when in aim.
Posted 2 years ago # -
@vutronic. Some discussion here: http://www.cocos2d-iphone.org/forum/topic/267
You could split the are into nodes - or maybe make the decision velocity based and not node based.Posted 2 years ago # -
Thanks for the info!
Posted 2 years ago # -
I'm going to build a custom vector 2d class so I can easily manage the velocity of each object and create different steering behaviors for each cpu plane.
Posted 2 years ago # -
Check out the CGPointExtension.* files in the Support folder - it probably has the math functions you need. It (unfortunately) doesnt distinguish between points and vectors, so even though everything is defined as a point, its also a vector library.
Posted 2 years ago #
Reply
You must log in to post.