UnofficialCrusaderPatch / UnofficialCrusaderPatch2

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

AI trading with each other #41

Open ByBurton opened 5 years ago

ByBurton commented 5 years ago

Would it be possible, to enable trading between allied ai's? They do already ask for stuff, and send stuff to the player, so can that be used for trading with each other? Just weirds me out, that this exists with the player, but not between computer opponents..

Edit: Would be pretty simple logic. AI A requests for example 12 wood, because it wants to build a house. It always requests double the amount it wanted to buy. -> AI B sends the stuff if they have it, otherwise it declines, and AI A asks another ally if there are more and asking again the same ally is disabled for a short time. Prioritizes human allies though.

PitchNeeded commented 5 years ago

Good idea. It would depend on the AI's personality too though what it would send so the likes of Sheriff and Caliph would still usually decline sending anything to another AI whereas Marshall and Sultan would be much more generous if they had the goods.

ByBurton commented 5 years ago

Maybe....

YouMoMCallME commented 5 years ago

Wanted to offer the same. Good Idea !

KingCaliph commented 4 years ago

Sadly nobody ever solved this issue. I have played this game since I was a child and I always wished of this being a possibility.

YouMoMCallME commented 4 years ago

Sadly nobody ever solved this issue. I have played this game since I was a child and I always wished of this being a possibility.

rekindle the topic

LordHansCapon commented 4 years ago

Well, it would be more like:

By the way, I have played around chaning the rule regarding asking for Gold. There is a hardcoded deny when player asks for gold, but I wrote a simple check which looks like this:

But it was still OP...

ByBurton commented 4 years ago

@LordHansCapon It would also need to take into calculation the aic variable that handles trades (how much stuff to keep), so that the character of an ai is still there. Caliph wouldn't send anything but apples to his allies, as those are the only thing he keeps enough on stock to have some leftover after he is asked for 5 or 10 apples).

That said I am quite interested about your change regarding sending gold.

Monsterfisch commented 4 years ago

200% would be amazing to see an interaction between the AI characters apart from throwing troops at each others walls. it would, however, be fairly important to boost their economies across the board so that such a feat can even be feasible. The abbot doesn't amass such treasures in a short amount of time after all.

ByBurton commented 4 years ago

200% would be amazing to see an interaction between the AI characters apart from throwing troops at each others walls. it would, however, be fairly important to boost their economies across the board so that such a feat can even be feasible. The abbot doesn't amass such treasures in a short amount of time after all.

Not necessarily. You could tweak the gold thingy. But me for my part am against the ai sending gold around. Unless they are way above their investment threshold and not actively recruiting a siege force. (e.g. If(attacking and gold > threshold * 20) send (threshold / allied ai lords) gold to each allied ai lord. Output text if the player is in their team. There should also be text output for normal goods being sent from ai to ai if the player is in their team.

Monsterfisch commented 4 years ago

I definitely agree that the ai shouldn't just send out gold all the time I am looking at it more in terms of help to recover from an enemy attack. So let's say caliph has been run down pretty badly and his economy is flat on its belly because marshall or the player has rekt his outer buildings etc. his team member ais could send him money/ resources to get back on his feet where otherwise the ai would just end up being dead in the water for a long time.

tldr; trading would only occur if an ai is pretty trashed and can't get back on its feet in the short term.

This logic could then also be used to have allies send reinforcements to their Team members. implying a mechanic like that would be realistically achievable ofc

ByBurton commented 4 years ago

Although sending gold is rarily a good thing. Sending resources is often way more cost effective.

Monsterfisch commented 4 years ago

true but like presents in rl money is just more universally useful. Now it would be a lot better if the Ai knew how to use it properly but that's a different story :D and there are certainly more important tweaks to the ai that can be made to have it less dependent on a larger rework like this for sure. This idea is also more a jab at an attempt to ave the AI from its own incompetence anyhow. I am fairly certain that once the ai starts giving players actual trouble no one will want them to trade with one another anymore xD

ByBurton commented 4 years ago

But I can already see the ai sending small gifts of gold like 10 to 50, and the almost defeated ai using that for positive taxes instead of buying wood... So sending wood or other resources and not implementing gold would be a smarter first step in my honest opinion.

Monsterfisch commented 4 years ago

yeah I would classify that under AI incompetence and would not like to see trading used to "fix" the ai in that regard but rather have "trading" be introduced after those kinks have been taken care of you know ai prioritization and all. ;)

like many things in life, this is probably also very multifaceted were buying wood is currently the right idea if we can make it so that maps don't get completely deforested by the ai by making it so that woodcutters only chop down big trees, etc using the free woodcutter the 50 gold being used to get back the peasants could be a good thing at that point. but yeah it depends