- Home /
Simple AI Aircraft Script
Hei guys, i want to make an AI Airplane for my game. But, i dont know how to made it. Can anyone give a simple AI Airplane script. Just simple AI...
@Fatty Sure there is. Constantly turn towards the player and accelerate forwards. Shoot every n seconds.
cbf writing it right now though, sorry.
thank for comment. Actually, i can make an AI to follow me toward. But my problem is how can i make the AI to move like me. For Example if my Aircraft passed an AI, my AI can make a path itself to "attack" me. In this case my AI must made rotation and position to "look and attack" me. but how can i do it???
an incredible simple approach to get you going is just keep using "LookAt".
you should be aware that AI such as you describe ("simple") often has 1000s of lines of code.
hope it helps.
@griffo dude you're totally NOT stupid in any way. you're a smart guy.
i think one of the funniest question ever on here was - literally - I mean literally - headline "Need help urgent - need script" text -- "So I want to make it that the computer can talk back to me in conversation, it's ok if only English. does anyone have the script"
I mean fuck.
Another really hot item at the moment is dynamic mesh building. You get questions like "Need to dynamically create dragon of any shape when user presses button, prefer javascript, can you give me script. it must fly too. also need to change colors"
it's completelly SOP on here that people don't realise how incredibly difficult things are.
the other day someone wanted RT $$anonymous$$P racing (!) sorted out in a few lines of code. "gee this seems hard"
Answer by Dragonlance · Oct 06, 2012 at 02:40 PM
In the sky, the path is everywhere (only limited by the ground ...). So as fattie said, this is basically just LookAt.
Maybe what you want is kinematic behavior, acting to the rules of middle school physics (an airplane will not rotate in a blink of an eye, it has to fly a curve etc.). Google for that stuff.
This link could be helpful http://www.red3d.com/cwr/steer/gdc99/
The AI could be as simple as the desicion where to fly (directly to the player, wabpoint 1-2-3-4 or something).
Harder it gets as soon as you want to have real dynamic flight physics or an AI that makes tactical descisions depending on the enemys and friends movements and situation.
But most likely you will not need complex things. Simple things can look brilliant and be fun, or they even can be a special challange(just look at the WoW bosses and enemys, everything scripted with some randomness and some thresholds for dmg and aggro, no intelligence).
Good luck and have fun!
Answer by rhys_vdw · Oct 06, 2012 at 02:39 PM
Pathfinding is for calculating efficient routes through terrain. Since aircraft move around in the air, it is not going to be hugely useful (except for maybe plotting paths around mountains).
What you need to do is define a set of conditions that your AI should recognize, and a set of behaviors that you want your craft to display. Work out how to recognize these conditions, and then execute code that makes it behave in the manner appropriate.
Unfortunately your question is too vague to be answered on this forum, you'll have to do a bit of research. I recommend starting with finite state machines. FSMs are a useful model that can be used for AI and many other game mechanics.
Your answer
Follow this Question
Related Questions
AI Have an Input Like The Player 1 Answer
bot AI half working 0 Answers
Aircraft controller script 2 Answers
AI Aircraft/Spacecraft yaw and pitch help 1 Answer
make an AI Flee 0 Answers