May 16th, 2013, 01:08
(This post was last modified: December 8th, 2017, 16:19 by SevenSpirits.
Edit Reason: fixed broken dropbox link
)
Posts: 7,766
Threads: 94
Joined: Oct 2009
It's like Mirrorland, but it's not mirrored. So:
* Seamless toroidal wrap!
* Interesting bodies of water!
* Lots of expansion options!
* Opponents on all sides!
But:
* Everyone faces their own unique situation!
* Every part of the map is unknown until you explore it!
* Other players might have resources you don't!
* Map dimensions can be whatever you want!*
It's TORUSLAND! (Download here)
* In Mirrorland, a 5-player game for example has to be 40x40 or 20x20, or it's not correctly mirrorable. But 20x20 is absurdly cramped, while 40x40 is a bit far on the roomy side.
Posts: 5,294
Threads: 59
Joined: Dec 2004
Want to brag the technical bits?
Blog | EitB | PF2 | PBEM 37 | PBEM 45G | RBDG1
May 16th, 2013, 01:24
(This post was last modified: May 16th, 2013, 01:29 by Sareln.)
Posts: 5,294
Threads: 59
Joined: Dec 2004
(May 16th, 2013, 01:12)Sareln Wrote: Want to brag the technical bits?
Generated a few maps, looks pretty cool Seven!
Generated something interesting - intentional?
Blog | EitB | PF2 | PBEM 37 | PBEM 45G | RBDG1
Posts: 7,766
Threads: 94
Joined: Oct 2009
Well it's modified from the Mirrorland script, so a lot of the description of that applies. But instead of generating a chunk of land that gets tiled and offset 5 or however many times and has mind-bending wrapping properties, it just makes one big one that wraps in the simple and obvious way. So that part is simpler (but a bit more complicated than it needs to be since the starting point was the aforementioned Mirrorland).
The one bit that's more complicated is choosing start locations. It's complex enough that I don't remember exactly how it works, but at least some of the complexity isn't used to any effect. So I'm not exactly proud of this but I will explain it anyway, since it's interesting to see how different people approach this. I started off by tracking food/commerce/production "values" that I assigned each tile of the map based on terrain, as well as a value I called "Early", which is heavily influenced by the presence of forests and jungles, and generally has a steeper value curve in that it doesn't care about flatland nonriver plains (which won't be worked early game), for example. Then, I evaluate each eligible tile as a possible city spot by picking out the 8 highest value tiles in its BFC and summing the different types of value over all of them, then just doing a linear combination of those values. And of course it adds points for a plains hill plant and stuff like that. When I say "linear combination", what I'm saying is that the separate calculation of all the different kinds of yields was unnecessary - I could have just given a single value for each tile. I was initially planning to do more with it, because e.g. the first X food is more important than later food, and the same with production and commerce. But it turned out that it was important to keep the scores quantitative and not just ordinal so I scrapped the fancier ideas.
The reason I needed the city values to be appropriately different by the amount their quality varied, and it wasn't good enough to just have better ones have higher values, was that I needed distance to other players to be an important factor. So, after every tile's capital score has been calculated, I place every player on a random legal tile. Then I loop through the players in a random order and compare their current spot to every spot in it's BFC, as well as 2 random spots anywhere on the map. The formula for score that I compare is: divide the precomputed city score by the sum of the reciprocals of the cubes of the distances to each other player. E.g. if my start is 8 tiles away from one player and 20 from the other two, then my score is divided by ( 1 / 20^3 + 1 / 20^3 + 1 / 8^3). You can see that the most significant fact in that equation is my low distance of 8 to another player - it's really reducing this position's score by a lot, because 1/8^3 is a lot bigger than 1/20^3. I previously wasn't cubing it, but that made it care too much about tile quality and not enough about distance. I jumped directly to cubing without trying squaring, and it worked to my satisfaction, so that's where I left it.
As I was describing, I am in the middle of seeing for every city in a random order if there's a better spot I can move it to. If I find one, I move it before continuing with the next city.
I do the checking and moving for a thousand iterations, which is probably overkill, but I don't know because it's the only number I tried. It ends up with players pretty well spread out, but still with fairly good capitals. Keep in mind that I don't add rivers to anyone's capital, so if there's a river there (which is usually the case) it's because the placement algorithm managed to make it happen.
This system would not work without modification on a map that's not a torus. It implicitly relies on there being opponents in all directions, and no edges of the map. If I put it to work on a map with edges, it would put everyone near the edge, so they can be far away from the other players, which is silly.
Posts: 7,766
Threads: 94
Joined: Oct 2009
(May 16th, 2013, 01:24)Sareln Wrote: (May 16th, 2013, 01:12)Sareln Wrote: Want to brag the technical bits?
Generated a few maps, looks pretty cool Seven!
Generated something interesting - intentional?
You mean the forested corn, right? Yeah, it's intentional that sometimes resources will bend the rules of which terrain they are allowed to appear in. When deciding where to place the next resource, I start with a score of 500 for every tile on the map and deduct points for various unfulfilled requirements. Deductions range from 100 to 400 points depending on the type. (E.g. an illegal forest tends to be -150, while an illegal hill is -400.) Any tile with 0 or lower score is disqualified; the remaining tiles get a random number from 0 to 1300 added to them, plus penalties deducted for adjacent resources (and smaller penalties for resources 2 tiles away) and the highest number gets the resource.
The fact that your settler started on a rice resource is actually more unusual. City placement has a penalty for starting you on a resource.
May 16th, 2013, 02:30
(This post was last modified: May 16th, 2013, 02:36 by Sareln.)
Posts: 5,294
Threads: 59
Joined: Dec 2004
Yeah, the forested corn was so unusual as to draw my eye before even seeing that the settler had landed on a rice!
Sounds like an interesting generation strategy.
If you wanted to port the map to something with out wrap...
Could you create virtual players at the O's and X's to force the actual players off the edge?
Blog | EitB | PF2 | PBEM 37 | PBEM 45G | RBDG1
Posts: 6,703
Threads: 131
Joined: Mar 2004
Wow, really cool work!
Is there still any normalization (remove peaks/desert/jungle, etc) applied to the starting locations? Or does this finally truly work the other way around: first generate the map then pick starts?
Is there any sort of balancing or mirroring beyond the capital BFCs?
Are you going to be the map scripter for Civilization 6?
Posts: 9,706
Threads: 69
Joined: Dec 2010
Awesome! Seven and Novice need to be hired for Civ 6 .
I think we need another PBEM to test this.
Posts: 7,766
Threads: 94
Joined: Oct 2009
(May 16th, 2013, 09:02)T-hawk Wrote: Wow, really cool work!
Is there still any normalization (remove peaks/desert/jungle, etc) applied to the starting locations? Or does this finally truly work the other way around: first generate the map then pick starts?
Is there any sort of balancing or mirroring beyond the capital BFCs?
Are you going to be the map scripter for Civilization 6?
Yeah, there is some normalization. One reason is that the script's desire to place civs far apart puts a heavy constraint on things. But also, I wanted to do something fairly similar to what civ iv follows in general. So:
mountain -> hills
tundra -> grass
desert, ice -> plains
jungle -> removed, 2/3 chance of forest added
Add one "good" food resource* if there isn't one
Add one any food resource if there aren't at least two total
Add hills until there are 3
Add forests until there are 4
Basically it's a little more conservative than the normal civ normalizer, in that it never adds resources past the first 2 that fulfill the food requirement, and never adds forests past 4. It also doesn't ensure fresh water (by adding a 1-tile lake or a river), which I realize is a bit noob-unfriendly.
Other than this, there isn't any other balancing, and there isn't any mirroring. An option for balanced critical strategic resources is in progress, by which I mean I broke said option of Mirrorland in the process of changing when starting locations are chosen, and will probably fix it.
Working on any part of civ 6 would be pretty cool.
* For this script, I defined a good food resource as one enabled by agriculture, hunting, or AH. The hunting and AH food resources, when placed to fulfill a "good" resource requirement, further change their plot to grassland if it isn't already.
Posts: 13,214
Threads: 25
Joined: Oct 2010
Do you add points for the preplaced improvements? Sareln has a cottage.
|