#4816 closed enhancement (fixed)
[PATCH] Create random map heightmap from atlas — at Version 10
Reported by: | elexis | Owned by: | elexis |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 23 |
Component: | Maps | Keywords: | |
Cc: | Patch: |
Description (last modified by )
The following tool by _kali allows exporting the current heightmap and the terrain textures to a JSON array which can in turn be loaded by random map scripts:
https://github.com/kali0ad/AtlasRandomMapGen
It was used by _kali to edit alpha 21 random maps (red sea, mediterranean, ...).
It has a very interesting use case, as it allos the creation of a well defined terrain in atlas, only requiring the random map author to define where objects (resources, actors, ...) are placed.
Of that code on git, we don't really need the JS and JSON file. The readme of that code proposes to amend the "Save" button functionality to write the heightmap to said JS file.
But it would be more useful if there was an "Export to heightmap..." button below the "Import heightmap" button that just writes the huge JSON heightmap to a *.hmap
file. (Eventually the image formats could be supported to if we want that)
The random map author can then just write one or two lines of code to use the heightmap file (like the other maps of that time do following r20157).
A related side quest would be saving the starting positions to that JSON object as well. Currently the locations are magic numbers and have to be modified with pure guesswork. The map writer could just save the locations of default_civil_centre
. This way the random map author can place the civic centers as he sees fit without having to take a look at the actual numbers.
See #5018 for support of loading image files from random maps.
Change History (14)
comment:1 by , 7 years ago
comment:2 by , 6 years ago
Component: | Atlas editor → Maps |
---|---|
Keywords: | rfc removed |
Owner: | set to |
Type: | defect → enhancement |
proof of concept: Phab:P110
The workflow will be one atlas window in which the scenario map can be edited (only elevation and textures) and in a second atlas window one can preview the rmgen result.
by , 6 years ago
Attachment: | screenshot1581.jpg added |
---|
Someone thought it was a good idea to reorder textures in squares rather than just one line after another
by , 6 years ago
Attachment: | Screenshot from 2018-02-02 04-55-06.jpg added |
---|
Priorities are not used by rmgen, difference noticeable with a magnifying glass
by , 6 years ago
Attachment: | screenshot1582.jpg added |
---|
Acropolis Bay (2). I find it ugly and not too useful, #5018 more so
comment:10 by , 6 years ago
Description: | modified (diff) |
---|
Another, probably better option would be to remove the JSON heightmap format and use PMP instead.
The
CMapReader::LoadRandomMap
could load themaps/random/mapname.pmp
file if it exists with the same code that is already called inCMapReader::LoadMap
for skirmish and scenario maps.It's probably better to not hardcode starting positions but let the random map script determine them using constraints like
[stayClasses(clLand, 20), avoidClassses(clVolcano, 10, clHill, 10)]
.Adding an "Export heightmap" button to only save the PMP file would be cleaner than requiring the random map author to save the thing as a scenario map, then delete the XML and move the PMP file.
No matter if the JSON or PMP format is used, random map script terrain data should only be opened using the existing function that creates a random in Atlas. The terrain can be edited and the export button can be used again.