I've found AI's blocking implementation by N-GRAM.
I thought about it from a martial arts perspective. Whether I’d block or evade a kick or punch thrown at me would depend on a lot of factors.
The biggest would be space. If I’m in the middle of the ring, I’ll probably just sidestep, but if I’m on a corner, I’ll block and force my way out.
Another would be what the opponent is doing exactly and what kind of strike is coming towards me. A block is rarely a solo motion, it usually carries over into a counterattack, which tends to make it more of an offensive thing. I probably use twice as many blocks when I’m chasing someone than if I’m standing ground because of this.
So you can control how much the AI is perceived as aggressive by increasing its odds of blocking. A block-heavy enemy pushes the player around and a run-heavy enemy will give the player a power fantasy moment. So make both and put them in different situations.
Doom Eternal has a good example of both. The Marauder and Archvile are both defensive powerhouses. The archvile will put up a shield and not let you hit him from a distance, but if you get close, hell teleport away, making for an intense cat and mouse style chase where he waits for you to make a mistake. The marauder is the opposite, always standing his ground and blocking. He forces the player around and makes you block and counter you have to make him make the mistake and block and counter him.
Hi everyone,
I would like to come back to the original question of:
I also wonder how to adjust AI's dodge or block skillfulness. What is general method for this in common game?
I am working on a sword combat and I can always code an enemy that blocks/counters every attack that player makes
=> basically give the AI an instantaneous and a super precise reaction to every attack that players makes.
Are there any good designs to balance skillfulness of AI in this area of blocking/countering player attacks?
In most games when you fight with an enemy you eventually land a hit => enemy makes a mistake.
Implementing simple system like: 80% of attacks will be blocked seems too simple.
Does anyone have experience with making AI for sword combat and can share their approach to this problem?
PS. I am not looking for code or a technical solution → but a general design.