Here are my two games which involve sac on h2/h7 with idea of queen and bishop to attack on castled king. Here is the good sac:
The bishop on the g1-a7 diagnole comes to mind.
In the second example, you walked into a windmill. I looked at 18...Qh4 in depth, but the computer ate my post, so lets try again. 18...Qh4 19. Bg4 (another diffrence, White never had time for this in the first example) 19...Be4 (a) 20. Nf3 Qh6 f5 is comming. (b) 20. Nxe4 gets complicated 20...dxe4 21. Bf5 (h5 was a threat here, but now the bishop can't retreat) 21...h5 (not 21. g6 Qg4) 22. Kh1 (the threat of Qg5+ limits White's choices) 22...g6 23. Rg1 Kh7 24. Qf1 Rg8 (much better then giving White the g file with 24...gxf5 25. Rg7+ Kh6) 25. Bxg6+ fxg6 material is equal, but Black has the strong Raf8-Rf3 Rxh3+ and I don't see much that White can do about it.
This has not been computer checked, but I moved pieces around on a PGN board. Look it over, look for mistakes maybe you will learn somthing about the attack.
oh sorry agressivesociopath , it was inserted in format of puzzle. I would change it to game format now.
In the first game, I think White should survive after 21.Bg2 (to follow with Qf3).
yes irontiger, but am asking about how to forsee and avoid the sac attack and how to counter effectively , like a general principle
There are no general principles in chess, forget about it.
What you can hope for is to develop a tactical sense that will ring a bell in your mind if pieces are placed in a way that calls for tactics, and in this case it's probably a combination of possible sac on h3 and/or queen ready to check on the h file and/or opponent's pieces far away.
But in any case, you need to redo the calculation every time.
I kind of doubt it after 21...Bg4 the f pawn being pinned is a major motiff, it can neither capture on g3 or advance to f3.
The Art of Attack in Chess by Vladimir Vukovic is an attempt to systemize attacks and draw principles from them. But Iron Tiger is right, you need to devolp tactical sense that sets off an alarm in your head and tells you to start calculating. Mating patterns and the concept of focal points will help, but in this case you needed to notice that the f pawn was pinned in the first example and that White's king jams up a sort of "Morphy's mate" that is not actually a mate in the second example.
The problem is that Black must avoid exchanging queens, I was thinking of lines like this :
@irontiger 21.Bg2 Bh3 22.Qf3 Qxf3 23.Bxf3 Bxf1 24.Kxf1 looks about right to me...
JG27Pyth's line look correct to me as well. The resulting position looks about equal (playable for both sides) to me
The second sac was not bad at all. You should have played 18... Bxh3 instead of 18... Qg5+ and you overlooked 20. Rg1! After 18...Bxh3 the position is practically fine for Black but it is of course very unbalanced. Black wins if he mates, White wins if he survives. I Think chances are equal!
Continuing from my last comment...
On second thought black is probably better since he also win a pawn at the end of that line (if he tries to keep the pawn his bishop becomes trapped). I don't think black can be worse with rook+3 pawns vs 2 bishops, so the sac seems to be good.
I was actually logging on to issue a retraction, but 23...Rd8 makes 24. Bxd4? Rxd4 25. Qb3 Be6 26. c4 Bxc4 a bit a mistake. 24. Qb3 b5 25. Bxd4 bxa4 26. Qxa4 Rxd4 the attack is not over yet although the queenside pawns will win an endgame.
JGPyh's line is shorter, less speculative and results in a formal material advantage.