- Home /
AI Have an Input Like The Player
Hello, I just make some AI script these week. I make AI for Airplane Deathmatch and TeamMatch game. Shortly, I make it and work perfectly (I think ), But when i see my AI movement, it`s look like "Too Clever" and The maneuver is bad, And Now I just think about
" How Can I Make the AI that have an Input Like a Player?"
I mean really Like a player. so The AI can Use Player script for itself.
is there any Tutorial or a Simple Script for learning?
Thanks
sorry for my Bad English ,,
Answer by TonyLi · Apr 25, 2013 at 01:41 PM
Many games use a "virtual controller" to control units. The unit reads motor commands (such as "pitch forward") from the virtual controller.
If the player is controlling the unit, then the player input component sets the virtual controller (e.g., gamepad forward button sets the virtual controller's "pitch forward" flag).
If an AI is controlling the unit, then the AI sets the virtual controller instead.
The unit itself doesn't care where the input is really coming from (AI or player). It just reads the virtual controller. This way, AI and player can both control the unit using the same virtual controller interface. As an added benefit, as the developer you can take control of any unit by providing input from the player input component instead of the AI component.
If you can get your hands on a copy of AI Game Programming Wisdom 4, which is unfortunately out of print, Brett Laming's "MARPO Methodology" article explains this in more detail and includes sample code.
yup,, i see. by the way, is there any AI tutorial again about my problem? Thanks
AIGameDev.com is probably the best place to start. They have a tutorial series at: http://aigamedev.com/open/tutorial/series-summary-library/
Your answer
Follow this Question
Related Questions
Simple AI Aircraft Script 2 Answers
Tilt aircraft based on accelerometer 0 Answers
Simple airplane AI 2 Answers
AI Controlled Airplane Banking 1 Answer
Realistic Aeroplane Controller.,Realistic Aeroplane flight 1 Answer