Are you aware that tribal village tend to appear on several lines from NW to SE?

hhhhhh

Prince
Joined
Jul 18, 2020
Messages
527
Forwarding something unusual found by the Chinese community... about map generation shenanigans.

The highlighted tiles are tribal villages. Note that many just appear along the line marked. I think this is a valid observation (instead of coincidence). And it probably means if you want to find tribal village you'd better go NW or SE after finding one. Going NE or SW is futile.

upload_2020-11-9_9-27-29.png


upload_2020-11-9_9-27-36.png


upload_2020-11-9_9-27-43.png
 

hhhhhh

Prince
Joined
Jul 18, 2020
Messages
527
Is it just with this one map script though or all maps?

Several map script including Lakes, Highlands, Seven Sea etc. Feel free to test other maps.

To those who that wish you didn't know... well at least the devs should know their poor choice of PRNG would result in something like this. And hopefully fix it. (Honestly I'm not hopeful given how many things are unfixed.)

(For the technical people here... Civ's PRNG is just a linear congruent one, x ↦ (1103515245 * x + 12345) % (2**32). Poor PRNG can leads to patterns when you put things on a 2d-plane or higher dimensional space, it's like when asked to choose random digits someone says "2, 5, 8" which looks kinda random but when you put it on a phone dial it's literally a straight line.)
 
Joined
Aug 3, 2020
Messages
423
Me and a friend often play cooperative against the AI, and one of us has usually tended to get a lot of tribal villages close by while the other often doesn't.
So this kind of makes sense, as if this finding is true, it means that one of us spawned closer to the lines than the other.
Which also means that if the above is true, one should usually start exploring SW and NE to get to a line the fastest (barring an immediate discovery) and then switch to exploring along the SE/NW diagonals.
 

Victoria

Regina
Supporter
Joined
Apr 11, 2011
Messages
11,883
@hhhhhh Not enough data but certainly signs. The villages are not directly on the lines and have outlyers as well. Also it may be civs that spawn using these lines and the camps then match accordingly so there is not enough data
At this very moment I am looking into barbs in more detail and about half an hour ago I validated someone elses claim a little bit more.
The claim is that every barb camp spawned is exactly 7 tiles away from a civ. Now I do see camps closer to civs but that closer camp is *always* 7 tiles away from another civ. and only one camp per civ initially. Still more validation on this, I am at the moment concentrating on the explore command... going to post findings in the barb thread.
 
Last edited:

Victoria

Regina
Supporter
Joined
Apr 11, 2011
Messages
11,883
Going NE or SW is futile.
OK I just ran a bunch of tests, a duel continents map is best for this. This will always spawn 2 major continents, each with 1 civ. 1 camp will spawn 7 tiles away on 1 continent in turn 1 and 7 tiles away from the other civ on the other continent in turn 2.
In all cases where the civ does not move before settling the barb camp spawns exactly 7 tiles from the civ. It also seems to spawn only in a diagonal direction which includes NE and SW so your statement is partially incorrect. For example below is a camp 7 tiles away and SW.
The scout always spawns in the NW side of the camp if it can but then moves randomly.
I have not looked at further camp spawns, perhaps these match your claims, but certainly the initial spawning camps while spawning diagnonally can do so in all 4 directions.

upload_2020-11-12_16-5-12.png
 
Last edited:

Victoria

Regina
Supporter
Joined
Apr 11, 2011
Messages
11,883
Oh duh, silly me, I am so involved with what I am doing I cannot even read a title correctly... Tibal village, means goody hut, my bad.
Interesting concept, going SW/NE could still nab you one though the chances are left if what is said stands up
The only think I ever noticed was there was always a goody hut somewhere within a cople of tiles of a natural wonder.
upload_2020-11-12_16-45-22.png
 
Last edited:

hhhhhh

Prince
Joined
Jul 18, 2020
Messages
527
How did they found out that this is the LCG formula used (vs any other common one)? Just curious.

I found it by looking at RandCalls.csv and tried a few common ones listed in the Wikipedia page. Looking back it should be pretty obvious since when the game start there were usually some "trial run" of the rand calls, and the first two seeds are 0 and 12345. But the modulus they use is 2^32 instead of 2^31, different from the common ones. So we know how the seed determine the next seed. But I don't know how to go from the seed to the output of rand(). I tried some of the bits but had no luck. If you are curious you can dig from here.

upload_2020-11-12_15-35-47.png


This is the trial run I am talking about, somehow it's not in current logs any more but it was always in RandCalls.csv (maybe one of the very recent update removed that):

upload_2020-11-12_15-40-29.png
 

hhhhhh

Prince
Joined
Jul 18, 2020
Messages
527
Even if we are not so lucky to figure out these with a few guesses, if we know it's an LCG, you can just assume it is x ↦ ax + b % m, where m is likely to be power of 2 for efficiency, and solve for a, b, m. Since 3554416254 > 2^31 we should start with m = 2^32. b = 12345 is clear since you have 0 ↦ 12345.

Now do this to figure out that a = 1103515245.
 

Onii-chan

King
Joined
Nov 7, 2016
Messages
637
Location
Stockholm, Sweden
I feel like this would need a decent sample size of tests on multiple different map scripts before one can truly say anything conclusive but if that pattern remains true then that's a pretty interesting find
 

DJ_Tanner

Emperor
Joined
Apr 19, 2013
Messages
1,094
@hhhhhh Not enough data but certainly signs. The villages are not directly on the lines and have outlyers as well. Also it may be civs that spawn using these lines and the camps then match accordingly so there is not enough data
At this very moment I am looking into barbs in more detail and about half an hour ago I validated someone elses claim a little bit more.
The claim is that every barb camp spawned is exactly 7 tiles away from a civ. Now I do see camps closer to civs but that closer camp is *always* 7 tiles away from another civ. and only one camp per civ initially. Still more validation on this, I am at the moment concentrating on the explore command... going to post findings in the barb thread.
Many outliers, I think based on those maps you could as equally say that tribal huts 'always spawn 2 tiles away from water'. That being said, some clustering is required in map gen since there is X amount of non spawnable land due to civ bias.
 
Top Bottom