Random maps based on Perlin noise

Did you create a mod, map, music, or a tool? Present them here and earn feedback!
Note: addon requests do not belong here.
Note, everything uploaded to this forum, MUST have a license!
Post Reply
AbcLmn18
Greenhorn
Posts: 10
Joined: 04 Oct 2021, 04:22

Random maps based on Perlin noise

Post by AbcLmn18 »

Perlin noise is often used in procedural generation. It is known to produce beautiful realistic landscapes. I tried to apply it to Warzone 2100 map generation and I find the results very promising. I'll keep publishing new maps of this kind in this thread.

(edits: I'm experiencing bugs with forum attachments so I'm restructuring the thread to work around that, please find the maps below)
Last edited by AbcLmn18 on 12 Nov 2021, 22:21, edited 25 times in total.
AbcLmn18
Greenhorn
Posts: 10
Joined: 04 Oct 2021, 04:22

Re: Random maps based on Perlin noise

Post by AbcLmn18 »

Below is a small asymmetric 1v1 map generated this way. I plan to publish more maps of this kind in this thread. Oils are scattered more or less uniformly across the map. This makes most individual maps relatively fair but definitely not entirely fair. It does not favor any side across multiple playthroughs.

I think it will look even better if applied on a larger scale where it'd have room for non-trivial mountains of all shapes and sizes. This map is very tightly constrained: it tries to offer at least some strategic chokepoints without blocking the path completely. This appears to be the primary performance bottleneck during map generation: in order to achieve good results the generator often throws away 10-20 full Perlin noise maps. The lag is noticable in the map picker and preview UI but I think it's reasonable. Of course it doesn't affect performance during the game. I could make it less tight but I think it makes the end result worse. So the tradeoff I chose is in my opinion the best for now but I'm open to suggestions.

v2: Significantly improved performance by optimizing the pathfinding check (which used to be around 3 times more expensive than the actual perlin noise generation). Now perlin noise generation is the primary bottleneck: each iteration takes 8ms on my machine.

I'm investigating the possibility of rewriting perlin noise generation in C++ inside the game so that to provide common (and fast!) tooling for future autogenerated maps. Pathfinding and occupancy/placement checks also arguably deserve this.
Attachments
2.jpg
1.png
2c-PerlinDuel-v2.wz
(10.96 KiB) Downloaded 114 times
AbcLmn18
Greenhorn
Posts: 10
Joined: 04 Oct 2021, 04:22

Re: Random maps based on Perlin noise

Post by AbcLmn18 »

v5:
I'm investigating the possibility of rewriting perlin noise generation in C++ inside the game so that to provide common (and fast!) tooling for future autogenerated maps.
Done! The updated map takes advantage of the native noise generator available in v4.2.1 for faster generation. Thanks pastdue for reviewing and landing my pull request! The map still works on older versions of the game, just slower.

Additionally v5 improves tree placement for more natural looks.
Attachments
2c-PerlinDuel-v5.wz
(11.04 KiB) Downloaded 127 times
AbcLmn18
Greenhorn
Posts: 10
Joined: 04 Oct 2021, 04:22

Re: Random maps based on Perlin noise

Post by AbcLmn18 »

Here's an asymmetric map for four players. It is much larger, with perlin noise at a larger scale yielding more detailed mountains.

Again, it is not suitable for multiplayer because it is not guaranteed to be fair. But it's fun to play against three bots. My next step is to implement symmetry.
Attachments
2.jpg
1.png
4c-PerlinValley-v5.wz
(11.05 KiB) Downloaded 127 times
AbcLmn18
Greenhorn
Posts: 10
Joined: 04 Oct 2021, 04:22

Re: Random maps based on Perlin noise

Post by AbcLmn18 »

I implemented symmetry. This is a symmetric 5v5 map that is absolutely fair across teams but otherwise makes no attempt to provide balanced experience. Some maps will be wide open, some will force all armies to go through a single 3-tile-wide choke point, some will have a huge lake in the middle, some will have a huge mountain that splits the map in half vertically, and so on.

Now that the basics are working, my next step is to implement strategic analysis that will make the maps less mad and more consistent. For now I only have one such analysis: the one that requires that you can reach from one team to another by land through a passage that is at least 3 tiles wide. It also gives a good estimate for rush distance. This analysis can be easily generalized to ensure N tiles wide passages or, conversely, to find the largest N for which such passage exists, which is already a useful metric metric. By blocking the path found by such analysis and re-running the analysis, secondary paths and choke points can be discovered.

The analysis is pretty costly though. It's O(map area) to re-run after I precompute distances to from each tile to the nearest blocked tile but it's still costly. I won't be able to progress until I move some of it to C++, which should improve generation lag of existing maps as well.
Attachments
2.jpg
1.png
10c-PerlinMadness-v6.wz
(12.07 KiB) Downloaded 149 times
Post Reply