
Explanation of Surprise Attacks
The important part, that is not immediately intuitive, is the result of monster vision being checked at the beginning of their turn.
Thus, from animations only, it might seem that if the enemy is “hot on your heels” and there is no gap between you, then passing a door wouldn’t help you (since the enemy *seems* to move at the same time as you and the door never visually closes). However, in reality the monster moves *after* you, so the whole process looks like this (starting with you standing in the door, and enemy next to you):
You move from the door -> door closes -> enemy turn starts, it doesn’t see you, it tries to move to your last know position (onto the door) -> the enemy moves onto the door, opening it -> since you just “came into view” for the monster, you can now surprise attack it.
This works for one hit, and then you can for example walk towards the next door and repeat, without needing a gap between you and the enemy. (assuming the enemy isn’t faster than you).
Same applies to what the Distrattos said with the pillars/grass. When walking around one, it *seems* as if the monster is moving at the same time and you aren’t breaking LoS, but you actually are, allowing you potentially a surprise attack every second turn (walk -> hit -> walk -> hit -> etc.) when walking around a pillar or single patch of grass.
As far as the sleeping part, my understanding is that if a monster is sleeping then it is a surprise attack, and also it is a surprise attack in the first turn when they wake up (so with ranged weapons you should be able to do two most of the time). As far as sneaking up to a sleeping monster for melee attack, this is mostly luck (though levitating is stealthier I think, plus there is a ring for stealth) but the rogue has a talent that makes it easier.
But I would treat sleeping surprise attacks as a bonus (unless you have a highly upgraded stealth ring or are a rogue specializing in that) and focus on using doors and corners/grass, as this is where you can get them easily and reliably.
You can surprise attack enemies by attacking them the same turn that you became visible to them (or is invisible when doing so)
So with the case of doors, as you move through and leave a door, it automatically closes behind you. If you wait behind the door, if an enemy opened and ended their turn in the door can then be surprised attacked.
If anything is left in the door, gold or similar loot from an enemy, or something you’ve dropped yourself, the door won’t shut and you don’t get the benefit from a surprise attack.
Since the trigger is to attack the enemy the same turn that they’re able to see you, you can also use grass for this or in some cases moving around corners.
For the latter, the easiest is those single pillar walls, where you can move diagonally around it, breaking line of sight briefly, allowing you to surprise the enemy when they try to catch up.