put a heavy troop on front like Cavalry , they will aim for the horses not the catapult.
Works the same with spiders
they kill the spiders not the catapults
Nah, still happens with horses in frontline. It doesn't happen with lich because the scorpions form a perfect grid fill. Humans are a different story. 4 melee frontline leaves 1 gap. 1 horse fixes the gap, but the horse charge messes up the line sometimes causing units to insta-target the back line.
What fixes it for me is putting a catapult directly behind the middle of a unit.
Here's my tests. S=Swordsmen, H=horse, A=Archer, x=nothing, C=catapult
Letters displayed in bold
will endanger your catapult sometimes if the outer tile of a catapult overlaps with one of them.S
Catapult will get hit right off the bat if horses charge, depending on the enemy unit composition.S
Catapult will generally not get hit, but if your swordsmen start incurring losses, or a few of the archers fall, a retarget takes place and catapult will take damage despite still having a frontline (maybe 1% of the raids, it tends to survive regardless as this is late in the raidS
Catapult will never get hit, but this wastes more space
For me, adding swordsmen to a lineup together with horses causes a lot of issues. The charges creates an invisible gap that the wall units use as an oppurtunity to attack either your catapults or archers.
This issue is still present if you use 4x swordsmen because there's always 1 tile that has a gap, but as long as no catapult is in - OR NEXT - to that gap, you're fine.
Essentially, if you want to 100% ensure that a siege weapon does not get hit, it should not be in a gap, next to a gap, or next to the edge of one of your units; it should always be in the middle of one of your units. I'm aware this severely limits placement and yes it sucks. Screenshot posted above is a great example of incorrect placement that will work MOST of the time, but because the catapult is on the edge of a unit rather than in the middle of it, it will sometimes get targeted.
I might just be totally wrong on this, but that's my experience as human anyway. Haven't lost a catapult in 3 months but used to lose them constantly due to what appeared to be random targeting. Fixed it when i tightened up my formation.