UnofficialCrusaderPatch / UnofficialCrusaderPatch2

Unofficial balancing patch installer for Stronghold Crusader 1
MIT License
430 stars 59 forks source link

AI Behaviour #8

Closed cybercorpse closed 5 years ago

cybercorpse commented 5 years ago

Hi, Sh0wdown! Is it possible for you to edit some options of the AI's behavior, like his preferable troops, use of siege equipment, etc?

Sh0wdown commented 5 years ago

I haven't looked into it, but I think it should be possible.

ByBurton commented 5 years ago

@Sh0wdown If so, could you for example make the Rat build more apple farms? Or fix stuff like Wolf not manning his towers / walls with Arabic Archers?

I am getting more and more hyped for this. To be honest, I am checking every 30 minutes since I heard about this for updates, and getting the latest ones asap.

I would love to donate some money, do you have a paypal or smthg.? I don't wanna do monthly stuff though...

Also.... at some point .... can you please buff my poor ratty? :( (After eeeeeverything else is done, so probably never... I know how programming works..)

cybercorpse commented 5 years ago

I haven't looked into it, but I think it should be possible.

Oh, it would be great. Our developers have not figured it out a long time ago, working on Stronghold Europe...

ByBurton commented 5 years ago

Oh, it would be great. Our developers have not figured it out a long time ago, working on Stronghold Europe...

I played a lot with your modification Stronghold Europe. I enjoyed especially the old soundtrack in Stronghold Crusader!

PitchNeeded commented 5 years ago

Hi, Sh0wdown! Is it possible for you to edit some options of the AI's behavior, like his preferable troops, use of siege equipment, etc?

Oh my goodness, it might actually be possible to make King Phillip have a proper siege force, with knights heading directly for the walls along with catapults and the spearmen and some archers to support!

ByBurton commented 5 years ago

Oh my goodness, it might actually be possible to make King Phillip have a proper siege force, with knights heading directly for the walls along with catapults and the spearmen and some archers to support!

Knights ... heading for walls .... does not sound promising to me... I would rather have him build catapults for attacks, with a lot more spearmen..

PitchNeeded commented 5 years ago

Well before he attacks you he sometimes says 'My knights will ride you down, charge!' so it would make sense for King Phillip to have at least a few knights in his main siege force to try and chop down the walls along with the spearmen before destroying the granary/marketplace etc inside the castle if they break through the walls! He could send up to 32 knights in a siege (Phillip can make 8 stables in his biggest original castles) which could be very strong against any castle which doesn't have enough crossbowmen or fire throwers.

I think it would be good if Saladin could create a couple of knights too with his swords and armour, (or ideally a retextured new Arabian knight unit which is as good as the European one if that is possible to create).

Flechador commented 5 years ago

Well before he attacks you he sometimes says 'My knights will ride you down, charge!' so it would make sense for King Phillip to have at least a few knights in his main siege force to try and chop down the walls along with the spearmen before destroying the granary/marketplace etc inside the castle if they break through the walls!

I like that idea, because it would be convenient with Phillip. I mean his attacks currently are just bad Rat attacks without Archers.

PitchNeeded commented 5 years ago

Now it seems possible to change AI behaviour, would it be possible eventually to create a new AI lord.... ;)

I was thinking maybe Lord Woolsack from Stronghold 1 could return. He could specialise in pikemen, raiding quarries, farms and mines etc. with forces of 20 or 30 pikemen which would be very powerful and cause damage to enemy economies. Pikemen would also be good for him as he would be able to counter his old rival Sir Longarm's knights! 😄 He wouldn't do his main attacks until he had a lot of troops as he is a careful strategist, but he would send a mix of pikemen and monks (I think monks would go well with Woolsack's personality and he kind of looks and sounds like a monk!), supported by archers. Some catapults and trebuchets too.

His economy would be good with ale, apple and cheese farming and use of religious buildings, as well as lots of fletchers and poleturners and a few armourers workshops. He is a good lord so would use +5 fear factor. His castle defences would be quite good, maybe not the best defended but with tower ballistae (no mangonels though) and quite a few archers on towers.

YouMoMCallME commented 5 years ago

Very good idea !

PitchNeeded commented 5 years ago

Thanks! Lord Woolsack is I think the best candidate for a new AI lord as he is the one of the only major characters in a Stronghold game not to have a skirmish AI and we also can make binks for him more easily from the Stronghold 1 video of him and use some of his speech from that (obviously if this AI was ever made, we should make it so you would have to have Stronghold 1 to be able to download this new AI).

PitchNeeded commented 5 years ago

I don't know if this is possible to do, but it would be good to be able to improve AI siege tactics in terms of which units advance first. A good example would be improving Sultan's tactics. It would be better if Sultan grouped his Arabian archers and Arabian swordsmen together before a siege, advancing his Arabian swordsman first and then the Arabian archers sometime later so they can actually distract the enemy when the Arabian swordsman are advancing!

Another example is Wolf's crossbowmen, who should advance ideally at the same time as the pikemen and swordsmen!

FixStronghold commented 5 years ago

Great work so far, I am guessing a few things will remain broken forever, but here are a few observations I made about the way the AI performs its attacks that is close to being buggy or is at least lazy coding and I believe no one has mentioned yet:

PitchNeeded commented 5 years ago

You or the AI being attacked can have vital buildings outside of your walls and the AI during an attack will simply ignore it.

I don't think it's a big issue, outside buildings are more for any raiding AI troops though to target, and anyway AI catapults or fire ballistae often manage to destroy some buildings outside the wall anyway.

I am sure we all know this but moats are just broken. The only unit that can remove moats reliably during an attack are pikemen. Maybe at least give all infantry units in the game the option to dig-out moats.

Maybe it could be made that European swordsmen and Arabian swordsmen can dig up enemy moats but they are very very slow at doing so (because of their heavy armour) compared to pikemen, macemen or European archers. Arabian archers should also maybe be able to dig moats, but to balance them with European archers they should be slower than European archers at digging moats (as they are a bit stronger than European archers).

Flechador commented 5 years ago

Maybe at least give all infantry units in the game the option to dig-out moats.

Maybe it's possible to change that all units can dig-out moats but it would look "bugged". Because the other units dont have animations for dig-out moats.

FixStronghold commented 5 years ago

I don't think it's a big issue, outside buildings are more for any raiding AI troops though to target, and anyway AI catapults or fire ballistae often manage to destroy some buildings outside the wall anyway.

Sorry I meant that the AI only attacks in waves that are large enough to attack the walls, which severely limits the strength of an AI when it has more troops. My suggestion was meant as part of a "fix" to have it also target other buildings or digging-up the moat.

You can test it for yourself, do the following: Play against Sultan, build a complete wall around your keep and cover the wall on the outside with flower gardens (or any other buildings even towers work). Depending on how much space you leave open will determine the size of the waves. I had a Saladin with a moat in front and his walls for the most part covered in bakeries or other buildings. He could defend himself effectively against multiple AIs attacking with 400 troops or more, because they would only ever send 10 troops at once. I guess part of the problem is also that the AI is completely inept at using siege equipment.

Panbutt commented 5 years ago

Yeah. Melee soldiers also rarely, if not ever, target gatehouses unless they are assassins. With the grand majority of the AI castles, destroying a single gatehouse can create a breach yet the AI doesn't seem to prioritize targeting them.

PitchNeeded commented 5 years ago

Yeah. Melee soldiers also rarely, if not ever, target gatehouses unless they are assassins. With the grand majority of the AI castles, destroying a single gatehouse can create a breach yet the AI doesn't seem to prioritize targeting them.

Although Richard and Pig tend to send rams to gatehouses, and Marshall, Frederick and Phillip may attack them with their knight raids if they have already destroyed outside buildings in the area and there is no other target nearby.

Sometimes it might not be be wise for an AI to attack a gatehouse, some AI's (like Richard and Emir) have boiling oil engineers on them whereas their walls are less defended. Also I have noticed that Wazir has small areas midway between the points of some of his star shaped vanilla castles where his archers can't fire at the wall chopping troops and the AI often manages to break through here.

Depending on how much space you leave open will determine the size of the waves. I had a Saladin with a moat in front and his walls for the most part covered in bakeries or other buildings. He could defend himself effectively against multiple AIs attacking with 400 troops or more, because they would only ever send 10 troops at once. I guess part of the problem is also that the AI is completely inept at using siege equipment.

I think the AI is good enough at using siege equipment, they aim for the towers first which is a good enough decision, as if they manage to destroy towers, particularly with AI's like Caliph who only have weak towers then the enemy firepower is reduced.

However the point about the 10 troops at once is something that needs to be improved definitely. I assume Richard, Pig, Sheriff and Wolf are slightly more successful at sieging Saladin's castle as they bring decent moat digging troops so can send more troops at once.

FixStronghold commented 5 years ago

Although Richard and Pig tend to send rams to gatehouses, and Marshall, Frederick and Phillip may attack them with their knight raids if they have already destroyed outside buildings in the area and there is no other target nearby.

Just to make this clear, we are not saying that the AI should target gatehouses or towers instead of walls, but additionally. There is only so many units that can attack the wall at any one time, which can be very restrictive if the wall is not reachable or the stronghold is small.

I think the AI is good enough at using siege equipment, they aim for the towers first which is a good enough decision, as if they manage to destroy towers, particularly with AI's like Caliph who only have weak towers then the enemy firepower is reduced.

Well I agree with what you said, but there are two big issues: Often the AI moves their catapults too close or builds them up too close and gets them destroyed, and secondly they often do not shoot for long enough to really destroy anything. I should maybe mention that there are two types of catapults, ones used for attack and others that are built to shoot at close enemies. I am only talking about the latter, the ones to attack enemies close-by seem to work okayish, although they are also often pushed into archer range.

However the point about the 10 troops at once is something that needs to be improved definitely. I assume Richard, Pig, Sheriff and Wolf are slightly more successful at sieging Saladin's castle as they bring decent moat digging troops so can send more troops at once.

Well you have a point and you would think that should be the case..., but in my game with Saladin it was Friedrich and Wolf. Anyway I ran another test with moats by building a complete moat around my keep to see what the problem is. So turns out there is indeed some coding to remove moats, but it is less than ideal and does not work in most scenarios. Both Pig and Wolf will send exactly 1 wave of about 10 units to remove a moat and that is it. Both Wolf and Pig still had plenty of units to send to remove the moat in each attack but instead just stood idly around..., again you can test this yourself.

PitchNeeded commented 5 years ago

@Sh0wdown Have you found the coding yet about AI military behaviour?

Sh0wdown commented 5 years ago

Closing this, as it is now possible with AIC edits.

saberzokabo commented 3 years ago

eh,can i change an AI units? & how?

GRhin commented 3 years ago

It's all in the aic files https://sh0wdown.github.io/UnofficialCrusaderPatch/aic/overview.html