need help with designing ai movement
hi, its my first post on the forums, so hi everyone. i am making a game in which the ai actor dodges you shots and throws shots at you. the problem is, my ai actor is either perfect or too dumb. here's how i decide how to move the ai: it starts moving in a random direction at the start of the game, then it moves tangentially away from the shot that you throw at the ai. this makes the ai just perfect, you just cant hit him, he dodges all your shots. how can i add some random random stupidity to the ai movement? please help!
Comments
In your Rules, use a random number between 1 and 100 and insert it in your Enemy Actor's logic.
For example:
If bullet is traveling towards the Enemy Actor AND Game.AI < random(1,100), move away.
Looking at the above example, if you set the value of AI to 80, then he has an 80% percent chance of doing the right thing
Or if you're just using an angle, change it to angle + random(-1*(100-Game.AI),100-Game.AI).
So, if the perfect angle to move away from an incoming bullet is 90 degrees and his AI is set to 80, the calculated angle will be 90+random(-20,20) or anywhere between 70 to 110.
Does that make sense?