[BTS] SGOTM 25 - Home Slices

I loved playing with Pollina because she would always pop in with an exact answer--seemingly glad to research it. With me, it have to go kicking and screaming into the code. I often come up with a partial answer. It can give me a headache, but this time it didn't take too long.

The answer is: if the capital is not in the "area", which I take to mean Toku is off-continent, then you double the distance.
Therefore, our capital is 'closer' to Shanghai than Tokyo is.

See, that's a partial answer. I doesn't explain the culture thing. Want me to go back in? <= See, this is me complaining :D

Thanks for checking this!
Knowing about the distance doubling for overseas cities might have saved us from a minor disaster. :goodjob:

This shows the doubling I was talking about:

Code:
int iCapitalDistance = ::plotDistance(getX_INLINE(), getY_INLINE(), pCapital->getX_INLINE(), pCapital->getY_INLINE());
                    if (area() != pCapital->area())
                    {
                        iCapitalDistance *= 2;
                    }

And this shows how culture and distance are both used to pick the winner: (Pretty short and sweet, but it gives me a headache)
Code:
                    int iCultureTimes100 = getCultureTimes100((PlayerTypes)iPlayer);

                    if (bConquest)
                    {
                        if (iPlayer == getOriginalOwner())
                        {
                            iCultureTimes100 *= 3;
                            iCultureTimes100 /= 2;
                        }
                    }

                    if (GET_PLAYER((PlayerTypes)iPlayer).getTeam() == getTeam()
                        || GET_TEAM(GET_PLAYER((PlayerTypes)iPlayer).getTeam()).isVassal(getTeam())
                        || GET_TEAM(getTeam()).isVassal(GET_PLAYER((PlayerTypes)iPlayer).getTeam()))
                    {
                        iCultureTimes100 *= 2;
                        iCultureTimes100 = (iCultureTimes100 + iTotalCultureTimes100) / 2;
                    }

                    int iValue = std::max(100, iCultureTimes100) / std::max(1, iCapitalDistance);

                    if (iValue > iBestValue)
                    {
                        iBestValue = iValue;
                        eBestPlayer = (PlayerTypes)iPlayer;
                    }

I can't make sense out of code, but I did notice that +1:culture: per turn in cities very close to Tokyo didn't lose their (Liberate) option after gaining a few :culture:
Hmm
 
Last edited:
Does anyone know when the first whip anger expires in Yan'an?

There is currently 15 turn of whip anger in Yanan.
We will experience an angry citizen next turn on T31, but since we are building Settler, there won't be any food losses.

Pretty sure we get a free beaker. 15b x 1.2 x 22 = 396b. If you count the turns on the research bar in your screenshot, we are almost completing in 21t (378b with 15 base-b).

Btw, guys, I can't pause / unpause the game. I'm back to Civ after several years - is it the Pause key that we use for this? My new laptop doesn't have a Pause, and I've been searching online for a key combination that might substitute, but no luck. It's pretty annoying.

Oh!
The free +1:science:, ya I forgot about that. :love:

Yes, that clears up the math perfectly.
So no AI knows Horseback Riding yet.

Extra Credit math homework:
Spoiler :
Making a test game where I know no one has Civil Service, the various slider settings produce the following numbers:

Civil Service - 1352:science: to finish.
Preqreq bonus, 20% for knowing Code of Laws.
No bonus for not knowing Theology.

0:science: per turn, 1352 turns
1:science: per turn, 676 turns
2:science: per turn, 451 turns
3:science: per turn, 338 turns.
4:science: per turn, 226 turns
5:science: per turn, 194 turns
6:science: per turn, 169 turns
7:science: per turn, 151 turns
8:science: per turn, 136 turns
9:science: per turn, 113 turns
10:science: per turn, 104 turns

Having no :science: per turn means Civil Service should never complete, but it does.
Must be a secret +1:science: per turn bonus!

10:science: per turn gets things done in 104 turns.
10 * 1.2 * 104 turns = 1236:science:
That is far short of 1352 that Civil Service costs!
Let's add in the +1:science: that I thought only came with 0% slider.
(10+1) * 1.2 * 104 = 1372.8
That is close, but can't be right.
If the math worked that way, Civil Service would be done in 103 turns, not 104.

As always when I'm stumped by civ 4 math, there is a round down somewhere, or Floor().
Floor((10+1)*1.2)*104 = 1352, exactly what Civil Service costs!

Now we need 1 final test.
Is the formula Floor((10+1)*1.2)*104?
Or is it Floor((10*1.2)+1)*104?

Plug in all 11 values from 0:science: per turn to 10:science: per turn into both formulas, and see which gives 11 correct answers!

Floor((??+1)*1.2)*x turns = 1352
Plug in 0 Science, get x=1352/[Floor((0+1)*1.2)]; x=1352 turns. So far so good.
Plug in 1 Science, get x=1352/[Floor((1+1)*1.2)]; x=676 turns. So far so good.
Plug in 2 Science, get x=1352/[Floor((2+1)*1.2)]; x=451 turns. So far so good.
Plug in 3 Science, get x=1352/[Floor((3+1)*1.2)]; x=338 turns. So far so good.
Plug in 4 Science, get x=1352/[Floor((4+1)*1.2)]; x=226 turns. So far so good.
Pug in 5 Science, get x=1352/[Floor((5+1)*1.2)]; x=194 turns. So far so good.
Plug in 10 Science, get x=1352/[Floor((10+1)*1.2)]; x=104 turns. Great!

Floor((??*1.2)+1)*x turns = 1352
Plug in 0 Science, get x=1352/[Floor((0*1.2)+1)]; x=1352 turns. So far so good.
Plug in 1 Science, get x=1352/[Floor((1*1.2)+1)]; x=676 turns. So far so good.
Plug in 4 Science, get x=1352/[Floor((4*1.2)+1)]; x=271 turns. WRONG
Plug in 5 Science, get x=1352/[Floor((5*1.2)+1)]; x=194 turns. So far so good.

So take the visible :science: from your slider, add +1, then multiply by prereq bonus, then round down to the nearest integer.
That should be the true :science: per turn.


That makes me really want to tech Horseback Riding as our 1st tech!
The Kremlin means our cities with Libraries and coastal cities can make 2 Horseback Archers every whip!

I've lost my vigor for Currency.
We can tech it once we get Alphabet and that nice +20% research bonus.
 
Last edited:
What's the latest plan for finishing/chopping the Kremlin? our workers sit idle for 1t? or, more accurately, they do a partial road?

Yes, partial road 1 turn.
The overflow from Sword whip makes the Kremlin complete and the movie play in between turns 32 and 33.
 
Last edited:
I know we discussed trying to win using:
1) Conquest win by bulbing Astro to kill Roosevelt.
2) Religious win with Apostolic Palace.
3) Culture win with Spies.
4) Domination by settling every square on the entire continent.

What about #5, teching Monarchy + Feudalism, gifting Roosevelt 4 cities, and trying to get him to capitulate?
Then we'd just have to destroy the rest of the AI on our continent to get a Conquest victory. :)

Roosevelt has a city on our landmass, which we can get Land Target on to make it even easier to get a capitulation.
Test game indicates it is theoretically possible.
Spoiler :

We could even combine it with Bbp's suggestion to make Roosevelt part of our 150,000:culture: city plans.
His capital is already overseas.
After getting the 150,000:culture: city, we would give Roosevelt 3 cities, take them back immediately, and capture his 4th city to the south of our capital to get fast 40 war success.

**Warning**
25:gold: per turn was not enough to get test game Roosevelt to take city gifts beyond 4 cities. :eek:
Had to give him more.

If Roosevelt is the last AI in the game, and we don't have a city on his continent, will he capitulate to us after losing 4 cities?
He should be in the bottom half of the world's average power even if he owns a lot of barb cities on the American continent. :hmm:
I'm sure we'd have more than half his land %.
I can't recall if we need a city on his continent to enable Capitulation, but test game indicates we don't.

This might be a good backup plan if the AP win blows up in our faces?
 
Last edited:
I can't make sense out of code, but I did notice that +1:culture: per turn in cities very close to Tokyo

Looks like it all simply boils down to: liberation happens if...

is your (CultureInCity / Distance) less than his.

Examples: Note: 0 culture = 1 culture.

- so if we have 1 culture and he has none, it's just closest distance.

If we have 2 culture, then he would need to be 2X closer than we are to still liberate.

If we have 5 culture and he has 2 culture, then he needs to be 2.5x closer than us to still liberate.

If we have 10 culture and he has 0 or 1, he would have to be 10 times closer.
 
Looks like it all simply boils down to: liberation happens if...

is your (CultureInCity / Distance) less than his.

Examples: Note: 0 culture = 1 culture.

- so if we have 1 culture and he has none, it's just closest distance.

If we have 2 culture, then he would need to be 2X closer than we are to still liberate.

If we have 5 culture and he has 2 culture, then he needs to be 2.5x closer than us to still liberate.

If we have 10 culture and he has 0 or 1, he would have to be 10 times closer.
In other words (corrected):

OurDistance > OurCulture/HisCulture*HisDistance, where 0c => 1c.

Except for the offshore bit, which doubles the score for the one not offshore. Also, it presumably means if we're both offshore (a city on the other island to the east), it's back to what you typed above.

Does the bConquest bit mean that ifwe captured from him his liberation back to him score is *3/2?
 
Last edited:
I know we discussed trying to win using:
1) Conquest win by bulbing Astro to kill Roosevelt.
2) Religious win with Apostolic Palace.
3) Culture win with Spies.
4) Domination by settling every square on the entire continent.

What about #5, teching Monarchy + Feudalism, gifting Roosevelt 4 cities, and trying to get him to capitulate?
Then we'd just have to destroy the rest of the AI on our continent to get a Conquest victory. :)

Roosevelt has a city on our landmass, which we can get Land Target on to make it even easier to get a capitulation.
Test game indicates it is theoretically possible.
Spoiler :

We could even combine it with Bbp's suggestion to make Roosevelt part of our 150,000:culture: city plans.
His capital is already overseas.
After getting the 150,000:culture: city, we would give Roosevelt 3 cities, take them back immediately, and capture his 4th city to the south of our capital to get fast 40 war success.

**Warning**
25:gold: per turn was not enough to get test game Roosevelt to take city gifts beyond 4 cities. :eek:
Had to give him more.

If Roosevelt is the last AI in the game, and we don't have a city on his continent, will he capitulate to us after losing 4 cities?
He should be in the bottom half of the world's average power even if he owns a lot of barb cities on the American continent. :hmm:
I'm sure we'd have more than half his land %.
I can't recall if we need a city on his continent to enable Capitulation, but test game indicates we don't.

This might be a good backup plan if the AP win blows up in our faces?
:goodjob:

We'll have to be really careful with the civil score because in your scenario, I'd assume we'd be ranked below Roosy in Export/Import. We just need enough points to not miss by one or two.
 
Last edited:
What about #5, teching Monarchy + Feudalism, gifting Roosevelt 4 cities, and trying to get him to capitulate?
Then we'd just have to destroy the rest of the AI on our continent to get a Conquest victory. :)
Love it! :goodjob:

We could steal Monarchy. I think one of the AIs will tech it after IW.

This gives us the extra 8pts for diplo, so we need 2 less wonders.

Civil doesn't change at all, compared to a religious win with Roosevelt still alive.
 
As near as I can tell, the 2 best city spots to (Liberate) to Tokugawa in about 10 turns from now are in the far southeast:
2N of that fish.
2W of the clam.
Spoiler :

Toku has Organized Religion, so there is no reason he can't spread religion to his 2 new cities.
Once they pop borders, his capital can easily make workboats and then they will start to grow with Deity bonuses.
With those 3 cities, Toku should tech decently for us.

If we decide to viciously attack Toku a 2nd time (we do need a 2nd island city at some point to make Currency work good), capturing his capital will move Toku's Palace to 1 of those 2 cities, get Bureau bonus, and develop nicely.

If we want to wipe Toku out completely, 15 turns should be enough time for both cities to grow to Size 2, and then once captured both cities have 1 forest chop available for Granary.
The Lighthouse can then be whipped with 1pop = 48:hammers: thanks to Kremlin and State Property.
 
PPP Draft 2
Plan going forward
T29 - Cease Fire with De Gaulle

70% :espionage: slider to peek at Tokugawa's tech path.
If Alpha or Currency, then pause for team's input on tech choice.
If Tokugawa is teching something besides Alpha or Currency, 100% :science: slider on Currency on T30.
We will soon have 8 cities, so Currency is the strongest tech for us.

Leaving Tokugawa's capital alive will let him use Bureaucracy and his Palace to tech things for us using Deity bonuses.
We can swiftly crush Manchou beginning bombing on T31 and a T33 capture using Choko, whipped Sword (no culture slider allows 6/40:hammers: whip on T30), and 4 Chariots (road Rice).
This will let us sign a Cease Fire on T34..

Ugh, I made a counting mistake on this plan. :o
1 of the 2 southern Chariots cannot reach Manchou until Turn 34. :o
Spoiler :

The Manchou attack plan needs adjusting.

**Edit**

Hmm, can just send the 3.4hp injured Chariot up I suppose.
2S of Rice T30, On Rice T31 thanks to chops removing forests, Road Rice T32 so they can get near Manchou.
Send the healthy 1 near the desert south to grab that Tokyo Worker.

Is everyone comfortable with Bomber hitting Manchou's defenses on T31 and us pillaging Iron T31 and having 1 Chariot available for counter attack on T32?
The City Garrison Longbow is almost guaranteed to attack, and win easily with 96% odds, thus sacrificing a Chariot.
Our bomber can then bombard the Longbow down to 3hp, and our 2nd Chariot can kill it.
To make odds better, I can move Archer up towards the Iron right now in case 2nd Chariot loses against 3hp Longbow, avoid city growth in Beijing 1 turn, then use 10% cultural slider until the Archer can get back to Beijing.

Toku's Galley to the south also present some danger.
It could attack our Fishing boats in Gao, attack our Galley as we try to steal a Worker from Tokyo, or worst case, invade Hong Kong amphibiously with a unit while our galley and unit are inside it, sinking both and capturing our gems city.


I wish to play soon up to Turn 33's Manchou capture and Kremlin finish.
Tech 100% Horseback Riding.
Gau stealing the Fish for 1 turn would also be very beneficial getting Settlers and Workboat out a bit faster.
 
Last edited:
Ugh, I made a counting mistake on this plan. :o
1 of the 2 southern Chariots cannot reach Manchou until Turn 34. :o
I don't see how any of the southern chariots can reach before T34, since we don't have OB with Bismarck anymore.
I think we should try to lure out the LB next turn, as you suggest. After that, the city capture is easy.
 
Big picture, I am now in favour of the following:
1. Tech HBR and build a stack for Moscow asap - try to more or less follow WT's conquest plan for Europe with some tweaks.
2. Get out a settler for a Moscow bomber base, which will also serve as one of the gift cities.
3. Forget GLH, let's just get some units out. Let Roosevelt have it - means he's not expanding.

With the Roosevelt-capitulation idea, we only need to tech HBR / Aest / Lit / Feudalism, and steal CS / Monarchy.

We can build the wonders we need at the very end. With the extra 8pts from diplo, we only need 13 wonders. We will already have Palace / GW / Shrine / Kremlin / AP, leaving us needing only 8 more. HE and NE are super easy. Looking at the list of others, there are easily 6 available in the 250-400h range with 2.1x multipliers. Or we build the FP and GT. I'm sure we will have 6 cities that can whip-OF / chop those very quickly at the very end, once we are done with unit production and are just completing the conquest and culture aspects of the game.

We only need 1 more GSpy and 1 GA. Any additional GSpy and GP could be put to use, if we happen to get them. We just need a plan for getting the GA in time.
 
I don't see how any of the southern chariots can reach before T34, since we don't have OB with Bismarck anymore.
I think we should try to lure out the LB next turn, as you suggest. After that, the city capture is easy.

The 1st Chariot would definitely die, and the 2nd might die in a 4:strength: vs. 3:strength: fight.
Then even though 2 Chariots could attack from the south on T33, they can only capture the city, not Workers.
Best case scenario, our 2nd Chariot wins, and we can use 1 Chariot to capture 1 Worker.

If we don't grab those Workers the same turn the city falls, they will likely be disbanded by Toku.

How about we bomb the Iron mine on T31, and move our Archer 1S of the iron on T31?
That should lure out the Longbow to massacre our Archer, and we can bomb it down to 3hp and our Sword can kill it for easy 2xp.
Then our Choko and 4 Chariots can attack the remaining defenders, and hopefully we will have 2 Chariots near roads free to grab Workers after the city falls.

If we bombed the Iron mine now on T30, that would complicate getting our Galley to Hong Kong safely because Toku's galley would likely move toward us.
 
Last edited:
@Kait: Okay, I see what you did.* Chariot 6 was supposed ot board the galley because both the Shanghai chariots could then have made it to Manchou. Not too late to correct it. Chariot 6 goes T30:SE-SE and T31:SE-SE, then T32 boards the galley at HK-NE before it moves. Ready to capture the worker just before CF. The two Shanghai chariots can make it to the rice road (Sorry I forgot to mention that rice road in my earlier post.)

Finally had time to open the save.
Manchou is still building! 49h into freaking what?. :crazyeye: And how did he put 12h into anything without a mine? Baffling. He worked the cottage because it shifted from 7t to 6t to hamlet. He will have trouble building anything more than +1 archer by T33. although he could 0whip two of them. So we don't want to threaten Manchou too much on T31, I guess.

*Or were you planning to put the Shanghai sword onto the galley and capture the Tokyo sword with it? That would work.
 
Last edited:
How about we bomb the Iron mine on T31, and move our Archer 1S of the iron on T31?
That should lure out the Longbow to massacre our Archer, and we can bomb it down to 3hp and our Sword can kill it for easy 2xp.
Then our Choko and 4 Chariots can attack the remaining defenders, and hopefully we will have 2 Chariots near roads free to grab Workers after the city falls.

If we bombed the Iron mine now on T30, that would complicate getting our Galley to Hong Kong safely because Toku's galley would likely move toward us.
The Toku worker on the hill is dangerous. He can chop that forest into two archers by t33. So next turn I think you need to check what that worker is doing. Completed road? Mining? Chopping?

If chopping, we need a chariot on the fp at Manchou-2s1w on T31 after DoW.
If road completed, where is the other worker? In other words, can they both chop it on T31 for 2 archers by T33? If so, again chariot at Man-2s1w.
Or maybe just chariot at Man-2s1w no matter what to preserve that forest and hopefully scare workers into the city.

The choko and swords need to move to Man-2s2w on T31, right? That means they're threatening Manchou. With an archer at Man-1s2w and a chariot at Man-2s1w, that's four units threatening Manchou. Will the lb still attack the archer? I don't know. In any case, I agree that bombing the iron may be the safest way to go. It might mean that we attack the lb at 20% and 3.0/6 but so be it. We'll still take the city on t33.
 
The overflow from Sword whip makes the Kremlin complete and the movie play in between turns 32 and 33.
Not sure I understand you. I still see the Kremlin completing on T32 (after hitting Enter on T31).
T30 2whip sword
T31 sword
T32 Kremlin
 
Manchou is still building! 49h into freaking what?. :crazyeye: And how did he put 12h into anything without a mine? Baffling. He worked the cottage because it shifted from 7t to 6t to hamlet. He will have trouble building anything more than +1 archer by T33. although he could 0whip two of them. So we don't want to threaten Manchou too much on T31, I guess.
Okay, we can see that Manchou is working the two 1f2h forests (little cottages in the background. That explains the 12h (10h *125%), so Manchou is building some building but it's at least a 105h bdlg. So what is it? Either the Pyramids or some building from a later Era.

Note that samurais would cost Toku only 33h. Can't be that either, so he probably doesn't have Engineering.
 
and hopefully we will have 2 Chariots near roads free to grab Workers after the city falls.
On the road at Manchou-1w on T32, right? SHould be able to get 2 chariots there unless the T31 Man-2s1w chariot needs to chase workers, which is the goal anyway.
 
Top Bottom