Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#5018 closed enhancement (fixed)

rmgen heightmap image import

Reported by: elexis Owned by: elexis
Priority: Should Have Milestone: Alpha 23
Component: Maps Keywords:
Cc: Patch:

Description (last modified by elexis)

While it is a rightfully demanded feature to open terrain maps created in atlas from a random map script, it would also be handy to open an image file of a heightmap directly from rmgen without creating a PMP file thereof.

The rmgen script can then be tought to interpolate, set the waterheight and so forth. This way one can keep the original data source and if needed replace it while the code and map generation still works. (It means if such a replacement is needed or benefitial, artistic value of the terrain is not lost).

See #4816 for loading Atlas terrain PMP files from random map scripts.

Attachments (3)

igotthis.jpg (370.1 KB ) - added by elexis 5 years ago.
red_sea.png (60.9 KB ) - added by elexis 5 years ago.
blue marble data
workswell.jpg (270.3 KB ) - added by elexis 5 years ago.

Download all attachments as: .zip

Change History (17)

by elexis, 5 years ago

Attachment: igotthis.jpg added

comment:1 by elexis, 5 years ago

For instance if someone decides that we actually wanted a slightly different chunk of the map (square to circular map conversion), the entire artwork in atlas would be lost, but if there was no artwork in atlas but rmgen doing the same, it can't be lost.

by elexis, 5 years ago

Attachment: red_sea.png added

blue marble data

by elexis, 5 years ago

Attachment: workswell.jpg added

comment:2 by elexis, 5 years ago

https://trac.wildfiregames.com/raw-attachment/ticket/5018/red_sea.png https://trac.wildfiregames.com/raw-attachment/ticket/5018/igotthis.jpg https://trac.wildfiregames.com/raw-attachment/ticket/5018/workswell.jpg

comment:3 by elexis, 5 years ago

Milestone: BacklogAlpha 23
Owner: set to elexis
Priority: Nice to HaveShould Have

comment:4 by elexis, 5 years ago

Resolution: fixed
Status: newclosed

In 21113:

Allow random map scripts to load heightmap image files, fixes #5018.

Move the atlas heightmap import code to MapIO.cpp and reuse it.
Implements what rP18523 and rP20525 wanted to be.

comment:5 by elexis, 5 years ago

In 21133:

Implement JS random map library counterpart to rP21131 and rP21113, refs #4816, #5018.

Refactors the heightmap and terrainmap copying code from rP18523 and the bicubic interpolation code from rP18710 / rP18925 which were unused since rP20362.

comment:6 by elexis, 5 years ago

In 21135:

Red Sea random map replica, based on the original map by _kali created in rP18523 deleted in rP20362, refs #4816, #5018, D957.

Uses an unadulterated, easily exchangeable, well compressed topography image of the NASA Blue Marble series in the public domain,
instead of a heavily tuned and not so well licensed NASA SRTM v4.1 image encoded in JSON.
Circular intead of a square map shape.
Randomized, height- and slope-based terrain texture painting, refs #5004.

comment:7 by elexis, 5 years ago

In 21157:

Mediterranean random map replica of _kali's map in rP18523, refs #5018, D957.

comment:8 by elexis, 5 years ago

In 21175:

Implement SmoothingPainter for random maps, fixes #5027.

This allows only specific regions of the map to be smoothened, especially important on imported digital elevation models.
It uses the Inverse Distance Weighting / Shepard's method as mentioned by Imarok and formerly implemented in the Pyrenean Sierra map by wraitii in rP12248.

Supersedes the globalSmoothHeightmap function in FeXoRs heightmap library, refs #3764.
Drop the heightmap argument to be consistent with the other painters.
If painting on arbitrary heightmaps is wished, the createArea mechanism, all Placers, Painters, Constraints and Areas can and should support that.

Update the HeightmapPainter from rP21133 to not break if TILE_CENTERED_HEIGHT_MAP is enabled (i.e. numVertices = numTiles), refs #5018.
Use that mode on Mediterranean and Red Sea.
Drop the disabling of bicubic interpolation in the HeightmapPainter instead of extending it to this feature.

Inevitable smoothing performance improvement for Belgian Uplands (from 45 to 15 seconds per call), even if it implies a somewhat different outcome, refs #5011.

comment:9 by elexis, 5 years ago

In 21227:

convertHeightmap1Dto2D helper function which allows extracting a subset of a heightmap image.
Could become superseded by the C++ counterpart returning a 2D array instead, refs #5018, #4816.

One more DiskPlacer from rP21225.

comment:10 by elexis, 5 years ago

In 21330:

Elephantine random map script, refs #5040.
Uses OpenStreetMap polygons for the shape of the water, refs #5018.

Proposed by: Sundiata, wowgetoffyourcellphone

comment:11 by elexis, 5 years ago

In 21403:

Add translateHeightmap function which allows repositioning of an imported heightmap before copying it to the map, refs #3764, #5018, #4816.

Inline some variables and return the heightmap in the heightmap library functions, so that one can apply multiple transformations within the same statement.

comment:12 by elexis, 5 years ago

In 21814:

Fix rP21113 compatibility with zipped mods, refs #5018.

Differential Revision: https://code.wildfiregames.com/D1480
Reviewed By: Itms

comment:13 by elexis, 5 years ago

Description: modified (diff)

comment:14 by elexis, 3 years ago

In 22892:

Use all three color channels when loading heightmaps following rP21113, refs #5018.

Removes wrong debug leftover line from rP21113 and unneeded clamp from rP12308.

Differential Revision: https://code.wildfiregames.com/D1816
Patch By: Angen
Comments By: Vladislav

Note: See TracTickets for help on using tickets.