Reward a sneak attack from behind, and limit it on bosses
Stabbing an unaware guard in the back should be a huge hit, but how do you decide what counts as behind? Angles go wrong when the attacker stands on the same spot, and a bonus that works on a boss ends the fight in one blow. This entry gives a sturdy test and the limits.
Why this works
Being unaware and being turned away are different facts, so they deserve different rewards. A direction test works from where things point, not from angles, so it has no seam at the turn-around. A cap on bosses keeps a surprise an opener, not a win.
When not to use it
Skip it when enemies see all around or when stealth is not part of your game. A hidden bonus then rewards luck, so teach stealth openly first, or make the bonus a skill the player chooses to build.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- 32 lines of example code with 4 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Reward a sneak attack from behind, and limit it on bosses" (read_entry sneak-attack-bonus-from-behind) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP