Version 0.60 Discussion Thread

I dunno whether this is an idiotic suggestion, I'm only new to the game (Noble only) but is there a way to improve automated workers? Well worker AI in general, I play on Noble and I haven't got the patience to work with 20-30 workers a turn so I just automate them all, but sometimes they do some really stupid stuff. One tile they turn into a cottage... then a workshop... then a farm when there are another half a dozen tiles that are exactly the same and unimproved. No civic changes in that time or tech improvements, it's really annoying.
 
The AI now has two main flaws left in Better BtS AI. You've highlighed one there Turkey. The worker AI is still very bad, it breaks the AI right now. In fact it's worse then you make it out to be, since the AI cycles out Towns and Villages, destroying it's economy when it does that.

Related to that is the other main weakness of the AI city specialization. Of course city specialization could not be tackled until worker AI is fixed so that the AI doesn't continualy replace it's improvements around a city.

Other tweaks to the AI being made now, such as the suggested improved voting behavior, or adding the ability for the AI to load exploring units onto boats will improve the feel of the game, and have visible effects. But they wol't substantially improve the strength of the AI. What's left in this mod to really make a substantial improvement to the AI's power would be to improve it's Worker AI, and City Specialization. Unfortunately these two changes are probably very complex, and tedious to code, and also don't have directly visible returns, it takes a while for such behavioral improvements to show up, and they are subtle.
 
since other mods all over the world are using better bts ai too, we should not link ai behavior with single technologies.

imo is the ai already rushing to techs which give free techs or free units.
 
Maybe the AI undervalues the value of unknown technologies in games that allow tech trading.

I personally think that many players overvalue the Liberalism technology. It is an interesting technology to reach first, but by no way a must have for me. I regularly win games where I don't reach this technology first.
 
In fact it's worse then you make it out to be, since the AI cycles out Towns and Villages, destroying it's economy when it does that.

Interesting to note that Vanilla/Warlords AI didn't do such things.

I'm only new to the game (Noble only) but is there a way to improve automated workers?

Advanced/Options/Automated Workers Leave Old Improvements.
 
Interesting to note that Vanilla/Warlords AI didn't do such things.

I've played quite a bit of games lately with the last version of better AI and debug mode on so I could watch what the AIs did. I gotta say I never saw it.
 
I've played quite a bit of games lately with the last version of better AI and debug mode on so I could watch what the AIs did. I gotta say I never saw it.

It is prevalent in the late game.
 
If the result of the AI picking techs one at a time is that if often doesn't see a really great tech 2 techs away because it's blocked by a poorer tech, then it'd be a problem.

I reckon averaging the value of two or three techs ahead could be worth it (or some more appropirate way to weight them). This would require the AI to be able to value techs that it cannot currently research though. Beelining too far down the tree is probably not a good idea by the way, especially if it is not flexible to shift strategy along the way.
 
- Holding down SHIFT+ALT and clicking on a leader in the scoreboard now sets your civ's warplan towards that leader to WARPLAN_PREPARING_TOTAL, like the AI does when beginning war preparations. This can be used to signal to Vassals that they should begin preparing for war, either declaring war or SHIFT+ALT clicking on the leader again will cancel (not multiplayer compatible)

Question over it: Does that works with permanent allies too?
 
If the result of the AI picking techs one at a time is that if often doesn't see a really great tech 2 techs away because it's blocked by a poorer tech, then it'd be a problem.

I reckon averaging the value of two or three techs ahead could be worth it (or some more appropirate way to weight them). This would require the AI to be able to value techs that it cannot currently research though. Beelining too far down the tree is probably not a good idea by the way, especially if it is not flexible to shift strategy along the way.

That's a very good point, and it's definitely a failing of the AI. The problem with the current method of tech-choosing is that looking out beyond the set of immediately available techs will slow the game to a crawl. Because the AI would have to cycle through all the techs for ones it can research, then evaluate each of them, then for each of those, cycle through all of the techs again looking for any techs that might have the first tech as a prerequisite and evaluate that tech. And if you extend it out two techs further down the line, you'd have to cycle through yet again and evaluate any techs that have those techs as a prereq.

But I don't think all hope is lost though... I think that one of the major faults of the AI is that it doesn't retain any knowledge from game to game. Having played over and over again, we develop a list of techs that we think are particularly useful and become "must-have" techs.

It would make sense to me to have the AI compile at the outset of each game a list of must-have techs (let's say 5) based on that AI's particular strategy. Then it would be a lot easier for the AI to cycle through that short list of techs and work its way backward to a preferable path to that tech than to start from where the AI is now and work forward with an increasingly wider set of branches on the tech tree. We could also make it so that the AI would periodically reevaluate the top-five techs it wants cycling out already researched ones, or ones that have dropped in value from a shift in strategy.

I'd also like to see the AI keep other lists of important things. In particular, I'd like to see the AI have some kind of list of desirable units for its strategy, or a quick "cheat sheet" of which units are the best against other units. I mean, if the AI invaded me with a huge army of Knights, and I didn't already have Pikemen ready to throw into the field, I'd probably start to build some... the AI, on the other hand, doesn't seem to take into account the composition of an enemy's force when deciding which units to build next.
 
Question over it: Does that works with permanent allies too?

Nevermind, I saw myself that it worked(by holding alt on my ally's name). But the problem is, when I did it, Zara started building missionaries of our religion nonstop, almost no military(he had only 3 cities at the point in the game) and started to send to convert the cities of Boudica, which we were set for total war with.

Why exactly it happened? He built only 1 axe and 1 spear in the 20~ turns since I set him on total war. He actually sent them(the axe and spear) around the same time I sent my stack to the enemy, but still, that doesn't really help, does it?
 
That's a very good point, and it's definitely a failing of the AI. The problem with the current method of tech-choosing is that looking out beyond the set of immediately available techs will slow the game to a crawl. Because the AI would have to cycle through all the techs for ones it can research, then evaluate each of them, then for each of those, cycle through all of the techs again looking for any techs that might have the first tech as a prerequisite and evaluate that tech. And if you extend it out two techs further down the line, you'd have to cycle through yet again and evaluate any techs that have those techs as a prereq.

If we didn't have to worry about compatibility with other mods, there could be a small database file that has all the information about which techs open up which. To have it work for all mods, you could simply create the file on the first turn of the game or something. I'm not completely sure but maybe you are overestimating the complexity of the search? Each tech usually only opens up one or two more and this information is probably pulled from XML? Or is it the other way round - each tech lists its prerequisities? In the latter case, the search would be more tedious and my earlier comment of creating a precompiled list could work better.

eg.
Tech A - opens up D and E
Tech B - opens up D and F
Tech C - opens up G
...

Using this list would be a matter of when valuing A, taking the appropriate weight with D and E. If the depth of the search was yet another tech in, you just average the value of Tech A and its next techs D and E. This is a recursive sort of thing I guess.
 
PieceOfMind, you don't use a file. Rather you use a deterministically constructed cache with fast lookups that automatically builds the cache on the first query.

This makes it stable over save/load cycles, and means you don't have to store any information on disk.

Sadly, it isn't true that a given technology "opens up" an other technology. The rules for Civ4 tech research are two lists, where "you must have all of X" and "you must have at least one of Y".

That means there is often multiple paths to get to a given technology.
 
A strange bug I've detected: In my latest game, Bombay (Indians) is the holy city of both Hinduism and Judaism. Hinduism is the major religion in the world (24%), while Judaism is a minor one (1%). The state religion of the Indians is Hinduism and it is present in their main cities.

When the first indian great prophet appeared: they used it to build the temple of Salomon instead of the Hinduism holy shrine :crazyeye: . They're losing not only tons of money but the espionage bonus and the increased conversion rate of other cities to Hinduism too!
 
PieceOfMind, you don't use a file. Rather you use a deterministically constructed cache with fast lookups that automatically builds the cache on the first query.

This makes it stable over save/load cycles, and means you don't have to store any information on disk.
Yeah a "file" is just my simplistic way of describing what you are talking about, because I can't program with these sorts of objects yet and I'm not sure how it's all done (my ideas are more to do with what is possible in theory).

Sadly, it isn't true that a given technology "opens up" an other technology. The rules for Civ4 tech research are two lists, where "you must have all of X" and "you must have at least one of Y".

That means there is often multiple paths to get to a given technology.

I see your point. But I think that is a problem that can be overcome. After all, in the pedia each tech has its prereqs listed explicitly.

If a Tech D requires Techs: A AND (B OR C),
then under the entry for Tech A in this cache, you would have:

Tech A: Leads to D, with B or C.

So if A is a tech you can currently research, D would be 1 deep down the tree if B or C is owned.

Creating the concise form of the list is not easy algorithmically but doable. I think having the AI consider techs 1 or 2 more deep in the tree could be very valuable, considering this is a huge advantage human players have at the moment.

If you want I could try and write the algorithm but I am unsure what form you'd like the list to take exactly.

When it comes to checking which techs open up which, obviously you'd need to do very simple checks on what techs you have, but it would not involve checking all the prereqs of every tech there is.
 
If we didn't have to worry about compatibility with other mods, there could be a small database file that has all the information about which techs open up which. To have it work for all mods, you could simply create the file on the first turn of the game or something. I'm not completely sure but maybe you are overestimating the complexity of the search? Each tech usually only opens up one or two more and this information is probably pulled from XML? Or is it the other way round - each tech lists its prerequisities? In the latter case, the search would be more tedious and my earlier comment of creating a precompiled list could work better.

eg.
Tech A - opens up D and E
Tech B - opens up D and F
Tech C - opens up G
...

Using this list would be a matter of when valuing A, taking the appropriate weight with D and E. If the depth of the search was yet another tech in, you just average the value of Tech A and its next techs D and E. This is a recursive sort of thing I guess.

Well, what I would do (and probably will) is have the AI cycle through all the techs at the outset of the game and pick the most valuable techs... let's say five or six. This would also allow the mod to work with other people's mods as well. And then when the AI looks to new techs to research, it will evaluate whether or not that tech will lead to the discovery of one of its five top techs. I've already coded a function that quickly starts from the desired tech and works its way back through the prereqs to see if the tech being evaluated leads to it.

This is essentially what the human player does when they want to beeline to a tech. We all have those must-have techs that fit into our strategy, and we plot our research path to get us to those techs as quickly as possible without compromising other potentially important techs. You could also add a new XML value that could determine how crucial the tech's ability to unlock future techs is to the AI, so modders could tweak this.
 
I found a small error while debugging a CTD for our mod. In CvUnitAI::AI_assaultSeaMove():

Code:
/*************************************************************************************************/
/** BETTER_BTS_AI_MOD                      01/21/09                                jdog5000      */
/**                                                                                              */
/** Naval AI, bugfix                                                                             */
/*************************************************************************************************/
		if( iCargo >= iTargetInvasionSize )
		{
			bAttack = true;
		}

		if ((iCargo >= iTargetReinforcementSize) || (bFull && iCargo > cargoSpace()))
		{
			bReinforce = true;
		}

		CvPlot* pAdjacentPlot = NULL;
		for (int iI = 0; iI < NUM_DIRECTION_TYPES; iI++)
		{
			pAdjacentPlot = plotDirection(getX_INLINE(), getY_INLINE(), ((DirectionTypes)iI));
			[B]if (pAdjacentPlot == NULL)
			{
                                continue;
			}[/B]
			if(iCargo > 0 )
			{
				CvCity* pAdjacentCity = pAdjacentPlot->getPlotCity();
				if( pAdjacentCity != NULL && pAdjacentCity->getOwner() == getOwnerINLINE() && pAdjacentCity->getPreviousOwner() != NO_PLAYER )
				{
					if( (GC.getGameINLINE().getGameTurn() - pAdjacentCity->getGameTurnAcquired()) < 5 )
					{
						// If just captured city and we have some cargo, dump units in city
						getGroup()->pushMission(MISSION_MOVE_TO, pAdjacentPlot->getX_INLINE(), pAdjacentPlot->getY_INLINE(), 0, false, false, MISSIONAI_ASSAULT, pAdjacentPlot);
						return;
					}
				}
			}
			else
			{
				if (pAdjacentPlot->isOwned() && isEnemy(pAdjacentPlot->getTeam()))
				{

The bold lines are what I have added. Thought this might save you a couple of minutes if it's not already fixed.
 
So the bug there is when a unit is at the edge of the map in a direction that doesn't wrap?
 
Back
Top Bottom