Suggestion: Ability to save randomly generated maps as .hwmap files.

2 replies [Last post]
TheZipBon
TheZipBon's picture
User offline. Last seen 5 years 23 weeks ago. Offline
Joined: 2016-12-02
Posts: 11

This would be handy for saving randomly generated maps you like, but without having to play with the same other randomly generated settings (like hog positions or weapons if in Highlander).

Waluigi time!

nemo
nemo's picture
User offline. Last seen 1 week 4 days ago. Offline
Joined: 2009-01-28
Posts: 1861

So... Generating one as "hwmap" would be kind of a pain to do - they are generated in different ways.

The RNG/map generation do not change *that* often, so it isn't totally unreasonable to save the values that generated the map.
Which is usually just the map type, the seed (click on the seed button to edit/copy it), and the detail level in the slider. Odds are that those values will work indefinitely since there's no current plans to change terrain generation. (erm. bad luck for you... this post made me look at what the RNG was currently doing and might change seed init which would change map gen next release if so, sorry. this usually doesn't happen tho Smile )

We should make getting the precise value for the slider easier - like printing a number, but you can probably find it pretty quick visually - esp if it is default or close to far left or right.

Fun RNG fact - ever wanted to play same random map with different positions? There's an advanced feature in the seed field that a fan asked for years ago. It is covered in the excellent Seed wiki page here https://hedgewars.org/node/6917

There is also another undocumented feature though, that I added long ago when the campaign random terrain got screwed up by a terrain generation change.

If you press [PRECISE] + [CAMERA] (left shift + c by default on a QWERTY keyboard), instead of generating a screenshot, it will dump the map to 2 PNGs in the screenshots folder - mapdump_TIMESTAMP_land.png and mapdump_TIMESTAMP_landpixels.png. Simply make a new preset map folder and copy the landpixels.png to map.png and (optionally) the land.png to mask.png.
You can even build a preset map this way, since the dump will include any ice, girders, ice girders, rubber, land spray, digging of tunnels, whatever... You can even use this to modify an existing preset map - treat the game as an interactive image editor ☺
There is some slight loss of information since the map colour scheme doesn't support multiple land types (since red is indestructible and blue is ice and green is bouncy, you can't have indestructible bouncy ice using mask.png right now) but apart from that... That can then be packaged as a .hwp for distribution here in the forum. Feel free to ask if you want it on the DLC page too.

Further reading on Preset maps. https://hedgewars.org/kb/PresetMaps

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

TheZipBon
TheZipBon's picture
User offline. Last seen 5 years 23 weeks ago. Offline
Joined: 2016-12-02
Posts: 11

nemo allegedly wrote:
Fun RNG fact - ever wanted to play same random map with different positions? There's an advanced feature in the seed field that a fan asked for years ago. It is covered in the excellent Seed wiki page here https://hedgewars.org/node/6917

There is also another undocumented feature though, that I added long ago when the campaign random terrain got screwed up by a terrain generation change.

If you press [PRECISE] + [CAMERA] (left shift + c by default on a QWERTY keyboard), instead of generating a screenshot, it will dump the map to 2 PNGs in the screenshots folder - mapdump_TIMESTAMP_land.png and mapdump_TIMESTAMP_landpixels.png. Simply make a new preset map folder and copy the landpixels.png to map.png and (optionally) the land.png to mask.png.
You can even build a preset map this way, since the dump will include any ice, girders, ice girders, rubber, land spray, digging of tunnels, whatever... You can even use this to modify an existing preset map - treat the game as an interactive image editor ☺
There is some slight loss of information since the map colour scheme doesn't support multiple land types (since red is indestructible and blue is ice and green is bouncy, you can't have indestructible bouncy ice using mask.png right now) but apart from that... That can then be packaged as a .hwp for distribution here in the forum. Feel free to ask if you want it on the DLC page too.

Further reading on Preset maps. https://hedgewars.org/kb/PresetMaps

These features look really useful, thanks for mentioning them. Although a way to make an automated "pipe seed" instead of having to "randomly" type characters yourself would be nice, if it's possible to do. Perhaps right click on randomize seed button could add a pipe and random characters after it, but leave original seed unchanged? Further right-clicks would only randomize characters after pipe character. Left-click would behave like the feature does currently.

Waluigi time!

User login

Copyright © 2004-2024 Hedgewars Project. All rights reserved. [ contact ]