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.

smiley added a subscriber: smiley.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.

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