There has been a lot of discussion in the original PW3 thread. Bobert13 mentions that the random function he made that we used was flawed:
http://forums.civfanatics.com/showthread.php?p=12702015#post12702015
PHP:
function PWRandSeed(fixedseed)
local seed
if fixedseed == nil then
seed = (Map.Rand(32767,"") * 65536) + Map.Rand(65535,"")
else
seed = fixedseed
end
math.randomseed(seed)
print("random seed for this map is " .. seed)
end
There certainly has been a lot of discussion going on over there.
I'd recommend starting around post #436 , where I bring up a few optimizations, and going from there. Most of what I covered in #436, you guys already implemented, parallel of what I was working on, but the stuff about lookup tables in the "3rd Edit" is beneficial to script run-times. Just now, I posted some new spiral iterators that are tangibly faster than
Plot_GetPlotsInCircleSimple. I'm not sure if you're aware of this, but
GetPlotsInCircleSimple is not returning a true spiral; it's more of a rectangular shape.
Also, this is the "fixed" random you have quoted (just clarifying). It's not perfect IMO, but it should have 1:1 distribution and it still caps at the 31 bit maximum. It may be the best that CiV's Map.Rand is capable of. I've not tested it in multiplayer, but if Jaii der Herr's rand worked, then there's no reason why this shouldn't.
As an aside, I'm also looking into implementing an improvement of the "rivers flow from lakes" idea in this script. As it is, sometimes it works great, but when the river flowing into the lake meets one of the new "Y'd" starting points, that are intended to give the effect of a river flowing from the lake, it looks like a mess.
I've already tried an alternative where instead of adding a "Y" to the start of the river flowing out of the lake, I just reversed the flow of that river segment. That however led to a new graphical issue where it looked like every river flowing from a lake had a break at the point where the river segments were flowing away from each other.
Right now, I'm looking at restricting lakes to tiles at least two plots away from a shoreline and then re-routing the river(s) involved to avoid this possibility. The restriction on lake placement would prevent certain scenarios where it's impossible to re-route the rivers involved.
I'm pretty confident that once I get rivers and lakes resolved, I'll be releasing version one of my PerfectWorld3 derivative map-script.
Edit: I noticed you have odd map heights possible for your resized "Terra" maps in this script. Then, (while searching for a way to limit the world size options available for my script [I want to get rid of Duel and Small as they have issues and my tectonic landmass generation doesn't scale down to those abysmally tiny sizes very well]) I stumbled across
this thread where the author of a map script apparently pulled his script from the downloads section and asked, that anyone who had a copy delete it, because he found out there's issues with the game's AI behavior related to maps with an odd height... I have no idea what issues he's talking about, but if they haven't been addressed, you should maybe round your map heights up for the "Terra" option.