Wouldn't it make more sense to put up some kind of flag whenever you start a wonder than for the AI to scan every city? I mean, somehow your other cities "know" right?
That said, I'd always thought that this trick worked the way that King Pluto had described it (a science race, not so much a production race).
Change your capital to work only the tiles 1s,1e,and 1se, leaving one citizen not working tiles. The Oracle still completes in two turns but Djenne now attempts to build it.
I don't think this post got the attention it deserves as it proves already that the RNG is responsible for the discrepancy, not the supposed cheat:
(1) Mylene builds Oracle in 2 turns working a mine ->Djenne builds walls
(2) Mylene builds Oracle in 5 turns not working a mine ->Djenne builds oracle
Well so the AI looks at your oracle progress supposedly? No because
(3) Keilah also builds oracle in 2 turns using a citizen spec ->Djenne builds oracle
In (3) Keilah's case the AI has as little chance to beat the Human to oracle as in (1) Still it gives it a try.
Well i ran these 3 cases through the debugger, in plain english the relevant piece of code looks like this (simplified so i can explain what basically happens)
------------------------------------------------------------
if randomNumber("BuildDefensebuilding") < population_in_Djenne
>>Build Walls
>>exit build routine
If WeCanBuildAWonder
>> Build Wonder
>> exit build routine
------------------------------------------------------------
randomNumber("BuildDefensebuilding") is the RNG where we have been talking about. It works with the Random_Seed.If the value returned from this function is smaller than 6, the population in Djenne, than Djenne will build Walls and exit the build routine because a satisfactory result has been reached, Djenne knows what to build: Walls.
If the value is greater than Djenne's population it will not build Walls but look further. In the next piece of code it will find that it can indeed construct a wonder, Oracle, and do so.
I listed the return value from the RNG randomNumber("BuildDefensebuilding) in these 3 cases:
(1) Mylene builds Oracle in 2 turns working a mine
->Value returned from RNG = 1, smaller than pop in Djenne so Walls are built
(2) Mylene slows down progress and builds oracle in 5
->Value returned from RNG = 22, greater than pop in Djenne so we move on to the wonder build part, find that we can build it and choose to do so
(3) Keilah manipulates tiles and builds oracle in 2 turns
->Value returned from RNG = 22, greater than pop in Djenne so we move on to the wonder build part, find that we can build it and choose to do so
So it's all dependent on what the RNG returns dependent on tiles worked, 22 without working the mine leading to oracle, 1 with working the mine leading to Walls.It has nothing to do with any spying of the AI on human production.
Not a big surprise, i don't know how it works exactly but small deviations in tiles worked but probably also other things can have big consequences, the butterfly effect as someone remarked here.
Here's the exact relevant code where the decision making is done for code-divers who like to verify the result....
Spoiler:
From AI_chooseproduction in CVCityAI.cpp beginning line 1962
if (!bAlwaysPeace && (bDanger || (GC.getGameINLINE().getSorenRandNum(30, "AI Build Defense") < getPopulation())))
{
if (!bDanger)
{
if (AI_chooseBuilding(BUILDINGFOCUS_EXPERIENCE, 20))
{
return;
}
} This one hits with RNG=1
if (AI_chooseBuilding(BUILDINGFOCUS_DEFENSE, 20))
{
return;
}
if (bDanger)
{
if (AI_chooseBuilding(BUILDINGFOCUS_EXPERIENCE, 20))
{
return;
}
}
}
if (AI_chooseBuilding(BUILDINGFOCUS_PRODUCTION, 20, 4))
{
return;
}
//20 means 5g or ~2 happiness...
if (AI_chooseBuilding(iEconomyFlags, 15, 20))
{
return;
}
if (!bLandWar)
{ This one hits with RNG=22
if (AI_chooseBuilding(iEconomyFlags, 40, 8))
{
return;
}
Nice work Dirk, 2 things to mention thou:
Since the tiles i work matter, which was shown in the example you described, this is already a spy on my city. Mansa has no way to see what tiles i work (no land unit near it), yet the rng aka how the AI is
programmed, is manipulated by it.
Maybe the term "spying on my city" is confusing people.
You could also say "the rng is manipulated by what i do with my city".
Why should it not matter in the same way with what i build?
And the other is..Kossin said he also believes in the "put some hammers into a wonder, the AI is less likely to build it" thingi. That is another great player with huge experience who thinks it works that way.
It is getting a bit much combined player experience for my taste to say: No, the AI (aka the rng, don't forget) is blind in this matter.
If i change the tiles i work, and the rng changes it's calculations based on that, this is most likely as well random, and this time it passes the "check" and still builds the Oracle with no chance of getting it. Because the rng is still a rng, see Kossin's "less likely, not never".
But this is the whole idea and what we talk about, isn't it? You have a higher chance to get it, i never said you will always
<You could also say "the rng is manipulated by what i do with my city". >
This is spot on. It's what happens at least when you switch tiles. But this it at least a bit different than Mansa actually cheating by explicitly looking at Delhi. Working other tiles influences RNG but not necessarily in favor of AI building the wonder if the Human player is slacking on it.
Actually we'd need to know how this RNG and the associated random seed works. See this post by VOU..
Of course it does -- mines can "pop" a resource, and the game uses the random number stack to check.
Another way to experiment with that idea is to replace the mine with an equivalent production tile; use the world builder to replace the mine with camped elephants, and see what happens.
When I do that, I get the oracle build each time (in am insignificant number of trials).
You could confirm that the random number stack is being consumed differently by turning on the right logging, although it appears that doing so requires rebuilding the DLL (or knowing which bits in the save file to hack to enable it).
Using random function to check for resource pop is logical, no other way to check really. It's also consistent with Keilah's result, Oracle was switched when not working the mine. But there are more things than just working mines or not i believe that influence this RNG, unit movement is certainly one of them. Atm i have some difficulty how RNG in combination with Random seed works, it's probably not that difficult but i can't explain it to myself in a way that i understand it right now .
But i can rebuild the DLL so maybe i should turn on that log Vou is talking about to get some more insight.
Nice work Dirk, 2 things to mention thou:
Since the tiles i work matter, which was shown in the example you described, this is already a spy on my city. Mansa has no way to see what tiles i work (no land unit near it), yet the rng aka how the AI is
programmed, is manipulated by it.
Maybe the term "spying on my city" is confusing people.
You could also say "the rng is manipulated by what i do with my city".
Why should it not matter in the same way with what i build?
And the other is..Kossin said he also believes in the "put some hammers into a wonder, the AI is less likely to build it" thingi. That is another great player with huge experience who thinks it works that way.
It is getting a bit much combined player experience for my taste to say: No, the AI (aka the rng, don't forget) is blind in this matter.
If i change the tiles i work, and the rng changes it's calculations based on that, this is most likely as well random, and this time it passes the "check" and still builds the Oracle with no chance of getting it. Because the rng is still a rng, see Kossin's "less likely, not never".
But this is the whole idea and what we talk about, isn't it? You have a higher chance to get it, i never said you will always
The AI doesn't know what you're doing. To demonstrate, consider putting yourself in their shoes - you have a number generator. You can ask it, and it will give you a number. That number is not actually random - it is determined by what the other player did - but there is no way you can deduce what the other player did simply based on the number you are given.
Sometimes switching around tiles to speed up Oracle will cause the AI to build walls instead of Oracle. Sometimes switching around tiles to speed up Oracle will cause the AI to also build Oracle instead of building walls. It doesn't, on average, make the game any easier or harder.
The AI doesn't know what you're doing. To demonstrate, consider putting yourself in their shoes - you have a number generator. You can ask it, and it will give you a number. That number is not actually random - it is determined by what the other player did - but there is no way you can deduce what the other player did simply based on the number you are given.
Echoing the same idea: the AI has no way of knowing that you consumed a random number by working a mine, or by choosing a slightly different place to put a sentry. Or by doing none of these things.
It just happens by luck that your choice (the only actually "random" thing in the scenario) shifted the RNG stack across a decision boundary that you could easily see. Butterfly effect on a macro scale. Usually the changes will be less direct.
Related: for an Uber example, see Pilgrimage to Mecca, where all sorts of crazy were possible so long as the dice didn't spin Asoka to an early religion.
Given everything just posted, it seems to me that a more fruitful line of research would be in the code that determines what the AI will tech next. It seems pretty well established that if the human player is gets a tech (i.e., priesthood) that none of the AIs have researched yet, they will avoid that tech in at least some cases for some period of time. This is perhaps one mechanic that could be used (exploited) to grab the Oracle (or other wonders) later than is usually possible.
Not a big surprise, i don't know how it works exactly but small deviations in tiles worked but probably also other things can have big consequences, the butterfly effect as someone remarked here.
The AI doesn't know what you're doing. (...) That number is not actually random - it is determined by what the other player did - but there is no way you can deduce what the other player did simply based on the number you are given.
Ok, I guess this is clear now (did I get it right? ):
NOT working the mine the Magic Number is 22 (Oracle)
While working the mine the Magic Number is 1 (Walls)
That said, the second part of the issue still not answered, if I got it right.
Now, feel free to make fun of my programming skills, I'm definitely not a coder.
But, to simplify, as a concept, it is possible that the program does something like this following or not? I'm not affirming it, I'm just asking for curiosity.
Code:
[COLOR="Blue"]#this color is for functions[/COLOR]
[COLOR="RoyalBlue"]#this color is for variables[/COLOR]
[B]function[/B] [COLOR="Blue"]fAiTurn[/COLOR]
[COLOR="RoyalBlue"]AiChoice[/COLOR] = -1
[COLOR="RoyalBlue"]n[/COLOR] = random
[COLOR="RoyalBlue"]AiChoice[/COLOR] = [COLOR="Blue"]fWhatAIChoice[/COLOR]([COLOR="RoyalBlue"]n[/COLOR])
...
...
###
[B]function[/B] [COLOR="Blue"]fWhatAiChoice[/COLOR]([COLOR="RoyalBlue"]n[/COLOR])
...
...
[B]if[/B] [COLOR="Blue"]fBuildWonder[/COLOR]([COLOR="RoyalBlue"]n[/COLOR]) = [COLOR="Red"]true[/COLOR] [B]then[/B] [COLOR="RoyalBlue"]AiChoice[/COLOR] = [COLOR="Blue"]fWonder[/COLOR]([COLOR="RoyalBlue"]n[/COLOR])
...
...
[B]return[/B] [COLOR="RoyalBlue"]AiChoice[/COLOR]
[B]function[/B] [COLOR="Blue"]fWonder[/COLOR]([COLOR="RoyalBlue"]n[/COLOR])
[COLOR="RoyalBlue"]array[/COLOR] = list of max 5 wonders the AI can build (in preference order)
[COLOR="RoyalBlue"]AiChoice[/COLOR] = [COLOR="Blue"]fPickAwonder[/COLOR]([COLOR="RoyalBlue"]n[/COLOR],[COLOR="RoyalBlue"]array[/COLOR][1],[COLOR="RoyalBlue"]array[/COLOR][2],[COLOR="RoyalBlue"]array[/COLOR][3],[COLOR="RoyalBlue"]array[/COLOR][4],[COLOR="RoyalBlue"]array[/COLOR][5])
[B]if[/B] [COLOR="RoyalBlue"]AiChoice[/COLOR] = [COLOR="Red"]a wonder the player is building[B]*[/B][/COLOR] [B]then[/B] [COLOR="RoyalBlue"]AiChoice[/COLOR] = [COLOR="Blue"]fPickSomethingElse[/COLOR]([COLOR="RoyalBlue"]n[/COLOR])
[B]return[/B] [COLOR="RoyalBlue"]AiChoice[/COLOR]
[COLOR="Red"][B]*[/B](or some other more specific criteria is met)[/COLOR]
Just wondering, trying to understand...
Thanks to anybody might have some further inputs!
EDIT:
Ah... forgot to mention, thanks to Keliah for its tests as well, of course!
And as well to Mylene for bringing up the discussion, the save, and opening this thread.
And, assuming the GSpy popped in 1440 BC, this would imply that the GWall was built on turn 14 (Turn/Year Ref: http://forums.civfanatics.com/showthread.php?t=148824*) . It would be highly unlikely that he built Stonehenge to boost GPP (3 wonders before 1000BC?)
Great thread!
If i change the tiles i work, and the rng changes it's calculations based on that, this is most likely as well random, and this time it passes the "check" and still builds the Oracle with no chance of getting it. Because the rng is still a rng, see Kossin's "less likely, not never".
But this is the whole idea and what we talk about, isn't it? You have a higher chance to get it, i never said you will always
Disagree - I think it's just as likely the wonder will get BIDL quicker. Maybe it's more noticeable when the wonder times are unusually delayed so you remember more - bit like the outrageous combat odds losses people are forever claiming are fixed.
I mean there might be times you would want an AI to finish a wonder more quickly, and all the same discussions would apply. You COULD juggle your tile assignments and/or make different fogbuster moves, and yes it WOULD change the RNG rolls used for the AI wonder building, either the desired way or the undesired way.
The thing is without playing it once you don't know whether it would have been the undesired way in the first place!
In the experiment in this thread, it's hardly surprising that the oracle took ages to finish when repeated reloads were made in order to navigate a path through the RNG rolls which would trigger decisions delaying the wonder. You could do the same thing and, just by changing worked tile assignments, make MM or another AI beeline the oracle or any other wonder and build it in an unbeatably fast time rather than a super slow one.
It would be like groundhog day, you could make anything happen with enough trial and error
Isolated my city..me and every AI starts with Masonry. 4 INDs (Gaulle, HC, Stalin, Bismarck).
I start with the mids day 1, 8h/turn.
Turn 92...the mids are in the queue.
Spoiler:
Lyons has been slow building them for...forever.
HC could have wipped them a few turns ago, notice on the right side he did not.
Spoiler:
Reload day 1, i remove masonry from my techs (the AIs all keep it), queue up random stuff and never touch masonry or the Mids.
No messing around, Gaulle this time builds them in his best city Paris at a normal time, and HC also picked his capital for a try.
Ok, I guess this is clear now (did I get it right? ):
NOT working the mine the Magic Number is 22 (Oracle)
While working the mine the Magic Number is 1 (Walls)
That said, the second part of the issue still not answered, if I got it right.
Now, feel free to make fun of my programming skills, I'm definitely not a coder.
But, to simplify, as a concept, it is possible that the program does something like this following or not? I'm not affirming it, I'm just asking for curiosity.
Code:
[COLOR="Blue"]#this color is for functions[/COLOR]
[COLOR="RoyalBlue"]#this color is for variables[/COLOR]
[B]function[/B] [COLOR="Blue"]fAiTurn[/COLOR]
[COLOR="RoyalBlue"]AiChoice[/COLOR] = -1
[COLOR="RoyalBlue"]n[/COLOR] = random
[COLOR="RoyalBlue"]AiChoice[/COLOR] = [COLOR="Blue"]fWhatAIChoice[/COLOR]([COLOR="RoyalBlue"]n[/COLOR])
...
...
###
[B]function[/B] [COLOR="Blue"]fWhatAiChoice[/COLOR]([COLOR="RoyalBlue"]n[/COLOR])
...
...
[B]if[/B] [COLOR="Blue"]fBuildWonder[/COLOR]([COLOR="RoyalBlue"]n[/COLOR]) = [COLOR="Red"]true[/COLOR] [B]then[/B] [COLOR="RoyalBlue"]AiChoice[/COLOR] = [COLOR="Blue"]fWonder[/COLOR]([COLOR="RoyalBlue"]n[/COLOR])
...
...
[B]return[/B] [COLOR="RoyalBlue"]AiChoice[/COLOR]
[B]function[/B] [COLOR="Blue"]fWonder[/COLOR]([COLOR="RoyalBlue"]n[/COLOR])
[COLOR="RoyalBlue"]array[/COLOR] = list of max 5 wonders the AI can build (in preference order)
[COLOR="RoyalBlue"]AiChoice[/COLOR] = [COLOR="Blue"]fPickAwonder[/COLOR]([COLOR="RoyalBlue"]n[/COLOR],[COLOR="RoyalBlue"]array[/COLOR][1],[COLOR="RoyalBlue"]array[/COLOR][2],[COLOR="RoyalBlue"]array[/COLOR][3],[COLOR="RoyalBlue"]array[/COLOR][4],[COLOR="RoyalBlue"]array[/COLOR][5])
[B]if[/B] [COLOR="RoyalBlue"]AiChoice[/COLOR] = [COLOR="Red"]a wonder the player is building[B]*[/B][/COLOR] [B]then[/B] [COLOR="RoyalBlue"]AiChoice[/COLOR] = [COLOR="Blue"]fPickSomethingElse[/COLOR]([COLOR="RoyalBlue"]n[/COLOR])
[B]return[/B] [COLOR="RoyalBlue"]AiChoice[/COLOR]
[COLOR="Red"][B]*[/B](or some other more specific criteria is met)[/COLOR]
Just wondering, trying to understand...
Thanks to anybody might have some further inputs!
EDIT:
Ah... forgot to mention, thanks to Keliah for its tests as well, of course!
And as well to Mylene for bringing up the discussion, the save, and opening this thread.
The second part is the AI delaying a tech when you have started the wonder belonging to that tech? It doesn't look likely since it seems the AI doesn't look directly into what you're doing if it isn't supposed to do so. The AI has a bigger chance of delaying a tech if you have finished the wonder but this is logical and probably common knowledge.
About your code sample, it doesn't work exactly like that but you get the idea. things are picked by AI with the random number in mind combined with other criteria.
The line <If Human is building the wonder i chose i pick something else> definitely doesn't happen. At least not in Mylene's sample that i run through debug. Essentially the decision was 100% RNG there 22 is oracle, 1 is walls.
A small disclaimer here.... I'm certain about what happens in Mylene's sample. It all happened in some 50 lines of codes, the most relevant lines i have listed. However there are > 20000 lines of code in cvCity and cvAiCity alone and the decision to build something can be earlier/later in the code, it's essentially a long sequence of ShallIBuildThis(RNG), if not run to next line of ShallIBuildThis(RNG). I have glanced over it and there doesn't seem to be any hint of a deliberate cheat but to be sure in a specific case you really need to run a save through the debugger or be a much better code reader than i am.
Finally in one of my first posts in the other thread it may have seemed that i don't value AZ's achievements that much. Not so, like many others i like his videos, and i certainly give him credit for playing a strong and original game. It's just that in 6 years that i've been here i've seen ridiculous bogus presented as absolute fact often based on experience by mediocre players. So i have become a bit skeptical. This one is not bogus, it could have been true and my first reaction was surprise more than skepsis. But from what i've seen now i don't believe it's true.
(cut since it is just above)
Wow! Clear, enlightening and exhaustive as always!
Thanks! Appreciated!
Happy to read your conclusions, since I'm about in your same boat: from my experience (and better players than I am reported experiences), after reading about this I'm kind of tempted to think that it might be; but, without any definitive evidence, I still mostly (and safely) skeptical at the moment.
And I'm definitely curious about it now!
Ah... if you ever have some time to spend in future, and you still wish to run some tests on my files you downloaded from vicawoo's thread, I still definitely interested in the results.
Again, only if/when you have some time, you wish to, and if you still are interested as well.
Now that one was starting to get a bit more scientific - isolate the human from the rest of the game and everything should happen exactly the same. But you did various things differently the second time, including removing masonry and choosing different city builds.
I tried a similar experiment, with the intention of keeping as much the same as possible, except for building or not building the pyramids. The results suggest no spying occurs!
Start game with 4 ind AIs.
WB a mountain barrier around our capital so we cannot be contacted.
WB ourself masonry and currency.
Deep-select future tech.
Run 1
Queue auto worker and pyramids (switch to wealth if we get to within 1 turn)
Wait and watch.
Run 2
Queue auto worker and wealth.
Wait and watch.
The idea of building wealth being I hoped that accumulating gold would not affect the rest of the world in any way. That is what apparently happened. Stalin builds the pyramids on T91, and from casual watching everything else appeared to happen the same too, including other wonder build dates and locations.
Run 3
Queue auto worker and city auto-build.
Wait and watch.
This time my capital built things including library and barracks. One of those things affected the rest of the world in some way because "history" did not play out the same this time.
I vaguely remember somebody saying that tech discounts apply based on the whole world, not just known civs. If that's the case building a library upped our tech rate, gave AIs cheaper techs, gave them different build decisions to make etc, and history diverged from the moment we built the library. Or perhaps the global power ratings are known without civ contact and our barracks had some such effect.
Conclusion
The first two runs strongly suggest the AIs do not have sight into our build queues, and that if the human does nothing requiring RNG rolls, and does not interact with any game mechanic in such a way that different RNG rolls will happen elsewhere, then the whole game will play out exactly the same and repeatably.
There is a fine line between natural sceptical, and focused on saying no no no for the heck of it
I choosed different city builds, wait a second...so they matter and go into the rng?
The Pyras are a city build...hello?!?
A really simple example of what happened in Mylene save would be like this (just to make sure i'm getting this right)
RNG and Seed give a set of numbers ie 0 9 1 8 3 7 6 4 5 2
If the RNG gives a number below 5 it builds the Oracle, otherwise it builds Walls (i know more checks than this but keep it to 2 choices)
Not working Mine gives you 0, since its below 5 the Oracle is placed in production queue.
Working Mine, the RNG gives 0 for the check on a resource pop, then for the Oracle it gives 9 since thats the next one in the sample. Walls are built.
Now i know that the RNG is a much bigger sample (so as to make things appear random as takes so long to repeat) with the Seed telling it where to start from within the sample. And that the RNG is used for lots of checks (ie barb spawns & random events) so small changes can cause big changes due to different values being applied to things.
You can always skip one RNG call if you pick a unit with 1 move and set it to autoexplore for one turn, if you really want to put some more handles in the testing ... but in the end we will most likely get the tried and tested result that , barring some well known situations, the AI has no more intel on the game than the human
There is a fine line between natural sceptical, and focused on saying no no no for the heck of it
I choosed different city builds, wait a second...so they matter and go into the rng?
The Pyras are a city build...hello?!?
But wonders are city builds which don't affect anything!
Skepticism not for the sake but in the search for truth. Try it out in the above save. Put hammers into any wonders you like, or build wealth. The AIs will not care, the wonder dates will be as follows:
T42: GW start (Thebes)
T50 GW end
T61 SH start (Thebes)
T61 Pyra start (Moscow)
T65 SH end
T71 TOA start (Paris)
T73 TOA start (Thebes)
T74 Oracle start (Thebes) - Ram abandons TOA after 1 turn - cheating spy on Louis!
T76 Oracle end with a 2-whip flourish
T87 GLH start (Memphis)
T90 Pyra end
T91 TOA end (Thebes - Ram with marble even had time for forge and still win race)
All so long as you research the same techs on the same turns - hence avoid library. I tried it with a barracks slipped in - no effect. Wealth, no effect. Any part wonder builds from us, no effect. Fail gold we get, no effect.
With a library things start to diverge about 10-20 turns after our library is finished, as AIs started to need different RNG rolls presumably from getting their techs a bit earlier.
Your save is...Prince
Building wealth and doing nothing is not realistic, on my Deity test the difference in Mids was 21 turns.
That is a lot, no matter how the rng reacts cos a Deity AI can build them in ~20 turns in a bigger city with the IND bonus. It should not happen that i get them on turn 91 just cos i build a library.
I know I was a bit abrasive about it the first time, but Mylene, you really need to educate yourself in the scientific method a bit. You are making assumptions and errors, most importantly:
you have preselected a result that you believe to be true and are looking for evidence to support it, interpreting unclear things as being the evidence you seek, and disregarding contradictory evidence because it goes against your instincts/feelings.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.