Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Travis Gatlin
17
Years of Service
User Offline
Joined: 14th May 2009
Location: Oxford, Alabama
Posted: 11th Mar 2011 01:52
Hi, i know i already posted an AI Thread before, but this time i have one for a purpose
You see, i've never been good with AI, at all, could you give me some advice on designing AI for a Jet Fighter that maneuvers, shoots small artillery and shoots missles in a jet fighter style.

My Current Project: Unbenounced to you, Puny Human!
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 11th Mar 2011 09:26
You need an autopilot

You can't use standard AI principles for aircraft AI, because most of the rules don't apply to it. I would suggest getting the aircraft controllable, so it might be controlled by straightforward inputs, like desired speed, pitch and yaw. Then with that, make the aircraft adjust to suit a heading, velocity and flying height - by adjusting pitch and yaw etc. That would be a good start to having the aircraft follow waypoints. While adjusting things to suit the desired heading, check the ground heights in front of the aircraft, maybe scan a forward location depending on the aircraft velocity - so if the aircraft is moving faster, scan the ground further away. Ideally you would be able to detect when the aircraft is heading towards a mountain, and have it adjust it's pitch or use an inbetween waypoint to avoid it.

Then once that is working, you can add a radar, so that targets can be identified - like scan through all the target objects and check their distance from the aircraft. Once a target is identified, go into dogfight mode, like head towards a constantly moving target location, behind the enemy aircraft, or above a ground target. When the target is in firing range, have the AI aim towards the location in front of the enemy depending on the enemy speed and bullet speed - if the enemy is static, then the target would be the enemy itself, otherwise have it work out the expected position and aim towards that.

Heat seeking missiles might use a very similar system, once the autopilot is in place it could be used for missiles too - just forgoe the height checks.

Health, Ammo, and bacon and eggs!
Travis Gatlin
17
Years of Service
User Offline
Joined: 14th May 2009
Location: Oxford, Alabama
Posted: 11th Mar 2011 23:38
So your saying that, say a line goes out in front of the aircraft and if there is mountain in front of it then it pitches up and straightens back out when it clears the mountain, then another line in front of it to detect it's enemy then enter fight mode.

My Current Project: Unbenounced to you, Puny Human!
Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 12th Mar 2011 10:17
Raycasting for enemy detection is for rather FPS characters. A simple distance check would be fine.

Some prime goals what i would go for:
- There is a certain distance within the enemy jet detects me and a closer distance when starts attacking
- It can be "awakened" by a missile sent to it, or a distant lucky shot by machine gun
- Could use different strategies. Sometimes try to shoot me down, sometimes sent not even one rocket (the rocket doesn't need an AI, that would make it too strong and impossible to dodge, a simple pitch up&down system is fine, like in most real rockets), sometimes goes far away so it can come back with twice as fast doing a complex attack
- Begin a rather escaping mode once its health is low

Overall it seems a rather easy task, but if you look into it, becomes a complex interesting stuff.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 12th Mar 2011 15:19
Yeah, remember that your enemies have radar, so when you get within a certain distance, have it decide whether to attack it. I think getting the things flying to waypoints is key, once they can do that everything else will be much more straightforward.

For detecting where to shoot though, it makes sense to just check the distance, and angle differences then adjust to suit that. So if the X angle difference between the enemy and you is below zero, the enemy should pitch up a little. If the angle difference on Y is only small, then use the rudders to turn a little, or if it's a lot, roll left or right and go into a proper turn.

Health, Ammo, and bacon and eggs!
Travis Gatlin
17
Years of Service
User Offline
Joined: 14th May 2009
Location: Oxford, Alabama
Posted: 13th Mar 2011 18:40
Thanks for the answers, sorry for the late reply, my internet was acting up yesterday.
But how would i check the distance? could i just use pick object from the enemy's location?

My Current Project: Unbenounced to you, Puny Human!

Login to post a reply

Server time is: 2026-07-17 13:59:13
Your offset time is: 2026-07-17 13:59:13