Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
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.
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.
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?
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.
You do realize that referring to PRNGs as RNGs is really common in casual conversations?
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.