how can i make advanced ai regarding enemy character see the player he shout then find a cover to be hiden then shoot the player from behind the cover please help me
1 Answer
1This is a complicated question... there's no short answer to it really. To accomplish something like this... first you'll need to populate your world with "information points" that will denote which areas are suitable for cover, or other such actions.
After this the rest will really depend on how you build your AI. If you want enemies to call for help when they see the player... you'll have to define this behaviour and broadcast a message to all enemies within a certain radius that "Player is spotted" etc.
I'd first start simple.. and build your AI up to a point where you can start accomplishing more complex things.
1) Get your AI to be able to track the player and flee from the player. 2) Get your AI to interact with the environment... either through advanced AI calculations of world geometry, or by hand-placed "information points"..it's really up to you how you set this up. 3) Next you can try to implement behaviours such as "calling for help" by putting all nearby enemies into "aggressive" mode or something to this effect.
You'll likely want to look into some AI architectures such as Finite State Machines, or Behaviour Trees etc.
Good luck! It's not going to be easy, but AI programming can be very fun.
Ditto. Personally I won't go with the information points, I would calculate nearby objects based on line-of-sight, height, and width (and maybe material).
– anon33906366I'd be inclined to agree with you, but if he has several complex actions, it might be easier for them to use a handcrafted node-based system. Depends what they want to do I suppose though.
– DavidB