UnofficialCrusaderPatch / UnofficialCrusaderPatch2

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

Problem with selling excess wheat by AI #1046

Open Ragnvald4 opened 1 month ago

Ragnvald4 commented 1 month ago

There is a problem with selling wheat by my modified NPC. I modified one of the characters of Stronghold Crusader, so that he could play better - for expample, I added him some wheat farms. But, he doesn't sell excess wheat at all, despite the fact that the position"MaxResourceOther" is set on 10. Wheat accumulates on the stockpiles taking up more and more space untill it occupies each stockpile. I face such a situation in which workers with iron, wood and stone are waiting for a free space on the stockpiles, because all the space is occupied by the unsellable wheat (the excess of the rest recources is sold). I suppose the problem is that wheat isn't included in the position "MaxResourceOther". Other resources, like iron, pitch, hop, flour, are included except for wheat. I want the character to keep some wheat on the stockpile and sell the excess, but it is impossible. Can this problem be fixed?

Monsterfisch commented 1 month ago

wheat is counted as food so in order to sell wheat you need to lower the max food amount

Ragnvald4 commented 1 month ago

Thanks for the answer. I would have never thought that wheat was regulated by position "MaxFood" because it is stored on a stockpile not in a granary like bread, cheese, apples, meat. Wheat is the only exception. I think wheat should be separated from food and have its own position in the aic file like beer, stone and wood, so that its amount could be efficiently regulated. It would be much better solution and give an NPC more control over its stockpiles. Moreover, it would prevent it from being blocked. If an NPC has a small castle and, lets say, two stockpiles with the maximum food quantity set to 200, the NPC will be blocked by accumulated wheat. Keeping much food in the granery is useful by being attacked, because peasants cannot work then. Simply, keeping more food allows an NPC to survive an attack without losing popularity due to the empty granary. Furthermore, a lot of food in the granary may help to increase popularity because of setting "DoubleRationsFoodThreshold" on, for example, 120 with the maximum food quantity set to 200. A high maximum amount of food and high setting of double rations give a character a guarantee of security that double rations will not clear his granary. The character can hold double rations safely and for a long time. But, excessively accumulated wheat ruins everything. To sum up, linking the maximum food amount with the maximum wheat amount is a mistake which should be correct by separating wheat from food and creating wheat a new position in the aic file titled "MaxWheat" like "MaxBeer". After all, beer is also a kind of food and it isn't included in the position "MaxFood".