Page MenuHomeWildfire Games

Alpine Mountains random map
Needs ReviewPublic

Authored by Feldfeld on Jun 22 2020, 9:41 AM.

Details

Reviewers
FeXoR
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Summary

This adds a new random map, Alpine Mountains : https://wildfiregames.com/forum/index.php?/topic/28391-random-map-alpine-mountains/
Things to note/discuss as of now :

  • The name Alpine Mountains could feel kind of generic, maybe it could be more specific, like "Julian Alps" but I don't really have much ideas in that regard.
  • I tried for at least 30 minutes to make a map preview for my other map Britannic Road, but failed utterly, so I don't have one for this map either.
  • One way to ensure bigger passages between players is to run the flood fill with a tile class that is clMountain + a 2-tile border. This could cause a bit more restarts but I think it's worth it and will probably add that soon.
  • It's not possible to find player placements after generating forests, it would leave a too small space left for player positions in some cases (typically 4v4 Tiny)
  • I'm not satisfied how nomad placement is done now. First it doesn't try to find a decent distance between players, and second, if the map is divided in 2 distinct areas the players will spawn on either one, and it could be quite small (in that case a restart would be preferred). For player distance I could fix that but didn't as of now since we could go for a different approach (like restarting generation from the beginning)
  • The initial ressources players have should be quite well balanced. However, the expansion opportunities can be imbalanced sometimes.
Test Plan

Generate the map with different settings (number of players and map size). Verify if the generation time is acceptable and if the gameplay looks enjoyable.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

Feldfeld changed the visibility from "Feldfeld" to "Public (No Login Required)".Jun 22 2020, 9:49 AM
Feldfeld updated this revision to Diff 12419.Jun 22 2020, 9:56 AM

Huh, looks like there is a bug where players starting entities don't get properly deleted upon restart. Don't know how I missed that, will need to fix.

Stan added reviewers: FeXoR, Restricted Owners Package.Jun 22 2020, 10:10 AM
Feldfeld updated this revision to Diff 12420.Jun 22 2020, 10:37 AM

Fixed the bug.

lyv added a subscriber: lyv.Jun 22 2020, 12:21 PM

If Noise2D can not be used, then I guess its fine.

But just take the function out and maybe keep it in the map script, and edit it a bit to enforce to our style. Looks like it was written for browsers. Mind the license.

binaries/data/mods/public/maps/random/alpine_mountains.js
96
var frequency = 12;
var octaves = 1;
var heightScale = 10;
var noise2D = new Noise2D(frequency);
for (let i = 0; i < octaves; ++i)
{
	for (let x = 0; x < mapSize; ++x)
	{
		for (let y = 0; y < mapSize; ++y)
		{
			let ix = x / mapSize;
			let iy = y / mapSize;
			g_Map.height[x][y] += noise2D.get(ix, iy) * heightScale || 0;
		}
	}

	frequency *= 0.75;
	heightScale *= 0.75;
	noise2D = new Noise2D(frequency);
}

Snippet of some code that was generating terrain using multiple octaves of perlin noise from our own implementation. You should be able to generate the same landscape by tuning values if the current map is also using simplex noise since Perlin and simplex noise generally look the same when scaled.

Feldfeld updated this revision to Diff 12424.Jun 22 2020, 7:14 PM

Here is what i got so far using Noise2D. The mountains feel to thin no matter how i change the parameters, difficult to find a good result.

lyv added a comment.Jun 22 2020, 7:38 PM

I see what you mean actually. I kinda like the new look.

It might be possible to exactly get what you want by scaling either horizontally or vertically. But its always a tedious process. I will try and see if I have more luck.

FeXoR added a comment.EditedJul 18 2020, 11:55 AM

P215 kindof working now. The paint prototype need adjustment for given area and the weight value to be determined by max/min dist to border.

As a reminder - some little bugs and inconviniences I found on the way:

  • scaleByMapSize can't handle negative values (but should if both given values have the same sign)
  • setBaseTerrainDiamondSquare generated heightmap sometimes contain height values larger than maxHeight (Also the height range check warning could be more telling)
  • Atlas doesn't take termination signals from console
  • As implemented a check for a point being in Area.points is expensive and cumbersome
Feldfeld updated this revision to Diff 15195.Jan 12 2021, 7:18 PM

Hi, after I realized that the look of this version of the map might not be as bad as I thought back then, I decided to rebase it to open it once again for feedback.
When evaluating the look of the map I recommend to sometimes generate it with the fog of war, as seeing it from a players perspective can be different from having all revealed.

I remember trying P215 some months ago. I think that the mountains were too spiky, I don't know if I did something wrong.

Imarok added a subscriber: Imarok.Jan 12 2021, 8:11 PM
Imarok added inline comments.
binaries/data/mods/public/maps/random/alpine_mountains.js
462

Please don't use deprecated functions.
At some point we need to get rid of them. Adding more to our codebase definitely doesn't help.

Imarok added inline comments.Jan 12 2021, 8:17 PM
binaries/data/mods/public/maps/random/alpine_mountains.js
462

(See #4695 for background info)

Feldfeld updated this revision to Diff 15208.Jan 12 2021, 8:41 PM

If I recall from my whacky memories, createObjectGroupsDeprecated is equivalent to a createObjectGroups call with a retryFactor of 0, is that correct?

Well probably not actually otherwise the deprecated functions placeholder wouldn't be needed. Plus I just reread the ticket so indeed there is no equivalence. I'll adjust the values if necessary

Feldfeld updated this revision to Diff 15213.Jan 12 2021, 9:12 PM

Adjusted values in previously deprecated functions

Well probably not actually otherwise the deprecated functions placeholder wouldn't be needed. Plus I just reread the ticket so indeed there is no equivalence. I'll adjust the values if necessary

Fine ๐Ÿ‘

Feldfeld updated this revision to Diff 15285.Jan 14 2021, 8:45 AM
Feldfeld marked 2 inline comments as done.
Feldfeld edited the summary of this revision. (Show Details)

Adjusted player placement so that they spawn further apart (on low player numbers) which reduces the imbalance in player positions.
I didn't yet replace the unreachable trees on mountains by their actor variation, because some of them are placed with a TerrainPainter which requires a template.

This comment was removed by wraitii.

The generation has some fairly bad edge cases, where one player can be basically entirely surrounded by mountains except for a minor passage near the border, things like that. You can also run into maps where some bit is just inaccessible because mountain ranges enclose it.

I don't particularly mind as most of our RM maps are wonky, but this won't be the most balanced either :P

Looks fairly good though.

where one player can be basically entirely surrounded by mountains except for a minor passage near the border, things like that

It is in my plans to add a constraint so that the flood fill passage can't be near the border because indeed that can hurt gameplay.
I will also try to guarantee bigger passages but I don't know to which extent I can go without making the loading time too long.

You can also run into maps where some bit is just inaccessible because mountain ranges enclose it.

I would say it's not a problem as the impassable area shouldn't be too big, except for nomad which I will need to handle in more details.
It could even provide some niceness, provided everything else is well balanced, as you truly don't know what to expect as you are exploring the map

I don't particularly mind as most of our RM maps are wonky, but this won't be the most balanced either :P

This map is indeed not balanced for expansion opportunities, however I did put some mechanisms to balance the resources close to starting positions. There is code that balances the additional food resources generation which can be collected from the start, and on top of the straggler trees there is a sizable forest that is guarranteed close by. Also due to how they are generated, stone and metal mines will always be regularly spread out on the map.
So resources wise this is playable up to a certain point.

I think the biggest problem for the multiplayer crowd is that the map is too "turtleish" as the chokepoints can be quite small (although it didn't prevent players to play maps like Ambush). The expansion opportunities balance is a second problem, but in general I think SP players should enjoy it

Feldfeld updated this revision to Diff 18346.Jul 28 2021, 5:36 PM
  • Flood fill now avoids the map border
  • Now nomad generations always have enough space
  • Better wood generation
  • Updated a few gaia entities in reaction to the terrain and map overhaul, however I didn't change terrain, but I am open to suggestions for that.
Feldfeld updated this revision to Diff 18351.Jul 29 2021, 6:58 PM

New terrains. Might make a winter biome, and possibly also something more elaborated later on.

Feldfeld updated this revision to Diff 18359.Aug 1 2021, 5:20 PM

Fixed a bug which could trigger errors on placing players initial resources, and could slow down loading time. Now the map generation should be very reliable.
Added winter biome, and 3 environmental presets that go with it: Sunny, Snowy and Night. For now they are chosen at random. I am not fully sure that I know what I'm doing with environmental settings.
Here is how the map looks like now:

  • Summer biome:


  • Winter biome:
    • Sunny:

  • Snowy:

  • Night:

Could there be an interest in merging this map?

It can be tested quickly on last release via feldmap mod.

Yes, the name is a bit generic.

It looks a bit computer generated. Maybe you could add more decoratives or use multiple "floor" (not mountain) textures.
In the summer it's also unnatural that there is a hard line between snowy mountains and fertile "floor".
Would it be possible to have the snow only on the shadowside of the mountain? For example.

Maybe @real_tabasco_sauce is also interested.
I'll review more extensively

real_tabasco_sauce added a comment.EditedOct 30 2023, 6:46 PM

Well I don't mind the name, since this can certainly replace our existing alpine mountains random map. That map is very ugly IMO.
I could make a preview .png for you if you like, but I am still unsure how to actually add .png files to patches.
When I have time I could also test it on svn.
Then I could see if adding some placement options would work out.

It looks a bit computer generated. Maybe you could add more decoratives or use multiple "floor" (not mountain) textures.

It does look computer generated, though to my eyes the biggest factor in that is that the Simplex noise (or at least how I used it) is too regular.
I recall when I made the map I tried to experiment with many textures and decoratives, and this was the result. But I definitely take any suggestion on that side.

In the summer it's also unnatural that there is a hard line between snowy mountains and fertile "floor".

True that is unnatural, I also had that impression.

Would it be possible to have the snow only on the shadowside of the mountain? For example.

Good idea, that should be possible. I'll look at it.

I could make a preview .png for you if you like, but I am still unsure how to actually add .png files to patches.

The version on feldmap now has a preview but not depending on biome. Anyway I'll give it another look at some point since it has been years now :D

When I have time I could also test it on svn.

As long as there isn't some hugely breaking changes I should be able to port it later.

Then I could see if adding some placement options would work out.

Sure. Keep in mind the map does a special check that all players are connected (and that not one player is locked behind mountains). Also, since a good ratio of space is occupied by mountains, that can restrict options.

Thanks for the feedback.

yeah, the options for each map are defined in the json file, so we can basically just choose whichever work.

Could there be an interest in merging this map?

Propably we should answer this question first before you invest more time. I don't think real_tabasco_sauce perceives this map as pretty only by changing some decoratives or textures.

May i ask you what the uniqueness (gameplay wise) of this map should be? Compared to Ambush or Frontier for example.

Feldfeld added a comment.EditedOct 30 2023, 9:51 PM

Could there be an interest in merging this map?

Propably we should answer this question first before you invest more time. I don't think real_tabasco_sauce perceives this map as pretty only by changing some decoratives or textures.

May i ask you what the uniqueness (gameplay wise) of this map should be? Compared to Ambush or Frontier for example.

My memory of Frontier is too vague. This map definitely has similarities with Ambush (chokepointy and expansion-oriented). However, the algorithm for Alpine Mountains is very unique, and was pretty much designed from scratch using simplex noise as a base for elevation. I can list the following differences on the top on my mind:

  • The features of Ambush are generated with quite a regular and predictable shape. So when you explore and find the start of an elevated terrain for example, this gives you a good intel on the shape of an area of the map that you didn't explore yet, as the elevation is always built in that specific way. On the other hand, with Alpine Mountains, the simplex noise makes the unexplored shape (the mountains) pretty much unpredictable, though they will always kind of look the same. What looks like a promising valley may lead to an area with few resources, you can find another remote path to the enemy etc. You can't be sure the mountain will be open or closed until you actually explore it.
  • I did a somewhat custom mineral placement where you can find good amount of mineral close to the mountain, compared to inside the valley. Minerals are also generated with smaller amounts, and more spread. Fewer big mines.
  • Likewise, other than the starting trees plus a nearby guaranteed forest, I think I made it so forests are generated close to the mountain.

There may be other things I forgot, but all in all the map should be quite unpredictable between generations and exploration should feel rewarding. On the downside for multiplayer the chokepoints can be bad and expansion opportunities can be (very) unbalanced. (Compare with Ambush since areas are generated with very similar patterns, that makes it so wherever a player spawns he will always find an opportunity to expand)
Also in Ambush a player can position his army to have a clear advantage elevation-wise, that is not really the case in Alpine Mountains.

One last point, it's not really gameplay but since I have a set biome instead of random, that gives more/easier options for use of diverse textures/decorations.... though it could be questioned if this map made a good use of it, I guess.

So I just did a few generations of the map and it looks great. I really like the randomness where you don't necessarily know what resources or even space you will have access to. So @phosit this map is quite unique compared to the existing maps.
One issue I have is that the mountains themselves take up so much playable space. I think it would be good to keep these obstacles in place while increasing the playable map area, so basically making the mountains steeper.
I would like to see slightly more frequent clumps of wood. I like that they are very dense, but in my eyes, wood shouldn't be too difficult to expand to. There were a couple 1v1 generations where 1 expansion would get 1 player control over almost all the accessible wood, and in team games it was even rarer to find forests not associated with a player.

Meh for "I want to demonstrate simplex noice".
"a map more random then ambush" is a good reason :)

I had some thaughts about the unnarural-ness. You could add another texture in between the floor and the mountain. You could even add small ponds.
The mountains could be rougher.
Did you try noise with multiple frequencies?

The trees on the mountains should be actors.

So I just did a few generations of the map and it looks great. I really like the randomness where you don't necessarily know what resources or even space you will have access to. So @phosit this map is quite unique compared to the existing maps.
One issue I have is that the mountains themselves take up so much playable space. I think it would be good to keep these obstacles in place while increasing the playable map area, so basically making the mountains steeper.
I would like to see slightly more frequent clumps of wood. I like that they are very dense, but in my eyes, wood shouldn't be too difficult to expand to. There were a couple 1v1 generations where 1 expansion would get 1 player control over almost all the accessible wood, and in team games it was even rarer to find forests not associated with a player.

Thx for the feedback, I will consider these. I more or less already knew about these problems but that is difficult to tune in this map

I had some thaughts about the unnarural-ness. You could add another texture in between the floor and the mountain.

I will take another look at it. I would also invite anyone inspired (and motivated) to do some painting on Atlas on top of a generation of this map and post a screenshot to get some ideas of what would look good.

You could even add small ponds.

About ponds, I considered it, but since I decided to go for uneven elevation for the playable area, the fact that in 0AD all terrain below an elevation level has water makes it hard for this map.

The mountains could be rougher.
Did you try noise with multiple frequencies?

From what I recall, the argument in Noise2D() builder is the frequency. Also the scaling I have in the noise.get() does another transformation which I don't know the definition. In general, I spent a long time tuning these arguments.
I definitely agree the mountains still look unnatural and could be rougher. My conclusion back then was probably that building mountains with a higher frequency noise would look even more unnatural, but in another way. So imo if we want to make them rougher (and less regular) it would take some kind of transformation (not using noise), after the noise gives the initial shape of the mountain. But the hard part is finding what kind of transformation could be interesting.

The trees on the mountains should be actors.

Yeah I left it that way back then because actors could not be used to create forests using the API, but if the map gets merged they will all be actors yes.

Thx for the feedback.

real_tabasco_sauce added a comment.EditedNov 2 2023, 5:10 AM

So why is it that you can't place the players and then apply the noise to the non-player area? Then I think placements might be more balanced and u could use the placement options.

Feldfeld added a comment.EditedNov 2 2023, 6:27 AM

So why is it that you can't place the players and then apply the noise to the non-player area? Then I think placements might be more balanced and u could use the placement options.

Since the player area will be set to the low elevation without considering the noise output at that location, there will be areas at the frontier between player area and the non player area where the noise value will be very high, making a huge delta of elevation, and that would most likely make it look unnatural as it will also draw a clear circle. That said it's true that I didn't try it and maybe there could be ways to mitigate and not make it look as bad as it sounds. But that map was not much designed for multiplayer, because even if that issue is fixed there is still the problem of small chokepoints not playing well with 0 A.D. (though that didn't stop players from playing Ambush, I guess)
Also when player placements are predictable that is one less thing you can get out of exploration though that doesn't compare with having a nicely balanced map.

One thing I forgot to mention, though you might have taken that into account already is that my recommended map size setting is one size larger than the one which would be used for mainland for the same number of players (that helps a little but still doesn't make the map balanced). It also helps with the quantity of playable area, you would do a similar thing with maps that use a noticeable quantity of water

So why is it that you can't place the players and then apply the noise to the non-player area? Then I think placements might be more balanced and u could use the placement options.

Since the player area will be set to the low elevation without considering the noise output at that location, there will be areas at the frontier between player area and the non player area where the noise value will be very high, making a huge delta of elevation, and that would most likely make it look unnatural as it will also draw a clear circle. That said it's true that I didn't try it and maybe there could be ways to mitigate and not make it look as bad as it sounds. But that map was not much designed for multiplayer, because even if that issue is fixed there is still the problem of small chokepoints not playing well with 0 A.D. (though that didn't stop players from playing Ambush, I guess)
Also when player placements are predictable that is one less thing you can get out of exploration though that doesn't compare with having a nicely balanced map.

That last bit is partially solved with the placement options. Especially since you can choose random selection, or select randomGroup, which is a bit more balanced than the current randomGroup-esq placement. In 1v1s, the placement options yield pretty interesting results.
Then you would have to have some kind of smoothing function to avoid the sharp ring around each player.
Also, even with the current generation, I think the iber walls work out ok, so they should still spawn.

Feldfeld added a comment.EditedNov 2 2023, 6:49 AM

So why is it that you can't place the players and then apply the noise to the non-player area? Then I think placements might be more balanced and u could use the placement options.

Since the player area will be set to the low elevation without considering the noise output at that location, there will be areas at the frontier between player area and the non player area where the noise value will be very high, making a huge delta of elevation, and that would most likely make it look unnatural as it will also draw a clear circle. That said it's true that I didn't try it and maybe there could be ways to mitigate and not make it look as bad as it sounds. But that map was not much designed for multiplayer, because even if that issue is fixed there is still the problem of small chokepoints not playing well with 0 A.D. (though that didn't stop players from playing Ambush, I guess)
Also when player placements are predictable that is one less thing you can get out of exploration though that doesn't compare with having a nicely balanced map.

That last bit is partially solved with the placement options. Especially since you can choose random selection, or select randomGroup, which is a bit more balanced than the current randomGroup-esq placement. In 1v1s, the placement options yield pretty interesting results.
Then you would have to have some kind of smoothing function to avoid the sharp ring around each player.
Also, even with the current generation, I think the iber walls work out ok, so they should still spawn.

Ok, it's worth a try, I will update this patch once I'm done (probably this weekend)
(also I edited my post above with recommended map size settings in case you missed)

So why is it that you can't place the players and then apply the noise to the non-player area? Then I think placements might be more balanced and u could use the placement options.

Since the player area will be set to the low elevation without considering the noise output at that location, there will be areas at the frontier between player area and the non player area where the noise value will be very high, making a huge delta of elevation, and that would most likely make it look unnatural as it will also draw a clear circle. That said it's true that I didn't try it and maybe there could be ways to mitigate and not make it look as bad as it sounds. But that map was not much designed for multiplayer, because even if that issue is fixed there is still the problem of small chokepoints not playing well with 0 A.D. (though that didn't stop players from playing Ambush, I guess)
Also when player placements are predictable that is one less thing you can get out of exploration though that doesn't compare with having a nicely balanced map.

That last bit is partially solved with the placement options. Especially since you can choose random selection, or select randomGroup, which is a bit more balanced than the current randomGroup-esq placement. In 1v1s, the placement options yield pretty interesting results.
Then you would have to have some kind of smoothing function to avoid the sharp ring around each player.
Also, even with the current generation, I think the iber walls work out ok, so they should still spawn.

Sorry for the late answer.
By randomGroup, are you referring to the playerPlacementRandom function? If not sorry if I'm not up to date with latest changes.
If it is playerPlacementRandom, I have some concerns about the resulting balance with that option. In a 1v1, it can place both players pretty much adjacent, and it can place a player in a corner. Even if the result is balanced, adjacent starting positions may still not be desired.
See a gen of Belgian Uplands to illustrate what I mean:

I can go on with the changes but I'm not sure I will be able to come up with a smoothing function that looks natural.
After checking Alpine Mountains again, yep the forests really need to get bigger, or there should be more of them.

In D2830#149140, @Stan wrote:

@wowgetoffyourcellphone, better name suggestion maybe?

Alpes Cottiae
Alpes Maritimae
Alpes Poeniae
Cisalpine Gaul
Lechtal Alps
Mieming Range
Stubai Alps
Sarntal Alps
Ortler Alps
ร–tztal Alps
Sesvenna Alps
Samnaun Alps