Just had an idea that I think could help a couple of small annoyances. The idea is that if you have selected a castle, tower or garrisoned town centre to attack a specific unit, that building will then prioritize attacking other units of that type. So for example, if you’re fighting under your castle with knights against your opponents pikes and xbow, you could right click the castle to attack a pikeman. The castle would then first attempt to attack other pikeman. If there isn’t one in range, it then looks to attack other military units, then buildings.
This would also help in situations like if both players are building a castle, one gets it up first then tries to shoot the vills of their opponent that is still building. Right now it is really hard to select the vills building if they’re on the backside of the castle. This would allow you to click one with the castle then auto targeting the others once that one is dead.
An opponent attacked my castle with rams. They also had arbalesters in range of the castle to shoot my units that attacked the rams. I manually had the castle shoot the arbalesters rather then the rams. So, I like your idea of having the castle continue to shoot the arbalesters automatically while I concentrated on directing cavalry to the rams.
I think once there are no more units of that type in range it would reset to attacking other things with a priority towards certain units. So if you tell it to go for a specific military unit it would go to other military units next, then maybe vills then buildings. If you were targeting vills then it would switch to military units, then buildings.
I find towers and castles tend to just choose random buildings to attack sometimes, even if there are vills or military targets in range, even if I haven’t selected the tower or castle to attack that building.
Yeah I think having it as a separate command or something like a setting that you can turn off would make sense, although I’m not sure of a time when I wouldn’t want it to kill more of a specific unit type before switching and if I did I could just select that unit to attack and it would switch to killing all units of that new type before switching back.
That the castles attack buildings even with units in range is not something new, and occurs for units too. It was really bad before, then I believe it got fixed, and now it’s back (But not as bad as it was). I have seen several cases of my ranged units attacking buildings when there are enemies only a couple of tiles away before they turn to shoot the unit.
Edit: It seems to have been fixed in today’s update according to the changelog, while they didn’t say anything to do with units not targeting other units, so it might be something else causing it this time around.