My personal thread: Clarification of certain game mechanics

He's not on ecstasy, he has just eaten some poor Chinese ^^ .

Don't lose your eagerness Tachy, you've already infected me towards changing my title and Avatar, don't make me change the place where I live and move towards you, to beat you to Civ playing. I'm a mighty warrior and I even have French 1 ^^ .
 
Ok here is some fodder for your fire:

How does "You press us to hard" denial work exactly?

I love to beg for money. The moment someone gets pleased with me I ask something. The longer we know each other the more I can secure. But if I get too greedy or ask too often -- they will stay pleased but will stop gifting me. The moment AI says sorry -- it is impossible to even ask for 1 gold! Some time has to pass after that sorry. How much time? How can I know how much to ask? When is the best to ask? Etc, etc...


P.S. Wow, impressive thread. You should really promote this in your sig (instead of your "French" French :lol:)
 
Ok here is some fodder for your fire:

How does "You press us to hard" denial work exactly?

I love to beg for money. The moment someone gets pleased with me I ask something. The longer we know each other the more I can secure. But if I get too greedy or ask too often -- they will stay pleased but will stop gifting me. The moment AI says sorry -- it is impossible to even ask for 1 gold! Some time has to pass after that sorry. How much time? How can I know how much to ask? When is the best to ask? Etc, etc...

In a nutshell:
You amass "hidden points" once you meet the leader, with 100 free points for the first beg. Points can be converted into value for gold, techs, maps, etc. but that requires lots of micro most people don't want to get into.

Two checks before the beg is granted.

Magnitude and Timer.
The magnitude is the quantity of points amassed that correspond to a tech/gold/map or lower. If you go over, you miss your chance and must wait the timer.

The timer is something that makes the beggard avoids to abuse and beg each turn. Basically, it's a system of memory. Each turn, you get some RNG that the AI loses track of your last beg and will allow you another one. Of course, if you got enough points and that only works with #turns. Nothing else.

Per testing and experience, IIRC, the best cycle of begging is 24 turns. On every gamespeed because that's not scaled. That means the AI will lose track at an odd of 64 % something like that. Timer isn't the right term but you got what I meant.

Also, IIRC, if your last beg was worth in hidden points less than your amassed number of points, you get the remaining for the next beg. IIRC of course. A beg doesn't put the counter to zero like that. Put that statement, don't take it for granted. I'm unsured.

For more info, check that out. I just resumed what I recalled from what I read in the code+nice interpretation of Oedali.

Will answer you PM soon btw.
 
Mystic Tachy— can the AI settle a GSpy? Or will they always build Scotland Yard?

I have seen settled GProphets, Scientists, Artists, Engineers, and Merchants; I cannot remember ever seeing a GSpy.

Did anyone ever explain AI use of specialists more generally? I know the tendencies (GProphets build the first shrine; GEngineers rush an available wonder; GScientists will bulb Philosophy, if Taoism has not been founded, etc.) but not the details.

And "hi." :wavey:
 
I'm interested in Espionage Game Mechanics at the moment. I'm finally trying to play a Cultural Victory game where the vast majority of culture for all three legendary cities will be from Spread Culture missions. I gave my first cultural city to an AI when it had only 10 Culture, because the AI was at the opposite side of the continent and had 3 cities for quite a while, thus willing to accept a city gift anywhere in the world. If it had founded its own 4th city, I would have had to give it bridge cities at most 9.5 plots apart from its cloest city to my cultural city I had still wished to give it away.

Back to my problem. With only 10 culture, it seems that the game is computing the Spread Culture mission as 10 * 5% = 0 and thus doesn't offer the mission at all. I had hoped the game would round the value up to 1 in this case, but it seems that the game is truncating the value of 10 * 5% = 0.5 culture down to zero. My question is would a total culture of 20 in the city suffice to make the Spread Culture mission available? The mission should thus spread 20 * 5% = 1 culture. I already have another city generating tile culture on the gift city's center plot which is the primary requirement for the Spread Culture mission to be available at all.

My proposed solution is to spread my state religion to this gift city, so the AI who doesn't have a religion yet will adopt it and it will gain 1 culture per turn until it gets 10 culture itself. At that point the combined city culture will be 10 + 10 = 20, and 20 * 5% = 1. That should enable the Spread Culture mission.

Another problem is this city is under so much cultural pressure that it revolts every two turns and would never gain its own culture. It is in its 4th consecutive revolt. It seems that I need to provide military police units to this city to maintain order long enough for it to gain the desired 10 culture.

EDIT: Not having enough culture was not the issue. After allowing the AI to accumulate 10 Culture for a total of 20 Culture, the Spread Culture mission was still not abailable. The final answer is the game computes the Espionage needed to complete the mission using all applicable discounts and if the computed espionage required is less than 1, the Spread Culture mission will not be available. To work around this issue, one needs to reduce the discounts until the computed espionage is 1 or more. The easiest way to do this is to move the Spy out of the city and back in so it loses the stationary Spy bonus. Otherwise, if the player Leader is spiritual switch to no state religion or another state religion to avoid that discount. There may be other ways to reduce the discounts. Or one can just wait until the AI accumulates enough Culture until the computed espionage needed becomes 1 or more.

Finally, since we share the same state religion, there will not be a -15% discount for state religion or the -25% discount for owning the corresponding holy city. I may need to spread another religion to its capital and other large cities to get it to convert to this other religion, assuming it doesn't found its own religion. I may even need to use espionage to cause to switch to this other religion as its state religion. Causing it to switch to Free Religion is another option for gaining the state religion and holy city espionage discounts.

I know that I have everything planned out and I'm quite capable of reading the Software Developer's Kit (SDK) on my own, so you don't need to respond on my account, but others reading your game mechanics thread might like you to comment on the mechanics behind the Spread Culture mission and other espionage missions. It occurs to me now to ask "Have you already covered this topic in detail?" My apologies in advance, if you have already covered espionage topics in detail.

Sun Tzu Wu
 
I've got something for you Tachy.

Question is simple and I need help fast:

What determines whether a city can be razed after conquest, or if it "insta-flips" (without even offering the option) back to you if you had it before?

Tia,

Seraiel
 
What we are referring is the popup enabling the choice of razing a city. Nonetheless, on special conditions, that doesn't happen and the city is automatically captured without choice whatsoever.

In CvPlayer.cpp, the concerned function is acquireCity().

Code:
if (lResult == 1)
		{
			//auto raze based on game rules
			if (pNewCity->isAutoRaze())
			{
				if (iCaptureGold > 0)
				{
					szBuffer = gDLL->getText("TXT_KEY_MISC_PILLAGED_CITY", iCaptureGold, pNewCity->getNameKey());
					gDLL->getInterfaceIFace()->addMessage(getID(), true, GC.getEVENT_MESSAGE_TIME(), szBuffer, "AS2D_CITYRAZE", MESSAGE_TYPE_MAJOR_EVENT, ARTFILEMGR.getInterfaceArtInfo("WORLDBUILDER_CITY_EDIT")->getPath(), (ColorTypes)GC.getInfoTypeForString("COLOR_GREEN"), pNewCity->getX_INLINE(), pNewCity->getY_INLINE(), true, true);
				}

				pNewCity->doTask(TASK_RAZE);
			}
			else if (!isHuman())
			{
				AI_conquerCity(pNewCity); // could delete the pointer...
			}
			else
			{
				//popup raze option
				eHighestCulturePlayer = pNewCity->getLiberationPlayer(true);
				bRaze = canRaze(pNewCity);
				bGift = ((eHighestCulturePlayer != NO_PLAYER) 
						&& (eHighestCulturePlayer != getID()) 
						&& ((getTeam() == GET_PLAYER(eHighestCulturePlayer).getTeam()) 
							|| GET_TEAM(getTeam()).isOpenBorders(GET_PLAYER(eHighestCulturePlayer).getTeam()) 
							|| GET_TEAM(GET_PLAYER(eHighestCulturePlayer).getTeam()).isVassal(getTeam())));

				if (bRaze || bGift)
				{
					CvPopupInfo* pInfo = new CvPopupInfo(BUTTONPOPUP_RAZECITY);
					pInfo->setData1(pNewCity->getID());
					pInfo->setData2(eHighestCulturePlayer);
					pInfo->setData3(iCaptureGold);
					gDLL->getInterfaceIFace()->addPopup(pInfo, getID());
				}
				else
				{
					pNewCity->chooseProduction();
					CvEventReporter::getInstance().cityAcquiredAndKept(getID(), pNewCity);
				}
			}
		}

There are three situations:
1) Autorazing is the most preponderant condition. Simply if the city never reached size 2, thus the city is autorazed. Even if you rushed a wonder in that city because culture is irrelevant.
2) The second condition is attributed to AI choices, thus irrelevant here.
3) This is the conditional structure we care about. It has two checks of different nature: bcanRaze and bGift.

bGift:
That one is related to team play or vassals doing some captured around your cities. It is seen pretty rarely because of team play option being a rare setting and vassals getting enemy cities pressured culturally by your cities are often sign of neglect.
Basically, if you're the culturally dominant in that border city, the team friend will liberate to the player (or other team partner). If the cultural dominance isn't checked, then it checks about Open Borders (which one I'm unsure what it means) and if that fails too, if the friend is your vassal, it's his/her duty to give back the city.

bcanRaze:
This is the situation of both human an AI allowing them to practically perform city razing.

The function is pretty simple:
Code:
bool CvPlayer::canRaze(CvCity* pCity) const
{
	if (!pCity->isAutoRaze())
	{
		if (GC.getGameINLINE().isOption(GAMEOPTION_NO_CITY_RAZING))
		{
			return false;
		}

		if (pCity->getOwnerINLINE() != getID())
		{
			return false;
		}

		if (pCity->calculateTeamCulturePercent(getTeam()) >= GC.getDefineINT("RAZING_CULTURAL_PERCENT_THRESHOLD"))
		{
			return false;
		}
	}

It first checks if No City Razing Option wasn't checked.
Then the second condition puzzles me...
And the last is about a threshold of your own culture (team culture) over the enemy's.
More specifically

Code:
<Define>
		<DefineName>RAZING_CULTURAL_PERCENT_THRESHOLD</DefineName>
		<iDefineIntVal>25</iDefineIntVal>
</Define>

If you got equal or more than 25% of your team culture, then the city is peacefully returned without option of disbanding it.

Whatever.
 
:hmm: .

In my current game, I have recaptured a city which I founded, and I had 200 :culture: in it, still, no raze-option was shown. That'd mean (towards your analysis) that the AI didn't have more than 600 :culture in the city, which I find very unlikely because 600 :culture: is really nothing on Marathon.

Is it maybe possible that cities which one founded onesself aren't razeable somehow?
 
Then I guess this:

Code:
if (pCity->getOwnerINLINE() != getID())
		{
			return false;
		}

could be the explanation. Meaning you can't raze a city when you're the original owner.
 
Correction to my Cultural Victory via Espionage Spread Culture missions message posted a few messages back in this thread:

When the target AI shares the same Religion as the Player, it is true that the -15% State Religion discount does not apply as previously stated. However, it was also stated that the -25% State Religion for the Holy City does not apply too. This is false. The -25% Holy City bonus does apply when one owns the Holy City of one's State Religion. The relevant Holy City can have only one owner, thus there is no possibilty of cancelling out this discount, without for example changing one's state religion. Thus, one can get a -25% State Religion espionage discount when the target shares one's religion by virtue of the player owning the state religion's Holy City.

Sun Tzu Wu
 
"Golden Age from TaJ Mahal. How is it compile? Before all cities compile their hammers IBT (in between [two successive] turns) or something else? I lost my chance to milk more fail gold from Sistine Chapel because of a Taj golden Age (the wonder went two turns left to one turn)."

If I understand correctly you do not have the answer for this one.

I'm pretty certain that cities are processed in order. So if your first city completes the Taj Mahal all other cities will get GA bonuses while if your last city completes it no cities will have bonuses for this turn.
 
Tachywaxon, you're my only hope!

I tried asking this in the Newbie Questions thread, but haven't gotten an answer:

How is the number of EP generated by a great spy infiltrate mission calculated? Do you get more EPs by infiltrating into the enemy city that is most expensive for your spies to exicuted missions or the least expensive? Or does it not matter?
 
Found a minor bug in the code (CVPlayerAI.cpp)
int CvPlayerAI::AI_maxGoldPerTurnTrade(PlayerTypes ePlayer) const
{
int iMaxGoldPerTurn;

FAssert(ePlayer != getID());

if (isHuman() || (GET_PLAYER(ePlayer).getTeam() == getTeam()))
{
iMaxGoldPerTurn = (calculateGoldRate() + (getGold() / GC.getDefineINT("PEACE_TREATY_LENGTH")));
}
else
{
iMaxGoldPerTurn = getTotalPopulation();

iMaxGoldPerTurn *= GC.getLeaderHeadInfo(getPersonalityType()).getMaxGoldPerTurnTradePercent();
iMaxGoldPerTurn /= 100;

iMaxGoldPerTurn += std::min(0, getGoldPerTurnByPlayer(ePlayer));
}

return std::max(0, std::min(iMaxGoldPerTurn, calculateGoldRate()));
}
First bolded part is saying that as a player you should be able to trade more GPT than you can now, specifically 1/10th of your current gold stockpile extra..... the second bolded part at the end is what I think breaks this :lol:.

Being as its in this thread its probably worth adding that the AIs maximum GPT for trading is the in the quoted code,
iMaxGoldPerTurn = getTotalPopulation();
iMaxGoldPerTurn *= GC.getLeaderHeadInfo(getPersonalityType()).getMaxGoldPerTurnTradePercent();
iMaxGoldPerTurn /= 100;

(Total pop of civ * Leader XML attribute)/100
That leader attribute is 10 for all but 3 AIs, Lincoln, Sury and Pacal who have 15.
In short its a tenth of the pop of most civs, and 1.5 times that for the above 3.

Also i've noticed an omission and some wrongness in my earlier AIs available trading gold post that i'll fix soon.
How is the number of EP generated by a great spy infiltrate mission calculated? Do you get more EPs by infiltrating into the enemy city that is most expensive for your spies to exicuted missions or the least expensive? Or does it not matter?
Its a fixed 3000 thats only modified by the gamespeed, .66 on quick, 1 on normal, 1.5 on epic and 3 at marathon.
Spoiler :
int CvUnit::getEspionagePoints(const CvPlot* pPlot) const
{
int iEspionagePoints;

iEspionagePoints = m_pUnitInfo->getEspionagePoints();

iEspionagePoints *= GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getUnitGreatWorkPercent();
iEspionagePoints /= 100;

return std::max(0, iEspionagePoints);
 
Is 2500 EP enough for Peter to build the Pyrmaids?

Moscow is 10 tiles away from Athens.

Spoiler :


 
Is 2500 EP enough for Peter to build the Pyrmaids?

Moscow is 10 tiles away from Athens.[/SPOILER]
Not exactly sure what your asking here as espionage can't build and I can't see Peter in your game?
Is it that your wondering if the large cost of sabotaging Moscow's production means its likely building the Pyramid and if at 2500 it would be complete?
 
Top Bottom