# HG changeset patch # User Wuzzy # Date 1558302733 -7200 # Node ID bea068dd9356454af6a9a0562ae3089e486f50eb # Parent 5d8068ee16fcda5c1aad72c53982e68cadedc21a Calculate max. recommended hog count for perlin maps diff -r 5d8068ee16fc -r bea068dd9356 ChangeLog.txt --- a/ChangeLog.txt Sun May 19 21:14:53 2019 +0200 +++ b/ChangeLog.txt Sun May 19 23:52:13 2019 +0200 @@ -124,6 +124,7 @@ + Display a warning when the same key is used multiple times + Stats screen now hides empty sections + Visual notification when someone joins the room online + + Display recommended max. hedgehog count for Perlin maps + Various minor style tweaks * Fix broken handling of /watch chat command on official server * Fix renaming a video leading to loss of thumbnail after restart diff -r 5d8068ee16fc -r bea068dd9356 hedgewars/uLandGenPerlin.pas --- a/hedgewars/uLandGenPerlin.pas Sun May 19 21:14:53 2019 +0200 +++ b/hedgewars/uLandGenPerlin.pas Sun May 19 23:52:13 2019 +0200 @@ -135,6 +135,43 @@ df:= detail * (6 - param2 * 2); + // Calculate estimate for max. hedgehog count + // Tunnels + if param1 = 0 then + begin + // Small tunnels + if param2 = 0 then + // 12..24 + MaxHedgehogs:= 12 + 1 * (cFeatureSize - 1) + // Medium tunnels + else if param2 = 1 then + // 14..24 + MaxHedgehogs:= 14 + max(0, 1 * (cFeatureSize - 3)) + // Large tunnels + else if param2 = 2 then + // 16..24 + MaxHedgehogs:= 16 + max(0, 1 * (cFeatureSize - 5)); + if MaxHedgehogs > 24 then + MaxHedgehogs:= 24; + end + // Islands + else if (param1 = 1) and (cFeatureSize <= 25) then + // Small islands + if param2 = 0 then + // 64..32 + MaxHedgehogs:= 32 + ((((25 - (cFeatureSize-1))*1000000) div 24) * 32) div 1000000 + // Medium islands + else if param2 = 1 then + // 56..28 + MaxHedgehogs:= 28 + ((((25 - (cFeatureSize-1))*1000000) div 24) * 28) div 1000000 + // Large islands + else if param2 = 2 then + // 48..24 + MaxHedgehogs:= 24 + ((((25 - (cFeatureSize-1))*1000000) div 24) * 24) div 1000000; + // We only want even numbers + if (MaxHedgehogs > 0) and ((MaxHedgehogs mod 2) = 1) then + MaxHedgehogs:= MaxHedgehogs - 1; + inoise_setup(); for y:= minY to pred(height) do