Jump to content

How AI vision could be improved


Psycho8Vegemite
 Share

Recommended Posts

This is a suggestion to the programmers mainly:

I've been programming for roughly 10 years now and have written code for a couple games with also countless of personal projects, some with well developed AI. On top of this, I absolutely love Escape From Tarkov, but, I hate seeing posts of how AI is so unnatural and with having seen it myself I want to suggest some things that could improve the AI to those programming them. So here is my opinion on how they could be improved:

First off the AI even when you're in pretty good concealment, will almost instantly recognise you most of the time. A way that I solved this when I was programming AI was to on top of ray tracing to every limb, sphere cast to the limb as well with multiple sizes that determine how well the AI can see the limbs. As an example:
The detection value (0-1 let's say) would plus 0.1f * limbValue every second for each limb that a successful 1m diameter sphere cast is made, however, if it failed then half the sphere casts diameter and detection value per limb and try recast. Do this over and over again with a max of 4 loops per limb and then multiply the value that would be added with the offset to the AI's direction of look with ' Mathf.Clamp01(Vector3.Dot( eyeDirection , ( limbPosition - eyePosition ).normalized)) '. This will make the AI less terminator like as it would have to look at the limb longer to recognise it if it is behind moderate cover but recognise it almost instantly when it is all in the open.
Along with this, the detection value would make the behaviour change as well, after 0.2f the AI may go to focus on what it 'saw' leading the eyeDirection to look at the limb making the detection a lot faster and visually cueing the players that the AI may be onto them.

Secondly with this, I've come to notice that AI doesn't really care much about their own lives. To improve on this I suggest that AI should have a sort of 'scared' meter (let's say 0-1 again). This meter would have a minimum value based on the pain and damage to their bodies given. So say they have reached 20% of max pain and their bodies are 30% damaged, their scare amount would have a min value of half of each added together (20/2 + 30/2 = 25%). On top of this, each bullet that hits will spike the value by 0.3f or near miss will spike the value by 0.1f, this would then be deducted by 0.05f every second. Now what this value would determine is the AI's fight or flight reflexes which would be randomised per AI (taking into consideration of their gear as well so if they have an AK-74 they will be more likely to fight). Now if the scare value surpasses the fightFlight value, the AI will run for their lives and leading up to it they would have increasingly worse accuracy so that if you shoot them off guard, they will 'poo themselves' and won't be able to shoot that well only suppressing pretty much.

 

I'm not too sure if this would be helpful to the devs or not considering the language barrier and their current code that might hinder this as well, but I thought I'd leave my some what experienced knowledge here which could help the programming of the AI.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...