CivIV RNG

Is it this we arguing about, axemen vs. archers or swordsmen. Units from the same era. Perhaps I should leave this thread before it's to late.
 
When I started this thread, my original implication was that the RNG was biased against the human. As someone said recently in the thread, that is unfair but not necessarily a bad thing. Someone pointed out early in the thread that they did some extensive testing that showed on average that the RNG was not biased.

I chose to let it drop at that point. I have messed with RNG's a little, but I am definitely not an expert. The RNG's can have other "problems" such as not being uniform, (don't know the word) numbers come in "clumps" (more than expected high or low values in groups), and others. In the other part of the actual original question, I was trying to see what RNG they used so that I could explore these possibilities, but evidently no one knows that came to the thread.

Several other people also rightly pointed out that humans just remember the negative "news" much more easily. I have come to accept this as well. Strangely enough, a couple reports in the real news came out about the same effect around the same time.

Still, I think there is enough anecdotal evidence that something is strange (such as one of the lesser "problems" of bad RNG's); however, it is no where near as significant as I thought at first, more on the level of a minor (but aggravating) annoyance. Not saying it doesn't aggravate me when my 5 elite CR3+ swordsmans get killed by a new wounded archer, but I will try to take the lumps as they come since everything seems at least close to fair.
 
Wow, Gee, you sure are right. Your warrior should NEVER lose to an archer attacking him! Your archers should also be invincable against enemy archers. I can't see any way possible that a 100 health axeman could ever lose to a 60 health axeman -- that is SO absurd.

These examples are so weak it's ridiculous, you can't win EVERY battle that the odds favor you, thats not how odds work. Just because the odds on your side does not make it garaunteed.

I thought your complaints were about modern units losing to ancient ones, not AXEMEN LOSING TO SWORDSMEN!!!! I can't believe how absurd your claims are. "The odds favored me heavily and I STILL lost" boo hoo. Get a clue...

Ah... come on! :mad:
I made reference to a posting above in which someone said he never saw any streaks in the RNG's results.
As you can see by the hitpoints dealt per strike, the winning units in all four examples have been much weaker than the final loser, which did not change the fact that said streaks occurred.

I think you should start to read next time, before you post.
 
When I started this thread, my original implication was that the RNG was biased against the human. As someone said recently in the thread, that is unfair but not necessarily a bad thing. Someone pointed out early in the thread that they did some extensive testing that showed on average that the RNG was not biased.
True - and this testing can easily be done by anyone by using the World Builder.

Also, If I'm not completely mistaken, the actual code is exposed, so anyone with a certain programming experience can check that there is no "isHuman()" code in the battle computation.

I chose to let it drop at that point. I have messed with RNG's a little, but I am definitely not an expert. The RNG's can have other "problems" such as not being uniform, (don't know the word) numbers come in "clumps" (more than expected high or low values in groups), and others. In the other part of the actual original question, I was trying to see what RNG they used so that I could explore these possibilities, but evidently no one knows that came to the thread.
I know that extensive statistical tests of this kind was performed on the CIV3 RNG, and they all confirmed that the RNG was pretty good. I don't remember any such tests with the CIV4 RNG, but it would surprise me if they use a worse RNG there. Not impossible though, as programming errors arent' exactly unheard of.


Several other people also rightly pointed out that humans just remember the negative "news" much more easily. I have come to accept this as well. Strangely enough, a couple reports in the real news came out about the same effect around the same time.
That is a pretty well-known fact, that the human brain thinks it sees patterns when there is only randomness. There is written lots of books on this topic. And it is not at all strange that such reports come in regularly, because that's just how the average brain works.


Still, I think there is enough anecdotal evidence that something is strange (such as one of the lesser "problems" of bad RNG's); however, it is no where near as significant as I thought at first, more on the level of a minor (but aggravating) annoyance. Not saying it doesn't aggravate me when my 5 elite CR3+ swordsmans get killed by a new wounded archer, but I will try to take the lumps as they come since everything seems at least close to fair.
I disagree that there is enough anecdotal evidence for drawing any conclution aboud streakiness or whatever RNG problem. It is a well-established fact (as mentioned above) that we see the random patterns in true randomness, and draw the wrong conclution from it.

For instance, Commander Bello's examples of streakiness doesn't indicate anything at all until he can give us statistics of how often such streakiness comes up. You see, such streakiness is expected in a good RNG, because true random numbers have such streakiness. The question is therefore if there is more streakiness than expected by a good RNG.

And to know that, we must: 1) compute how much such streakiness that is "correct", by a true RNG, and 2) make a test to see if we get the expected amount of streakiness.


I will go as far as saying that if Commander Bello had not been able to give examples of streakiness, that would be a strong indication of incorrect RNG. But having an RNG that gives streaky results now and then is just as it should be, and having a human brain that notices this and makes patterns out of it, is just as expected.
 
Ah... come on! :mad:
I made reference to a posting above in which someone said he never saw any streaks in the RNG's results.
As you can see by the hitpoints dealt per strike, the winning units in all four examples have been much weaker than the final loser, which did not change the fact that said streaks occurred.
hoopsnerd obviously misunderstood your post.

I fully agree that you gave good examples of streakiness, but as I wrote in the post just above, such streakiness is expected of a good RNG. The question is whether it happens more than expected in CIV4, which I have no reason to believe.

I think a good, and not too difficult test could be to build a scenario of 100 units of each side, and get them to attack each other. We already know that the number of victories is pretty close to expected in CIV4, but I don't think anyone has tested whether the number of victories where the winner is completely undamaged, is as expected.

Victories where the winner is undamaged is a good indication of streaks, and if this number is higher than expected, we have a good indication of too much streakiness. If the number is as expected, we have a good indication of a correct RNG.
 
Here is how to test if it's a good random number generator:

Whenever you feel like it, decide you're going to bet on the result of a battle.

1) Pick the outcome you think is going to happen.
2) Write down the chance of it that is given to you.
3) Play out the battle.
4a) If you were right, add 1 / (chance of it happening) to a running total.
4b) If you were wrong, subtract 1/ (1 - chance of it happening) from your running total.

After predicting a hundred battles, report your result in this thread. If you got a very high positive number, and are able to repeat this performance consistently, then congratulations: the RNG is not properly pseudo-random.


I'm sure no one's going to follow through on this experiment, but here's why I told you that: The point of a RNG isn't to be "fair", or to provide a variety of results. It's to be unpredictable.

All those patterns you notice count for NOTHING if you don't systematically predict they will happen that way beforehand.
 
hoopsnerd obviously misunderstood your post.

I fully agree that you gave good examples of streakiness, but as I wrote in the post just above, such streakiness is expected of a good RNG. The question is whether it happens more than expected in CIV4, which I have no reason to believe.

I think a good, and not too difficult test could be to build a scenario of 100 units of each side, and get them to attack each other. We already know that the number of victories is pretty close to expected in CIV4, but I don't think anyone has tested whether the number of victories where the winner is completely undamaged, is as expected.

Victories where the winner is undamaged is a good indication of streaks, and if this number is higher than expected, we have a good indication of too much streakiness. If the number is as expected, we have a good indication of a correct RNG.

As I have said and repeated in the past already, I have no doubts concerning the technical correctness of the RNG!

What I doubt, though, is if such an RNG is the best means to simulate battles.

You can translate the examples I have shown into battles between healthy units - the damaged axeman would equal a healthy maceman or whatever, and the losing axeman would be say an infantry (the odds - I haven't proven them - should be roughly the same).

What I wanted to point out was that even a stronger unit can suffer severe damage by engaging a weaker one. This sometimes does not display any "realistic" example, as an infantry unit should just slaughter macemen.

That's all, I wanted to point out.

Once again (why do I have to repeat this all the time? - and I am not addressing you personally), all what I am going for is that according to my point of view the combat system should be overhauled in such way that modern time units should suffer only minor damage when engaging ancient units.
Furthermore it would be advantagous, if concepts of morale, leadership, supply and weather would be in the game - meaning that they are noticable, that the player can adjust his tactics accordingly.

Finally, I am not against randomness at all.

I am against the way randomness currently works, that's all.
 
In my opinion, the change that Bello advertises would be a step backwards for the Civ franchise. If advanced units can wipe the floor with previous units, then getting the next military technology fast, then crushing your neighbours becomes the obvious winning strategy. This is bad game design. There should not be any obvious winning strategy, builders and culture-based players need to have a reasonable time-frame to survive with outdated units. Otherwise the versatility of the game would suffer.

Increasing the strength gap between older and newer units would reduce the number of workable strategies for the game, and would also reduce the little tactical challenge there is (who cares whether the defender stands on the hill when he can't hurt you anyways?).

I don't know whether Bello's wishes would make the game more realistic, but frankly I don't care much either. I'm pretty sure however that they would be bad game design in the context of the Civ franchise, and that I *do* care about.
 
Once again (why do I have to repeat this all the time? - and I am not addressing you personally),
I don't see why you feel you have to repeat it. I think most of us understand what you want. It is just that many of us think your ideas would make the game worse.


ll what I am going for is that according to my point of view the combat system should be overhauled in such way that modern time units should suffer only minor damage when engaging ancient units.
...to which I vigorously disagree. Partly for game play reasons similar to those Psyringe writes - and partly due to realism reasons.

In real life, a major power has never had such large military technology advantage over another major power that its forces were unbeatable. So even if your suggestion would make a single battle more realistic, it would make the whole war, overall strategy much more unrealistic.

Furthermore it would be advantagous, if concepts of morale, leadership, supply and weather would be in the game - meaning that they are noticable, that the player can adjust his tactics accordingly.
It would make the CIV combat more detailed on a tactical level. Whether that is good or bad depends on whether you are most interested in tactical combat or overall strategic gameplay.

For me personally, I think the overall strategic gameplay is what makes CIV so fun, and losing focus of that will not make the game better.

I'm all for improving the combat on a strategic level though. As mentioned earlier, I think the combat model would be much more fun/realistic if friendly/enemy units in adjacent squares affected the combat odds.
If this was in, you would have to spread out your forces, and support your attack/defense from neighbouring terrain, instead of the single SoD.


Finally, I am not against randomness at all.

I am against the way randomness currently works, that's all.
I've failed to understand what kind of randomness you want in CIV though.
 
hoopsnerd obviously misunderstood your post.

I didn't misunderstand his post, and I read it. I understand that his attempt atmaking examples of "streaky" behavior in an RNG, however by saying "streaky" I thought he was refering to say, 6 Infantry units dying to a longbowmen unit in one big streak... NOT a streak in 1 battle where 1 unit happened to get lucky hits a few times in a row... not to mention that they are UNITS OF THE SAME ERA! Just what do you expect from an RNG?

Arg... I'm done with this thread.
 
Also, If I'm not completely mistaken, the actual code is exposed, so anyone with a certain programming experience can check that there is no "isHuman()" code in the battle computation.

:) No "isHuman()" code struck me as funny. "Strangely enough," I actually learned last night reading Soren Johnson's blog "Designer Notes" that they released the source code. If I ever get the time, I may have to take an actual look at the code to satisfy my own questions. Thanks for bringing it up.

I know that extensive statistical tests of this kind was performed on the CIV3 RNG, and they all confirmed that the RNG was pretty good. I don't remember any such tests with the CIV4 RNG, but it would surprise me if they use a worse RNG there. Not impossible though, as programming errors arent' exactly unheard of.

That's good to hear. How do you know? Were you involved in play testing or something? Given the very high quality of the series, I would have been surprised if they had not done extensive testing on an integral part of the game, but on the other hand I recognized that it is all too easy to call a stock RNG function that is not necessarily as robust as it should be, so I was not eliminating the possibility.
 
I have just run a test using QuickBasic, which has its own RNG which is undoubtedly not the same as that used in Civ4.
The program generated 1 million random numbers between 0 and 999. Setting a trigger level of 250 (i.e. simulating an attacker with strength 3 times that of the defender), it produced 2 streaks of 10 consecutive "attacker loses this combat round", 9 streaks of 8 losses, 33 of 7, 130 of 6, 568 of 5, 2261 of 4, 8733 of 3, 35178 of 2, and 140294 singles - a total of 187208, rather less than the theoretical 250000. Subsequent runs gave very similar figures; no streaks longer than 10 (several runs gave a maximum streak length of 9), never more than 200000 losses.
The converse condition, looking for winning streaks when the combat round odds are at 75%, gave as expected very similar results, though one run produced a single streak of 11 consecutive victories.
When the attacker's strength is twice the defenders (trigger set at 333) then the losing streaks become longer and more frequent, the longest one produced being of 14 consecutive losses. At 1.5 times strength, the longest streak of losses was 16 in a row.
I conclude that streaks do occur in RNGs and that the one used in Civ4 is no exception.
It is important to note, as I admit I have failed to do in the past, that the chance of winning a combat round is not the same as that of winning the whole battle. If your attacker has three times the strength of the defender, your chance of winning a combat round is 75%, whereas your chance of winning the fight is >99.9%.
 
Theoretically you can destroy the USS Nimitz by poking it with a feather pillow, under the right conditions, but I for one deem it pointless to discuss such extreme circumstances. In ingame terms, I think there should be no way a unit of vastly inferior technology could ruin a tank at full health, because that's how it is in reality. No stirring yet highly theoretical tale that incorporates a number of additional conditions can change that. But wave after wave after wave ought to be able to.

Theoretically you can destroy the World Trade Center with a few boxcutter knives, under the the right conditions, but I for one deem it... ummm... nevermind. ;)
 
Just another example of streakiness, which I find most annoying: :mad:

Please have a close look the the first and the last line

attachment.php


Actually, things like this make any attempt of managing your troops obsolete. Granted, it does not happen very often that these results occur, yet it happens. And these should not happen at all - even not rarely.
 

Attachments

  • Civ4ScreenShot0186b.JPG
    Civ4ScreenShot0186b.JPG
    75.9 KB · Views: 156
*sigh* It's a bit sad to see you still clinging to your misconception of randomness and probabilities. I'm sure that nothing I could ever say will change this strange view of yours, but anyway ...

Streaks of 9 wins in a row,as depicted in a screenshot, should of course happen in Civ's combat system. They should happen with a chance of precisely 1 : 2^9, which equals 1 : 512, which equals about 0.2%. This means that when you have 512 battles with 9 rounds each, one of them is expected to result in a 9-win streak (and another one in a 9-loss streak).

Now, if you could show that such streaks happen substantially more often than expected, then you could build a case to call the RNG "streaky". Since you can't do that, your contribution is, unfortunately, worthless. From the single example you provide, no one (not even yourself) can determine whether the RNG yields more, less, or exactly the expected number of streaks.

The only thing that's worth mentioning here is that the combat chance rounding error, which had been fixed for the main map display long ago, is still present in the combat log. But this has been a known bug for months.

What an insubstantial reason to necromance a week-old thread in which your rather ... individual ... views about randomness were debunked several times already. :(
 
Is this thread still alive? I hoped it would have died an natural death by now.

Just another example of streakiness, which I find most annoying: :mad:

Please have a close look the the first and the last line

attachment.php



Actually, things like this make any attempt of managing your troops obsolete. Granted, it does not happen very often that these results occur, yet it happens. And these should not happen at all - even not rarely.

Why shouldn't it happen? Should rolling a six on a standard die ten times in a row happen? If you do it long enough it will. As it should be.

And how in the all the heavens do you draw the conclusion that this makes managing your troops obsolete? It just means that some of them will be lost. Yes, that means even your superior level 9 unit will have bad luck someday and die.

That's why games like Civilization and even more Wargames are more about managing your army instead of the single units. No one ever won a war by carefully training and nurturing a single soldier or a single unit and sending them to battle under "controlled" circumstances.
 
Streaks of 9 wins in a row,as depicted in a screenshot, should of course happen in Civ's combat system. They should happen with a chance of precisely 1 : 2^9, which equals 1 : 512, which equals about 0.2%. This means that when you have 512 battles with 9 rounds each, one of them is expected to result in a 9-win streak (and another one in a 9-loss streak).
:(
That's if the chance of winning a round is 50%. In the screenshot, from the damage-per-hit figures the strength ratio must have been at least 3.16:1, giving the warrior about a 24% winning chance per round, and .24^9 = .0000026 chance of winning 9 in a row, which is .00026%. This doesn't alter the sad fact that such streaks must and will occur.
Also, the example battle ran 12 rounds, not 9, and could have finished in 3.
 
That's if the chance of winning a round is 50%. In the screenshot, from the damage-per-hit figures the strength ratio must have been at least 3.16:1, giving the warrior about a 24% winning chance per round, and .24^9 = .0000026 chance of winning 9 in a row, which is .00026%. This doesn't alter the sad fact that such streaks must and will occur.
You're correct, I missed one step of the combat system there (adjusting the per-round win chance). Thanks for putting that right! Also, thanks for seeing the point that it doesn't really matter how improbable the event exactly is, because from one single data point it is impossible to determine whether streaks occur with the expected frequency, or more often, or less.

Also, the example battle ran 12 rounds, not 9, and could have finished in 3.
Also true, however in this case I consciously omitted the first three rounds of combat - since the original claim focused on an a supposed "streakiness" of the RNG, including the non-streaky bits of the given example didn't make much sense imho.
 
Back
Top Bottom