   Programming the Dogfighting parts of a FlightSim...
  Well, okay, I'm not 100% sure if this is AI, or if this is math and physics, but here goes...So the player is easy to deal with, give him an acceleration, give him keyboard functionality, and poof, he can be an ace combat pilot, give him a few restraining variables, so he can't go too fast, cant turn too quickly, etc etc....But now, we have computer opponents, who require all of the above, and more, but without the help of the complex brain of the human mind.  Where would I begin to start programming pathfinding algorithms for a CPU fighter pilot who's ultimate goal in flight is to get the enemy in his sights, and finally, blow him out of the sky....These aren't kiddy 3d algorithms we're talking about, these are algorithms that, sure, theyre 3d just like every other game, (an FPS for instance), but the Z value plays an enourmously greater roll, so it needs to be in EVERY calculation, in an FPS you can check if your goal is perpendicular on the Z axis and perform a relatively 2d algorithm to get there.But in a flight sim, the Z's are 99% NEVER the same with two objects... We aren't going to worry about gravity, or atmosphere, since it will be based in space, but seriously, how is this gonna work?  All I am asking for is possibly a few articles for flight sim algorithms and theory, and maybe a tiny bit of sample code, thanks in advance.   
  As far as AI goes, I think a dog fighting AI would be a lot simpler than an FPS one. An FPS AI has all sorts of pathfinding and collision detection problems, dogfighting is largely going to occur in a large empty space. Really, all you basically need is to be able to rotate the ship towards the target within the limits of the flight model (not stalling etc).   ;  The reason I feel it would be much much more difficult to program than an FPS pathfinder would be this:No matter what, your object has to travel in an arc *within its flight capabilities*Quadratics anyone?   ;  Well, that could be done with simple vector math. You have the targets position, and yours, take a vector and turn as far as allowable in that direction. Think about how you do it if you are at the joystick.   ;  Sounds simple enough, but... to add real difficulty to the game...  In real life, a pilot who simply steers to aim at the target, is toast...There are techniques and such that you must figure out as a pilot, and you would have to program in which technique would be the most useful...  Only reason I know this is because I played a couple good flightsims in my day and there was one which actually taught you, that the direct route to your target is not always the best one....If I want relatively stupid AI I could program just a simple, turntoaimat function...............Or maybe I'm just being bullheaded and not accepting an easy answer to my problem?  Thinking it should be more complicated than it is?   ;  Well, if it were me I would start out by writing a simple ai that just followed the target mindlessly, and then try that out from the point of view of the player. It might be stupid, but its possible it looks fine from the players perspective. If its not ok, start adding variables to tweak the behaviour, distance to break off before you get too close for example. Build it up in small pieces.   ;  Sounds good :d   ;  Please check this demo: http://www.dreambuildersstudios.com/download/demo.exe The AI is a turntoaim kind with some tweaks. PM me if that is what you're looking or and I'll help you as much as I can. Of course I have lots of improvments to do in the future and we might talk about that too.;Quote:Original post by ShaminoIn real life, a pilot who simply steers to aim at the target, is toast...This is true mostly because of the effects of gravity.  The pilot must be aware of his energy state (speed and altitude) vs his enemy.  If you are flying around in space the best option would probably be to slam on the brakes (to reduce turning radius) and just yank the stick back (assuming you are within weapons range.  Otherwise it is better to attempt to plot an intercept course).  This of course tends of degenerate into a fight where the two ships park and spin around.  (it happens in Freespace with some shivan AI ships).  ;  It's not a smart move to reduce speed if you're fighting in enemy turrets firing range :)