UnofficialCrusaderPatch / UnofficialCrusaderPatch2

Unofficial balancing patch installer for Stronghold Crusader 1
MIT License
429 stars 60 forks source link

HorseArcher die unnecessarily in defense #1009

Open Swartonf opened 2 years ago

Swartonf commented 2 years ago

Iam doing some tests on my own and got into a big problem. HorseArchers sure are good when it comes to the lategame. BUT they are going to be a bad choice for the AI anyways.

While defending, the Horsearchers all run into close combat and all die unnecessarily. The AI has to recruit them again, which slows down its attack and isnt able to defeat its opponent for that reason.

The problem is, that the horsearchers are the fastest to run into close combat, while they arent close combat fighters. Is there a way let the horsearchers to stay in their field without running towards melee fighters (if an ai is attacked)? Their current defensive behaviour is the problem, even while they are strong in the offense.

gynt commented 2 years ago

How large is the castle this AI is attacking?

J-T-de commented 2 years ago

I guess what you are refering to is the fact that the castle is often completely closed during a siege. As soon as some attacker opens a path all workers and sortie and raid units will move towards their respective targets. And the horse archers are just the fastest do get in the meat grinder. Sounds like a deep modification in the path finding (only use a safe way) which seems impossible. Not sure if there would be a hackish solution which does not introduce other sorts of headaches (just wait time till the unit gets ordered to a place sounds like it will negatively impact all non-siege situations...).

Xebenkeck commented 2 years ago

Unfortunatly there is only a few places you can set Horsearchers in the attacking army, of which only one really acts like what you are requesting.

If horse archers are set to AttackUnit2(attunitvanguard recently renamed) they will head to a second rally point around the enemy castle, and then after a set amount of time they will attack the walls in melee form. Not really utilizing their use.

If they are set to AttackunitBackup, they do not move from their second rally point until the walls are breached, once they are and a path to the keep is established they will run in to the peasent gathering area.

If they are set to Attackunit engage, they will act towards enemy units not inside the castle, but in this situation they do run directly at enemy units, melee included, once all external enemies are eliminated they act like AttackUnit2 and will melee attack the wall after a bit of time.

Only AttackUnitPatrol do horse archers engage the enemy archers on the wall and move around, The parameter AttUnitPatrolRecommandDelay controls how long they stand still after getting to a rally point, for what you are asking, I suggest putting this at 1 gametick, therefore the horsearchers attacking the castle will not stop and stand in position for any longer then one tick, this essentially keeps them mobile. No they don't specifically run away from a melee unit, but it is the best option we have.

I never really tried them on AttackUnitSiegeDef but here they would just patrol between the attack siege equipment, once they are dead they also, after a set amount of time, will attack the walls in melee form.

Panbutt commented 2 years ago

Setting them as AttackUnitSiegeDef can be a bit buggy sometimes. If there are active harassing/raiding siege engines the AttackUnitSiegeDef units will move to protect those engines instead. They'll even run all the way back to the keep to "defend" the single raiding catapult that was just built. This applies to any unit in the AttackUnitSiegeDef field not just horse archers.