[GS] When Exactly Spy Mission Success is Determined

Tyroq

Warlord
Joined
Jul 21, 2011
Messages
128
Location
Iowa, USA
So a funny thing happened to me the other day. I was playing along, enjoying a nice golden age as Korea in the 1700s, and I had a spy mission fail. Aww nuts. Oh well, promise the AI not to do it anymore and move on with life. Well, speaking of life, real-life decided to throw a wrench into the works and the power went out. Computer shut off, all that fun stuff. So anyway, I booted things back up but didn't have a recent save, so I grabbed the latest auto-save and resumed from there. It was the turn before the spy mission failed. Hmm, I wonder if it will succeed this time? It had an 84% chance of success. Odds would seem to be in my favor. Hit next turn. Mission failed again. Weird. Now I'm curious how this works, so I reload again, and the mission fails again. Now, reloads take a while, and I'm not extremely patient, so I gave up and resumed playing like normal. But I'm wondering if the game determines more than one turn in advance how a mission is going to go, whether success or failure? Because, it would seem that statistically, trying several times on an 84% chance of success mission ought to lead to, you know, actual success.

Has anybody ever tested this out and discovered when exactly the game determines the outcome of a mission? I know my own tries are a very small sample set, but it just seems counter-intuitive that 3 plays of a single turn end up with the exact same outcome. I also wonder if the game does this same thing for rock band success?
 
I know that the outcome of your spy being succesful in his/her escape is determined in the same turn it occurs, but I'm not sure about missions themselves.

Maybe the other player had one of those green cards that affect your chance of success or a governor? I'm not sure if you are able to see your % depleted by this or not.
 
So a funny thing happened to me the other day. I was playing along, enjoying a nice golden age as Korea in the 1700s, and I had a spy mission fail. Aww nuts. Oh well, promise the AI not to do it anymore and move on with life. Well, speaking of life, real-life decided to throw a wrench into the works and the power went out. Computer shut off, all that fun stuff. So anyway, I booted things back up but didn't have a recent save, so I grabbed the latest auto-save and resumed from there. It was the turn before the spy mission failed. Hmm, I wonder if it will succeed this time? It had an 84% chance of success. Odds would seem to be in my favor. Hit next turn. Mission failed again. Weird. Now I'm curious how this works, so I reload again, and the mission fails again. Now, reloads take a while, and I'm not extremely patient, so I gave up and resumed playing like normal. But I'm wondering if the game determines more than one turn in advance how a mission is going to go, whether success or failure? Because, it would seem that statistically, trying several times on an 84% chance of success mission ought to lead to, you know, actual success.

Has anybody ever tested this out and discovered when exactly the game determines the outcome of a mission? I know my own tries are a very small sample set, but it just seems counter-intuitive that 3 plays of a single turn end up with the exact same outcome. I also wonder if the game does this same thing for rock band success?

I think even if you reloaded this save a million times, this mission would fail every single time. The seed for the RNG remains the same on reload, so every time the RNG algorithm would generate the same result in the the 16% fail interval. Unless, perhaps, you can still do some other actions that use the same RNG sequence before hitting Next turn, but I really don't know it it works like this here. In Civ 4, for example, while creating a new game you can check the setting "New random seed on reload", then the results of a particular combat may be different when you reload. There is no such option in Civ 6 settings. This is based on what I vaguely remember about RNG from IT classes a couple of decades ago, more or less, so it might be that I am terribly wrong here. :)
 
I think even if you reloaded this save a million times, this mission would fail every single time. The seed for the RNG remains the same on reload, so every time the RNG algorithm would generate the same result in the the 16% fail interval. Unless, perhaps, you can still do some other actions that use the same RNG sequence before hitting Next turn, but I really don't know it it works like this here. In Civ 4, for example, while creating a new game you can check the setting "New random seed on reload", then the results of a particular combat may be different when you reload. There is no such option in Civ 6 settings. This is based on what I vaguely remember about RNG from IT classes a couple of decades ago, more or less, so it might be that I am terribly wrong here. :)

Yeah, this is correct. It will fail 100% of the time on reload, unless you load back a few more turns.
 
I believe that someone posted good evidence a while back that the chance of success shown for spy missions is not always accurate. I don't recall details. But if that's the case, even if you are getting a new roll on each reload, you may not be as unlucky as it appears.
 
I think even if you reloaded this save a million times, this mission would fail every single time. The seed for the RNG remains the same on reload, so every time the RNG algorithm would generate the same result in the the 16% fail interval. Unless, perhaps, you can still do some other actions that use the same RNG sequence before hitting Next turn, but I really don't know it it works like this here. In Civ 4, for example, while creating a new game you can check the setting "New random seed on reload", then the results of a particular combat may be different when you reload. There is no such option in Civ 6 settings. This is based on what I vaguely remember about RNG from IT classes a couple of decades ago, more or less, so it might be that I am terribly wrong here. :)

As someone who doesn't know much about code or programming, I'm hoping you can explain that a bit more. I live in Iowa. Around here the only seeds we use are what go in the ground. I've played Civ games for years, but the technical stuff is not something I ever got into.
 
As someone who doesn't know much about code or programming, I'm hoping you can explain that a bit more. I live in Iowa. Around here the only seeds we use are what go in the ground. I've played Civ games for years, but the technical stuff is not something I ever got into.

The "seed" in this case is a string of numbers that dictates what happens during randomly determined events. Since the roll for your spy is based on this string of numbers, it will always either fail or succeed no matter how many times you do it.

The main reason this feature exists is to keep people from reloading fights so that they win every time, from back in the day when RNG played a lot more into combat than anything else.
 
@Tyroq
Start a new game, save it, do exactly the same moves each time and you will get the same item from a goody hut.
The move a unit differently and the goody hut will most likely change.
It is not really random in the true sense of the word.
 
Or trigger an eureka or inspiration before grab the goody hut would change the reward.
Sometimes doing things like making alliance, declaring war... can change the output of espionage mission next turn.
 
As someone who doesn't know much about code or programming, I'm hoping you can explain that a bit more. I live in Iowa. Around here the only seeds we use are what go in the ground. I've played Civ games for years, but the technical stuff is not something I ever got into.
I think, for more extensive explanation, I better refer you, for example, to this site, among many others. If I start explaining in depth myself, I may provide quite a few "alternative facts", because I'm no programmer neither.

I just know that computers have trouble to generate random numbers (no hands to roll a dice) and use pseudo-random number generation algorithms instead. The generated sequence is seemingly random and fit for purpose, but to generate that sequence the computer needs an initial value - the seed, which may be the time reading of your machine when you create the game. As I understand, in this case the seed stays the same for the entire game, and every event that needs a random number just picks the next value from the generated pseudo-random sequence, based on the same initial seed.

As for the fate of your spy mission, I understand that the program asked for a random number, the algorithm supplied one. For simplicity, let's say it asked to give a number from the interval 1–100. As the chance of success was 86%, let's say if the supplied number were from 1 to 86, the mission would succeed, and if from 87 to100, it would fail. Let's say that in your case the next number in the sequence was 90 - fail. Now if you reload the same save and make no changes in your moves that would require a random number, the order of events will be the same and the evaluation of this spy mission will always be based on the same number in the "random" sequence - it will always be that fateful 90. Yes, that roll had the 86% chance to be successful, but the time of the creation of your game and all the long chain of events in it up to that moment led to picking that specific value from the random sequence to be used for the evaluation of your spy mission.

So there you go, I just hope I did not write too much nonsense here :)
 
Additionally I was the one that found out that 84% success was not really what people thought it was.

So if we look at 90% / 7% / 3% you have a 90% chance of success but within that 90% chance there is a chance of being spotted and having to escape which is then another random roll. Both we done in the same turn at the end of the spying. Now I did a lot of sample data but could not get to the precise stuff for escape because it changes depending on how many escape routes there are and which one you take but I can tell you by foot is safest.
Within the 7% for failure there is a chance on undetected, detected, and captured/killed so the 3% is actually higher than 3%.
Your level counts for a lot and it is based on 3d6 rolls by the looks of things.
I have the stats I did but it is only a small part of it and I gave up because it would take a lot of sample data.
I just wish Firaxis would tell us.

If you doubt what I am saying read carefully the texts of mission... it says things like “your spy stole the gold successfully but was killed” and the gold ends up in your treasury (over a few turns)
 
I think even if you reloaded this save a million times, this mission would fail every single time. The seed for the RNG remains the same on reload, so every time the RNG algorithm would generate the same result in the the 16% fail interval. Unless, perhaps, you can still do some other actions that use the same RNG sequence before hitting Next turn, but I really don't know it it works like this here. In Civ 4, for example, while creating a new game you can check the setting "New random seed on reload", then the results of a particular combat may be different when you reload. There is no such option in Civ 6 settings. This is based on what I vaguely remember about RNG from IT classes a couple of decades ago, more or less, so it might be that I am terribly wrong here. :)

Even without random seed on reload, in civ 4 you could simply instruct a unit to auto explore and it would use the same RNG roll for determining that rather than say a combat outcome. So you could game the RNG anyway. This is one of several reasons HoF banned reloading/replaying turns.

Might such an approach still work in Civ 6?

I believe that someone posted good evidence a while back that the chance of success shown for spy missions is not always accurate. I don't recall details. But if that's the case, even if you are getting a new roll on each reload, you may not be as unlucky as it appears.

Do you recall a thread title or some key word? I'd be interested to find details about this bug if it exists.
 
I'd be interested to find details about this bug if it exists.
It is not a bug it is a misconception about the mechanics and by running hundreds of spy missions and collating the evidence it showed spys dying more than quoted. This included inspecting the random rolls of each mission.
I will try and drag the thread out and post it here.

EDIT: @TheMeInTeam link is here How to use spy as France
The charts are based on the random number rolled to work out the correct %: so is quite accurate.
 
Last edited:
It is not a bug it is a misconception about the mechanics and by running hundreds of spy missions and collating the evidence it showed spys dying more than quoted. This included inspecting the random rolls of each mission.
I will try and drag the thread out and post it here.

EDIT: @TheMeInTeam link is here How to use spy as France
The charts are based on the random number rolled to work out the correct %: so is quite accurate.

Thanks for this. It's a bit to read through, but if I'm interpreting correctly the displayed success% is accurate. You can still get caught on success, but the displayed % for the mission itself is not wrong. While UI could use a little clarity, as you say this is not a bug then. It would require the displayed % to be wrong (which is what willowbrook's post implied) to be a bug.

On the spies dying side, having displayed % not match actual death rate could be argued as one though.
 
This RNG talk always reminds me that in RL we are only subject to one seed (no reloading!) and probably don't have free will.

Anyone else go down this road when thinking about RNG and seeds?
 
Thank you @Icicle @MrRadar @Victoria for the very informative replies. This aspect of the game makes a lot more sense now.
 
I have been instructed to tell you that we do.

I suspect most people don't know what they really mean when they say this :p.

Maybe a bit tangential in an RNG thread, but whether anything is "random" as opposed to "too many factors to compute/anticipate" isn't settled science. RNG algorithms might ultimately boil down to "random-seeming if a bit less random-seeming than our perception of reality".

Anyway I haven't tried but it should still be possible to alter outcomes in games by making it use RNG algorithm in different order and thus get different outcomes for say damage or spy failure. At least in principle. I'm not sure where the game tethers its RNG calls or if it rolls to decide outcomes in advance of the relevant turn.
 
or if it rolls to decide outcomes in advance of the relevant turn.
It rolls at the time of the action, at least that is how it logs it in VI.
If I take action A then action B in the same turn action B will always be the same but if I do action C in between then action B will change. I have not tested if action D instead of C will cause B to have a differing result which I guess would be the true test.
 
Top Bottom