SGOTM 16 - Kakumeika

Here how a tech value is calculated:

iCost
= TechCost - HowFarAiProgressedOnThatTech.
Indeed, for fresh techs, it's only the tech cost after considering mapsize, gamespeed and difficulty you are playing on.
So to put this in GrandpaSpeak, are you saying that for Fishing the tech value for Brennus is:

40 * mapsize * gamespeed * difficultylevel

and this is found in CvTeam.cpp, CvTeam::getResearchCost, correct?
Spoiler :
Code:
int CvTeam::getResearchCost(TechTypes eTech) const[COLOR="SeaGreen"][/COLOR]
{
	int iCost;

	FAssertMsg(eTech != NO_TECH, "Tech is not assigned a valid value");

	iCost = GC.getTechInfo(eTech).getResearchCost();

	iCost *= GC.getHandicapInfo(getHandicapType()).getResearchPercent();
	iCost /= 100;

	iCost *= GC.getWorldInfo(GC.getMapINLINE().getWorldSize()).getResearchPercent();
	iCost /= 100;

	iCost *= GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getResearchPercent();
	iCost /= 100;

	iCost *= GC.getEraInfo(GC.getGameINLINE().getStartEra()).getResearchPercent();
	iCost /= 100;

	iCost *= std::max(0, ((GC.getDefineINT("TECH_COST_EXTRA_TEAM_MEMBER_MODIFIER") * (getNumMembers() - 1)) + 100));
	iCost /= 100;

	return std::max(1, iCost);
}
but are those values the same for us as for AIs, or not?

I find:
- <HandicapInfo> <Type>HANDICAP_EMPEROR</Type>
<iResearchPercent>120</iResearchPercent>

- <WorldInfo> <Type>WORLDSIZE_STANDARD</Type>
<iResearchPercent>130</iResearchPercent>​
but do both of these apply to Brennus also? Or does the 1.2 handicap only apply to humanoids?

So, for Gramps, is the answer
40*1.3*1.2​
or just
40*1.3​
?

Btw, Tachy, I really appreciate the way you explain the code. I'm such an amateur most of it goes right over my head, but for the first time, I'm starting to understand certain calls. Like if I'm understanding it correctly, this:
Code:
GET_PLAYER(getSecondPlayer()).AI_dealVal(getFirstPlayer()
is saying, go look in CvPlayer.cpp to find getSecondPlayer(), right?
 
So to put this in GrandpaSpeak, are you saying that for Fishing the tech value for Brennus is:

40 * mapsize * gamespeed * difficultylevel

and this is found in CvTeam.cpp, CvTeam::getResearchCost, correct?
Spoiler :
Code:
int CvTeam::getResearchCost(TechTypes eTech) const[COLOR="SeaGreen"][/COLOR]
{
	int iCost;

	FAssertMsg(eTech != NO_TECH, "Tech is not assigned a valid value");

	iCost = GC.getTechInfo(eTech).getResearchCost();

	iCost *= GC.getHandicapInfo(getHandicapType()).getResearchPercent();
	iCost /= 100;

	iCost *= GC.getWorldInfo(GC.getMapINLINE().getWorldSize()).getResearchPercent();
	iCost /= 100;

	iCost *= GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getResearchPercent();
	iCost /= 100;

	iCost *= GC.getEraInfo(GC.getGameINLINE().getStartEra()).getResearchPercent();
	iCost /= 100;

	iCost *= std::max(0, ((GC.getDefineINT("TECH_COST_EXTRA_TEAM_MEMBER_MODIFIER") * (getNumMembers() - 1)) + 100));
	iCost /= 100;

	return std::max(1, iCost);
}
but are those values the same for us as for AIs, or not?

I find:
- <HandicapInfo> <Type>HANDICAP_EMPEROR</Type>
<iResearchPercent>120</iResearchPercent>

- <WorldInfo> <Type>WORLDSIZE_STANDARD</Type>
<iResearchPercent>130</iResearchPercent>​
but do both of these apply to Brennus also? Or does the 1.2 handicap only apply to humanoids?

So, for Gramps, is the answer
40*1.3*1.2​
or just
40*1.3​
?

40*1*1.3, except that there is rounding at each operation, and so the order of operations matters. AIs play on Noble level, so they get the Noble non-handicap. We get 1.2 because we're on Emperor, not because we are human. Everyone is on the same map, so everyone gets the 1.3.

Btw, Tachy, I really appreciate the way you explain the code. I'm such an amateur most of it goes right over my head, but for the first time, I'm starting to understand certain calls. Like if I'm understanding it correctly, this:
Code:
GET_PLAYER(getSecondPlayer()).AI_dealVal(getFirstPlayer()
is saying, go look in CvPlayer.cpp to find getSecondPlayer(), right?

C++ generally has objects that contain data and methods that operate upon the objects, perhaps with other parameters. (For example, the get/set/change methods that all operate upon the data in the object. This is done so that the implementation of the data can change but the use of the object can stay the same.) A method always has a parameter list in parentheses (which might be empty) which allows you to see what are methods and what are objects.

This fragment is from a method of a "deal" object, and at execution time the data for that deal is known by this method. The deal has two players involved, but as in life each person looks at the deal from their own point of view. The deal object contains something that lets you find out which players are involved (with getFirstPlayer() and getSecondPlayer()). The implementation of that is just a number that is an entry into the list of players, but the GET_PLAYER "function" hides that implementation from you, so that GET_PLAYER(getSecondPlayer()) looks like you are gettng the index of the second player and using that to get the actual Player object. That Player object has a method that tells you how an AI would value the list of things if they would be getting them from the player identified by getFirstPlayer(). (Your code fragment cuts off some of the parameters to AI_getDealVal, which includes the list of stuff recieved. This value gets compared later with the value of stuff given.) One other catch is that the deal code often uses AI_getDealVal to get the value of a deal, but that need not mean that the calling player is in fact an AI... the value returned is the value an AI *would* place upon that side of the deal.

We're interested in the value of Brennus.AI_dealVal(Kakumeika, <various techs>) to see if we can get enough fair trade.
 
Thanks, mabraham! I appreciate your willingness to share your knowledge about c++. I've always been interested in it, but never got around to studying it rigorously.

So this all confirms what I calculated above about our trade deals with Brennus, except that Priesthood is only worth 110.

And it also makes the calculations pretty easy with only 2 AIs.

If only we know the tech, the formula is:
BaseTechCost * 1.3 * 1.75 (Theology, CoL, Currency)​
If one AI also knows it:
BaseTechCost * 1.3 * 1.5 (Priesthood)​
Both rounded down to the nearest tens column.
...
 
Kaitzilla noted that the first Spy has an 80% probability of stealing Iron Working, but the 2nd Spy has a 62% probability of stealing Iron Working. If the 2nd Spy "fortifies" for just one turn its probabilty would be 80%. Can we squeeze in a fortification turn for the 2nd Spy?

EDIT: The PPP has the first Spy fortify for two turns and the 2nd Spy forifies zero turns. I'd prefer that they both fortify one turn each, so they both get 80% pronability of stealing Iron Working. This is only possible if the 2nd Spy can get into position a turn earlier. Is this possible?

Sun Tzu Wu

Nope, no time.

The 2nd spy arrives just in time for the 62% steal. Even if it could arrive earlier, I'm pretty sure having 2 spies in the same city lowers the odds of the first succeeding.

If we wait one more turn to do the gift and steals, then the AP will hold elections T126, not a vote to return the city T125.
 
40*1*1.3, except that there is rounding at each operation, and so the order of operations matters. AIs play on Noble level, so they get the Noble non-handicap. We get 1.2 because we're on Emperor, not because we are human. Everyone is on the same map, so everyone gets the 1.3.



C++ generally has objects that contain data and methods that operate upon the objects, perhaps with other parameters. (For example, the get/set/change methods that all operate upon the data in the object. This is done so that the implementation of the data can change but the use of the object can stay the same.) A method always has a parameter list in parentheses (which might be empty) which allows you to see what are methods and what are objects.

This fragment is from a method of a "deal" object, and at execution time the data for that deal is known by this method. The deal has two players involved, but as in life each person looks at the deal from their own point of view. The deal object contains something that lets you find out which players are involved (with getFirstPlayer() and getSecondPlayer()). The implementation of that is just a number that is an entry into the list of players, but the GET_PLAYER "function" hides that implementation from you, so that GET_PLAYER(getSecondPlayer()) looks like you are gettng the index of the second player and using that to get the actual Player object. That Player object has a method that tells you how an AI would value the list of things if they would be getting them from the player identified by getFirstPlayer(). (Your code fragment cuts off some of the parameters to AI_getDealVal, which includes the list of stuff recieved. This value gets compared later with the value of stuff given.) One other catch is that the deal code often uses AI_getDealVal to get the value of a deal, but that need not mean that the calling player is in fact an AI... the value returned is the value an AI *would* place upon that side of the deal.

We're interested in the value of Brennus.AI_dealVal(Kakumeika, <various techs>) to see if we can get enough fair trade.


I see all kinds of English words but the meanings are all different.

Conclusion: Two Foreign Languages; Math and C++ :salute:


As near as I can glean, Theocracy and Code of Laws is gonna get us +3 relations from all the results posted so far. That should be just fine for us open borders T121. Even if it takes till T122 for the Worst Enemy tag to go away, the latest plan would still find that acceptable. Brennus needs to be up to snuff economically by T124. I think Tachywaxon and LTC are focusing on if we should ignore the 40 gold and just gift Priesthood too for +4 relations since the threshold is so close.

If Brennus settles 11 or 12 cities because he is a maniac and will probably require 12-18gpt in gifts even with open borders on T124, what should we do? Give him Currency?
 
@Kaitzilla

Something else I keep forgetting...keep an eye on the Ramesses negmod
-1 You refused to stop trading with our Worst Enemy
This could vanish on any given turn, in which case we can get to Friendly sooner. That means +4 for Our trade relations have been fair and forthright and +1 for common war or +3 for Civics.

Speaking of which, here's a summary of the Free Trade Value data for both Ramesses and Brennus. WIth this information, we can be wise about when we gift which tech to whom.
Code:
       FairTradeValue 
       if X AIs own it
Tech   0 AIs      1 AI
----   -----      ----

Theo    1130       970        
CUrr     910       780  
CoL                680 
PHood              110
Fish                70
Sail               190
CS      1820      1560




      =================
      Fair Trade Needed
      For Brennus
      =================

      Brennus met  We met  
Turn  us T18       Brennus T19 Plusmods
----  -----------  ----------- -------- 
T117     2000         1980        +4    
T118     2020         2000        +4
T119     2040         2020        +4  
T120     2060         2040        +4

T121     1560         1545        +3    
  

      =================
      Fair Trade Needed
      For Ramesses
      =================

      Rameses met  We met  
Turn  us T21       Rameses T22 Plusmods 
----  -----------  ----------- -------- 
T121     1120         1100        +2   
T123     1160         1140        +2    
T125     1200         1180        +2
Getting the +2 to Ramesses might be a little trickier, because we want to keep techs in reserve to get IW+DramaAesthetics+Drama+Music (sheesh!). What I see is this (the turn numbers are just for example):

T116 Gift Theology to Ramesses +1130 FTV
T1XX Gift Theology to Brennus +970 FTV

Now Brennus only needs +590 FTV by T121. That could be CoL for +680 FTV.

===

But here's another complication I just thought of. Ramesses will become Brennnus' WE, but on T121/T123/T125 we'll be conducting massive trades to Ramesses and getting -4 WE negmods. Does Ramesses also get those with Brennus, if he trades with us when we're Brennus' WE, I forget? Because we'll need to work around that. If possible, we need to make sure Ramesses also gets those -4 WE negmods immediately after we do so he flips back to the WE... In any case, Brennus is not going to be Cautious with us after that and we'll lose our gems deal 10t after we made it.

Special Note: We have to gift any appropriate techs to Ramesses before T121, when Ramesses becomes Brennus' WE or we'll get negmods with Brennus for trading to his WE!!!

xpost
 
If our gifts to Brennus T119 causes his "worst enemy tag" to switch to Ramesses, then we need to give Ramesses a tech for +2 relations before that happens or we'll get hit with WE penalties with Brennus.

Should we give Ramesses Currency T118? Will Theocracy to Ramesses T118 still allow Theo+CoL to Brennus T119 to get us +3 relations?

**Edit**
Oops xpost. I didn't know the gems deal would end after 10t because of the -2 vote :sad: Could maybe delay the gems trade until T123 when we will need it. Does the open borders deal also cancel after 10turns if we are Brennus' worst enemy again?

If the gems and open borders are both gonna vanish like mist T131 or T133, then it might be time to go back to plan A. Gift Trojan Horse T120, steal twice, DoW T121 and take them back. Or is T133 enough time to come up with an alternate happy source before we get cut off?

I also forgot about trading with Friendly Ramesses most likely on T123 would also give negmods. Ramesses would still be Brennus' Worst Enemy at that point. We need those techs though. Should also probably avoid giving Egypt Fishing for gold until T120 so he doesn't cancel our resource deal prematurely.
 
PPP#3 for T116-T126, Jungle Pigs edition!​

Drunk Pigs
(Working grassland for 2 turns here doesn't shave off a turn getting to pop 6 for some reason :hmm:)
Sorry, Kaitzilla, my bad. :deadhorse: My spreadsheet had a 1:food: flub. I think this is even better:
Code:
DrunkPigs      Food Citizens/comments
---------      ---- -----------------
T116 Settler   14/26 
T117 Settler   14
T118 wb        14   
T119           23
T120           19/28 pigs,fp,fp,grass
T121           14/30 Kaitzilla's Special
T122 settler   14    (assuming HG is good otherwise wb and grow to p6)
T123 settler   14/26 3whip
T124 done>wb
T125 done>forge?
The trick is to build the settler now, before the FP farm is done. That gains us the extra food needed. Plus, before I didn't think about the possibility of the HG pluspop. This solution isn't slower if we fail on the HG and is faster if we get them.

EDIT: The wb is also done 1t sooner...

...
 
If our gifts to Brennus T119 causes his "worst enemy tag" to switch to Ramesses, then we need to give Ramesses a tech for +2 relations before that happens or we'll get hit with WE penalties with Brennus.

Should we give Ramesses Currency T118?
I would gift Ramesses Theocracy before gifting it to Brennus. I would also gift that to both of them asap, in hopes that Brennus will commit himself to the Hagia Sofia (instead of Chichen Itsa a few turns later). Of course this risks allowing Brennus to try to DoW us before T121, but if he threatens we could always gift him all three techs to get +4 and expedite things.
Will Theocracy to Ramesses T118 still allow Theo+CoL to Brennus T119 to get us +3 relations?
Yes, that would also work, according to my calculations.

**Edit**
Oops xpost. I didn't know the gems deal would end after 10t because of the -2 vote :sad: Could maybe delay the gems trade until T123 when we will need it.
Just make the deal before Brennus stops being Cautious. Edit: I'd make them asap. Brennus could threaten us at any moment and we might have to suck up a negmod...
Does the open borders deal also cancel after 10turns if we are Brennus' worst enemy again?
No. (EDIT for typo) OBs remain till we're at war.
If the gems and open borders are both gonna vanish like mist T131, then it might be time to go back to plan A. Gift Trojan Horse T120, steal twice, DoW T121 and take them back.
Do whatever gives us the optimum benefit. My vision is for us to research HBR after MC and capture Camulodunum just as soon as we can muster up about 3 cats and 3 HAs. Our spy will provide more details.

So we don't necessarily need the gems deal more than 10 turns. The same for the OBs. But if Brennus is researching Calendar rapidly, it might be worth it to delay a DoW, but the OBs will still make it safer and a bit cheaper to steal Calendar in Camulodunum. We could even try spreading Confu there in advance. We're going to keep the city anyway, so we'll benefit from teh spread later.


...
 
One other option for DPF after the granary is galley if we find something over there to settle. Otherwise, your PPP has become too freaking complicated for me. Gotta trust you from here on out... :goodjob:
 
I would gift Ramesses Theocracy before gifting it to Brennus. I would also gift that to both of them asap, in hopes that Brennus will commit himself to the Hagia Sofia (instead of Chichen Itsa a few turns later). Of course this risks allowing Brennus to try to DoW us before T121, but if he threatens we could always gift him all three techs to get +4 and expedite things. Yes, that would also work, according to my calculations.

Just make the deal before Brennus stops being Cautious. Edit: I'd make them asap. Brennus could threaten us at any moment and we might have to suck up a negmod...No. (EDIT for typo) OBs remain till we're at war. Do whatever gives us the optimum benefit. My vision is for us to research HBR after MC and capture Camulodunum just as soon as we can muster up about 3 cats and 3 HAs. Our spy will provide more details.

So we don't necessarily need the gems deal more than 10 turns. The same for the OBs. But if Brennus is researching Calendar rapidly, it might be worth it to delay a DoW, but the OBs will still make it safer and a bit cheaper to steal Calendar in Camulodunum. We could even try spreading Confu there in advance. We're going to keep the city anyway, so we'll benefit from teh spread later.


...

Whipping a war for gems would strain our happy problem to outrageous levels. Plus the Jungle Pigs trojan plan T124 means the AP can't stop a war until T145. A bit risky if we fail to take Brennus' gems city. Guess that's what the scout would be for hmmm

All the other points look good.
 
One other option for DPF after the granary is galley if we find something over there to settle. Otherwise, your PPP has become too freaking complicated for me. Gotta trust you from here on out... :goodjob:

Haha, the main source of stress is the 0 happy resources. I've never played a game and had that happen before. If you look at Ramesses lands, he won't ever have any happy resources to trade to us.

The usual prescription is Monarchy and cheap garrison troops, but we are hardly structured right now to do that. If only we had Calendar ...


Open borders till war is declared and 10 turns of gems to get garrions warriors in all the small cities without unhappy citizens still seems valuable. I'll just have to watch the diplo situation very closely before making trades.
 
PPP#3 is completed once again!

Will do another test game from just the PPP.


Might play in 4 hours up to T122 if everyone likes.(or surrenders;)) Then we can decide whether to go forward with settling Jungle Pigs or to just send 3 spies+a missionary down to Camulodunam to steal Iron Working and settle somewhere else.


Sorry I overcomplicate turnsets so much :blush:

I'm a memory-foam ball of confusion when it comes to detailed mechanics so I mainly stick to :hammer::hammer::hammer: because it is so simple and straightforward.
 
PPP#3 is completed once again!

Will do another test game from just the PPP.


Might play in 4 hours up to T122 if everyone likes.(or surrenders;)) Then we can decide whether to go forward with settling Jungle Pigs or to just send 3 spies+a missionary down to Camulodunam to steal Iron Working and settle somewhere else.


Sorry I overcomplicate turnsets so much :blush:

I'm a memory-foam ball of confusion when it comes to detailed mechanics so I mainly stick to :hammer::hammer::hammer: because it is so simple and straightforward.

Go for it. Good luck!
 
Ok, test results from PPP were fine.

Will keep in mind to re-negotiate that fish gift with Ramesses for gpt if it comes up.

Also, it appears to be safe to start trading with Ramesses T123 after the Gems and Open borders deal is signed with Brennus. Even with a furious simulated Brennus, he still took Jungle Pigs T124. We have just enough techs to get Music if we do something like Metal Casting->Construction, Currency ->Aesthetics, tech Literature ourselves, then trade Literature+Civil Service -> Music+Drama.

A demand from Ramesses will be awkward, especially if he asks for something after he becomes Brennus' worst enemy and we don't have open borders/gems yet.

A couple typos in the PPP. Horse City should have a build order of Conf. Missionary, Chariot, then warrior.


We might have a minor solution to the Happy problem that hits T132 when gems get cut off. We get half priced colloseums with Construction because we are a Cultural Civ. Not the best solution, but if a major city has terrible happy problems, might be worth to build.


Gonna start play in 10 minutes to T122. Cross your fingers for good luck!
 
Back
Top Bottom