Root of all AI improvment cycling evil?

The big problem is that cottages/workshops are both suboptimal choices once one hits the midgame, where lumbermills beat both (trade routes give all the commerce you need). But, of course, at that stage, the AI has already chopped all its forests.

Hug those trees - disable AI chopping now!
You should know this is atleast discussible ;)
 
This should be saved for some computer science book.

A quite small problem in a single line, that doesn't trigger a direct problem, but leads to and alternating situation later on which is hard to debug.

(Excessively commenting code does help sometimes).
 
That's some great work you did here jdog. Now I feel the question is: does that belong to betterAI or to the unofficial patch? :p
 
That's some great work you did here jdog. Now I feel the question is: does that belong to betterAI or to the unofficial patch? :p

There are several things which are in BBAI that may "belong" in UP or vice versa. It's already at the point the line is blurred. Many fixes were included into the latest official patch. I would say that BBAI+UP is an essential must-have addon now and is no longer optional. That's my opinion.
 
There are several things which are in BBAI that may "belong" in UP or vice versa. It's already at the point the line is blurred. Many fixes were included into the latest official patch. I would say that BBAI+UP is an essential must-have addon now and is no longer optional. That's my opinion.

It's my understanding that fixes in UP are already included in BBAI.
 
Great find. I see this will fix the flip-flopping, but will it stop the AI from paving over all its Towns with Workshops when that is clearly a suboptimal choice? I find this happens whether or not I'm invading the AI. The better leaders will keep tech parity with me and vice versa, but at some point they'll just decide they preferred the Stone Age better and destroy all their Towns and start slipping behind.

Yes, they start rebuilding Cottages over the Workshops, and this fix will address that part, but this won't stop them from tanking their economy. Is this a simple matter of tweaking the :hammers: vs. :commerce: weights?
 
Great find. I see this will fix the flip-flopping, but will it stop the AI from paving over all its Towns with Workshops when that is clearly a suboptimal choice? I find this happens whether or not I'm invading the AI. The better leaders will keep tech parity with me and vice versa, but at some point they'll just decide they preferred the Stone Age better and destroy all their Towns and start slipping behind.

Yes, they start rebuilding Cottages over the Workshops, and this fix will address that part, but this won't stop them from tanking their economy. Is this a simple matter of tweaking the :hammers: vs. :commerce: weights?

The AI wouldn't start rebuilding cottages over the workshops when they truly thought that workshops were higher valued than cottages. The phenomenon that you describe here fits perfectly in the flip - flopping causes described by jdog5000, namely that cottages are valued as the average between a cottage and a town during construction but are valued as a cottage when considering replacing the cottage.
 
The AI wouldn't start rebuilding cottages over the workshops when they truly thought that workshops were higher valued than cottages. The phenomenon that you describe here fits perfectly in the flip - flopping causes described by jdog5000, namely that cottages are valued as the average between a cottage and a town during construction but are valued as a cottage when considering replacing the cottage.

Yes, I understand that part and agree this will help. What I'm saying is that I think the initial choice to replace the Towns with Workshops is flawed given that the AI tends to fall behind in the late game in my games once they start doing that. Sure, they can produce Rifleman faster than I can, but that's because I'm building Infantry, Artillery, and Tanks.
 
Without some priority given to production, the only workshop that will get a higher value than a town is the caste system, state property workshop versus the non-universal suffrage, non-free speech, non-financial town (if I understand the code well enough). That's a 2 :food: 4 :hammers: tile versus a 2 :food: 5 :commerce: tile. With any other combination of civics, the AI will normally prefer the town.

It could of course be that the AI is regularly in a state where it gives priority to production. Or maybe the AI is regularly in the above described combination of civics.

I think the production preference modifier and commerce preference modifier should work in such a way that the AI balances the workshops and towns around a city in order to get decent production and commerce. That's good enough for the AI in the non-national wonder cities. So with very low production, the AI might get a few workshops (preferably not build over towns) and with high enough production the AI will not transfer more towns into workshops.
 
Yes, that's a good summary Roland. From my experience watching this so far, it's now quite rare for the AI to workshop over a village or town ... it can do it under the right circumstances where it really needs production in the city, but the days of random town destruction are seemingly past.
 
Glad to hear that jdog. I haven't been able to test your latest changes in an actual game.
 
Back
Top Bottom