SGOTM 16 - Kakumeika

EDITED BELOW
My first hunch before reading that post was you maybe wrongly reported the tech cost as what we see in the tech tree is calculated/inflated of what an AI sees. AI sees what a noble human player would see. Therefrom the difficulty of tech trading on deity and the need of partially tech the wanted tech to be traded to us (like Alpha). [/COLOR][/B]
I took teh price of Fishing as 40 from the main menu here at CFC, then multiplied it by 1.3. I also tried multiplying additional by 1.2. The answer seemed somewhere in between. But I set up a whole spreadsheet chart and tried every single tech cost in between 50 and 75 and couldn't get an answer that corresponded to what happened in the test game I made.

In the test game I made (I used bcool's test from 4000BC), I added alpha and fishing and gave Stalin a scout neare us to meet us. I also isolated him so he couldn't meet anyone else and I killed his scout after he met us. I checked every single turn form meeting to turn 15, so I could watch the plusmods fall from +4 to 0. Inputted that data into my spreadsheet and calculated what the formula says. I couldn't get the formula to match up with either data set (slightly different results depending on who me whom).

Silu doesn't say how the counter is incremented or when. That's in the code for sure. And somehow something else is weird, although I realize it might have to do with Stalin or whatever.

Edit: For example, when we meet Brennus, is that 1 turn having know him? Next turn is already 2? When he meets us in the interturn, is it already 2 turns we we first meet him?
Code:
==========================
Results from the test game
==========================

      Plusmods  Plusmods
      Brennus   We meet
Turn  meets us  Brennus
----  --------  -------
0       
1         4         4
2         4         4
3         3 <-----> 4
4         2 <-----> 3
5         2         2
6         2         2
7         1         [B][COLOR="red"]2  <------ CORRECTED!![/COLOR][/B]
8         1         1
9         1         1
10        1         1
11        1         1
12        1         1
13        1         1
14        0 <-----> 1 
15        0         0
 
Silu doesn't say how the counter is incremented or when. That's in the code for sure. And somehow something else is weird, although I realize it might have to do with Stalin or whatever.

I have seen this counter and multitude of others in my previous searches. Those stupid counters are those "member variables" or I personally call them "dead ends". Possibly those counters are handled somewhere in the game (perhaps in the exe = unfathomable :eek:).

I asked and asked those who really know (modders for instance), but either they give partial answers or refuse to answer.

Since then, I assumed those counters just worked like i=i+1, nothing more due to lack of material to read and understand.
 
Since then, I assumed those counters just worked like i=i+1, nothing more due to lack of material to read and understand.
I think that's the correct assumption. What I'm asking is, where does that i=i+1 occur in the sequence of actions in this particular code?

It appears that it must be happening during Brennus' turn, because then it would make sense that when he meets us during his T0 turn, the counter increments to 1 and when we meet him during our T1 turn, it hasn't incremented to 1 yet.

But then does it start at default = 1, because in Silu's equation, we'd get a divide-by-zero error if it starts at zero. So you see, Silu doesn't epxlain the whole thing.

By the way, I also tried starting at 1 to see if that worked with teh equation better, but still not.
 
I'd love to, but I don't know how... How?

:cringe: Here's some processed poop:

Code:
  //atleast I'm honest   
    int iNonsense = 0;
    iNonsense += getCapitalCity()->getX();
    iNonsense += getCapitalCity()->getY();

Lol at this developper comment. "At least I'm honest" Reply: Nonsense.

I need Brennus' capital coordinates.
 
I think that's the correct assumption. What I'm asking is, where does that i=i+1 occur in the sequence of actions in this particular code?

It appears that it must be happening during Brennus' turn, because then it would make sense that when he meets us during his T0 turn, the counter increments to 1 and when we meet him during our T1 turn, it hasn't incremented to 1 yet.

But then does it start at default = 1, because in Silu's equation, we'd get a divide-by-zero error if it starts at zero. So you see, Silu doesn't epxlain the whole thing.

By the way, I also tried starting at 1 to see if that worked with teh equation better, but still not.

First of all, that is true when a variable is a denominator, the code gives a default (variable+1) to avoid epic fail divide by 0.

But I don't really see the real importance of an offset of 1 turns in ~90 turns since we met Brennus. If that was like 10-20 turns, I would understand, but the higher the number, the less grave an offset of 1 turn. Just like the inverse function where the next number has few impact on the y coordinate when x roams around 1000.
 
:cringe: Here's some processed poop:

Code:
  //atleast I'm honest   
    int iNonsense = 0;
    iNonsense += getCapitalCity()->getX();
    iNonsense += getCapitalCity()->getY();

Lol at this developper comment. "At least I'm honest" Reply: Nonsense.

I need Brennus' capital coordinates.

Last SGOTM we had that from Stonehenge (but screwed up our maths and got daggered anyway). We don't have that or Calendar yet, so no centered map, so no coordinates of anything, so no iNonsense.

Nonsense, on the other hand... that's what we're good at! :lol:
 
Here's the definition of those counters:

Code:
int CvTeamAI::AI_getHasMetCounter(TeamTypes eIndex) const
{
	FAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)");
	FAssertMsg(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)");
	return m_aiHasMetCounter[eIndex];
}


void CvTeamAI::AI_setHasMetCounter(TeamTypes eIndex, int iNewValue)
{
	FAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)");
	FAssertMsg(eIndex < MAX_TEAMS, "eIndex is expected to be within maximum bounds (invalid Index)");
	m_aiHasMetCounter[eIndex] = iNewValue;
	FAssert(AI_getHasMetCounter(eIndex) >= 0);
}


void CvTeamAI::AI_changeHasMetCounter(TeamTypes eIndex, int iChange)
{
	AI_setHasMetCounter(eIndex, (AI_getHasMetCounter(eIndex) + iChange));

And here is the function taking care of many counters and doing the actual finger counter.

Code:
void CvTeamAI::AI_doCounter()
{
	int iI;

	for (iI = 0; iI < MAX_TEAMS; iI++)
	{
		if (GET_TEAM((TeamTypes)iI).isAlive())
		{
			if (iI != getID())
			{
				AI_changeWarPlanStateCounter(((TeamTypes)iI), 1);

				if (isAtWar((TeamTypes)iI))
				{
					AI_changeAtWarCounter(((TeamTypes)iI), 1);
				}
				else
				{
					AI_changeAtPeaceCounter(((TeamTypes)iI), 1);
				}

				if (isHasMet((TeamTypes)iI))
				{
					AI_changeHasMetCounter(((TeamTypes)iI), 1);
				}

				if (isOpenBorders((TeamTypes)iI))
				{
					AI_changeOpenBordersCounter(((TeamTypes)iI), 1);
				}

				if (isDefensivePact((TeamTypes)iI))
				{
					AI_changeDefensivePactCounter(((TeamTypes)iI), 1);
				}
				else
				{
					if (AI_getDefensivePactCounter((TeamTypes)iI) > 0)
					{
						AI_changeDefensivePactCounter(((TeamTypes)iI), -1);
					}
				}

				if (isHasMet((TeamTypes)iI))
				{
					if (AI_shareWar((TeamTypes)iI))
					{
						AI_changeShareWarCounter(((TeamTypes)iI), 1);
					}
				}
			}
		}
	}
}

In the end, it is really i++ == i=i+1.
A chance the devs let us good variable naming because I wouldn't know how to relate those member variable (those things with m_ ) with actual game data otherwise.
 
Last SGOTM we had that from Stonehenge (but screwed up our maths and got daggered anyway). We don't have that or Calendar yet, so no centered map, so no coordinates of anything, so no iNonsense.

Nonsense, on the other hand... that's what we're good at! :lol:

Oops, that's true. On the three statements.

@LowtherCastle

I repeat that's unnecessary as we got a large AI_getHasMetCounter. Even if you correct, I don't think it matters much between a divider of 89 or 90.
 
EDITED

@Tachy

Okay, I got the equation to work, using these values:

I. TurnCounter(now) = T(now) - T(met) + 1, where T(Brennes met us) = T(We met Brennus) - 1

II. (CIVS_KNOWN - CIVS_WHO_KNOW_IT) / CIVS_KNOWN = 1 if Brennus knows only us.

In other words, I think Silu made a mistake here.

===

The value for FIshing that works is 72. That is, 40 * 1.3 + (40 / 2) * 1 = 72. Wait, this doesn't make sense, because I'm using two different values for COST ( 40*1.3 and 40). Okay, so I didn't figure out the formula, but I seem to have gotten the final tech cost...)

EDIT2: It turns out that any value in {70,...,74} works...



very many xpost
 
@LowtherCastle

I repeat that's unnecessary as we got a large AI_getHasMetCounter. Even if you correct, I don't think it matters much between a divider of 89 or 90.
I'm not worried about the offset. I'm worried about the equation. Those are big numbers and we need to know what works and what doesn't.
 
@Kaitzilla

Do you think maybe you should just do your gpt T120 TH plan? The DoW plan that shulec liked?

On T118, Adam can see the corn. If there's a worker or two, he can figure out when's the latest to steal a worker. We could DoW T119 for a T122 worker steal (foregoing the granary in TH) or DoW T120 for a T123 worker steal. If we'll be too late for the steal, then you just go with your T120 plan and we hope we keep the granary.

This is anything but a simple turnset, but the show must go on. I think by now you know all the ins and outs of what might happen, right?

As for the gems, we'll just let WastinTime capture Camulodunum and all will be well, right?
 
I'm looking at an alternate Trojan Horse city that maybe we can take back with 66% AP chance resolution.

Have both workers mining the Paris' hill T118. Have one road 1SE of Paris T119 for spy.

Whip a Confuscian Missionary in Horse City as soon as possible and spread it to Clams/Jungle Pigs on T121.

Settle JungPigs/Clams T120 with a whip T116 in Corn/Pigs/Fish

We get culture in it T121 and spread Conf. and gift it to Brennus at size 1 on T121 and a good spy steal attempt on T122.

We give Code of Laws earlier to counter -1 border tensions and -2 voted against us and we can sign open borders T122.

Then if we win the AP vote we get the city back on T123 just in time for Hanging Gardens to maybe give it Pop 2 and we had a good 80% steal attempt.

If the resolution is defied, we can keep trying to steal from the close by Clams/Jungle Pigs.

If we fail to steal and we get the city back, then we'd have delayed Iron Working steal by a large amount. We might have to give the city back again right away, but if it was size 2 we could whip it first and then it would be ok to declare war and take it without razing it but i still like the peaceful method/gems.



Sooooo Trojan Horse #2 with one good steal chance? :lol:

Spoiler :
Tipping towards Craziest now...

Seems good. The AP vote timing seems to work (nominate resolution IBT121-2 when Brennus has it, get it back IBT2-3) but not sure if HG will work. We still have to float Brennus' economy, but we can keep TH as our spam city, and get trade routes from Brennus for a temporary boost to our economy before we settle enough islands, and hopefully gems. If the spy fails, then we have to keep trying from Camulodunum, which is possible in any scenario. Owning the clams-jungle-pigs city does make us Brennus war target, which might bother us in some scenarios, but we'd know where to concentrate the defence to buy time until we can lose it for an AP peace (if needed). That site can work up two cottages for Paris, be an OK hybrid city long term, and in some universe that bcool thinks possible culture-capture the gems from Camulodunum.
 
I'm looking at an alternate Trojan Horse city that maybe we can take back with 66% AP chance resolution.

Have both workers mining the Paris' hill T118. Have one road 1SE of Paris T119 for spy.

Whip a Confuscian Missionary in Horse City as soon as possible and spread it to Clams/Jungle Pigs on T121.

Settle JungPigs/Clams T120 with a whip T116 in Corn/Pigs/Fish

We get culture in it T121 and spread Conf. and gift it to Brennus at size 1 on T121 and a good spy steal attempt on T122.

We give Code of Laws earlier to counter -1 border tensions and -2 voted against us and we can sign open borders T122.

Then if we win the AP vote we get the city back on T123 just in time for Hanging Gardens to maybe give it Pop 2 and we had a good 80% steal attempt.

If the resolution is defied, we can keep trying to steal from the close by Clams/Jungle Pigs.

If we fail to steal and we get the city back, then we'd have delayed Iron Working steal by a large amount. We might have to give the city back again right away, but if it was size 2 we could whip it first and then it would be ok to declare war and take it without razing it but i still like the peaceful method/gems.



Sooooo Trojan Horse #2 with one good steal chance? :lol:

Spoiler :
Tipping towards Craziest now...
This has a special benefit I hadn't thought of before. When we capture Camulodunum, we get one gems tile without having to wait for Camulodunum to come out of resistance, shortening the time we don't have the gems we've grown fond of.

What I dont' understand, though, is the OBs part. We already need an additional +4 just to get to Cautious to get Brennus to trade us gems (an additional +3 starting T121). How were you planning to do that?
 
Owning the clams-jungle-pigs city does make us Brennus war target, which might bother us in some scenarios, but we'd know where to concentrate the defence to buy time until we can lose it for an AP peace (if needed).
D'oh! What have I been thinking?!? Any city we gift to Brennus will immediately make us a land target...
 
Code:
int CvPlayerAI::AI_getTradeAttitude(PlayerTypes ePlayer) const
{
	// XXX human only?
	return range(((AI_getPeacetimeGrantValue(ePlayer) + std::max(0, (AI_getPeacetimeTradeValue(ePlayer) - GET_PLAYER(ePlayer).AI_getPeacetimeTradeValue(getID())))) / ((GET_TEAM(getTeam()).AI_getHasMetCounter(GET_PLAYER(ePlayer).getTeam()) + 1) * 5)), 0, 4);
}

I leave that for now. I have to go, but I don't want to lose progress in just verifying Silu's thing.
 
Tachy, you wouldn't believe some of the funked up bejesus I'm getting from this testing. Check these plusmods out for trading Fishing to Stalin. We get more value from our trade if Brennus knows Ramesses than if he only knows us. We get the most value if Brennus knows Ramesses, but we don't!?!?!

Yup, that's right. If we both know Ramesses, the value is different from when only Brennus knows Ramesses. Funkoid.

Code:
      ==========  ===============
       Stalin     Stalin  and we
        knows     know each other
      ==========  ===============
Turn  us us+Wang   +wang
----  -- -------   -----
0      4      4      4
1      4      4      4
2      3      4      4
3      2      3      3
4      2      3      3
5      2      2      2
6      1      2      2          Plusmods we get for gifting Fishing
7      1      2      1
8      1      1      1      
9      1      1      1      
10     1      1      1
11     1      1      1
12     1      1      1
13     0      1      1
14            1      1
15            1      0
16            1      
17            0
 
Back
Top Bottom