UnofficialCrusaderPatch / UnofficialCrusaderPatch2

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

Recovering from attacks and economic chokeholds #116

Open Monsterfisch opened 5 years ago

Monsterfisch commented 5 years ago

While playing with the put to sleep and tearing down of buildings disabled (both industry and defenses) for the ai I noticed that once the ai is down in economy it's next to impossible for them to recover from that spot, as they have no gold nor people to get back on their feed. Would it, therefore, be possible to have a sort of timer tick down when gold hasn't rising above a certain threshold for like 6 in-game months before its able to put buildings back to sleep and or destroy industry buildings as a safety mechanism? (would work well with the coming free market since then they would be able to get an economy rolling again somewhat as long as they have the money) As they still tear down buildings occasionally after being attacked (not sure if that's due to inaccessibility being created because of destruction or something else but because of it at times it creates a bugged engineers guild where only the waiting area is left and therefore prevents a new guild to be build and engineers being recruited resulting in attacks missing siege equipment and defenses mangonels and balista etc.

I also have been setting up some custom ai castles which end up producing a lot of wealth for their inhabitants, which they hardly ever put to good use. Maybe it would be possible for the ai to buy some more weapons to get their next attack ready if they have passed a certain gold threshold? you know like 50000 gold for example.

ByBurton commented 5 years ago

The biggest problem is if there are no trees nearby, and the ai runs out of lumber, and has nothing else left. I can not do anything... It hurts to see that..

ByBurton commented 5 years ago

When the Sultan is broke, has nothing but a granary and a marketplace: -Finally gets 18 wood from a lumberjack -> Sells immediately -> Money not enough for food, gifts to people instead so they do not run away -> repeat

irgendein-alf commented 5 years ago

i got a potential solution(idea) for the "ai is totally broke - issue" but i'm not sure if it's possible to implement this: 0) there is a game mechanic. if you're down to 0(?) popularity and your population is on 3 civilians or less, the game will automatically put you back to 75 popularity immediately. the only problem is, civilians stop despawning when you have 4(even at 0 popularity), so you'll never actually hit 3 unless a) you recruit someone or b) someone dies. 1) the game mechanic described in "0" would need to be scaled down to 'despawn until minimum of 3 civilians is reached ', so the buff triggers automatically (or automatically trigger it at 4 civilians instead of 3, should be easier) 2) whenever the AI is broke (== can't build troops/economy buildings for n months and food+happyness is below a certain threshhold) it'll trigger a loop like this: 2a) put tax on max 2b) set food use to 0 2c) optional: sell material as usual 2d) wait until happyness got boosted/reset 2e) goto 2c (25 times total) 3) after 25 of those cycles, the AI will have at least 1000 gold from taxes(it's ~42-46/cycle), sets food use & taxes back to regular level and starts buying building material/food again.

Heroesflorian commented 5 years ago

Not quite sure about the specific "algorithm" there, but I like the general idea of somehow triggering that "popularity reset" mechanic (after some delay of course, to avoid providing ways for exploiting it) not exclusively at "below 4" population but also with 4 or more population.

Another complication in that regard: Workers in wells and water pots will never despawn even the popularity is at 0 and the population is still more than 4. One could build (a bunch of houses and) 100 water pots, then set food rations, etc all to zero, put highest taxes up, and end up with 0 popularity but still 300 population (100 water pots x 3 workers per water pot) with continuously high tax income.


As they still tear down buildings occasionally after being attacked (not sure if that's due to inaccessibility being created because of destruction or something else but because of it at times it creates a bugged engineers guild where only the waiting area is left and therefore prevents a new guild to be build and engineers being recruited resulting in attacks missing siege equipment and defenses mangonels and balista etc.

Oh yes... bugged, permanently semi-destroyed engineers guilds, oil smelters and tunnelors guilds are a real "nightmare"! Would love to see this fixed. With one exception, possibly... I've seen some custom AIV for the Marshal where an oil smelter is intentionally made inaccessible and thus buggily-destroyed, which will cause it to never be rebuilt, but the AI still tries to keep the building materials (10 iron) for it in stockpile at all times in order to be able to rebuild it. This makes it possible to ramp up the Marshal's weapon production to new records, as this way he makes sure to have iron in the stockpile at all times! Combined with slightly negative fear factor for stronger economy and even higher weapon production output, this turns him into quite a beast even without weapon purchases, no-setting-to-sleep fixes or other mod features!

irgendein-alf commented 5 years ago

@Heroesflorian "after some delay of course, to avoid providing ways for exploiting it" no delay needed because; the human player can already exploit it: buy 1 fireguy at 4 pop for 5 gold, then you're at 3 pop, it triggers, you're back to 75 happiness. 1 cycle are 3 ingame month for an ai (or for a player at minimum game speed). during that time, the economy is pretty useless & the tax income/month is equivalent to 10 pop -12 happiness tax. as i've mentioned, to accumulate ~1000 gold that way, the ai will need to sit around with effectively 0 productivity (you already mentioned the water pots) for 6,25 stronghold years. then rebuild the general economy. i'd say the ai can't abuse it.