Sid Meier's Civilization VI

Sid Meier's Civilization VI

View Stats:
This topic has been locked
cameranutzii May 20, 2021 @ 6:55am
RNG
Can someone please explain what "RNG" stands for and how it relates to the game? I see reference to it but haven't found anything online that actually tells me why I need to know this.

TY in advance!
< >
Showing 1-11 of 11 comments
Oaks May 20, 2021 @ 7:03am 
RNG is "random number generator", essentially when the computer has do assign a random number or factor to something (such as a roll of the dice).

RNG to my knowledge doesn't relate so much to civ 6 since there is not so many times where randomness comes into play (as opposed to civ4, where the battles were determined by RNG).

In civ 6, RNG relates for example to disasters (since there is a random chance it can happen per turn) and in map generation, since the maps are generated from scratch.

Bad map RNG means you start at a point that has few resources.

Hope that cleared it up some. I am by no means an expert, so I am sure someone can give an even better account if it.
BlackSmokeDMax May 20, 2021 @ 7:07am 
RNG = random number generator

For some of the things in Civ, there is a small amount of random factor built in. During things that use this, like combat. there is a slight variation in what the outcome could be as compared to the inputs. I don't know the amount of RNG factor built into Civ 6 combat, but it isn't a ton. But you will see different outcomes by reloading the game and doing the same operation.

Now, that brings up another thing about RNG. How is it implemented? Some games use something like a random seed per turn. What this does is if you reload and try the same thing twice on the same turn, you will get the same exact result. If you let a turn go by, and then do the same exact thing you are likely to get a different result, as the RNG seed has changed. Not all games do this the same way. You could use a new seed for every event for instance, in which case my last example wouldn't be true. There would then be the chance for a new outcome every time you try it. (a chance for a different outcome, not a guarantee!)

One way my examples above have been used in Civ games in the past is goody huts. I don't remember which versions did it which way, but it worked something like I mentioned above. The point is that both methods have been used in the past in different Civ iterations.

RNG seed per turn method:
Popping goody hut will yield the same result every time after reloading the save until you advance a turn.

RNG seed per event:
Popping goody hut give the chance of a different result every time you reload the save.

For the most part there is nothing you need to do about RNG, just as long as you know it is there and that it gives the chance for different results. Mostly this results in different amounts of damage per battle in Civ 6, and different rewards from goody huts.

Without RNG being added to combat, it would be an exactly mathematical problem every time. Whereas now it is a mathematical problem with a slight variation built in.
Last edited by BlackSmokeDMax; May 20, 2021 @ 7:08am
bamdorf May 20, 2021 @ 8:01am 
The discussions above are correct, but I would add my 2c. It seems to be that complaints about the "RNG" are frequently used to indicate that one's results aren't due to poor decision making, but rather the EVIL RNG, which seems to control one's fate, apparently, and negatively, in crucial situations. Of course it is seldom mentioned that one can sometimes benefit, perhaps unrealistically, from a lucky RNG result. Clearly, in that case it was the superior decision making of the player! Akin to re-rolling one's start until one gets a great result. Etc. I really enjoy watching youtube games in which the player stoically accepts a bad result and tries to overcome it, even when there is perhaps a reasonable objective reason, such as "I meant to do that, but I just forgot about it for a moment! I should be able to reload". Well, to each their own. Use a game in the way you enjoy the most. It is just a computer program.
cameranutzii May 20, 2021 @ 8:19am 
Wow, thanks everyone! Very helpful!
tulle040657 May 20, 2021 @ 9:18am 
Originally posted by BlackSmokeDMax:
RNG = random number generator

For some of the things in Civ, there is a small amount of random factor built in. During things that use this, like combat. there is a slight variation in what the outcome could be as compared to the inputs. I don't know the amount of RNG factor built into Civ 6 combat, but it isn't a ton. But you will see different outcomes by reloading the game and doing the same operation.

Now, that brings up another thing about RNG. How is it implemented? Some games use something like a random seed per turn. What this does is if you reload and try the same thing twice on the same turn, you will get the same exact result. If you let a turn go by, and then do the same exact thing you are likely to get a different result, as the RNG seed has changed. Not all games do this the same way. You could use a new seed for every event for instance, in which case my last example wouldn't be true. There would then be the chance for a new outcome every time you try it. (a chance for a different outcome, not a guarantee!)

One way my examples above have been used in Civ games in the past is goody huts. I don't remember which versions did it which way, but it worked something like I mentioned above. The point is that both methods have been used in the past in different Civ iterations.

RNG seed per turn method:
Popping goody hut will yield the same result every time after reloading the save until you advance a turn.

RNG seed per event:
Popping goody hut give the chance of a different result every time you reload the save.

For the most part there is nothing you need to do about RNG, just as long as you know it is there and that it gives the chance for different results. Mostly this results in different amounts of damage per battle in Civ 6, and different rewards from goody huts.

Without RNG being added to combat, it would be an exactly mathematical problem every time. Whereas now it is a mathematical problem with a slight variation built in.
Don't try to explain things you do not really know how they work. All your text is wrong and useless in understanding the pseudo-random number generator works on your computer
BlackSmokeDMax May 20, 2021 @ 10:40am 
No, it isn't how an RNG is calculated, but it is how Civ 6 uses the RNG.

It's not worth explaining how computers are terrible at actually doing real RNG, because it really isn't relevant to what the OP asked.

If I'm wrong in what I said above, how about you correct it?
tulle040657 May 20, 2021 @ 11:50am 
Originally posted by BlackSmokeDMax:
No, it isn't how an RNG is calculated, but it is how Civ 6 uses the RNG.

It's not worth explaining how computers are terrible at actually doing real RNG, because it really isn't relevant to what the OP asked.

If I'm wrong in what I said above, how about you correct it?
Your explanation of what seeds is 100% wrong, sorry. Here is a little lesson for you. You computer uses a nonlinear equation to generate random numbers so...

random_number = f(last_random_number);

So the code looks something like this....

static last_random_number;
int rand()
{
random_number = f(last_random_number);
last_random_number = random_number;
return(random_number);
}

so if you make the call last_random_number will always be 0 and you will always get the same sequence of numbers. So there is a seed function that lets you set the first number it uses

seed(int start_value)
{
last_random_number = start_value;
}

Games that try and keep you from save scumming just save the last random number and use that as the seed when the save is loaded instead of generating a new value. All random number on any computer you are likely ever to use make random numbers this way

If you want I can do a "How to generate a seed for the random number generator" In another post. There are a few ways to do this
BlackSmokeDMax May 20, 2021 @ 12:05pm 
Originally posted by tulle040657:
Originally posted by BlackSmokeDMax:
No, it isn't how an RNG is calculated, but it is how Civ 6 uses the RNG.

It's not worth explaining how computers are terrible at actually doing real RNG, because it really isn't relevant to what the OP asked.

If I'm wrong in what I said above, how about you correct it?
Your explanation of what seeds is 100% wrong, sorry. Here is a little lesson for you. You computer uses a nonlinear equation to generate random numbers so...

random_number = f(last_random_number);

So the code looks something like this....

static last_random_number;
int rand()
{
random_number = f(last_random_number);
last_random_number = random_number;
return(random_number);
}

so if you make the call last_random_number will always be 0 and you will always get the same sequence of numbers. So there is a seed function that lets you set the first number it uses

seed(int start_value)
{
last_random_number = start_value;
}

Games that try and keep you from save scumming just save the last random number and use that as the seed when the save is loaded instead of generating a new value. All random number on any computer you are likely ever to use make random numbers this way

If you want I can do a "How to generate a seed for the random number generator" In another post. There are a few ways to do this

That is way to detailed to not be coming to the same results as I explained. While true mine wasn't technically correct on the behind the scenes, it was only intended to let the OP know what to expect.

My point being, correcting me may be fine for "exacting detail", but are you actually telling the OP that they will see any difference while playing as compared to what I said?

You certainly have not explained how "all my text is wrong". What would OP see differently as compared to what I said?
Oaks May 20, 2021 @ 12:30pm 
Originally posted by BlackSmokeDMax:
Originally posted by tulle040657:
Your explanation of what seeds is 100% wrong, sorry. Here is a little lesson for you. You computer uses a nonlinear equation to generate random numbers so...

random_number = f(last_random_number);

So the code looks something like this....

static last_random_number;
int rand()
{
random_number = f(last_random_number);
last_random_number = random_number;
return(random_number);
}

so if you make the call last_random_number will always be 0 and you will always get the same sequence of numbers. So there is a seed function that lets you set the first number it uses

seed(int start_value)
{
last_random_number = start_value;
}

Games that try and keep you from save scumming just save the last random number and use that as the seed when the save is loaded instead of generating a new value. All random number on any computer you are likely ever to use make random numbers this way

If you want I can do a "How to generate a seed for the random number generator" In another post. There are a few ways to do this

That is way to detailed to not be coming to the same results as I explained. While true mine wasn't technically correct on the behind the scenes, it was only intended to let the OP know what to expect.

My point being, correcting me may be fine for "exacting detail", but are you actually telling the OP that they will see any difference while playing as compared to what I said?

You certainly have not explained how "all my text is wrong". What would OP see differently as compared to what I said?

Personally, Blacksmoke's explanation was more helpful. I'm interested in what it is, not an in depth look at the code. As a non-programmer, the code doesn't tell me much.
Aachen May 20, 2021 @ 3:13pm 
Originally posted by AQ:

RNG, mean,s random number generator.i.(the moon will always revolve around the earth without exception).

Developers will have you believe they can generate random numbers,which is complete nonsense,as a mathematician i can tell you,binary is scripted one,s and zero,s, which means on each level with each civ they will build the wonder if available to them on there assigned turn number.
play on emperor without ever needing to count,everthing above this is pontless.

You do realize that referring to PRNGs as RNGs is really common in casual conversations?

Rhudda May 20, 2021 @ 3:23pm 
Originally posted by AQ:
RNG, mean,s random number generator.i.(the moon will always revolve around the earth without exception).this is complete bollox.

Developers will have you believe they can generate random numbers,which is complete nonsense,and as a mathematician i can tell you,binary is scripted one,s and zero,s, which means on each level with each civ they will build the wonder if available to them on there assigned turn number.
play on emperor without ever needing to count,everthing above this is pontless.

Would you consider adding the /quote tag to properly separate your reply from the original post, please?

I'm not sure what you're trying to say in your first paragraph - care to elaborate?

As for your second paragraph: Devs can get close enough to random numbers for it to not matter. If a game includes dice rolls, it can be programmed in such a way that no one knows which number will turn up next. This is what an RNG does.

In Civ, this means that certain events happen at random times. Disasters won't always strike on turn x, and their severity, the amount of damage they cause and how many tiles they fertilise (if applicable) will be determined as randomly as possible. When a unit attacks another, the amount of damage isn't fixed or scripted, it is generated by an RNG, within a bracket of 80-120 % of a fixed number. Heck, which direction a barbarian scout takes after spawning might be random too.

Sure, the actions of civilisations follow a decision tree, but you can't really call that scripted either. Yes, if the circumstances are similar enough they will make the same decisions, but there is no assigned turn in which they start building a specific wonder.
< >
Showing 1-11 of 11 comments
Per page: 1530 50

Date Posted: May 20, 2021 @ 6:55am
Posts: 11