From 9a2bf1ebfbd5698589384fd37b17dcd30e4e3935 Mon Sep 17 00:00:00 2001 From: elexis Date: Wed, 31 Jan 2018 20:46:43 +0000 Subject: [PATCH] Performance improvement on Kerala, refs #5011. This was SVN commit r21092. --- binaries/data/mods/public/maps/random/kerala.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/binaries/data/mods/public/maps/random/kerala.js b/binaries/data/mods/public/maps/random/kerala.js index 38bd58c979..0c32e9e13d 100644 --- a/binaries/data/mods/public/maps/random/kerala.js +++ b/binaries/data/mods/public/maps/random/kerala.js @@ -51,7 +51,6 @@ var clRock = g_Map.createTileClass(); var clMetal = g_Map.createTileClass(); var clFood = g_Map.createTileClass(); var clBaseResource = g_Map.createTileClass(); -var clMountains = g_Map.createTileClass(); var waterPosition = fractionToTiles(0.31); var playerPosition = fractionToTiles(0.55); @@ -110,7 +109,7 @@ paintRiver({ }); g_Map.log("Marking mountain area"); -createArea( +var areaMountains = createArea( new ConvexPolygonPlacer( [ new Vector2D(mountainPosition, mapBounds.top), @@ -118,8 +117,7 @@ createArea( new Vector2D(mapBounds.right, mapBounds.top), new Vector2D(mapBounds.right, mapBounds.bottom) ].map(pos => pos.rotateAround(startAngle - Math.PI / 2, mapCenter)), - Infinity), - new TileClassPainter(clMountains)); + Infinity)); g_Map.log("Creating shores"); for (let i = 0; i < scaleByMapSize(20, 120); ++i) @@ -142,15 +140,17 @@ paintTileClassBasedOnHeight(-6, 0.5, 1, clWater); Engine.SetProgress(45); g_Map.log("Creating hills"); -createAreas( +createAreasInAreas( new ChainPlacer(1, Math.floor(scaleByMapSize(4, 6)), Math.floor(scaleByMapSize(16, 40)), 0.1), [ new LayeredPainter([tCliff, tGrass], [3]), new SmoothElevationPainter(ELEVATION_SET, heightHill, 3), new TileClassPainter(clHill) ], - [avoidClasses(clPlayer, 20, clHill, 5, clWater, 2, clBaseResource, 2), stayClasses(clMountains, 0)], - scaleByMapSize(5, 40) * numPlayers); + avoidClasses(clPlayer, 20, clHill, 5, clWater, 2, clBaseResource, 2), + scaleByMapSize(5, 100), + 3, + [areaMountains]); g_Map.log("Creating forests"); var [forestTrees, stragglerTrees] = getTreeCounts(1000, 6000, 0.7);