Example here, super accurate until 5 meters, then worsening until like 20 meters and then being more accurate until like 30m
Can even make it stepped, so there's noticeable enemy accurary jumps so it's super accurate until 10 meters, slightly inaccurate from 10-15m and then a big drop in accuracy at 15 before slowly getting worse
Have made it so that I can control enemies shooting accuracy with an animation curve, where I define a miss-radius for a given distance and can make them inaccurate in a non-linear fashion :)
#indiegame #gamedev #enemy #ai #solodev