Page 1 of 2
Game is using pseudo-randomness but forget to warn us about it?
Posted: Tue Jun 23, 2020 4:02 pm
by demiare
Recently I'd decided to cheat one stratagem for me via save/load. And discovered a few "funny" things:
0) Saves are overwritten on loading them with a different checksum, so they're altered during loading. That get my first WTF face.
1) So to check my worst guess I saved "basic" version of save in another folder on my HDD and replaced it each time after attempting to load & execute a stratagem.
2) I have DC 150 and d100+61 roll. This should mean I have 11% chance of success. Seems easy? Except I used 40 attempts and still not get it.
This is almost impossible statistically (99.05% chance to get at least single success in 40 tries).
3) During my tries I saw result 147 six times. Again - it's almost impossible statistically if game using honest d100 rolls.
Exactly same experience I have with tech discoveries - I have 5 available basic techs, two of them are power plant one. Over 12 attempts to reload save & end turn (counting only attempts that triggered tech discovery, not fruitless one!) I had ZERO power plant discoveries.
This is statistically impossible again (99.78% chance to trigger one of two power plant techs at least once in case of "honest" random).
This is insanely annoying. Why? Basic tech consist of 3 Mil and 7 Eco. Every re-balance of budget lead to massive minuses to relationships & I really need basic military techs too. So I'm forced to unlock next tech groups while lacking critical energy generation techs OR eat extreme penalties for disabling Military Research (idea of delaying military techs and spread budget 70-30 between Eco&Mil councils is not on table at all!).
In my previous tries I was lucky to have a power generating asset nearby but now I don't see any of them while I'm finishing to deal with 3rd zone (and spies unlocked 4th one to me).
Combine it with completely vague mechanism of tech discovery - as game show ZERO info how much BP I need accumulate & how high is my chance to unlock new tech...
P.S. Because of this both finds I'm no longer willing to play this game as this is third time when SE is lying to me (first one was Borealis start - game happily generate planet with no water while description is promising it & don't allow to make a snow-filled planet as restriction on max share of sea is too severe for it + even basic life is seems to be prohibited on such planets).
Sorry but I have zero understanding why game need a some kind of anti-cheat protection while AI is cheating like crazy openly and shamelessly (free roads + with a single lvl1 office & command bunker lvl1 it was capable to keep in Admin lvl with me while I was cheating "unlimited" PP myself to unlock councils ASAP and have lvl2 bunker & lvl1 office too).
RE: Game is using pseudo-randomness but forget to warn us about it?
Posted: Tue Jun 23, 2020 4:56 pm
by zuekamo
this game needs an Ironman option to avoid the savescuming
RE: Game is using pseudo-randomness but forget to warn us about it?
Posted: Tue Jun 23, 2020 5:13 pm
by Ekaton
Huh, that's quite interesting. Hope Vic can elaborate.
RE: Game is using pseudo-randomness but forget to warn us about it?
Posted: Tue Jun 23, 2020 5:32 pm
by zgrssd
All games use Pseudorandom Number Generators? Or do you think the game has a connection to
a wall full a Lava Lamps or something that elaborate?
What you talk about is preserving the seed. Wich is really jsut a normal thing that games do since Civilisation 2.
RE: Game is using pseudo-randomness but forget to warn us about it?
Posted: Tue Jun 23, 2020 5:43 pm
by JamesHunt
ORIGINAL: zuekamo
this game needs an Ironman option to avoid the savescuming
Even more relevant for multiplayer as PBEM is very prone for getting exploited by cheaters backuping saves and "try-scumming" until they satisfied with their turn results. Even when RNG generation is fixed in the savegame beforehand by playing variations cheaters still achieve what they´re looking for. You often encounter those MP AARs were one was playing super-perfect which at times can raise the suspicion that this method was used.
That the save is modified during loading could indicate a safety protection against this (save could store information about loading attempts in order to expose cheaters), although backuping saves basically bypasses this as the OP did.
I remember for DC Barbarossa somebody mentioned that he believed that there is something in place to prevent brute force savescum RNG attacks and that he felt convinced restarting the game offset or reseted some of this non-randomness. Could be subjective impression although I didn´t follow this as I never was interested in playing with such methods.
RE: Game is using pseudo-randomness but forget to warn us about it?
Posted: Tue Jun 23, 2020 5:47 pm
by Falke
1) That you had different results in all that reloading means that a RNG seed is not being saved, that would prevent a different result.
2) A Statistically calculated 99.99% chance is still not 100%- Statistically 100 coin tosses should have 50 heads and 50 tails. In reality the actual result varies between 100 heads and 100 tails.
3) If always having power tech early is such an issue, just start with L4 Tech
4) There is no need to change the relative budget, worst case just set the council to 100% Discovery which costs 2pp.This BP is not wasted as it gets used once new areas are available
RE: Game is using pseudo-randomness but forget to warn us about it?
Posted: Tue Jun 23, 2020 5:49 pm
by Smidlee
Zgrssd is right. There is no true randomness in computer programs.
RE: Game is using pseudo-randomness but forget to warn us about it?
Posted: Tue Jun 23, 2020 6:10 pm
by Lovenought
I don't get it? If you reload game properly (just save before a roll or end turn, then reload and do it again) you get a different result each time. I used savescumming all the time during my practice games where I needed all the help I could get.
RE: Game is using pseudo-randomness but forget to warn us about it?
Posted: Tue Jun 23, 2020 6:13 pm
by ZiggyMaca
OP; did you restart the game between save scum testing runs? You know, I don't really care too much, I think you saying the game lied to you is... dramatic? All entertainment tricks you to some extent.
RE: Game is using pseudo-randomness but forget to warn us about it?
Posted: Tue Jun 23, 2020 6:51 pm
by zgrssd
ORIGINAL: demiare
Recently I'd decided to cheat one stratagem for me via save/load. And discovered a few "funny" things:
0) Saves are overwritten on loading them with a different checksum, so they're altered during loading. That get my first WTF face.
1) So to check my worst guess I saved "basic" version of save in another folder on my HDD and replaced it each time after attempting to load & execute a stratagem.
2) I have DC 150 and d100+61 roll. This should mean I have 11% chance of success. Seems easy? Except I used 40 attempts and still not get it.
This is almost impossible statistically (99.05% chance to get at least single success in 40 tries).
3) During my tries I saw result 147 six times. Again - it's almost impossible statistically if game using honest d100 rolls.
0) that is a bug I already reported. Not even sure it is actuall changing anything, but the date is updated either way.
2) The chance of failing one roll as 89%.
The chance of missing the roll 40 times in a row, is 89%^40. So 0.9% I think.
"Not impossible. Just really, really unlikely." - Trillian McMillian, Hitchhikers Guide to the Galaxy.
3) Bithday paradox. The chance for any two rolles to be same, is higher then the chance for any roll to match a specific number. You just noticed it with 147.
With chances, one of hte best indicator of faulty data is stiff to be to evenly distributed.
And that is before we get into the issue of Pseudorandom Numbers, Programming errors, seed preservation, the specific parts of your input changing the RNG, and how .NET Initializes the RNG if it got no input.
And then you never specified
wich stratagem you used. Some of them use
really odd rolls - like the Retirement ones. And the Ui is not always properly showing it.
RE: Game is using pseudo-randomness but forget to warn us about it?
Posted: Tue Jun 23, 2020 9:51 pm
by diamondspider
Very interesting! I'd guess bugs.
RE: Game is using pseudo-randomness but forget to warn us about it?
Posted: Tue Jun 23, 2020 11:05 pm
by demiare
ORIGINAL: Falke
1) That you had different results in all that reloading means that a RNG seed is not being saved, that would prevent a different result.
2) A Statistically calculated 99.99% chance is still not 100%- Statistically 100 coin tosses should have 50 heads and 50 tails. In reality the actual result varies between 100 heads and 100 tails.
3) If always having power tech early is such an issue, just start with L4 Tech
4) There is no need to change the relative budget, worst case just set the council to 100% Discovery which costs 2pp.This BP is not wasted as it gets used once new areas are available
1) Yes it's usage of seed, sorry for using wrong term. No, game can use a seed to generate a small sequence instead of single value.
2) Yes, but receiving THREE events with statistical probability less then 1%... Sure, I can be unlucky but highly doubt I'm THAT unlucky [:D].
Plus I saw here that other users had similar issues with power plant techs.
3) No, this isn't a solution. If technologies are weighted instead of being based on honest random we should know about it as it's affecting our strategic plans. Plus you know - if power plant techs are low-weighted (or even scripted to be last) then we may have OTHER unfairly delayed techs. This will again affect our development.
Will be fun to play in Civilization without ability seeing a tech tree - while it's still using it? For me it's not, especially if you aren't on "settler" difficulty

4) Thanks, I will try it if it will work because I was sure that all points that unable to be used would be transferred in another work - same as with research while you haven't discovered any techs.
ORIGINAL: zgrssd
2) The chance of failing one roll as 89%.
The chance of missing the roll 40 times in a row, is 89%^40. So 0.9% I think.
"Not impossible. Just really, really unlikely." - Trillian McMillian, Hitchhikers Guide to the Galaxy.
3) Bithday paradox. The chance for any two rolles to be same, is higher then the chance for any roll to match a specific number. You just noticed it with 147.
2) Failing <1% roll three times statistically is less then 1:1M.
Highly improbable. But guess I would do an another try in a day or two.
3) 6 times over 40 attempts rolling a same die on d100 dice? Of course it's still possible, but highly unlikely.
ORIGINAL: zgrssd
And then you never specified wich stratagem you used. Some of them use really odd rolls - like the Retirement ones. And the Ui is not always properly showing it.
Protectorate. Description saying it's a single d100 roll against static calculated difficulty.
I know how wonky could be XdX rolls because of my D&D experience and basic education in statistic. [:)]
RE: Game is using pseudo-randomness but forget to warn us about it?
Posted: Wed Jun 24, 2020 12:09 am
by lloydster4
You failed a 161 DC. Move on.
In the time it took you to compile all this data you could have been having fun or gone for a walk or done something productive.
RE: Game is using pseudo-randomness but forget to warn us about it?
Posted: Wed Jun 24, 2020 12:19 am
by diamondspider
That is not fair. If an 11% chance is really a 0.1% chance, it is a very serious and annoying bug that could perhaps have only been detected with a lot of testing like that. I recently had a case of getting something like 10 critical successes in a row in situations that it was around 50% just to pass it (meaning very low probability of critical), so it could be there are bugs in both directions.
RE: Game is using pseudo-randomness but forget to warn us about it?
Posted: Wed Jun 24, 2020 2:37 am
by demiare
Well I don't have time to repeat my experiment until tomorrow but I reloaded my save one time more. And get
again 147 as result. Now it's 7 out of 41. [:D]
Now I'm almost 100% sure that game either save a seed or somehow fail to re-initialize RNG correctly.
ORIGINAL: lloydster4
You failed a 161 DC. Move on.
In the time it took you to compile all this data you could have been having fun or gone for a walk or done something productive.
I'm actually
enjoying digging into math behind game. For example I'd spent more then hundred hours in Stellaris on pure experiments to determine best weapon load-out and fleet composition. [:)]
ORIGINAL: diamondspider
That is not fair. If an 11% chance is really a 0.1% chance
If you don't believe to me then zgrssd already posted a formula in his latest post here.
Chance to fail 40 times out of 40 tries is (1 - 11%)^40 = (89%)^40 = (0.89)^40 =~ 0.0094, or 0.94%.
Opposite or NOT fail 40/40 will be to get at least one success. Chance for it will be (1 - 0.94%) =~ 99.1%.
RE: Game is using pseudo-randomness but forget to warn us about it?
Posted: Wed Jun 24, 2020 3:00 am
by diamondspider
Was responding to prior post and agreeing with you that this is a valid point.
RE: Game is using pseudo-randomness but forget to warn us about it?
Posted: Wed Jun 24, 2020 4:26 am
by Vic
Ah right... yeah actually the leader relation modifier (-20 / +20 range) is implemented in a special way. It loads the dice for the actual 1d100 roll.
This means that a Relation 100 leader who gets +20 will roll 20% of the cases 100 and never below 21.
best wishes,
Vic
RE: Game is using pseudo-randomness but forget to warn us about it?
Posted: Wed Jun 24, 2020 4:30 am
by diamondspider
Cool. Also explains why, with a bit of luck, I got so many criticals with about 100 relation on my leader.
RE: Game is using pseudo-randomness but forget to warn us about it?
Posted: Wed Jun 24, 2020 4:30 am
by josefrees
I’ve played enough games where it tells me I have a 99% chance to hit and I miss that I know that 99% is not 100%
RE: Game is using pseudo-randomness but forget to warn us about it?
Posted: Wed Jun 24, 2020 9:18 am
by MC456
ORIGINAL: zuekamo
this game needs an Ironman option to avoid the savescuming
Yep, this is one thing I've always suggested. Not only is it good to prevent save-scumming and give players a better sense of accomplishment, but it also allows for a more competitive experience. Telling someone you beat X_planet on the hardest difficulty doesn't mean anything when you can just re-roll all your stratagems and combat rolls.