Better BUG AI

Possible AI problem: Moving workers and/or ships into doomed cities unnecessarily

I had two situations now where the AI moved workers or empty ships into cities that were clearly doomed. Example: The AI has two cities left on the mainland. I'm attacking the AI capital. After the attack, the capital is defended by one heavily wounded Longbowman, whereas I have several strong attackers ready for the next turn. So the city is clearly doomed. Nevertheless the AI, in its turn, moves several workers from somewhere near the second AI city into the doomed capital, where I capture them in the next turn.

I can provide a proper report with a savegame if desired - if so, please shout.
 
Maybe jdog knows what this is, maybe not .. You can post a savegame to Report Questionable Behavior, maybe that helps.
Moving non-combat units to a more dangerous place on purpose sounds like a real bug, so I'll try to look at the save too but can't promise anything.
 
I linked to the post that includes the fix, which is simply restoring the original code and removing the "Efficiency" code from Lead from Behind.
 
Yes it is, you obviously didn't check the bottom of the first post:
SVN:
BULLAI @ scourceforge
Spoiler :
first Better BUG AI: http://forums.civfanatics.com/showthread.php?p=8657114#post8657114

2010-02-13 version was revision 15
2010-02-17 version was revision 23
2010-02-18 version was revision 25
2010-02-19 version was revision 31
2010-02-20 version was revision 35
2010-02-25 version was revision 39
2010-03-05 version was revision 42
2010-03-06 version was revision 44
2010-03-09 version was revision 47
2010-03-26 version was revision 55
2010-03-29 version was revision 62
2010-03-31 version was revision 63
2010-04-11 version was revision 64
2010-04-12 version was revision 65
2010-04-23 version was revision 69
2010-05-03 version was revision 70
2010-05-05 version was revision 71
2010-05-13 version was revision 72
2010-05-16 version was revision 74
2010-05-17 version was revision 80
2010-05-20 version was revision 83
2010-05-26 version was revision 87
2010-06-10 version was revision 96
2010-06-16 version was revision 97
2010-07-01 version was revision 98

2010-07-08 version is revision 99
 
Question about the code, in CvCity.
If im reading this right it looks like the same function is called in two different ways,

Code:
int CvCity::getAdditionalHealthByFeature(FeatureTypes eFeature, int iChange) const
{
	int iGood = 0, iBad = 0;
	return getAdditionalHealthByFeature(eFeature, iChange, iGood, iBad);
}

/*
 * Returns the total additional health that adding or removing iChange eFeatures will provide
 * and sets the good and bad levels individually.
 *
 * Doesn't reset iGood or iBad to zero.
 * Positive values for iBad mean an increase in unhealthiness.
 */
int CvCity::getAdditionalHealthByFeature(FeatureTypes eFeature, int iChange, int& iGood, int& iBad) const
{
Is this ok in C++?
 
Yes, that's ok.

.

I added an additional "SVN" link to the "Last Update" line, this should be more obvious. For the record, BullAI is just another name for the BULL and Better BTS AI SDK merge which existed long before my Better BUG AI, and since that project was pretty much abandoned I'm using its SVN for my own purposes now.
 
My brother and I (7000km apart) have tried about 5 games now with this mod. Every single game has turned into an OSS error fest sometime during the game.

Has anyone else tried this mod multiplayer? We'll be trying a mod-free game tonight to see what happens.
 
I haven't tried the latest version, but I have used earlier versions of this mod in multiplayer. We rarely get OOS early in the game, and get them in the midgame not infrequently but one player just disconnects and returns. I was never able to find a pattern to them or anything that would be helpful in tracking them down. In any case they were never so common that they made it too frustrating to play.
 
I had not heard of that feature. Seems overly confusing.

The reason I use it there is because modders wanted to know the net health change without being concerned about the good vs. bad contributions. The first function does just that: it returns the net without making you pass in variables to receive the good and bad values.

It's really only confusing if you a) don't understand function overloading and b) don't read the comments. :p

What is the CxImage folder for?

It provides the ability to take and save a JPEG screensnot from the SDK and Python. It's used by BUFFY/BUG's MapFinder feature.

My brother and I (7000km apart) have tried about 5 games now with this mod. Every single game has turned into an OSS error fest sometime during the game.

Did you follow the instructions in the README with regard to keeping four user settings the same among all players?
 
Friends and I play multiplayer, using direct ip, and we sometimes get OoS, usually when one player builds something BIG.

We usually simply save the game and reload and the OoS usually stays away.

It's only minorly bothersome.
 
Woo hoo. Tried my first mod and I do like it. Thanks very much.

I think I should have downloaded it first onto the desktop with the larger screen. There are also many new buttons. I'm still exploring.
 
I finally finished adding the few things I wanted to complete before I go off rewriting the civics ai. Took me a week longer than expected but at least now I'm done.

Better BUG AI 1.02a (2010-07-25) @ mediafire
rev 100
- Spies will wake up again when stationary bonus is maxed, if sent to sleep on a plot where they can perform missions (Afforess)
- more MongooseFeatureDamageFix
- various small fixes/teaks for the AI
- no more isolated starts on PerfectWorld!
rev 101
- AI can now build city defense units even if only warriors are available (using other UnitAIs, ignoring NotUnitAIs)
- Retreat to a doomed city is hopefully less likely now
- Building forts is no longer considered in AI_bestPlotBuild, they can only be built from AI_improveBonus. (That's the way it was initially, and that's the way it should be. I see that now.)
 
Back
Top Bottom