AI Issues

Androrc the Orc

Emperor
Joined
Apr 19, 2004
Messages
1,621
Location
Vienna, Austria
I just downloaded the latest version of WestwardHo (0.4) and applied the latest patch (0.42), but I'm having one issue. Having started a map on huge, the colonial AI players seem to be brain dead. They never leave their starting location, and even if I give them some units they won't create cities.
 
Yeah, TC01 and I have been discussing this issue. For some reason I can't get the SDK he uploaded to work for me so I passed a long some files for him to merge into the SDK that should fix this.

The problem is simple in that if the AI has no cities it will search the whole map for a good spot on the coast that has access to a Europe Tile, sense Westward Ho's map generator has no Europe Tiles each tile always returns 0. So, the AI never finds a spot to found its first city. After the first city things run as normal so I removed the check for the best Europe Tile and that should fix it. The files I uploaded are here: http://forums.civfanatics.com/showpost.php?p=9865917&postcount=2

Not sure if the DLL he has uploaded will work for you or not but you can try it out.
 
I've merged it.

I am not totally sure if it's working or not, though. In my first test, I saw the AI send out it's two non-Wagon units.

In the second, it didn't.

I don't have the time to test further, but I'm attaching the compiled DLL (and changed XML file) in "patch" form.

It's just a zip containing a WestwardHo mod folder. Copy that mod folder into Colonization\Mods and click yes to overwrite.


Also, Kailric, the DLL compiles fine for me using Visual Studio. You use Codeblocks, right? That may be the problem.
 

Attachments

  • AI Fix Attempt 1.zip
    1.1 MB · Views: 239
I've merged it.

I am not totally sure if it's working or not, though. In my first test, I saw the AI send out it's two non-Wagon units.

In the second, it didn't.

I don't have the time to test further, but I'm attaching the compiled DLL (and changed XML file) in "patch" form.

It's just a zip containing a WestwardHo mod folder. Copy that mod folder into Colonization\Mods and click yes to overwrite.


Also, Kailric, the DLL compiles fine for me using Visual Studio. You use Codeblocks, right? That may be the problem.

K, I'll check it out when I get home this evening. Yeah, I use Codeblocks but I also have Visual C++ 2008 Express Edition I use it to compile the debug version. I'll see if I can get it compiled using that.
 
I tested the fix, and in a normal map (and thus, two opponents), one of my opponents built a city, but only after a few turns. The other opponent didn't build a city at all, until I manually gave him a city, after which he functioned normally.
 
I tested the fix, and in a normal map (and thus, two opponents), one of my opponents built a city, but only after a few turns. The other opponent didn't build a city at all, until I manually gave him a city, after which he functioned normally.

Haven't got home yet to test this yet. Yeah, the AI will take a few turns to build a city cause they can't build within 6 tiles of their homecity. So they have to move away first. Why the other civ didn't build a city is puzzleing but I'll figure it out.
 
I figured out why I could not compile. For some reason your (TC01) WestwardHo dll has more "Cy" files than the original. Like CyCityInterface1 has been split between CyCityInterface2 through 5. So, I added all the missing ones in Codeblocks and I was able to compile it.

The extra files are:

CyCityInterface2 - 5
CyDealInterface
CyGameInterface1 - 3
CyGlobalContextInterface5 - 7
CyMapInterface1 - 2
CyPlayerInterface3 - 4
CyPlotInterface2
CyUnitInterface2

I'll be able to better fix this now and post a new Dll for testing soon.
 
To compile in Visual C++, I needed to split my files (or rather, use the downloaded makefile project which had the files) like that. TC01's case is likely the same, specially since we discussed that downloadable makefile some time ago here in the forums.
 
To compile in Visual C++, I needed to split my files (or rather, use the downloaded makefile project which had the files) like that. TC01's case is likely the same, specially since we discussed that downloadable makefile some time ago here in the forums.

Ok, cool. THanks for the heads up on that.

I have attached a new fix. There is a new dll already compiled plus 4 cpp files and 2 xml files.

In my tests all AIs would found a first city.

The new Rule is you can't found a city within 5 tiles of any Home City, not just your own.
 
I've made an installer for Kailric's patch, to make it easier to apply, and released it as patch "0.421"- a standalone patch that you have to apply on top of 0.42. It's been posted to the download thread, the main thread- and here's another link: here.

I should note, however, that it doesn't work with AI Autoplay. Most users don't need to worry about that.
 
I've made an installer for Kailric's patch, to make it easier to apply, and released it as patch "0.421"- a standalone patch that you have to apply on top of 0.42. It's been posted to the download thread, the main thread- and here's another link: here.

I should note, however, that it doesn't work with AI Autoplay. Most users don't need to worry about that.

Cool, thanks TC01.

What exactly do you mean by "it doesn't work". Does it crash the game or does the AI not act right or something?
 
Cool, thanks TC01.

What exactly do you mean by "it doesn't work". Does it crash the game or does the AI not act right or something?

The other AIs do found cities, but your autoplayed civ I does nothing.

I put the game on autoplay for maybe 25 turns- I had done nothing afterwards, but both of the other players on the map had founded a colony.
 
The other AIs do found cities, but your autoplayed civ I does nothing.

I put the game on autoplay for maybe 25 turns- I had done nothing afterwards, but both of the other players on the map had founded a colony.

Ahh, well you may have to manually unload your units from the wagon and then start AutoPlay...

Yes, I just checked it. If you unload your units then you can Autoplay just fine. If I remember I'll add a check for Autoplay in the next update.
 
Reuploaded the patch installer- it should install to the correct directory now.

(It was installing to "Westward Ho" rather than "WestwardHo").
 
Happy New Year to all.
 
Top Bottom