Jump to content

Script to automatically set the elevation in the editor


Butschi

Recommended Posts

On 2/16/2023 at 6:18 PM, Butschi said:

As an update, my latest map build:

OKdyI2Q.png

Z7cOP32.jpg

I (once more) reworked the buildings algorithm and roads/railways/streams. Mostly playing along nicely, although one has to take care not to have a too dense network, because then the algorithm won't be able to find a valid solution.

UmOsEFG.jpg

Now also with fence-like objects...

tHoFBbC.jpg

... and flavour objects.

PmSeuPO.jpg

So basically by now all the necessary functionality is there and working. Some things can be improved but that is more tweaking of cost functions, etc.

I am going to be working on maps for my first Agger Valley campaign, probably consisting of three missions. But afterwards I will go about making the tool available for everyone, I think. 🙂 (Which will involve tyding up, making a tutorial, etc.)

This is simply incredible work. I will be taking this for a spin in the near future, well done and answers a need that has been left wanting for years.

Bil

Link to comment
Share on other sites

I'm very impressed, Butschi. That map looks both beautiful and tactically interesting. Did your algorithm do all the work, or did you place anything manually?

It's good that you let it fill in forests with a mix of light and heavy forest. In my opinion, it looks and plays better than just having mono-block heavy or light forest.

Does it also vary the tree density, or what did you set it to? I find three trees per square is too dense for most cases, and the best is usually a mix of tiles with 1 and 2 trees.

Link to comment
Share on other sites

14 minutes ago, Bulletpoint said:

I'm very impressed, Butschi. That map looks both beautiful and tactically interesting. Did your algorithm do all the work, or did you place anything manually?

It's good that you let it fill in forests with a mix of light and heavy forest. In my opinion, it looks and plays better than just having mono-block heavy or light forest.

Does it also vary the tree density, or what did you set it to? I find three trees per square is too dense for most cases, and the best is usually a mix of tiles with 1 and 2 trees.

The map is almost completely autogenerated. "Almost" meaning, that for the picture with the bus stops I placed the bus stops correctly. That is something my tool can't do, it only places flavour objects into the correct map square. Can be quite interesting to go and find all the tiny benches on a map. 😄 I'll have to make it write out a list of that stuff, I think.

Now, to be fair, the pics are of course a bit cherry-picked. Not everything looks as nice. If zoom into the 2nd pic you can see a red area with lots of fences all over the place. In reality that is a Tennis club and someone actually put all the little fences around each court there.

Also, what I usually do, but not for this map, yet, is use aerial imagery to add lots of single trees and bushes and often hedges to OSM that (of course) don't exist in OSM but are important for flavour because otherwise settlements look too sterile. There has to be a little work left for map makers, right?

How forests look like is configurable:

    "mixed_forest": {
        "tags": [
            ["landuse", "forest"],
            ["natural", "wood"]
        ],
        "exclude_tags": [
            ["leaf_type", "broadleaved"]
        ],
        "cm_types": [
            {"menu": "Foliage", "cat1": "Tree A", "cat2": "density 1", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree A", "cat2": "density 2", "weight": 2},
            {"menu": "Foliage", "cat1": "Tree A", "cat2": "density 3", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree B", "cat2": "density 1", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree B", "cat2": "density 2", "weight": 2},
            {"menu": "Foliage", "cat1": "Tree B", "cat2": "density 3", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree C", "cat2": "density 1", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree C", "cat2": "density 2", "weight": 2},
            {"menu": "Foliage", "cat1": "Tree C", "cat2": "density 3", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree D", "cat2": "density 1", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree D", "cat2": "density 2", "weight": 2},
            {"menu": "Foliage", "cat1": "Tree D", "cat2": "density 3", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree E", "cat2": "density 1", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree E", "cat2": "density 2", "weight": 2},
            {"menu": "Foliage", "cat1": "Tree E", "cat2": "density 3", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree F", "cat2": "density 1", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree F", "cat2": "density 2", "weight": 2},
            {"menu": "Foliage", "cat1": "Tree F", "cat2": "density 3", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree G", "cat2": "density 1", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree G", "cat2": "density 2", "weight": 2},
            {"menu": "Foliage", "cat1": "Tree G", "cat2": "density 3", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree H", "cat2": "density 1", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree H", "cat2": "density 2", "weight": 2},
            {"menu": "Foliage", "cat1": "Tree H", "cat2": "density 3", "weight": 1}
        ],
        "process": [
            "type_random_individual"
        ],
        "priority": 0,
        "active": true
    },

The "tags" part collects all OSM geometries tagged "landuse: forest" and "natural wood". Those are basically polygons. "type_random_individual" under "process" tells the tool to make a random choice for each CM-square that is covered by this polygon. And the entries under "cm_types" have a weight that determines the probability with which the CM-tree type and density is chosen. Currently, for mixed forests, all tree-types have the same probability of being chosen, with density 2 being twice as likely as 1 or 3. So if you want less 3-tree-tiles, you can just give them a smaller weight. You can even add in "Dummy"-Tiles, something that the tool doesn't recognize, and give it a weight if you want random empty tiles.

Forest ground works in much the same way, currently it is "Light Forest" only but you could add in random Heavy Forest.

Eventually I'd like to have random clusters of trees, which would be most realistic, I think, but that will have to wait. 😉

Link to comment
Share on other sites

1 hour ago, Butschi said:

 

Now, to be fair, the pics are of course a bit cherry-picked. Not everything looks as nice. If zoom into the 2nd pic you can see a red area with lots of fences all over the place. In reality that is a Tennis club and someone actually put all the little fences around each court there.

I'm sure there are some minor niggles.. and the script can't place proper corner pieces for the roads yet, so you get some hard edges where the road tiles intersect. And I'm sure at least a few of the buildings are placed a bit oddly - and maybe have windows facing into other buildings. But in general, it looks brilliant, I think.

Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...