Quick Answers / 'Newbie' Questions

Where can I ask a question here? (Newbee)
Simple quick questions can go here. If you want a more detailed discussion, or have a lotta questions feel free to start your own thread.
 
I was playing a game on Noble and popped Bronze Working from a hut on turn 2 and got the usual "switch to slavery?" prompt, which I declined at that time, but then the very next turn I got a prompt I'd never seen before, saying something like "You may want to take a look at your available civics" featuring the same choices as the "switch to [civic]?" prompt minus the button that instantly switches to the civic. I guess this isn't really a question so much as a "huh, that's weird"
 
AFAIK that popup usually appears in advanced starts, I definitely have seen it before, especially in mods. It usually occurs on the second played turn (i.e. turn 1 if one starts at turn 0).

That it appeared probably is related to discovering the tech in the first 5 turns as these have slightly different rules.
 
Yeah I figured it was something like that. I may have popped it turn 0, I can't remember precisely, but it was definitely within like the first 3 turns this occurred.
 
With Auto-Promotions turned on, how does the computer determine what promotions to add to units?
 
I've never even tried that option, but, according to the code, the promotions get chosen by the AI as intelligently as it can:
Spoiler :
C++:
void CvPlayerAI::AI_doTurnUnitsPost()
{
	// ...
	if (!isHuman() || isOption(PLAYEROPTION_AUTO_PROMOTION))
	{
		for(pLoopUnit = firstUnit(&iLoop); pLoopUnit != NULL; pLoopUnit = nextUnit(&iLoop))
		{
			pLoopUnit->AI_promote();
		}
	}
	// ...
}
And AI_promote calculates a "promotion value" for each valid promotion and picks the one with the highest such value: CvUnitAI::AI_promotionValue
The value depends a lot on the "AI type" assigned to the unit. For a human unit, I think that'll be the default AI type set for the unit type in Civ4UnitInfos.xml, e.g. city defender for all Archers. This AI type probably gets (permanently) assigned here when a human player starts producing a unit:
Spoiler :
C++:
void CvCity::pushOrder(OrderTypes eOrder, int iData1, int iData2, bool bSave, bool bPop, bool bAppend, bool bForce)
{
  // ...
	switch (eOrder)
	{
	case ORDER_TRAIN:
		if (canTrain((UnitTypes)iData1) || bForce)
		{
			if (iData2 == -1)
			{
				iData2 = GC.getUnitInfo((UnitTypes)iData1).getDefaultUnitAIType();
			}
			// ...
		}
A quick test in the debugger seems to confirm that this is how it works. Auto-promotions at the start of a human turn, newly produced units appear at the end of a human turn. Well, one couldn't promote them faster than that manually either (to have them promoted in case that they need to defend immediately).
 
I've never even tried that option, but, according to the code, the promotions get chosen by the AI as intelligently as it can. A quick test in the debugger seems to confirm that this is how it works. Auto-promotions at the start of a human turn, newly produced units appear at the end of a human turn. Well, one couldn't promote them faster than that manually either (to have them promoted in case that they need to defend immediately).
I looked in here - https://modiki.civfanatics.com/index.php?title=Civ4PromotionInfos - but I could not see any parameter that uses <AIWeighting> or similar
 
I see no way to guide the choice of the promotion through XML other than changing default unit types, – which will have have side-effects. Not seeing a Python override either. The BeginPlayerTurn handler might run before the DLL assigns auto-promotions, so perhaps one could apply some special promotion rules through Python beforehand.
 
Supposedly, a ship of the line has "+50% vs. Frigate." Is this really the case? Does a SOL get the +50% while defending against a frigate as well?

I'm asking because over the years, I've noticed that the AI's frigates seem to have a remarkable success rate against my SOLs. With the same number of combat stars on each side, you'd think it would be pretty uncommon for a frigate to take out a SOL, seeing as how the latter has a +50% bonus and a +10% "terrain" bonus. But over and over again, I watch the AI's frigates pick off my undamaged SOLs. It's kind of aggravating.

"It's just confirmation bias." Yeah, I hear ya, but this time I got into an intercontinental war against two AI nations with plenty of sea battles, and I started keeping score. So far, with undamaged units and an equal number of combat stars, the AI's frigates have won 12 out of 21 attacks on my SOLs. Seems a tad high to me.

"That means nothing because of insufficient sample size." OK, fair enough. What would be a sufficient sample size?

Just to be clear, I'm not accusing the game of "cheating." I'm wondering if there's some kind of disconnect between documentation and code.
 
A bonus will specify if it only applies to offensive or defensive battles (see Phalanx having +100% defence against Chariots), so the +50% vs. Frigates applies to both. A quick test confirms that the game at least reports the bonus working in both cases, so if it didn't actually apply properly that would very difficult to test. It's possible to get the game to spit out a sufficient sample size worth of random numbers, the issue is that no one knows how the combat mechanics actually utilize those numbers, so it's not clear whether the game is actively cheating, merely has a tendency to get streaks of similar outcomes too often (I.E. "Frigate deals damage against a Ship of the Line") due to pseudo-random RNG quirks, or is as perfectly fair as it can be short of being hooked up to a Geiger counter to generate truly random numbers.

For the record, with full health and both sides having equal Combat promotions, the odds for a Frigate to win against a Ship of the Line should be around 9-11%. That said, two caveats: One is that the defensive bonus from coast doesn't make a significant difference, about 1% to the final chance to win or lose. Two is that SotLs (assuming the above scenario) deal 24 damage per successful combat round, which means Frigates barely survive four combat round losses instead of only three, which increases their odds of unlikely victories pretty significantly - one more chance to roll the dice, pretty much. If you see a frigate with only 0.3:strength: remaining it won because of that extra combat round.

All that said 12 out of 21 such combats favoring the ~10% outcome is certainly statistically improbable, but I wouldn't say it's out of the question for Civ IV's notorious combat RNG. It has a reputation, though to what extent it is deserved I unfortuntaely can't say.
 
You can test it in World Builder, say a duel map Deity Archipelago. Create a stack of 100 SoL for you and 100 Frigates for the AI. I tested it and got about 90% win rate from the SoL.

Now let's say you want to test the AI frigates attacking your SoL. You can't have equal stacks because even an aggressive AI like Montezuma will not attack at 10% odds. So I gave him hundreds of frigates vs. 40 SoL to see how many he would lose to destroy my stack. First let's try to roughly calculate how many it would take.

sol.png


On average we expect him to lose 36 out of the 40 initial battles at 10% odds. On the left side above you see the odds for undamaged SoL defending in ocean, so no 10% defense for coast for +50%, resulting in 8 combat strength vs. 12. This is the combat odds display on BUFFY, not sure how it looks without mods. Anyway, notice on the left side how it says 55 HP on defeat, that means each loss on average brings an opponent SoL to ~55% of its HP.

On the right side, you see the odds if a fresh frigate attacks a SoL with almost the average outcome of the first battle (52 HP). And now you have very good odds. It's not strictly mathematically correct, but let's assume the average outcome for all battles. The AI would lose 36 frigates on the first wave, and then will only lose about 6 on the second wave because of ~5/6 win rate. Then probably no more losses to finish a few highly damaged ships. So maybe we expect 42 frigates lost to wipe a stack of 40 SoL with 100+ fresh frigates to throw at it. It's almost equal units loss, but you end up with 40 damaged frigates as well.

So let's see what actually happens in game if I let Montezuma attack my SoL, and then on the next turn reverse the situation by creating a large stack of frigates attacking a stack of 40 Montezuma SoL until I eliminate them all. And then I look in the Statistics pane.

sol2.png

Surprisingly, the losses were exactly symmetrical on both sides, and both pretty close to our rough calculation of 42 frigates lost.
 
Thank y'all for the analysis. The total results righted themselves somewhat before tech improvements came around, but I was still on the short end.

Right now I'm stewing more about watching a stack of 6 of my cannon EACH losing against a monster pile of knights. Success chance: 63.7%. 0-6 with those odds. :D C'est la guerre.
 
Is it really necessary to research Sailing for trade routes? When I open borders with other civs it takes a lot of time before my cities get trade routes. Is there any way to speed up the process?
 
Is it really necessary to research Sailing for trade routes? When I open borders with other civs it takes a lot of time before my cities get trade routes. Is there any way to speed up the process?
To get trade routes you need (off the top of my head):
  • There needs to be a route (either by water or with roads)
  • One of you need to have mapped the route
  • One of you need to have the tech for the route if over water (rivers, coast, sea or ocean)
  • You BOTH need to be allowed foreign trade routes, ie. neither in merchentism
 
More specifically, you need Sailing tech to established trade routes over rivers and coast tiles outside your cultural borders. Anything within your cultural borders you can established trade routes through without any tech, although this is generally only useful for establishing early domestic trade routes.
 
Thank you all for the responses. I have more questions. Is it better to research Monarchy for the increased happiness in order to work more tiles or Currency for the additional trade route? In some games the +1 trade routes gives me a good amount of commerce but Currency takes a lot to research because you need Alphabet or Mathematics first.
 
Monarchy is always offered by AIs for trade (if relations are good enuf), so if you play with standard settings and expect that one of them will go for Monarchy, researching a different tech will be better.
Same goes for Alpha :)
There are only a few techs that AIs always give away, but those 2 are in.
 
Monarchy is always offered by AIs for trade (if relations are good enuf), so if you play with standard settings and expect that one of them will go for Monarchy, researching a different tech will be better.
Same goes for Alpha :)
There are only a few techs that AIs always give away, but those 2 are in.
Does this strategy work on high difficulties like Immortal and Deity? Because in those difficulties the AI overwhelms me in terms of research capatibility. Is it a good idea to get Hereditary Rule, work cottages and then work your way to Currency?
 
Does this strategy work on high difficulties like Immortal and Deity? Because in those difficulties the AI overwhelms me in terms of research capatibility. Is it a good idea to get Hereditary Rule, work cottages and then work your way to Currency?
The higher the level, the more the AI will have techs to trade. Trade for Monarchy. Currency is good bait.
 
Back
Top Bottom