Planning on implementing something like this, but it will require heavy modification to the line-of-sight code.
I like the concept of peeking at an obstacle bumping your height up to just enough to see over it, that’s a new idea, and I’ll be nabbing it when this gets implemented.
The full system gives obstacles a height value instead of just blocking or not blocking vision.
For the sake of illustration, we’ll say that each level is one foot above the ground.
standing PC eye height will be something like 5, crouching 4, crawling 2.
A counter would be 4, refrigerator 7, windowframe 2-4, a wall would be 10, or whatever the max is.
A regular zombie would also be 5, a brute, 6, hulk 7-8, dog 2, child 3-4.
To determine if a PC sees a monster (and vice versa), you’d keep track of what “slice” is visible, it would default to 0+, if an obstacle higher than the current value interposes, it bumps the number up to that, so for each square in range, you have a heightmap, and any entities (ground, furniture, monsters, items) in that square with a height above the heightmap for that square are visible. Can probably do the same with overhangs indoors. Will have to put some thought into how this interacts with multiple z-levels.
If we want to get extra, extra fancy, we might apply some kind of trig dealy so e.g. a counter right next to or close to a PC won’t block vision of everything shorter than it is.
As an example, if you have a standing PC, a counter, and a zombie dog, neither the dog nor the PC is going to see the other. A zombie next to the dog could see the PC and vice versa. If the PC drops on the ground, the zombie wouldn’t be able to see him either.