A Better AI.

I finished Stonehenge in 1000AD (that's AD) on standard continents, Prince, Epic, which I thought was extremely weird.

I played the 12/12 build on huge map, 18civs, raging barb, aggressive AI, on deity difficulty, map is archipelago snaky continent. Stonehenge got built at 2035 bc, in vanilla they usually finished it 600 years earlier. But great Wall got finished by AI 2155 BC, 120 years!!!!!!!!!!!! before stonehenge. I completed pyramid on 1585 BC, just 1 turn before AI. And rushed to build great light house on 1300 Bc, again just 1 or 2 turns ahead of AI. While parthenon was build at 800 BC by AI.

I must say I'm impressed with AI aiming for good wonder early. Especially the rush to build great light house and great wall, 2 great wonders when you playing with archipelago map and raging barb setting, caught me compeletely off guard, in vanilla great light house usually got built only around 700 or 800 BC. Great Wall only around 1600 BC.
 
Man, I feel bad asking so many questions, but I have another one.
I'm upgrading to warlords and I'm going through and looking at changes to files. It seems they removed the UNITAI_ATTACK_CITY from the Mustketman unit (and all its derivatives). Does this mean the AI will not use them to attack cities?

I always found the French one useful for attacks since they're fast, and I'm looking at the Ottoman one and the bonuses just scream city-attacker to me.
 
Unless a unit has the "NOT" AI type then basically it can be chosen for any role. The AI types actually doesn't have that much impact since the value functions look at strength and bonuses and stuff when determining the most fit unit for a given role.
 
Blake I'm interested in knowing how it came that your code was used in the 2.08 patch. I recently WinMerged some of my own mods to 2.08 and saw many references to "new AI code curtusy of Blake", the only other major instance of Firaxis using public code was the incorporation of the Score graph in the very first patch (try to recover your supressed memories of the horrible graph that the 1.00 game shipped with). And I resently saw some posts by Trip explicity stating that their planning on including fan content in the next expantion pack and were taking submissions. I have some code for modular XML loading which is an extention of code by Chinese American as seen in this thread Modular Loading I've been extending his code to cover virtualy all file types and standardized the naming system. When ready the mod will allow content like a whole Unit, Tech, Leader or even Civilization to be contained in a single directory alowing it to be added or removed by simply dragging and droping. This could greatly improve the ease of content merging which is the biggest hurdle in making a large Civ4 mod. How would you recomend I go about contacting Firaxis and petitioning for them to include it? Is their anything in particular they would want done with the code to make it ready, its already fairly clean and I'm testing it will working moduals right now. Do you know their policy on copyrighted code, do they use only public domain code?
 
1001 you mean :goodjob:
 
I played the 12/12 build on huge map, 18civs, raging barb, aggressive AI, on deity difficulty, map is archipelago snaky continent. Stonehenge got built at 2035 bc, in vanilla they usually finished it 600 years earlier. But great Wall got finished by AI 2155 BC, 120 years!!!!!!!!!!!! before stonehenge. I completed pyramid on 1585 BC, just 1 turn before AI. And rushed to build great light house on 1300 Bc, again just 1 or 2 turns ahead of AI. While parthenon was build at 800 BC by AI.

I must say I'm impressed with AI aiming for good wonder early. Especially the rush to build great light house and great wall, 2 great wonders when you playing with archipelago map and raging barb setting, caught me compeletely off guard, in vanilla great light house usually got built only around 700 or 800 BC. Great Wall only around 1600 BC.

On Diety maybe the AI is building ancient wonders. I find it wierd a human can build even a single wonder against the AI bonuses on Diety though.

On Prince or Noble, the AI will not build ancient wonders. To the point it's like a bug, I can pick and choose wich wonder to build, whenever I want. Stonhenge, Great wall, 1000 AD when I start to build them, and still win "The Race" This is new from the 12-12 build.
 
Man, I feel bad asking so many questions, but I have another one.
I'm upgrading to warlords and I'm going through and looking at changes to files. It seems they removed the UNITAI_ATTACK_CITY from the Mustketman unit (and all its derivatives). Does this mean the AI will not use them to attack cities?

I think AI types are more important when AI decides troop build up (like build X defenders, Y attackers, Z counters, etc...), or when chosing promotions.

I guess Blake can correct me if I'm wrong, but this is what I gathered when I looked at AI code several moths ago.
 
On Prince or Noble, the AI will not build ancient wonders. To the point it's like a bug, I can pick and choose wich wonder to build, whenever I want. Stonhenge, Great wall, 1000 AD when I start to build them, and still win "The Race" This is new from the 12-12 build.

I found the same. I always play Noble, and with the 12-12 build I completed the Great Wall, The Pyramids, and the Great Library.
I'm not complaining mind, just giving feedback.:)

(Also I'll just mention in passing that this was my first game of Warlords for some time when I didnt have one single non-barbarian fight. I finished 3rd by score, so I suppose I should've been more aggresive if I wanted to win, but hey I'm a builder type! :) I did kill a few lions and the odd barbarian before I finished the wall though :rolleyes:)
 
In re the governor, I wish:

There was a way to force no specialists of a given type, and perhaps no specialists (other than citizens) at all, and

The governor would absolutely freeze growth at the happy cap, and

That the screen layout permitted a "maximize culture" function, and

That the type of specialists used corresponded more closely to the kind of emphasis specified.

It still drives me nuts to find the governor changing specialists willy-nilly when I'm trying to avoid contaminating a GP farm and don't want to micromanage it. Although the new governor is great at doing what is generally good, it sucks at doing what I want.
 
...
(Also I'll just mention in passing that this was my first game of Warlords for some time when I didnt have one single non-barbarian fight. I finished 3rd by score, so I suppose I should've been more aggresive if I wanted to win, but hey I'm a builder type! :) I did kill a few lions and the odd barbarian before I finished the wall though :rolleyes:)
It drives me bonkers if I don't get a half dozen generals or so. Try it. You'll become addicted to promotions. Play as Japan and experience the thrill of gunpowder units with 6 promotions fresh out of the box. :)

Last game I cleared my continent of other civs at something-or-other BC, with one general, and then ... the other continent with three civs and three different religions was a model of builder tranquility with 3-way defensive pacts. No more generals for me. Go figure.
 
On Diety maybe the AI is building ancient wonders. I find it wierd a human can build even a single wonder against the AI bonuses on Diety though.

On Prince or Noble, the AI will not build ancient wonders. To the point it's like a bug, I can pick and choose wich wonder to build, whenever I want. Stonhenge, Great wall, 1000 AD when I start to build them, and still win "The Race" This is new from the 12-12 build.

You need to rush some key early wonders just to stay in game on deity. The way to do it is chop chop chop + whip. I have 4 workers to chop pyramid and 5 workers to chop great light house. And at start, I regenerate map till I get a starting loc with tons of forests and stone close by + Qin is industrious. And I need to reload if I don't get bronze working after I poped all the goody huts around me.
 
In re the governor, I wish:

There was a way to force no specialists of a given type, and perhaps no specialists (other than citizens) at all, and

...

That the type of specialists used corresponded more closely to the kind of emphasis specified.

It still drives me nuts to find the governor changing specialists willy-nilly when I'm trying to avoid contaminating a GP farm and don't want to micromanage it. Although the new governor is great at doing what is generally good, it sucks at doing what I want.

In the next build, the governor should be a lot better in the cases where you are forcing at least one specialist. It should assign specialists of the same type(s) for as long as possible.

This means if you are in caste system, and you force one artist, then every specialist assigned will be an artist. If you assign one artist and one scientist, then half the specialists will be artists and half will be scientists.

When you are not under caste system, when forcing engineers, or any other case where you have a limited number of specialists, it will be better about working plots when it can do so, instead of assigning specialists that you do not want (prior to this coming fix, it would drop the worst plot and add the best specialist if the worst plot was bad enough). With the fix, if you force any specialists, then only the specialists you are forcing will be considered in comparison to worked plots. Once all the plots that are workable are being worked, then it will go back and assign specialists of types you did not force. (That is to say, if you have a size 30 city, and are forcing 1 engineer with a max of 3 engineers, then it has no choice but to assign some other specialist type).

Overall, I think this will be exactly what you want, other than the one case where you want to force no specialists, and emphasize food does not do that for you. The only case I can see where this happens is when you want to make sure a certain city gets the next GP, so you want to slow down GP points in all other cities. I am not sure of any good way to accomplish this, given the constraints that we are not going to be changing the user interface.

The governor would absolutely freeze growth at the happy cap, and

It should be doing this if there is any sensible combination of plots to work and specialists that does this. Under slavery, it will let a city grow one higher than the cap, assuming you will be whipping it. It will not turn on halt growth though, as the assumption is that you will find something to do with that extra population, whether it is switching to nationhood or slavery to use it, or raise your happy cap.

Can you give a specific example where your city is growing past the cap when you did not wish it to do so? And were you in slavery?

That the screen layout permitted a "maximize culture" function, and

Changing the User Interface is not within the scope of this project.

The closest you can come to this, is if you turn on emphasize commerce, and your global commerce slider is up around 60% to culture or higher, then it will end up emphasizing culture.

This works for the late stage cultural victory case, where you have your culture slider high, but does not work so well when you are just fighting a border culture war. Hopefully the force specialist changes will help a bit. Turning on emphasize commerce might also help here a little, even in the case where the culture slider is not set very high. If you post a save game with a case where you want to emphasize culture, I can explore other possible ways to get what you want without breaking anything else.

-Iustus
 
It should be doing this if there is any sensible combination of plots to work and specialists that does this. Under slavery, it will let a city grow one higher than the cap, assuming you will be whipping it. It will not turn on halt growth though, as the assumption is that you will find something to do with that extra population, whether it is switching to nationhood or slavery to use it, or raise your happy cap.
Do other people like the way that this works? (Serious question.) I play slavery because I want to be able to whip, not necessarily because I am whipping at the moment. One point of black smoke is mostly an annoyance but it seems awkward.

When I say force culture, what I want is to squeeze culture out of a particular city to expand its borders, without messing with the culture slider.
 
Under slavery, it will let a city grow one higher than the cap, assuming you will be whipping it.
Do other people like the way that this works?

Yes, I love this feature. The extra non-working citizen can pretty easily just be left there for even 20 turns until I have something I want to whip in that city. I see the plume of smoke as a signal fire - I go to that city, switch it to something worth whipping, and do so a few turns later.

I don't really see what huge problem the extra non-working citizen creates. He consumes 2 food and prevents WLTKD. The latter is rare enough during slavery that I really don't see this as an issue. The former is only really a problem if you're trying to build workers/settlers, as it cuts into your production.

The only other possible issue is a situation where the govenor ends up working a bread tile rather than a high production/commerce tile, for no reason except to feed the non-working citizen. When that happens, I step in and manually assign plots and starve the city. I don't see this as having to micromanage, I see it as having to play the game during the unusual situations that the default behavior can't be expected to work. Again, I see the smoke as a helpful reminder that human intervention could be needed, so it's not even a hassle trying to remember in which cities the govenor could be failing.

When I say force culture, what I want is to squeeze culture out of a particular city to expand its borders, without messing with the culture slider.

I introduced my girlfriend to the game, and once she got good enough to understand all the underlying mechanics, she discovered this with an outraged, "What!? There's no 'emphasize culture' button?" I consider this one of Firaxis's lasting interface oversights and I too wish there was some way to fix it, but as it would require both a UI and an AI change I see why it's outside of this project.

As I'm thinking about it, though, doesn't the next build actually already fix this? With the new specialist behavior, won't some degree of emphasizing culture be possible with a combination of "emphasize GP" and forcing an artist and a priest? It's still not perfect since you can't get the govenor to automatically max the artists first and only then do priests but it'd be awfully close - definitely closer than running commerce + culture slider. This is the only way to force culture in a single city anyway, unless you're talking about the govenor controlling your build order too.
 
Hmm, I had been using the 'Ethnically Diverse Units' graphics too and removing that stops the crash. But prior to the 12-12 build, I was able to use both with no problems.

Did anything change in the .dll that would preclude the graphics-only changes of the othe mod?

Thanks!

I've duplicated this bug. Something must have changed in the 12-12 BetterAI build, and here's my reasoning.

I have a cobbled-together modpack (call it BJw) of my own creation. It worked fine with BetterAI 12-09 build.

Using BJw with no (special) CVGameCore.dll works perfectly on generating new map and on a BJw savegame.
Using BJw with the 12-12 build in the mod folder - CTD on new game, CTD as soon as I end turn on old save.
Using BJw with the 12-12 build in customassets folder - CTD on new game, CTD as soon as I end turn on old save.
"Empty" BJw (literally all contents of mod folder deleted), no use of BetterAI dll - works on new game, works on old save - so it's not a problem with the interaction of the mod and the save itself
"Empty" BJw, 12-12 build in mod folder - CTD old save, but works for new game
"Empty" BJw, 12-12 build in customassets - CTD old save
No mods at all, 12-12 build in customassets - Works, both cases
Using BJw with a different modified CVGameCore.dll in mod folder - works, both cases
Using BJw with 12-9 build in mod folder - works, both cases.

This was pretty exhaustive and took about an hour to run through. The only cases that fail were the 12-12 build of BetterAI, used in conjunction with some other mod (in my case BJw, in UncleJoe's EDU).

The fact that I can grab a modified CVGameCore dll out of another random mod, like Customizeable Domestic Advisor, put it in my mod (with no components of CDA in use at all), and have it work, OR I can use the 12-9 build with my mod and have that work too - really seems to suggest something changed in the 12-12 build.

Apparently, it'd have to be a change like.. altering a function that doesn't actually get used by "vanilla warlords" but that a mod is calling. Even that is very strange, though - Ethically Diverse Units only modifies a single python file (screens\CvDawnOfMan.py), so I don't know what could have changed to make that fail. I'm going to make a mod that only changes XML and see if I can continue to reproduce this behavior, then I'll update this post.

*update after another 45 minutes of testing*
Running just pieces that modified XML from my BJw mod - worked with 12-12 build.
Running almost all components of my BJw but not the greatperson mod - worked with 12-12 build.
Running just GreatPersonMod, alone - CTD on ending turn, CTD on new game with 12-12 build. Works all cases 12-9 build.
Running Ethically Diverse Units alone - CTD on loading savegame (doesn't even get to turn) and CTD on new game with 12-12 build, but works all cases 12-9 build.

There's only a single file in common between these two mods - Assets\XML\Units\Unitinfos.xml. However, in my first test of just the xml files, I used my own modified copy of that file which contains all the changes (additional GP names) from the greatpersonmod as well as a few of my own changes to boot. There were no conflicts using it with the 12-12 betterai build.

I literally tried 14+ different mods singularly and in conjunction with one another (the "almost all components" bit above) and even all at once they ran fine with the 12-12 build. The only real common thread that the GP mod and the EDU mod have is that they both add a significant amount of custom artwork. However, plotlistenhancements and the modified sevopedia both add at least a few art files and I had no problem using those with 12-12 build.

The kicker, though, remains that any and all of these mods work fine with the 12-9 build.

I would use the python debugger to give better information but I can't get it to work in warlords (I've used it successfully for troubleshooting this type of thing in vanilla). I enable it in the warlords ini file, and the loader hangs on "init python" even when I'm only loading "vanilla warlords" and not autoloading a mod.
 
A small thing I noticed during last game (with 12-12 build) -- AI builds (or sends by ship) workers in single square islands.
 
Blake and Iustus.
Try checking the governor of the AI again. I played with the latest build and I discovered that sometimes the AI build things without any purpose. For example, He builds settlers in the industrial and modern era when the world is full and there isn't any place to settle. Also, the AI doesn't build the national and the world wonders in the most suitable cities. Just for example- he builds the Wall Street in a city that doesn't produce a serious amount of commerce, and the Oxford university in a bad science city.

There are checks for this in place. If you can post a save, ideally 1 turn before the AI chooses to build the building, I can look into why it is not working. I will be investigating this on my own, regardless.

One think you could do to help, is to turn on cheatcode=chipotle, and hold alt over the city, you will see something like this in the help text (along with other info):
ranks.jpg


This is saying that this city is:
2nd highest population
(base, prior to modifier buildings, etc): 3rd in food, 4th in production, 3rd in overall commerce
post modifiers, it moves up one rank in production to 3rd
it is 1st in gold, 2nd in research, and 3rd in culture

I would like to know what these ranks are showing for the cities you think are building the wrong thing (and which building it is building).

Most national wonders should be building in no worse than the 3rd best of their category, if they have an obvious category.

-Iustus
 
I've duplicated this bug. Something must have changed in the 12-12 BetterAI build, and here's my reasoning.

I have a cobbled-together modpack (call it BJw) of my own creation. It worked fine with BetterAI 12-09 build.

Using BJw with no (special) CVGameCore.dll works perfectly on generating new map and on a BJw savegame.
Using BJw with the 12-12 build in the mod folder - CTD on new game, CTD as soon as I end turn on old save.
Using BJw with the 12-12 build in customassets folder - CTD on new game, CTD as soon as I end turn on old save.
"Empty" BJw (literally all contents of mod folder deleted), no use of BetterAI dll - works on new game, works on old save - so it's not a problem with the interaction of the mod and the save itself
"Empty" BJw, 12-12 build in mod folder - CTD old save, but works for new game
"Empty" BJw, 12-12 build in customassets - CTD old save
No mods at all, 12-12 build in customassets - Works, both cases
Using BJw with a different modified CVGameCore.dll in mod folder - works, both cases
Using BJw with 12-9 build in mod folder - works, both cases.

This was pretty exhaustive and took about an hour to run through. The only cases that fail were the 12-12 build of BetterAI, used in conjunction with some other mod (in my case BJw, in UncleJoe's EDU).

The fact that I can grab a modified CVGameCore dll out of another random mod, like Customizeable Domestic Advisor, put it in my mod (with no components of CDA in use at all), and have it work, OR I can use the 12-9 build with my mod and have that work too - really seems to suggest something changed in the 12-12 build.

Apparently, it'd have to be a change like.. altering a function that doesn't actually get used by "vanilla warlords" but that a mod is calling. Even that is very strange, though - Ethically Diverse Units only modifies a single python file (screens\CvDawnOfMan.py), so I don't know what could have changed to make that fail. I'm going to make a mod that only changes XML and see if I can continue to reproduce this behavior, then I'll update this post.

*update after another 45 minutes of testing*
Running just pieces that modified XML from my BJw mod - worked with 12-12 build.
Running almost all components of my BJw but not the greatperson mod - worked with 12-12 build.
Running just GreatPersonMod, alone - CTD on ending turn, CTD on new game with 12-12 build. Works all cases 12-9 build.
Running Ethically Diverse Units alone - CTD on loading savegame (doesn't even get to turn) and CTD on new game with 12-12 build, but works all cases 12-9 build.

There's only a single file in common between these two mods - Assets\XML\Units\Unitinfos.xml. However, in my first test of just the xml files, I used my own modified copy of that file which contains all the changes (additional GP names) from the greatpersonmod as well as a few of my own changes to boot. There were no conflicts using it with the 12-12 betterai build.

I literally tried 14+ different mods singularly and in conjunction with one another (the "almost all components" bit above) and even all at once they ran fine with the 12-12 build. The only real common thread that the GP mod and the EDU mod have is that they both add a significant amount of custom artwork. However, plotlistenhancements and the modified sevopedia both add at least a few art files and I had no problem using those with 12-12 build.

The kicker, though, remains that any and all of these mods work fine with the 12-9 build.

I would use the python debugger to give better information but I can't get it to work in warlords (I've used it successfully for troubleshooting this type of thing in vanilla). I enable it in the warlords ini file, and the loader hangs on "init python" even when I'm only loading "vanilla warlords" and not autoloading a mod.

Thank you for doing all this work. I tracked down the issue and it will be fixed in the next build. (It was related to using an uninitialized variable, and loading a mod just seemed to be unlucky in getting the right bad value that would cause a crash). I am a bit suprised that this bug was not causing more crashes.

-Iustus
 
Back
Top Bottom