In 2014 the Supreme Court ruled in Alice v CLS that computer inventions that claim “abstract ideas” are invalid. What happened in the years following is that the lower courts took this as an opportunity to weed out the crappy patents that were previously good extortion assets. Around the same time, the Supreme Court in Octane Fitness granted lower courts more discretion to shift fees and force losing plaintiffs to pay the defense costs for an unreasonable patent infringement claim. Also, in 2012 Congress passed the American Invents Act that created an Inter Partes Review proceeding at the patent office that lets accused infringers (or others) challenge the invalidity of patents more cheaply than a full trial and often to stop a trial pending its resolution. All these combined have resulted in substantially lower troll demands, and more reluctance by trolls to follow through with an extortionate case.
Good precedent is in Inventor Holdings v. Bed Bath Beyond at the Federal Circuit Court of Appeals. The holding is that a lower court can decide that if a plaintiff turns a blind eye to how bad it’s sotware patent is in light of _Alice_ and doesn’t drop its case, it can award the defendant its attorney fees. This particular case went on far, far too long and the court awarded almost $1M in defendant’s fees to be paid.