From c5b7ecefa146c8aaa051789d33fc062cabcdf655 Mon Sep 17 00:00:00 2001 From: elexis Date: Thu, 18 Jan 2018 13:57:11 +0000 Subject: [PATCH] Delete BaseHeight property from random map JSON files and rmgen library, refs #6, #4973, 9ee44bd9b8, 0e0ed94926. The height is only a concern to the random map script, not the rmgen library, nor the gamesetup, nor the simulation. Reveals the actual initial elevation to the random map script author without looking up the JSON file. Group and rename all height constants of random maps below the template names. Rename waterHeight to heightSeaGround to prevent confusion with the actual waterlevel. Remove useless paintTerrainBasedOnHeight calls on African Plains and Polar Sea. This was SVN commit r20904. --- .../mods/public/maps/random/aegean_sea.js | 34 ++++---- .../mods/public/maps/random/aegean_sea.json | 1 - .../mods/public/maps/random/african_plains.js | 16 ++-- .../public/maps/random/african_plains.json | 1 - .../mods/public/maps/random/alpine_lakes.js | 7 +- .../mods/public/maps/random/alpine_lakes.json | 3 +- .../mods/public/maps/random/alpine_valley.js | 23 +++--- .../public/maps/random/alpine_valley.json | 3 +- .../data/mods/public/maps/random/ambush.js | 6 +- .../data/mods/public/maps/random/ambush.json | 1 - .../public/maps/random/anatolian_plateau.js | 7 +- .../public/maps/random/anatolian_plateau.json | 3 +- .../mods/public/maps/random/archipelago.js | 19 ++--- .../mods/public/maps/random/archipelago.json | 1 - .../mods/public/maps/random/arctic_summer.js | 7 +- .../public/maps/random/arctic_summer.json | 1 - .../public/maps/random/ardennes_forest.js | 30 ++++--- .../public/maps/random/ardennes_forest.json | 1 - .../public/maps/random/atlas_mountains.js | 4 +- .../public/maps/random/atlas_mountains.json | 3 +- .../public/maps/random/belgian_uplands.js | 28 +++---- .../public/maps/random/belgian_uplands.json | 1 - .../public/maps/random/botswanan_haven.js | 16 ++-- .../public/maps/random/botswanan_haven.json | 1 - .../public/maps/random/caledonian_meadows.js | 30 +++---- .../maps/random/caledonian_meadows.json | 3 +- .../maps/random/cantabrian_highlands.js | 11 ++- .../maps/random/cantabrian_highlands.json | 3 +- .../data/mods/public/maps/random/canyon.js | 20 ++--- .../data/mods/public/maps/random/canyon.json | 1 - .../data/mods/public/maps/random/continent.js | 9 ++- .../mods/public/maps/random/continent.json | 1 - .../public/maps/random/corinthian_isthmus.js | 14 ++-- .../maps/random/corinthian_isthmus.json | 1 - .../data/mods/public/maps/random/corsica.js | 22 +++--- .../data/mods/public/maps/random/corsica.json | 3 +- .../maps/random/cycladic_archipelago.js | 13 +++- .../maps/random/cycladic_archipelago.json | 1 - .../data/mods/public/maps/random/danubius.js | 23 +++--- .../mods/public/maps/random/danubius.json | 1 - .../mods/public/maps/random/deep_forest.js | 22 +++--- .../mods/public/maps/random/deep_forest.json | 1 - .../data/mods/public/maps/random/empire.js | 2 +- .../data/mods/public/maps/random/empire.json | 1 - .../public/maps/random/english_channel.js | 19 ++--- .../public/maps/random/english_channel.json | 3 +- .../public/maps/random/extinct_volcano.js | 26 ++++--- .../public/maps/random/extinct_volcano.json | 1 - .../data/mods/public/maps/random/flood.js | 20 ++--- .../data/mods/public/maps/random/flood.json | 1 - .../data/mods/public/maps/random/fortress.js | 7 +- .../mods/public/maps/random/fortress.json | 3 +- .../mods/public/maps/random/frontier.json | 1 - binaries/data/mods/public/maps/random/gear.js | 22 ++++-- .../data/mods/public/maps/random/gear.json | 1 - .../public/maps/random/guadalquivir_river.js | 22 +++--- .../maps/random/guadalquivir_river.json | 1 - .../public/maps/random/gulf_of_bothnia.js | 23 +++--- .../public/maps/random/gulf_of_bothnia.json | 3 +- .../data/mods/public/maps/random/harbor.js | 55 +++++-------- .../data/mods/public/maps/random/harbor.json | 1 - .../mods/public/maps/random/hells_pass.js | 26 +++---- .../mods/public/maps/random/hells_pass.json | 1 - .../public/maps/random/hyrcanian_shores.js | 23 ++++-- .../public/maps/random/hyrcanian_shores.json | 3 +- .../data/mods/public/maps/random/india.js | 13 +++- .../data/mods/public/maps/random/india.json | 1 - .../public/maps/random/island_stronghold.js | 21 ++--- .../public/maps/random/island_stronghold.json | 1 - .../data/mods/public/maps/random/islands.js | 20 +++-- .../data/mods/public/maps/random/islands.json | 1 - .../data/mods/public/maps/random/kerala.js | 15 ++-- .../data/mods/public/maps/random/kerala.json | 3 +- binaries/data/mods/public/maps/random/lake.js | 7 +- .../data/mods/public/maps/random/lake.json | 1 - .../data/mods/public/maps/random/latium.js | 19 ++--- .../data/mods/public/maps/random/latium.json | 3 +- .../data/mods/public/maps/random/lions_den.js | 53 +++++++------ .../mods/public/maps/random/lions_den.json | 1 - .../mods/public/maps/random/lorraine_plain.js | 23 +++--- .../public/maps/random/lorraine_plain.json | 3 +- .../data/mods/public/maps/random/mainland.js | 4 +- .../mods/public/maps/random/mainland.json | 1 - .../data/mods/public/maps/random/migration.js | 19 +++-- .../mods/public/maps/random/migration.json | 1 - .../maps/random/neareastern_badlands.js | 27 ++++--- .../maps/random/neareastern_badlands.json | 3 +- .../mods/public/maps/random/new_rms_test.js | 13 ++-- .../mods/public/maps/random/new_rms_test.json | 1 - .../public/maps/random/northern_lights.js | 21 ++--- .../public/maps/random/northern_lights.json | 3 +- .../data/mods/public/maps/random/oasis.js | 18 +++-- .../data/mods/public/maps/random/oasis.json | 3 +- .../public/maps/random/persian_highlands.js | 7 +- .../public/maps/random/persian_highlands.json | 3 +- .../public/maps/random/phoenician_levant.js | 29 +++---- .../public/maps/random/phoenician_levant.json | 3 +- .../data/mods/public/maps/random/polar_sea.js | 20 +++-- .../mods/public/maps/random/polar_sea.json | 1 - .../public/maps/random/pyrenean_sierra.js | 11 ++- .../public/maps/random/pyrenean_sierra.json | 3 +- .../public/maps/random/rhine_marshlands.js | 13 +++- .../public/maps/random/rhine_marshlands.json | 3 +- .../public/maps/random/river_archipelago.js | 13 +++- .../public/maps/random/river_archipelago.json | 1 - .../data/mods/public/maps/random/rivers.js | 21 ++--- .../data/mods/public/maps/random/rivers.json | 1 - .../public/maps/random/rmgen/gaia_terrain.js | 24 +++--- .../mods/public/maps/random/rmgen/library.js | 5 -- .../mods/public/maps/random/saharan_oases.js | 7 +- .../public/maps/random/saharan_oases.json | 3 +- .../data/mods/public/maps/random/sahel.js | 7 +- .../data/mods/public/maps/random/sahel.json | 1 - .../maps/random/sahel_watering_holes.js | 27 ++++--- .../maps/random/sahel_watering_holes.json | 3 +- .../mods/public/maps/random/schwarzwald.js | 35 +++++---- .../mods/public/maps/random/schwarzwald.json | 1 - .../public/maps/random/snowflake_searocks.js | 10 ++- .../maps/random/snowflake_searocks.json | 1 - .../mods/public/maps/random/stronghold.js | 8 +- .../mods/public/maps/random/stronghold.json | 1 - .../maps/random/survivalofthefittest.js | 9 ++- .../maps/random/survivalofthefittest.json | 1 - .../data/mods/public/maps/random/syria.js | 10 ++- .../data/mods/public/maps/random/syria.json | 3 +- .../data/mods/public/maps/random/the_nile.js | 16 ++-- .../mods/public/maps/random/the_nile.json | 1 - .../maps/random/the_unknown/unknown_common.js | 78 ++++++++++--------- .../data/mods/public/maps/random/unknown.json | 1 - .../mods/public/maps/random/unknown_land.json | 1 - .../mods/public/maps/random/volcanic_lands.js | 7 +- .../public/maps/random/volcanic_lands.json | 3 +- .../data/mods/public/maps/random/wall_demo.js | 2 +- .../mods/public/maps/random/wall_demo.json | 1 - .../data/mods/public/maps/random/wild_lake.js | 24 +++--- .../mods/public/maps/random/wild_lake.json | 1 - 136 files changed, 729 insertions(+), 651 deletions(-) diff --git a/binaries/data/mods/public/maps/random/aegean_sea.js b/binaries/data/mods/public/maps/random/aegean_sea.js index 776109c016..66e4496dc8 100644 --- a/binaries/data/mods/public/maps/random/aegean_sea.js +++ b/binaries/data/mods/public/maps/random/aegean_sea.js @@ -44,7 +44,15 @@ const aDecorativeRock = "actor|geology/stone_granite_med.xml"; const pForest = [tForestFloor, tForestFloor + TERRAIN_SEPARATOR + oCarob, tForestFloor + TERRAIN_SEPARATOR + oDatePalm, tForestFloor + TERRAIN_SEPARATOR + oSDatePalm, tForestFloor]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightSeaGround = -3; +const heightSeaBump = -2.5; +const heightCorralsLower = -2; +const heightCorralsUpper = -1.5; +const heightShore = 1; +const heightLand = 2; +const heightIsland = 6; + +InitMap(heightShore, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); const mapCenter = getMapCenter(); @@ -62,12 +70,6 @@ var clGrass = createTileClass(); var clHill = createTileClass(); var clIsland = createTileClass(); -var waterHeight = -3; -var corralsHeightLower = -2; -var corralsHeightUpper = -1.5; -var shoreHeight = 1; -var landHeight = 2; - placePlayerBases({ "PlayerPlacement": playerPlacementRiver(0, fractionToTiles(0.6)), "PlayerTileClass": clPlayer, @@ -104,16 +106,16 @@ paintRiver({ "width": fractionToTiles(0.35), "fadeDist": scaleByMapSize(6, 25), "deviation": 0, - "waterHeight": waterHeight, - "landHeight": landHeight, + "heightRiverbed": heightSeaGround, + "heightLand": heightLand, "meanderShort": 20, "meanderLong": 0 }); paintTileClassBasedOnHeight(-Infinity, 0.7, Elevation_ExcludeMin_ExcludeMax, clWater); -paintTerrainBasedOnHeight(-Infinity, shoreHeight, Elevation_ExcludeMin_ExcludeMax, tShoreLower); -paintTerrainBasedOnHeight(shoreHeight, landHeight, Elevation_ExcludeMin_ExcludeMax, tShoreUpper); +paintTerrainBasedOnHeight(-Infinity, heightShore, Elevation_ExcludeMin_ExcludeMax, tShoreLower); +paintTerrainBasedOnHeight(heightShore, heightLand, Elevation_ExcludeMin_ExcludeMax, tShoreUpper); Engine.SetProgress(40); createBumps(avoidClasses(clWater, 2, clPlayer, 20)); @@ -157,7 +159,7 @@ Engine.SetProgress(60); log("Creating undersea bumps..."); createAreas( new ChainPlacer(1, Math.floor(scaleByMapSize(4, 6)), Math.floor(scaleByMapSize(16, 40)), 0.5), - new SmoothElevationPainter(ELEVATION_SET, -2.5, 3), + new SmoothElevationPainter(ELEVATION_SET, heightSeaBump, 3), stayClasses(clWater, 6), scaleByMapSize(10, 50)); @@ -166,16 +168,16 @@ createAreas( new ChainPlacer(1, Math.floor(scaleByMapSize(4, 6)), Math.floor(scaleByMapSize(30, 80)), 0.5), [ new LayeredPainter([tShoreLower, tShoreUpper, tHill], [2 ,1]), - new SmoothElevationPainter(ELEVATION_SET, 6, 4), + new SmoothElevationPainter(ELEVATION_SET, heightIsland, 4), paintClass(clIsland) ], [avoidClasses(clPlayer, 8, clForest, 1, clIsland, 15), stayClasses (clWater, 6)], scaleByMapSize(1, 4) * numPlayers ); -paintTerrainBasedOnHeight(-Infinity, waterHeight, Elevation_IncludeMin_IncludeMax, tSeaDepths); -paintTerrainBasedOnHeight(waterHeight, corralsHeightLower, Elevation_ExcludeMin_IncludeMax, tCoralsLower); -paintTerrainBasedOnHeight(corralsHeightLower, corralsHeightUpper, Elevation_ExcludeMin_IncludeMax, tCoralsUpper); +paintTerrainBasedOnHeight(-Infinity, heightSeaGround, Elevation_IncludeMin_IncludeMax, tSeaDepths); +paintTerrainBasedOnHeight(heightSeaGround, heightCorralsLower, Elevation_ExcludeMin_IncludeMax, tCoralsLower); +paintTerrainBasedOnHeight(heightCorralsLower, heightCorralsUpper, Elevation_ExcludeMin_IncludeMax, tCoralsUpper); log("Creating island stone mines..."); createMines( diff --git a/binaries/data/mods/public/maps/random/aegean_sea.json b/binaries/data/mods/public/maps/random/aegean_sea.json index 05215f2d68..8462c8d16d 100644 --- a/binaries/data/mods/public/maps/random/aegean_sea.json +++ b/binaries/data/mods/public/maps/random/aegean_sea.json @@ -4,7 +4,6 @@ "Script" : "aegean_sea.js", "Description" : "Players start on two sides of a sea with scattered islands.", "BaseTerrain" : ["medit_grass_shrubs", "medit_rocks_grass_shrubs", "medit_rocks_shrubs", "medit_rocks_grass", "medit_shrubs"], - "BaseHeight" : 1, "Keywords": ["naval"], "CircularMap" : true, "Preview" : "aegean_sea.png" diff --git a/binaries/data/mods/public/maps/random/african_plains.js b/binaries/data/mods/public/maps/random/african_plains.js index 8c61ee3b30..7e00d327cb 100644 --- a/binaries/data/mods/public/maps/random/african_plains.js +++ b/binaries/data/mods/public/maps/random/african_plains.js @@ -1,11 +1,10 @@ Engine.LoadLibrary("rmgen"); -var tPrimary = ["savanna_grass_a"]; +var tPrimary = "savanna_grass_a"; var tForestFloor = "savanna_forestfloor_a"; var tCliff = ["savanna_cliff_a", "savanna_cliff_a_red", "savanna_cliff_b", "savanna_cliff_b_red"]; var tSecondary = "savanna_grass_b"; -var tGrassShrubs = ["savanna_shrubs_a"]; -var tGrass = ["savanna_grass_a_wetseason", "savanna_grass_b_wetseason"]; +var tGrassShrubs = "savanna_shrubs_a"; var tDirt = "savanna_dirt_a"; var tDirt2 = "savanna_dirt_a_red"; var tDirt3 = "savanna_dirt_b"; @@ -38,7 +37,11 @@ var aRock = "actor|geology/stone_savanna_med.xml"; const pForest = [tForestFloor + TERRAIN_SEPARATOR + oPalm, tForestFloor]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +var heightSeaGround = -5; +var heightLand = 2; +var heightCliff = 3; + +InitMap(heightLand, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -107,7 +110,7 @@ createAreas( new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), Math.floor(scaleByMapSize(60, 100)), 5), [ new LayeredPainter([tShore, tWater], [1]), - new SmoothElevationPainter(ELEVATION_SET, -5, 7), + new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 7), paintClass(clWater) ], avoidClasses(clPlayer, 22, clWater, 8, clHill, 2), @@ -115,8 +118,7 @@ createAreas( ); Engine.SetProgress(45); -paintTerrainBasedOnHeight(3, Math.floor(scaleByMapSize(20, 40)), 0, tCliff); -paintTerrainBasedOnHeight(Math.floor(scaleByMapSize(20, 40)), 100, 3, tGrass); +paintTerrainBasedOnHeight(heightCliff, Infinity, 0, tCliff); createBumps(avoidClasses(clWater, 2, clPlayer, 20)); diff --git a/binaries/data/mods/public/maps/random/african_plains.json b/binaries/data/mods/public/maps/random/african_plains.json index 8319b5c082..7b7218ee99 100644 --- a/binaries/data/mods/public/maps/random/african_plains.json +++ b/binaries/data/mods/public/maps/random/african_plains.json @@ -4,7 +4,6 @@ "Script" : "african_plains.js", "Description" : "The central region of the vast continent of Africa, birthplace of humanity. Players start in a lush area teeming with vegetation and wildlife.", "BaseTerrain" : ["savanna_grass_a"], - "BaseHeight" : 2, "Keywords": [], "Preview" : "african_plains.png", "CircularMap" : true diff --git a/binaries/data/mods/public/maps/random/alpine_lakes.js b/binaries/data/mods/public/maps/random/alpine_lakes.js index b79b41cbe2..6ba78366ae 100644 --- a/binaries/data/mods/public/maps/random/alpine_lakes.js +++ b/binaries/data/mods/public/maps/random/alpine_lakes.js @@ -80,7 +80,10 @@ else const pForest = [tForestFloor + TERRAIN_SEPARATOR + oPine, tForestFloor]; -InitMap(g_MapSettings.BaseHeight, tPrimary); +var heightSeaGround = -5; +var heightLand = 3; + +InitMap(heightLand, tPrimary); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -155,7 +158,7 @@ for (var i = 0; i < numLakes; ++i) new ChainPlacer(1, Math.floor(scaleByMapSize(4, 8)), Math.floor(scaleByMapSize(40, 180)), 0.7, chosenPoint[0], chosenPoint[1]), [ new LayeredPainter([tShore, tWater, tWater], [1, 3]), - new SmoothElevationPainter(ELEVATION_SET, -5, 5), + new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 5), paintClass(clWater) ], avoidClasses(clPlayer, 20, clWater, 8), diff --git a/binaries/data/mods/public/maps/random/alpine_lakes.json b/binaries/data/mods/public/maps/random/alpine_lakes.json index 431ab39c7c..f9cbec55b5 100644 --- a/binaries/data/mods/public/maps/random/alpine_lakes.json +++ b/binaries/data/mods/public/maps/random/alpine_lakes.json @@ -4,8 +4,7 @@ "Script" : "alpine_lakes.js", "Description" : "High Alpine mountains surrounding deep valleys strung with mountain streams and finger-like lakes.", "BaseTerrain" : ["alpine_dirt_grass_50"], - "BaseHeight" : 3, "CircularMap" : true, "Preview" : "alpine_lakes.png" } -} \ No newline at end of file +} diff --git a/binaries/data/mods/public/maps/random/alpine_valley.js b/binaries/data/mods/public/maps/random/alpine_valley.js index 1caeec9974..e987a306d1 100644 --- a/binaries/data/mods/public/maps/random/alpine_valley.js +++ b/binaries/data/mods/public/maps/random/alpine_valley.js @@ -278,9 +278,14 @@ else var aBushSmall = "actor|props/flora/bush_medit_sm_dry.xml"; } +var heightLand = 3; +var heightOffsetBump = 2; +var snowlineHeight = 29; +var heightMountain = 30; + const pForest = [tForestFloor + TERRAIN_SEPARATOR + oPine, tForestFloor]; -InitMap(g_MapSettings.BaseHeight, tPrimary); +InitMap(heightLand, tPrimary); const numPlayers = getNumPlayers(); const mapCenter = getMapCenter(); @@ -294,12 +299,6 @@ var clMetal = createTileClass(); var clFood = createTileClass(); var clBaseResource = createTileClass(); -/** - * Minimum distance between two mountainranges. - */ -var snowlineHeight = 29; -var mountainHeight = 30; - var [playerIDs, playerPosition, playerAngle, startAngle] = playerPlacementCircle(fractionToTiles(0.35)); placePlayerBases({ @@ -334,7 +333,7 @@ new MountainRangeBuilder({ "pathplacer": new PathPlacer(undefined, undefined, undefined, undefined, undefined, 0.4, scaleByMapSize(3, 12), 0.1, 0.1, 0.1), "painters":[ new LayeredPainter([tCliff, tPrimary], [3]), - new SmoothElevationPainter(ELEVATION_SET, mountainHeight, 2), + new SmoothElevationPainter(ELEVATION_SET, heightMountain, 2), paintClass(clHill) ], "constraint": avoidClasses(clPlayer, 20), @@ -353,13 +352,13 @@ new MountainRangeBuilder({ Engine.SetProgress(35); -paintTerrainBasedOnHeight(getMapBaseHeight() + 0.1, snowlineHeight, 0, tCliff); -paintTerrainBasedOnHeight(snowlineHeight, mountainHeight, 3, tSnowLimited); +paintTerrainBasedOnHeight(heightLand + 0.1, snowlineHeight, 0, tCliff); +paintTerrainBasedOnHeight(snowlineHeight, heightMountain, 3, tSnowLimited); log("Creating bumps..."); createAreas( new ClumpPlacer(scaleByMapSize(20, 50), 0.3, 0.06, 1), - new SmoothElevationPainter(ELEVATION_MODIFY, 2, 2), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetBump, 2), avoidClasses(clPlayer, 10), scaleByMapSize(100, 200)); Engine.SetProgress(40); @@ -369,7 +368,7 @@ createAreas( new ClumpPlacer(scaleByMapSize(40, 150), 0.2, 0.1, 1), [ new LayeredPainter([tCliff, tSnowLimited], [2]), - new SmoothElevationPainter(ELEVATION_SET, mountainHeight, 2), + new SmoothElevationPainter(ELEVATION_SET, heightMountain, 2), paintClass(clHill) ], avoidClasses(clPlayer, 20, clHill, 14), diff --git a/binaries/data/mods/public/maps/random/alpine_valley.json b/binaries/data/mods/public/maps/random/alpine_valley.json index a3c425660c..ef9429be7c 100644 --- a/binaries/data/mods/public/maps/random/alpine_valley.json +++ b/binaries/data/mods/public/maps/random/alpine_valley.json @@ -4,8 +4,7 @@ "Script" : "alpine_valley.js", "Description" : "High Alpine mountains bordering deep valleys.", "BaseTerrain" : ["alpine_dirt_grass_50"], - "BaseHeight" : 3, "Preview" : "alpine_valley.png", "CircularMap" : true } -} \ No newline at end of file +} diff --git a/binaries/data/mods/public/maps/random/ambush.js b/binaries/data/mods/public/maps/random/ambush.js index 8075bd3e4a..4202395483 100644 --- a/binaries/data/mods/public/maps/random/ambush.js +++ b/binaries/data/mods/public/maps/random/ambush.js @@ -4,7 +4,9 @@ Engine.LoadLibrary("rmbiome"); setSelectedBiome(); -InitMap(g_MapSettings.BaseHeight, g_Terrains.mainTerrain); +var heightLand = 2; + +InitMap(heightLand, g_Terrains.mainTerrain); initTileClasses(); @@ -21,7 +23,7 @@ Engine.SetProgress(20); addElements([ { "func": addBluffs, - "baseHeight": getMapBaseHeight(), + "baseHeight": heightLand, "avoid": [ g_TileClasses.bluff, 12, g_TileClasses.hill, 5, diff --git a/binaries/data/mods/public/maps/random/ambush.json b/binaries/data/mods/public/maps/random/ambush.json index 5a2a2df5e8..ac7cecd87e 100644 --- a/binaries/data/mods/public/maps/random/ambush.json +++ b/binaries/data/mods/public/maps/random/ambush.json @@ -4,7 +4,6 @@ "Script" : "ambush.js", "Description" : "High bluffs overlook the terrain below. Bountiful resources await on the cliffs, but beware of enemies planning an ambush.", "BaseTerrain" : ["medit_sea_depths"], - "BaseHeight" : 2, "Preview" : "ambush.png", "SupportedBiomes": true, "CircularMap" : true diff --git a/binaries/data/mods/public/maps/random/anatolian_plateau.js b/binaries/data/mods/public/maps/random/anatolian_plateau.js index 605d58a340..a79abd3114 100644 --- a/binaries/data/mods/public/maps/random/anatolian_plateau.js +++ b/binaries/data/mods/public/maps/random/anatolian_plateau.js @@ -28,7 +28,10 @@ const aBushSmall = "actor|props/flora/bush_medit_sm.xml"; const pForest = [tForestFloor + TERRAIN_SEPARATOR + oPoplar, tForestFloor]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +var heightLand = 1; +var heightOffsetBump = 2; + +InitMap(heightLand, g_MapSettings.BaseTerrain); var numPlayers = getNumPlayers(); @@ -73,7 +76,7 @@ Engine.SetProgress(20); log("Creating bumps..."); createAreas( new ChainPlacer(1, Math.floor(scaleByMapSize(4, 6)), Math.floor(scaleByMapSize(2, 5)), 0.5), - new SmoothElevationPainter(ELEVATION_MODIFY, 2, 2), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetBump, 2), avoidClasses(clPlayer, 13), scaleByMapSize(300, 800)); diff --git a/binaries/data/mods/public/maps/random/anatolian_plateau.json b/binaries/data/mods/public/maps/random/anatolian_plateau.json index 84d6f64dfc..a72681d128 100644 --- a/binaries/data/mods/public/maps/random/anatolian_plateau.json +++ b/binaries/data/mods/public/maps/random/anatolian_plateau.json @@ -4,8 +4,7 @@ "Script" : "anatolian_plateau.js", "Description" : "An indefensible open land with little wood and stone, representing the central basin of Asia Minor.", "BaseTerrain" : ["steppe_grass_a", "steppe_grass_c", "steppe_grass_d"], - "BaseHeight" : 1, "Preview" : "anatolian_plateau.png", "CircularMap" : true } -} \ No newline at end of file +} diff --git a/binaries/data/mods/public/maps/random/archipelago.js b/binaries/data/mods/public/maps/random/archipelago.js index 15468e2b91..3f1ff2f3d7 100644 --- a/binaries/data/mods/public/maps/random/archipelago.js +++ b/binaries/data/mods/public/maps/random/archipelago.js @@ -43,7 +43,11 @@ const aBushSmall = g_Decoratives.bushSmall; const pForest1 = [tForestFloor2 + TERRAIN_SEPARATOR + oTree1, tForestFloor2 + TERRAIN_SEPARATOR + oTree2, tForestFloor2]; const pForest2 = [tForestFloor1 + TERRAIN_SEPARATOR + oTree4, tForestFloor1 + TERRAIN_SEPARATOR + oTree5, tForestFloor1]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +var heightSeaGround = -5; +var heightLand = 3; +var heightShore = 1; + +InitMap(heightSeaGround, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); @@ -57,9 +61,6 @@ var clFood = createTileClass(); var clBaseResource = createTileClass(); var clLand = createTileClass(); -var landHeight = 3; -var shoreHeight = 1; - var islandRadius = scaleByMapSize(22, 31); var [playerIDs, playerPosition] = playerPlacementCircle(fractionToTiles(0.35)); @@ -76,7 +77,7 @@ for (let i = 0; i < numPlayers; ++i) playerPosition[i].y, 0, [Math.floor(islandRadius)]), - new SmoothElevationPainter(ELEVATION_SET, landHeight, 4)); + new SmoothElevationPainter(ELEVATION_SET, heightLand, 4)); log("Creating random islands..."); createAreas( @@ -89,15 +90,15 @@ createAreas( undefined, scaleByMapSize(30, 70)), [ - new SmoothElevationPainter(ELEVATION_SET, landHeight, 4), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 4), paintClass(clLand) ], null, scaleByMapSize(1, 5) * randIntInclusive(5, 10)); -paintTerrainBasedOnHeight(landHeight - 0.6, landHeight + 0.4, 3, tMainTerrain); -paintTerrainBasedOnHeight(shoreHeight, landHeight, 0, tShore); -paintTerrainBasedOnHeight(getMapBaseHeight(), shoreHeight, 2, tWater); +paintTerrainBasedOnHeight(heightLand - 0.6, heightLand + 0.4, 3, tMainTerrain); +paintTerrainBasedOnHeight(heightShore, heightLand, 0, tShore); +paintTerrainBasedOnHeight(heightSeaGround, heightShore, 2, tWater); placePlayerBases({ "PlayerPlacement": [playerIDs, playerPosition], diff --git a/binaries/data/mods/public/maps/random/archipelago.json b/binaries/data/mods/public/maps/random/archipelago.json index 741f598070..ad3c7a7244 100644 --- a/binaries/data/mods/public/maps/random/archipelago.json +++ b/binaries/data/mods/public/maps/random/archipelago.json @@ -4,7 +4,6 @@ "Script" : "archipelago.js", "Description" : "A maze of islands of different sizes and shapes. Players start with more wood than normal.", "BaseTerrain" : ["medit_sand_wet"], - "BaseHeight" : -5, "Keywords": ["naval"], "Preview" : "archipelago.png", "SupportedBiomes": true, diff --git a/binaries/data/mods/public/maps/random/arctic_summer.js b/binaries/data/mods/public/maps/random/arctic_summer.js index 77be548dcc..a15ee7a825 100644 --- a/binaries/data/mods/public/maps/random/arctic_summer.js +++ b/binaries/data/mods/public/maps/random/arctic_summer.js @@ -39,7 +39,10 @@ var aRockMedium = "actor|geology/stone_granite_med.xml"; const pForest = [tForestFloor + TERRAIN_SEPARATOR + oBush, tForestFloor + TERRAIN_SEPARATOR + oBush2, tForestFloor]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +var heightSeaGround = -5; +var heightLand = 2; + +InitMap(heightLand, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); @@ -112,7 +115,7 @@ createAreas( 1), [ new LayeredPainter([tShore, tWater, tWater], [1, 3]), - new SmoothElevationPainter(ELEVATION_SET, -5, 5), + new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 5), paintClass(clWater) ], avoidClasses(clPlayer, 15), diff --git a/binaries/data/mods/public/maps/random/arctic_summer.json b/binaries/data/mods/public/maps/random/arctic_summer.json index 7cf5c20335..4026fd8fd5 100644 --- a/binaries/data/mods/public/maps/random/arctic_summer.json +++ b/binaries/data/mods/public/maps/random/arctic_summer.json @@ -4,7 +4,6 @@ "Script" : "arctic_summer.js", "Description" : "Summer has arrived to the cold regions of the north and with it have many animals, profiting from its milder climate. Wolves, ever present, have shed their winter clothes; deer, hares and muskox populate the plains. The last traces of winter are rapidly disappearing, only to reappear very soon.", "BaseTerrain" : ["alpine_grass_rocky"], - "BaseHeight" : 2, "Keywords": [], "Preview" : "arctic_summer.png", "CircularMap" : true diff --git a/binaries/data/mods/public/maps/random/ardennes_forest.js b/binaries/data/mods/public/maps/random/ardennes_forest.js index 83d71a0eef..1c1ed3bcb1 100644 --- a/binaries/data/mods/public/maps/random/ardennes_forest.js +++ b/binaries/data/mods/public/maps/random/ardennes_forest.js @@ -1,11 +1,5 @@ Engine.LoadLibrary("rmgen"); -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); - -const numPlayers = getNumPlayers(); -const mapSize = getMapSize(); -const mapCenter = getMapCenter(); - const tGrass = ["new_alpine_grass_b", "new_alpine_grass_c", "new_alpine_grass_d"]; const tPineForestFloor = "temp_forestfloor_pine"; const tForestFloor = [tPineForestFloor, tPineForestFloor, "alpine_dirt_grass_50"]; @@ -52,6 +46,18 @@ var pForest = [ tForestFloor ]; +const heightRavineValley = 2; +const heightLand = 30; +const heightRavineHill = 40; +const heightHill = 50; +const heightOffsetRavine = 10; + +InitMap(heightHill, g_MapSettings.BaseTerrain); + +const numPlayers = getNumPlayers(); +const mapSize = getMapSize(); +const mapCenter = getMapCenter(); + var clPlayer = createTileClass(); var clHill = createTileClass(); var clForest = createTileClass(); @@ -67,7 +73,7 @@ createArea( new ClumpPlacer(diskArea(fractionToTiles(0.42)), 0.94, 0.05, 0.1, mapCenter.x, mapCenter.y), [ new LayeredPainter([tCliff, tGrass], [3]), - new SmoothElevationPainter(ELEVATION_SET, 30, 3) + new SmoothElevationPainter(ELEVATION_SET, heightLand, 3) ]); Engine.SetProgress(5); @@ -164,7 +170,7 @@ for (let size of [scaleByMapSize(50, 800), scaleByMapSize(50, 400), scaleByMapSi new ClumpPlacer(size, 0.1, 0.2, 0.1), [ new LayeredPainter([tCliff, [tForestFloor, tForestFloor, tCliff]], [2]), - new SmoothElevationPainter(ELEVATION_SET, 50, size < 50 ? 2 : 4), + new SmoothElevationPainter(ELEVATION_SET, heightHill, size < 50 ? 2 : 4), paintClass(clHill) ], avoidClasses(clPlayer, 8, clBaseResource, 2, clHill, 5), @@ -175,7 +181,7 @@ for (let size of [scaleByMapSize(50, 800), scaleByMapSize(50, 400), scaleByMapSi new ClumpPlacer(size * 0.3, 0.94, 0.05, 0.1), [ new LayeredPainter([tCliff, tForestFloor], [2]), - new SmoothElevationPainter(ELEVATION_MODIFY, 10, 3) + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetRavine, 3) ], stayClasses(clHill, 4), mountains.length * 2, @@ -186,7 +192,7 @@ for (let size of [scaleByMapSize(50, 800), scaleByMapSize(50, 400), scaleByMapSi new ClumpPlacer(size, 0.1, 0.2, 0.1), [ new LayeredPainter([tCliff, tForestFloor], [2]), - new SmoothElevationPainter(ELEVATION_SET, 10, 2), + new SmoothElevationPainter(ELEVATION_SET, heightRavine, 2), paintClass(clHill) ], avoidClasses(clPlayer, 6, clBaseResource, 2, clHill, 5), @@ -220,7 +226,7 @@ for (let size of [scaleByMapSize(50, 800), scaleByMapSize(50, 400), scaleByMapSi new ClumpPlacer(size * 0.3, 0.94, 0.05, 0.1), [ new LayeredPainter([tCliff, tForestFloor], [2]), - new SmoothElevationPainter(ELEVATION_SET, 2, 2) + new SmoothElevationPainter(ELEVATION_SET, hRavineValley, 2) ], [avoidClasses(clHillDeco, 2), stayClasses(clHill, 0)], ravine.length * 2, @@ -231,7 +237,7 @@ for (let size of [scaleByMapSize(50, 800), scaleByMapSize(50, 400), scaleByMapSi new ClumpPlacer(size * 0.1, 0.3, 0.05, 0.1), [ new LayeredPainter([tCliff, tForestFloor], [2]), - new SmoothElevationPainter(ELEVATION_SET, 40, 2), + new SmoothElevationPainter(ELEVATION_SET, hRavineHill, 2), paintClass(clHill) ], [avoidClasses(clHillDeco, 2), borderClasses(clHill, 15, 1)], diff --git a/binaries/data/mods/public/maps/random/ardennes_forest.json b/binaries/data/mods/public/maps/random/ardennes_forest.json index 29d6438430..0a0312c75c 100644 --- a/binaries/data/mods/public/maps/random/ardennes_forest.json +++ b/binaries/data/mods/public/maps/random/ardennes_forest.json @@ -6,7 +6,6 @@ "BaseTerrain" : [ "temp_forestfloor_pine", "temp_forestfloor_pine", "alpine_cliff_c", "alpine_grass_rocky" ], - "BaseHeight" : 50, "CircularMap" : true, "Preview" : "ardennes_forest.png" } diff --git a/binaries/data/mods/public/maps/random/atlas_mountains.js b/binaries/data/mods/public/maps/random/atlas_mountains.js index f786ad66e2..aa75f87fba 100644 --- a/binaries/data/mods/public/maps/random/atlas_mountains.js +++ b/binaries/data/mods/public/maps/random/atlas_mountains.js @@ -33,7 +33,9 @@ const aAleppoPine = "actor|flora/trees/aleppo_pine.xml"; const pForest1 = [tForestFloor + TERRAIN_SEPARATOR + oCarob, tForestFloor]; const pForest2 = [tForestFloor + TERRAIN_SEPARATOR + oAleppoPine, tForestFloor]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightLand = 3; + +InitMap(heightLand, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); diff --git a/binaries/data/mods/public/maps/random/atlas_mountains.json b/binaries/data/mods/public/maps/random/atlas_mountains.json index bd6e59d3d0..38a76e6e6e 100644 --- a/binaries/data/mods/public/maps/random/atlas_mountains.json +++ b/binaries/data/mods/public/maps/random/atlas_mountains.json @@ -4,8 +4,7 @@ "Script" : "atlas_mountains.js", "Description" : "A rugged land with small room for buildings with scarce wood. Represents the mountain range in the north-west africa.", "BaseTerrain" : ["medit_rocks_grass", "medit_rocks_grass", "medit_rocks_grass", "medit_rocks_grass", "medit_rocks_grass_shrubs", "medit_rocks_shrubs"], - "BaseHeight" : 3, "Preview" : "atlas_mountains.png", "CircularMap" : true } -} \ No newline at end of file +} diff --git a/binaries/data/mods/public/maps/random/belgian_uplands.js b/binaries/data/mods/public/maps/random/belgian_uplands.js index 6f2d5cab87..bbd499d3f1 100644 --- a/binaries/data/mods/public/maps/random/belgian_uplands.js +++ b/binaries/data/mods/public/maps/random/belgian_uplands.js @@ -1,7 +1,9 @@ Engine.LoadLibrary("rmgen"); Engine.LoadLibrary("heightmap"); -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightLand = 0; + +InitMap(heightLand, g_MapSettings.BaseTerrain); var numPlayers = getNumPlayers(); var mapSize = getMapSize(); @@ -24,25 +26,25 @@ var averageWaterCoverage = 1/3; // NOTE: Since errosion is not predictable actua if (mapSize < 200) // Sink the waterlevel on tiny maps to ensure enough space averageWaterCoverage = 2/3 * averageWaterCoverage; -var waterHeight = -MIN_HEIGHT + heightRange.min + averageWaterCoverage * (heightRange.max - heightRange.min); -var waterHeightAdjusted = waterHeight + MIN_HEIGHT; -setWaterHeight(waterHeight); +var heightSeaGround = -MIN_HEIGHT + heightRange.min + averageWaterCoverage * (heightRange.max - heightRange.min); +var heightSeaGroundAdjusted = heightSeaGround + MIN_HEIGHT; +setWaterHeight(heightSeaGround); // Prepare terrain texture by height placement var textueByHeight = []; // Deep water -textueByHeight.push({"upperHeightLimit": heightRange.min + 1/3 * (waterHeightAdjusted - heightRange.min), "terrain": "temp_sea_rocks"}); +textueByHeight.push({"upperHeightLimit": heightRange.min + 1/3 * (heightSeaGroundAdjusted - heightRange.min), "terrain": "temp_sea_rocks"}); // Medium deep water (with fish) var terrains = ["temp_sea_weed"]; terrains = terrains.concat(terrains, terrains, terrains, terrains); terrains = terrains.concat(terrains, terrains, terrains, terrains); terrains.push("temp_sea_weed|gaia/fauna_fish"); -textueByHeight.push({"upperHeightLimit": heightRange.min + 2/3 * (waterHeightAdjusted - heightRange.min), "terrain": terrains}); +textueByHeight.push({"upperHeightLimit": heightRange.min + 2/3 * (heightSeaGroundAdjusted - heightRange.min), "terrain": terrains}); // Flat Water -textueByHeight.push({"upperHeightLimit": heightRange.min + 3/3 * (waterHeightAdjusted - heightRange.min), "terrain": "temp_mud_a"}); +textueByHeight.push({"upperHeightLimit": heightRange.min + 3/3 * (heightSeaGroundAdjusted - heightRange.min), "terrain": "temp_mud_a"}); // Water surroundings/bog (with stone/metal some rabits and bushes) var terrains = ["temp_plants_bog", "temp_plants_bog_aut", "temp_dirt_gravel_plants", "temp_grass_d"]; @@ -50,19 +52,19 @@ terrains = terrains.concat(terrains, terrains, terrains, terrains, terrains); terrains = ["temp_plants_bog|gaia/flora_bush_temperate"].concat(terrains, terrains); terrains = ["temp_dirt_gravel_plants|gaia/geology_metal_temperate", "temp_dirt_gravel_plants|gaia/geology_stone_temperate", "temp_plants_bog|gaia/fauna_rabbit"].concat(terrains, terrains); terrains = ["temp_plants_bog_aut|gaia/flora_tree_dead"].concat(terrains, terrains); -textueByHeight.push({"upperHeightLimit": waterHeightAdjusted + 1/6 * (heightRange.max - waterHeightAdjusted), "terrain": terrains}); +textueByHeight.push({"upperHeightLimit": heightSeaGroundAdjusted + 1/6 * (heightRange.max - heightSeaGroundAdjusted), "terrain": terrains}); // Juicy grass near bog -textueByHeight.push({"upperHeightLimit": waterHeightAdjusted + 2/6 * (heightRange.max - waterHeightAdjusted), +textueByHeight.push({"upperHeightLimit": heightSeaGroundAdjusted + 2/6 * (heightRange.max - heightSeaGroundAdjusted), "terrain": ["temp_grass", "temp_grass_d", "temp_grass_long_b", "temp_grass_plants"]}); // Medium level grass // var testActor = "actor|geology/decal_stone_medit_a.xml"; -textueByHeight.push({"upperHeightLimit": waterHeightAdjusted + 3/6 * (heightRange.max - waterHeightAdjusted), +textueByHeight.push({"upperHeightLimit": heightSeaGroundAdjusted + 3/6 * (heightRange.max - heightSeaGroundAdjusted), "terrain": ["temp_grass", "temp_grass_b", "temp_grass_c", "temp_grass_mossy"]}); // Long grass near forest border -textueByHeight.push({"upperHeightLimit": waterHeightAdjusted + 4/6 * (heightRange.max - waterHeightAdjusted), +textueByHeight.push({"upperHeightLimit": heightSeaGroundAdjusted + 4/6 * (heightRange.max - heightSeaGroundAdjusted), "terrain": ["temp_grass", "temp_grass_b", "temp_grass_c", "temp_grass_d", "temp_grass_long_b", "temp_grass_clovers_2", "temp_grass_mossy", "temp_grass_plants"]}); // Forest border (With wood/food plants/deer/rabits) @@ -74,10 +76,10 @@ var terrains = ["temp_grass_plants|gaia/flora_tree_euro_beech", "temp_grass_moss var numTerrains = terrains.length; for (var i = 0; i < numTerrains; i++) terrains.push("temp_grass_plants"); -textueByHeight.push({"upperHeightLimit": waterHeightAdjusted + 5/6 * (heightRange.max - waterHeightAdjusted), "terrain": terrains}); +textueByHeight.push({"upperHeightLimit": heightSeaGroundAdjusted + 5/6 * (heightRange.max - heightSeaGroundAdjusted), "terrain": terrains}); // Unpassable woods -textueByHeight.push({"upperHeightLimit": waterHeightAdjusted + 6/6 * (heightRange.max - waterHeightAdjusted), +textueByHeight.push({"upperHeightLimit": heightSeaGroundAdjusted + 6/6 * (heightRange.max - heightSeaGroundAdjusted), "terrain": ["temp_grass_mossy|gaia/flora_tree_oak", "temp_forestfloor_pine|gaia/flora_tree_pine", "temp_grass_mossy|gaia/flora_tree_oak", "temp_forestfloor_pine|gaia/flora_tree_pine", "temp_mud_plants|gaia/flora_tree_dead", "temp_plants_bog|gaia/flora_tree_oak_large", diff --git a/binaries/data/mods/public/maps/random/belgian_uplands.json b/binaries/data/mods/public/maps/random/belgian_uplands.json index 727a7e4379..dbf2434cf4 100644 --- a/binaries/data/mods/public/maps/random/belgian_uplands.json +++ b/binaries/data/mods/public/maps/random/belgian_uplands.json @@ -8,7 +8,6 @@ ], "CircularMap" : false, "BaseTerrain" : ["temp_grass", "temp_grass_b", "temp_grass_c", "temp_grass_d", "temp_grass_long_b", "temp_grass_clovers_2", "temp_grass_mossy", "temp_grass_plants"], - "BaseHeight" : 0, "Preview" : "belgian_uplands.png" } } diff --git a/binaries/data/mods/public/maps/random/botswanan_haven.js b/binaries/data/mods/public/maps/random/botswanan_haven.js index 4193a1dd90..e617107082 100644 --- a/binaries/data/mods/public/maps/random/botswanan_haven.js +++ b/binaries/data/mods/public/maps/random/botswanan_haven.js @@ -42,7 +42,13 @@ const aShrub = "actor|props/flora/shrub_tropic_plant_flower.xml"; const aFlower = "actor|props/flora/flower_bright.xml"; const aPalm = "actor|props/flora/shrub_fanpalm.xml"; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightMarsh = -2; +const heightOffsetBump = 1; +const heightLand = 3; +const heightHill = 15; +const heightOffsetBump = 2; + +InitMap(heightLand, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); @@ -87,7 +93,7 @@ Engine.SetProgress(15); log("Creating bumps..."); createAreas( new ClumpPlacer(scaleByMapSize(20, 50), 0.6, 0.1, 1), - new SmoothElevationPainter(ELEVATION_MODIFY, 2, 2), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetBump, 2), avoidClasses(clPlayer, 13), scaleByMapSize(300, 800)); @@ -96,7 +102,7 @@ createAreas( new ChainPlacer(1, Math.floor(scaleByMapSize(4, 6)), Math.floor(scaleByMapSize(16, 40)), 0.5), [ new LayeredPainter([tCliff, tHill], [2]), - new SmoothElevationPainter(ELEVATION_SET, 15, 2), + new SmoothElevationPainter(ELEVATION_SET, heightHill, 2), paintClass(clHill) ], avoidClasses(clPlayer, 20, clHill, 15, clWater, 0), @@ -108,7 +114,7 @@ for (let i = 0; i < 2; ++i) new ChainPlacer(1, Math.floor(scaleByMapSize(6, 12)), Math.floor(scaleByMapSize(15, 60)), 0.8), [ new LayeredPainter([tShoreBlend, tShore, tWater], [1, 1]), - new SmoothElevationPainter(ELEVATION_SET, -2, 3), + new SmoothElevationPainter(ELEVATION_SET, hMarsh, 3), paintClass(clWater) ], avoidClasses(clPlayer, 25, clWater, Math.round(scaleByMapSize(7, 16) * randFloat(0.8, 1.35))), @@ -132,7 +138,7 @@ Engine.SetProgress(40); log("Creating bumps..."); createAreas( new ClumpPlacer(scaleByMapSize(20, 50), 0.3, 0.06, 1), - new SmoothElevationPainter(ELEVATION_MODIFY, 1, 2), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetBump, 2), stayClasses(clWater, 2), scaleByMapSize(50, 100)); diff --git a/binaries/data/mods/public/maps/random/botswanan_haven.json b/binaries/data/mods/public/maps/random/botswanan_haven.json index 652c584737..b1c484e8fe 100644 --- a/binaries/data/mods/public/maps/random/botswanan_haven.json +++ b/binaries/data/mods/public/maps/random/botswanan_haven.json @@ -4,7 +4,6 @@ "Script" : "botswanan_haven.js", "Description" : "Botswanan Africa during the wet season, a land which was arid and inhospitable just weeks before has come to life totally transformed. Herds of zebras graze amid the tall, lush grasses in which lions lie waiting, while in the shallow pools lurk fearsome crocodiles.", "BaseTerrain" : ["savanna_grass_b_wetseason"], - "BaseHeight" : 3, "Keywords": [], "CircularMap" : true, "Preview" : "botswanan_haven.png" diff --git a/binaries/data/mods/public/maps/random/caledonian_meadows.js b/binaries/data/mods/public/maps/random/caledonian_meadows.js index 36ddfeb546..3906931829 100644 --- a/binaries/data/mods/public/maps/random/caledonian_meadows.js +++ b/binaries/data/mods/public/maps/random/caledonian_meadows.js @@ -2,7 +2,7 @@ Engine.LoadLibrary("rmgen"); Engine.LoadLibrary("rmbiome"); Engine.LoadLibrary("heightmap"); -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +InitMap(0, g_MapSettings.BaseTerrain); /** * Drags a path to a target height smoothing it at the edges and return some points along the path. @@ -226,9 +226,9 @@ let heightRange = { "min": MIN_HEIGHT * heightScale, "max": MAX_HEIGHT * heightS // Water coverage let averageWaterCoverage = 1/5; // NOTE: Since terrain generation is quite unpredictable actual water coverage might vary much with the same value -let waterHeight = -MIN_HEIGHT + heightRange.min + averageWaterCoverage * (heightRange.max - heightRange.min); // Water height in environment and the engine -let waterHeightAdjusted = waterHeight + MIN_HEIGHT; // Water height in RMGEN -setWaterHeight(waterHeight); +let heightSeaGround = -MIN_HEIGHT + heightRange.min + averageWaterCoverage * (heightRange.max - heightRange.min); // Water height in environment and the engine +let heightSeaGroundAdjusted = heightSeaGround + MIN_HEIGHT; // Water height in RMGEN +setWaterHeight(heightSeaGround); log("Generating terrain using diamon-square..."); let medH = (heightRange.min + heightRange.max) / 2; @@ -244,17 +244,17 @@ rescaleHeightmap(heightRange.min, heightRange.max); Engine.SetProgress(25); let heighLimits = [ - heightRange.min + 1/3 * (waterHeightAdjusted - heightRange.min), // 0 Deep water - heightRange.min + 2/3 * (waterHeightAdjusted - heightRange.min), // 1 Medium Water - heightRange.min + (waterHeightAdjusted - heightRange.min), // 2 Shallow water - waterHeightAdjusted + 1/8 * (heightRange.max - waterHeightAdjusted), // 3 Shore - waterHeightAdjusted + 2/8 * (heightRange.max - waterHeightAdjusted), // 4 Low ground - waterHeightAdjusted + 3/8 * (heightRange.max - waterHeightAdjusted), // 5 Player and path height - waterHeightAdjusted + 4/8 * (heightRange.max - waterHeightAdjusted), // 6 High ground - waterHeightAdjusted + 5/8 * (heightRange.max - waterHeightAdjusted), // 7 Lower forest border - waterHeightAdjusted + 6/8 * (heightRange.max - waterHeightAdjusted), // 8 Forest - waterHeightAdjusted + 7/8 * (heightRange.max - waterHeightAdjusted), // 9 Upper forest border - waterHeightAdjusted + (heightRange.max - waterHeightAdjusted)]; // 10 Hilltop + heightRange.min + 1/3 * (heightSeaGroundAdjusted - heightRange.min), // 0 Deep water + heightRange.min + 2/3 * (heightSeaGroundAdjusted - heightRange.min), // 1 Medium Water + heightRange.min + (heightSeaGroundAdjusted - heightRange.min), // 2 Shallow water + heightSeaGroundAdjusted + 1/8 * (heightRange.max - heightSeaGroundAdjusted), // 3 Shore + heightSeaGroundAdjusted + 2/8 * (heightRange.max - heightSeaGroundAdjusted), // 4 Low ground + heightSeaGroundAdjusted + 3/8 * (heightRange.max - heightSeaGroundAdjusted), // 5 Player and path height + heightSeaGroundAdjusted + 4/8 * (heightRange.max - heightSeaGroundAdjusted), // 6 High ground + heightSeaGroundAdjusted + 5/8 * (heightRange.max - heightSeaGroundAdjusted), // 7 Lower forest border + heightSeaGroundAdjusted + 6/8 * (heightRange.max - heightSeaGroundAdjusted), // 8 Forest + heightSeaGroundAdjusted + 7/8 * (heightRange.max - heightSeaGroundAdjusted), // 9 Upper forest border + heightSeaGroundAdjusted + (heightRange.max - heightSeaGroundAdjusted)]; // 10 Hilltop let playerHeight = (heighLimits[4] + heighLimits[5]) / 2; // Average player height diff --git a/binaries/data/mods/public/maps/random/caledonian_meadows.json b/binaries/data/mods/public/maps/random/caledonian_meadows.json index 2f4e625512..5a2d197d61 100644 --- a/binaries/data/mods/public/maps/random/caledonian_meadows.json +++ b/binaries/data/mods/public/maps/random/caledonian_meadows.json @@ -6,7 +6,6 @@ "Description" : "Fertile lands surrounded by harsh terrain.\nRemains of recent snowfalls still haunt the forests, and torrential rivers from the snowmelt have barely died away.\nAiming at a realistic terrain, this map might not always be balanced.", "CircularMap" : true, "BaseTerrain" : "whiteness", - "Keywords": [], - "BaseHeight" : 0 + "Keywords": [] } } diff --git a/binaries/data/mods/public/maps/random/cantabrian_highlands.js b/binaries/data/mods/public/maps/random/cantabrian_highlands.js index f4f388b4cc..cdf66fe9c4 100644 --- a/binaries/data/mods/public/maps/random/cantabrian_highlands.js +++ b/binaries/data/mods/public/maps/random/cantabrian_highlands.js @@ -41,7 +41,11 @@ const aBushSmall = "actor|props/flora/bush_medit_sm.xml"; const pForestD = [tGrassDForest + TERRAIN_SEPARATOR + oOak, tGrassDForest + TERRAIN_SEPARATOR + oOakLarge, tGrassDForest]; const pForestP = [tGrassPForest + TERRAIN_SEPARATOR + oPine, tGrassPForest + TERRAIN_SEPARATOR + oAleppoPine, tGrassPForest]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightSeaGround = -7; +const heightLand = 3; +const heightHill = 20; + +InitMap(heightLand, g_MapSettings.BaseTerrain); var numPlayers = getNumPlayers(); var mapSize = getMapSize(); @@ -57,7 +61,6 @@ var clFood = createTileClass(); var clBaseResource = createTileClass(); var playerHillRadius = defaultPlayerBaseRadius() / (isNomad() ? 1.5 : 1); -var playerHillElevation = 20; var [playerIDs, playerPosition, playerAngle] = playerPlacementCircle(fractionToTiles(0.35)); @@ -68,7 +71,7 @@ for (let i = 0; i < numPlayers; ++i) new ClumpPlacer(diskArea(playerHillRadius), 0.95, 0.6, 10, playerPosition[i].x, playerPosition[i].y), [ new LayeredPainter([tCliff, tHill], [2]), - new SmoothElevationPainter(ELEVATION_SET, playerHillElevation, 2), + new SmoothElevationPainter(ELEVATION_SET, heightHill, 2), paintClass(clPlayer) ]); @@ -121,7 +124,7 @@ var waterAreas = createAreas( new ClumpPlacer(scaleByMapSize(100, 250), 0.8, 0.1, 10), [ new LayeredPainter([tShoreBlend, tShore, tWater], [1, 1]), - new SmoothElevationPainter(ELEVATION_SET, -7, 6), + new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 6), paintClass(clWater) ], avoidClasses(clPlayer, 2, clWater, 20), diff --git a/binaries/data/mods/public/maps/random/cantabrian_highlands.json b/binaries/data/mods/public/maps/random/cantabrian_highlands.json index 14c8e5a427..6d71d999d7 100644 --- a/binaries/data/mods/public/maps/random/cantabrian_highlands.json +++ b/binaries/data/mods/public/maps/random/cantabrian_highlands.json @@ -4,8 +4,7 @@ "Script" : "cantabrian_highlands.js", "Description" : "Each player starts on a hill surrounded by steep cliffs. Represents Cantabria, a mountainous region in the North of the Iberian peninsula.", "BaseTerrain" : ["temp_grass_long"], - "BaseHeight" : 3, "Preview" : "cantabrian_highlands.png", "CircularMap" : true } -} \ No newline at end of file +} diff --git a/binaries/data/mods/public/maps/random/canyon.js b/binaries/data/mods/public/maps/random/canyon.js index a71eff6cb2..252db846c1 100644 --- a/binaries/data/mods/public/maps/random/canyon.js +++ b/binaries/data/mods/public/maps/random/canyon.js @@ -40,7 +40,10 @@ const aTree = g_Decoratives.tree; const pForest1 = [tForestFloor2 + TERRAIN_SEPARATOR + oTree1, tForestFloor2 + TERRAIN_SEPARATOR + oTree2, tForestFloor2]; const pForest2 = [tForestFloor1 + TERRAIN_SEPARATOR + oTree4, tForestFloor1 + TERRAIN_SEPARATOR + oTree5, tForestFloor1]; -InitMap(g_MapSettings.BaseHeight, tMainTerrain); +const heightLand = 3; +const heightHill = 30; + +InitMap(heightHill, tMainTerrain); var numPlayers = getNumPlayers(); var mapSize = getMapSize(); @@ -57,9 +60,6 @@ var clFood = createTileClass(); var clBaseResource = createTileClass(); var clLand = createTileClass(); -var landHeight = 3; -var hillHeight = 30; - var playerCanyonRadius = scaleByMapSize(18, 32); var [playerIDs, playerPosition] = playerPlacementCircle(fractionToTiles(0.35)); @@ -77,7 +77,7 @@ for (let i = 0; i < numPlayers; ++i) playerPosition[i].y), [ new LayeredPainter([tMainTerrain, tMainTerrain], [2]), - new SmoothElevationPainter(ELEVATION_SET, landHeight, 2), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 2), paintClass(j == 1 || isNomad() ? clLand : clPlayer) ]); @@ -86,7 +86,7 @@ createArea( new ClumpPlacer(diskArea(fractionToTiles(0.16)), 0.7, 0.1, 10, mapCenter.x, mapCenter.y), [ new LayeredPainter([tMainTerrain, tMainTerrain], [3]), - new SmoothElevationPainter(ELEVATION_SET, landHeight, 3), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 3), paintClass(clLand) ]); @@ -108,7 +108,7 @@ for (let i = 0; i < scaleByMapSize(9, 16); ++i) 0.1, 0), [ - new SmoothElevationPainter(ELEVATION_SET, hillHeight, 3), + new SmoothElevationPainter(ELEVATION_SET, heightHill, 3), paintClass(clHill2) ], avoidClasses(clPlayer, 6, clHill2, 3, clHill, 2)); @@ -122,7 +122,7 @@ for (let g = 0; g < scaleByMapSize(5, 30); ++g) new ClumpPlacer(diskArea(fractionToTiles(0.06)), 0.7, 0.1, 10, tx, tz), [ new LayeredPainter([tMainTerrain, tMainTerrain], [3]), - new SmoothElevationPainter(ELEVATION_SET, landHeight, 3), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 3), paintClass(clLand) ], avoidClasses(clLand, 6)); @@ -160,7 +160,7 @@ for (let g = 0; g < scaleByMapSize(5, 30); ++g) new PathPlacer(tx, tz, playerPosition[playerID].x, playerPosition[playerID].y, scaleByMapSize(11, 17), 0.4, scaleByMapSize(3, 12), 0.1, 0.1), [ new LayeredPainter([tMainTerrain, tMainTerrain], [3]), - new SmoothElevationPainter(ELEVATION_SET, landHeight, 3), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 3), paintClass(clLand) ]); } @@ -184,7 +184,7 @@ for (let i = 0; i < numPlayers; ++i) 0), [ new LayeredPainter([tRoadWild, tRoad], [1]), - new SmoothElevationPainter(ELEVATION_SET, landHeight, 2), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 2), paintClass(clLand), paintClass(clHill) ]); diff --git a/binaries/data/mods/public/maps/random/canyon.json b/binaries/data/mods/public/maps/random/canyon.json index c32b10f3ca..62ff66ccd7 100644 --- a/binaries/data/mods/public/maps/random/canyon.json +++ b/binaries/data/mods/public/maps/random/canyon.json @@ -4,7 +4,6 @@ "Script" : "canyon.js", "Description" : "Players start around the map in deep canyons.", "BaseTerrain" : ["medit_sea_depths"], - "BaseHeight" : 30, "Preview" : "canyon.png", "SupportedBiomes": true, "CircularMap" : true diff --git a/binaries/data/mods/public/maps/random/continent.js b/binaries/data/mods/public/maps/random/continent.js index 29367d1666..fb1469b5ff 100644 --- a/binaries/data/mods/public/maps/random/continent.js +++ b/binaries/data/mods/public/maps/random/continent.js @@ -40,7 +40,10 @@ const aBushSmall = g_Decoratives.bushSmall; const pForest1 = [tForestFloor2 + TERRAIN_SEPARATOR + oTree1, tForestFloor2 + TERRAIN_SEPARATOR + oTree2, tForestFloor2]; const pForest2 = [tForestFloor1 + TERRAIN_SEPARATOR + oTree4, tForestFloor1 + TERRAIN_SEPARATOR + oTree5, tForestFloor1]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightSeaGround = -5; +const heightLand = 3; + +InitMap(heightSeaGround, g_MapSettings.BaseTerrain); var numPlayers = getNumPlayers(); var mapSize = getMapSize(); @@ -68,7 +71,7 @@ createArea( 0, [Math.floor(fractionToTiles(0.33))]), [ - new SmoothElevationPainter(ELEVATION_SET, 3, 4), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 4), paintClass(clLand) ]); @@ -87,7 +90,7 @@ for (let i = 0; i < numPlayers; ++i) 0, [Math.floor(scaleByMapSize(23, 50))]), [ - new SmoothElevationPainter(ELEVATION_SET, 3, 4), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 4), paintClass(clLand) ]); diff --git a/binaries/data/mods/public/maps/random/continent.json b/binaries/data/mods/public/maps/random/continent.json index 0c5f9939c9..be7b8d468c 100644 --- a/binaries/data/mods/public/maps/random/continent.json +++ b/binaries/data/mods/public/maps/random/continent.json @@ -4,7 +4,6 @@ "Script" : "continent.js", "Description" : "All players starts on a continent surrounded by water.", "BaseTerrain" : ["medit_sea_depths"], - "BaseHeight" : -5, "Preview" : "continent.png", "SupportedBiomes": true, "CircularMap" : true diff --git a/binaries/data/mods/public/maps/random/corinthian_isthmus.js b/binaries/data/mods/public/maps/random/corinthian_isthmus.js index 53349a2187..c27798ccd4 100644 --- a/binaries/data/mods/public/maps/random/corinthian_isthmus.js +++ b/binaries/data/mods/public/maps/random/corinthian_isthmus.js @@ -41,7 +41,10 @@ const aDecorativeRock = "actor|geology/stone_granite_med.xml"; const pForest = [tForestFloor, tForestFloor + TERRAIN_SEPARATOR + oCarob, tForestFloor + TERRAIN_SEPARATOR + oDatePalm, tForestFloor + TERRAIN_SEPARATOR + oSDatePalm, tForestFloor]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +var heightSeaGround = -4; +var heightLand = 3; + +InitMap(heightLand, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -58,9 +61,6 @@ var clBaseResource = createTileClass(); var clGrass = createTileClass(); var clHill = createTileClass(); -var landHeight = getMapBaseHeight(); -var waterHeight = -4; - log("Creating the main river"); var riverAngle = randFloat(0, Math.PI); var riverWidth = scaleByMapSize(15, 70); @@ -69,13 +69,13 @@ var riverEnd = new Vector2D(mapCenter.x, mapSize).rotateAround(riverAngle, mapCe createArea( new PathPlacer(riverStart.x, riverStart.y, riverEnd.x, riverEnd.y, riverWidth, 0.2, 15 * scaleByMapSize(1, 3), 0.04, 0.01), - new SmoothElevationPainter(ELEVATION_SET, waterHeight, 4)); + new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 4)); log("Creating small puddles at the map border to ensure players being separated..."); for (let point of [riverStart, riverEnd]) createArea( new ClumpPlacer(Math.floor(diskArea(riverWidth / 2)), 0.95, 0.6, 10, point.x, point.y), - new SmoothElevationPainter(ELEVATION_SET, waterHeight, 4)); + new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 4)); log("Creating passage connecting the two riversides..."); var passageStart = riverStart.rotateAround(Math.PI / 2, mapCenter); @@ -91,7 +91,7 @@ createArea( 3 * scaleByMapSize(1, 4), 0.1, 0.01), - new SmoothElevationPainter(ELEVATION_SET, landHeight, 4)); + new SmoothElevationPainter(ELEVATION_SET, heightLand, 4)); paintTerrainBasedOnHeight(-6, 1, 1, tWater); paintTerrainBasedOnHeight(1, 2, 1, tShore); diff --git a/binaries/data/mods/public/maps/random/corinthian_isthmus.json b/binaries/data/mods/public/maps/random/corinthian_isthmus.json index 283b225519..e4d37ca043 100644 --- a/binaries/data/mods/public/maps/random/corinthian_isthmus.json +++ b/binaries/data/mods/public/maps/random/corinthian_isthmus.json @@ -4,7 +4,6 @@ "Script" : "corinthian_isthmus.js", "Description" : "Two Mediterranean land masses connected by a narrow spit of land, called an 'Isthmus'.", "BaseTerrain" : ["medit_grass_shrubs", "medit_rocks_grass_shrubs", "medit_rocks_shrubs", "medit_rocks_grass", "medit_shrubs"], - "BaseHeight" : 3, "CircularMap" : true, "Preview" : "corinthian_isthmus.png" } diff --git a/binaries/data/mods/public/maps/random/corsica.js b/binaries/data/mods/public/maps/random/corsica.js index 3ece849dc6..b4898c07fc 100644 --- a/binaries/data/mods/public/maps/random/corsica.js +++ b/binaries/data/mods/public/maps/random/corsica.js @@ -38,7 +38,18 @@ var aPlantC = "actor|props/flora/grass_soft_tuft_a.xml"; var aStandingStone = "actor|props/special/eyecandy/standing_stones.xml"; -InitMap(g_MapSettings.BaseHeight, tVeryDeepWater); +var heightSeaGround = -8; +var heightCreeks = -5; +var heightBeaches = -1; +var heightMain = 5; + +var heightOffsetMainRelief = 30; +var heightOffsetLevel1 = 9; +var heightOffsetLevel2 = 8; +var heightOffsetBumps = 2; +var heightOffsetAntiBumps = -5; + +InitMap(heightSeaGround, tVeryDeepWater); var numPlayers = getNumPlayers(); var mapSize = getMapSize(); @@ -70,15 +81,6 @@ var nbBeaches = scaleByMapSize(2, 5); var nbPassagesLevel1 = scaleByMapSize(4, 8); var nbPassagesLevel2 = scaleByMapSize(2, 4); -var heightMain = 5; -var heightCreeks = -5; -var heightBeaches = -1; -var heightOffsetMainRelief = 30; -var heightOffsetLevel1 = 9; -var heightOffsetLevel2 = 8; -var heightOffsetBumps = 2; -var heightOffsetAntiBumps = -5; - log("Creating Corsica and Sardinia..."); var swapAngle = randBool() ? Math.PI / 2 : 0; var islandLocations = [new Vector2D(0.05, 0.05), new Vector2D(0.95, 0.95)].map(v => v.mult(mapSize).rotateAround(-swapAngle, mapCenter)); diff --git a/binaries/data/mods/public/maps/random/corsica.json b/binaries/data/mods/public/maps/random/corsica.json index 45c0cc4c01..bd597fa1fe 100644 --- a/binaries/data/mods/public/maps/random/corsica.json +++ b/binaries/data/mods/public/maps/random/corsica.json @@ -4,9 +4,8 @@ "Script" : "corsica.js", "Description" : "The players start on two opposing islands, both with a very jagged relief that will make landing difficult.", "BaseTerrain" : ["medit_dirt", "medit_dirt_b", "medit_dirt_c"], - "BaseHeight" : -8, "Keywords": ["naval"], "Preview" : "corsica.png", "CircularMap" : false } -} \ No newline at end of file +} diff --git a/binaries/data/mods/public/maps/random/cycladic_archipelago.js b/binaries/data/mods/public/maps/random/cycladic_archipelago.js index 9aa92483c8..328fc107f8 100644 --- a/binaries/data/mods/public/maps/random/cycladic_archipelago.js +++ b/binaries/data/mods/public/maps/random/cycladic_archipelago.js @@ -42,7 +42,12 @@ const pPineForest = [tForestFloor+TERRAIN_SEPARATOR+oPine, tGrass]; const pPoplarForest = [tForestFloor+TERRAIN_SEPARATOR+oLombardyPoplar, tGrass]; const pMainForest = [tForestFloor+TERRAIN_SEPARATOR+oCarob, tForestFloor+TERRAIN_SEPARATOR+oBeech, tGrass, tGrass]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightSeaGround = -5; +const heightLand = 3; +const heightHill = 12; +const heightOffsetBump = 2; + +InitMap(heightSeaGround, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -98,7 +103,7 @@ function createCycladicArchipelagoIsland(position, tileClass, radius, coralRadiu new ClumpPlacer(diskArea(radius), 0.7, 0.1, 10, position.x, position.y), [ new LayeredPainter([tOceanCoral, tBeachWet, tBeachDry, tBeach, tBeachBlend, tGrass], [1, 3, 1, 1, 2]), - new SmoothElevationPainter(ELEVATION_SET, 3, 5), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 5), paintClass(tileClass) ], avoidClasses(clPlayer, 0))); @@ -155,7 +160,7 @@ Engine.SetProgress(20); log("Creating bumps..."); createAreasInAreas( new ClumpPlacer(scaleByMapSize(20, 60), 0.3, 0.06, 1), - new SmoothElevationPainter(ELEVATION_MODIFY, 2, 3), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetBump, 3), avoidClasses(clCity, 0), scaleByMapSize(25, 75),15, areas); @@ -167,7 +172,7 @@ createAreasInAreas( new ClumpPlacer(scaleByMapSize(20, 150), 0.2, 0.1, 1), [ new LayeredPainter([tCliff, tCliffShrubs], [2]), - new SmoothElevationPainter(ELEVATION_SET, 12, 2), + new SmoothElevationPainter(ELEVATION_SET, heightHill, 2), paintClass(clHill) ], avoidClasses(clCity, 15, clHill, 15), diff --git a/binaries/data/mods/public/maps/random/cycladic_archipelago.json b/binaries/data/mods/public/maps/random/cycladic_archipelago.json index bbaafa9271..5921517b07 100644 --- a/binaries/data/mods/public/maps/random/cycladic_archipelago.json +++ b/binaries/data/mods/public/maps/random/cycladic_archipelago.json @@ -4,7 +4,6 @@ "Script" : "cycladic_archipelago.js", "Description" : "Each player starts on an island surrounded by water.\n\nThe Cyclades is an island group in the Aegean Sea, south-east of the mainland of Greece. They are one of the island groups which constitute the Aegean archipelago. The name refers to the islands around the sacred island of Delos. The Cyclades comprise about 220 islands. The islands are peaks of a submerged mountainous terrain, with the exception of two volcanic islands, Milos and Santorini. The climate is generally dry and mild, but with the exception of Naxos the soil is not very fertile.", "BaseTerrain" : ["medit_sea_depths"], - "BaseHeight" : -5, "Keywords": ["naval"], "Preview" : "cycladic_archipelago.png", "CircularMap" : true diff --git a/binaries/data/mods/public/maps/random/danubius.js b/binaries/data/mods/public/maps/random/danubius.js index d2c5b416c7..06c7beb568 100644 --- a/binaries/data/mods/public/maps/random/danubius.js +++ b/binaries/data/mods/public/maps/random/danubius.js @@ -117,7 +117,13 @@ const normalMapSize = 320; // Minimum distance from the map border to ship ungarrison points const ShorelineDistance = 15; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightSeaGround = -3; +const heightShore = 1; +const heightLand = 3; +const heightPath = 5; +const heightIsland = 6; + +InitMap(heightLand, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -151,9 +157,6 @@ var clPath = createTileClass(); var clRitualPlace = createTileClass(); var waterWidth = fractionToTiles(0.3); -var waterHeight = -3; -var shoreHeight = 1; -var landHeight = 2; // How many treasures will be placed near the gallic civic centers var gallicCCTreasureCount = randIntInclusive(8, 12); @@ -204,7 +207,7 @@ if (gallicCC) placer, [ new LayeredPainter([tShore, tRoad, tRoad], [1, 3]), - new SmoothElevationPainter(ELEVATION_SET, 5, 4), + new SmoothElevationPainter(ELEVATION_SET, heightPath, 4), paintClass(clPath) ]); @@ -359,8 +362,8 @@ paintRiver({ "width": waterWidth, "fadeDist": scaleByMapSize(6, 25), "deviation": 0, - "waterHeight": waterHeight, - "landHeight": landHeight, + "heightRiverbed": heightSeaGround, + "heightLand": heightLand, "meanderShort": 30, "meanderLong": 0, "waterFunc": (ix, iz, height, riverFraction) => { @@ -382,8 +385,8 @@ Engine.SetProgress(30); paintTileClassBasedOnHeight(-Infinity, 0.7, Elevation_ExcludeMin_ExcludeMax, clWater); log("Creating shores..."); -paintTerrainBasedOnHeight(-Infinity, shoreHeight, 0, tWater); -paintTerrainBasedOnHeight(shoreHeight, landHeight, 0, tShore); +paintTerrainBasedOnHeight(-Infinity, heightShore, 0, tWater); +paintTerrainBasedOnHeight(heightShore, heightLand, 0, tShore); Engine.SetProgress(35); log("Creating bumps..."); @@ -429,7 +432,7 @@ createAreas( new ChainPlacer(Math.floor(scaleByMapSize(3, 4)), Math.floor(scaleByMapSize(4, 8)), Math.floor(scaleByMapSize(50, 80)), 0.5), [ new LayeredPainter([tWater, tShore, tIsland], [2, 1]), - new SmoothElevationPainter(ELEVATION_SET, 6, 4), + new SmoothElevationPainter(ELEVATION_SET, heightIsland, 4), paintClass(clIsland) ], [avoidClasses(clIsland, 30), stayClasses (clWater, 10)], diff --git a/binaries/data/mods/public/maps/random/danubius.json b/binaries/data/mods/public/maps/random/danubius.json index 2d0baf7e01..57e027131c 100644 --- a/binaries/data/mods/public/maps/random/danubius.json +++ b/binaries/data/mods/public/maps/random/danubius.json @@ -4,7 +4,6 @@ "Script" : "danubius.js", "Description" : "Players start along the banks of the river Danube in the period following the expansion into Pannonia by the Celtic Boii tribe. Seeking to consolidate their hold on this land, celtic reinforcements have been sent to root out the remaining foreign cultures. Players not only have to vie for power amongst themselves, but also beat back these ruthless invaders. Ultimately, the Boii were defeated by the rising power of the Dacians, hence leading to the reemergence of the Geto-Dacian Confederation under King Burebista.", "BaseTerrain" : ["temp_grass_aut", "temp_grass_plants_aut", "temp_grass_c_aut", "temp_grass_d_aut"], - "BaseHeight" : 4, "Keywords": ["trigger"], "CircularMap" : true, "Preview" : "danubius.png", diff --git a/binaries/data/mods/public/maps/random/deep_forest.js b/binaries/data/mods/public/maps/random/deep_forest.js index 2f17fdee2c..5bf084f055 100644 --- a/binaries/data/mods/public/maps/random/deep_forest.js +++ b/binaries/data/mods/public/maps/random/deep_forest.js @@ -1,13 +1,5 @@ Engine.LoadLibrary("rmgen"); -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); - -var clPlayer = createTileClass(); -var clPath = createTileClass(); -var clHill = createTileClass(); -var clForest = createTileClass(); -var clBaseResource = createTileClass(); - var templateStone = "gaia/geology_stone_temperate"; var templateStoneMine = "gaia/geology_stonemine_temperate_quarry"; var templateMetalMine = "gaia/geology_metal_temperate_slabs"; @@ -34,11 +26,23 @@ var terrainHillBorder = ["temp_highlands", "temp_highlands", "temp_highlands", " "temp_highlands", "temp_highlands", "temp_highlands", "temp_cliff_b", "temp_dirt_gravel_plants", "temp_highlands|gaia/fauna_goat"]; +var heightPath = -2; +var heightLand = 0; +var heightOffsetRandomPath = 1; + +InitMap(heightLand, g_MapSettings.BaseTerrain); + var mapSize = getMapSize(); var mapArea = getMapArea(); var mapRadius = mapSize/2; var mapCenter = getMapCenter(); +var clPlayer = createTileClass(); +var clPath = createTileClass(); +var clHill = createTileClass(); +var clForest = createTileClass(); +var clBaseResource = createTileClass(); + var numPlayers = getNumPlayers(); var baseRadius = 20; var minPlayerRadius = Math.min(mapRadius - 1.5 * baseRadius, 5/8 * mapRadius); @@ -113,7 +117,7 @@ for (let i = 0; i < numPlayers + (pathBlending ? 1 : 0); ++i) new RandomPathPlacer(pathStart, pathEnd, 1.25, baseRadius / 2, pathBlending), [ new TerrainPainter(terrainPath), - new SmoothElevationPainter(ELEVATION_SET, -2, 2, 1), + new SmoothElevationPainter(ELEVATION_SET, heightPath, 2, heightOffsetRandomPath), paintClass(clPath) ], avoidClasses(clHill, 0, clBaseResource, 4)); diff --git a/binaries/data/mods/public/maps/random/deep_forest.json b/binaries/data/mods/public/maps/random/deep_forest.json index 83ed9b58d5..52b8bfb3a6 100644 --- a/binaries/data/mods/public/maps/random/deep_forest.json +++ b/binaries/data/mods/public/maps/random/deep_forest.json @@ -4,7 +4,6 @@ "Script" : "deep_forest.js", "Description" : "A deep dark forest in Germania.", "BaseTerrain" : ["temp_grass", "temp_grass_b", "temp_grass_c", "temp_grass_d", "temp_grass_long_b", "temp_grass_clovers_2", "temp_grass_mossy", "temp_grass_plants"], - "BaseHeight" : 0, "Preview" : "deep_forest.png", "CircularMap" : true } diff --git a/binaries/data/mods/public/maps/random/empire.js b/binaries/data/mods/public/maps/random/empire.js index fa1e09bba3..77cb374d70 100644 --- a/binaries/data/mods/public/maps/random/empire.js +++ b/binaries/data/mods/public/maps/random/empire.js @@ -4,7 +4,7 @@ Engine.LoadLibrary("rmbiome"); setSelectedBiome(); -InitMap(g_MapSettings.BaseHeight, g_Terrains.mainTerrain); +InitMap(2, g_Terrains.mainTerrain); initTileClasses(); diff --git a/binaries/data/mods/public/maps/random/empire.json b/binaries/data/mods/public/maps/random/empire.json index a3d3b1d3d8..8307c89a8a 100644 --- a/binaries/data/mods/public/maps/random/empire.json +++ b/binaries/data/mods/public/maps/random/empire.json @@ -4,7 +4,6 @@ "Script" : "empire.js", "Description" : "A neighboring province has pledged alegiance to your rule. It's up to you to command them to victory.", "BaseTerrain" : ["medit_sea_depths"], - "BaseHeight" : 2, "Keywords": [], "Preview" : "empire.png", "SupportedBiomes": true, diff --git a/binaries/data/mods/public/maps/random/english_channel.js b/binaries/data/mods/public/maps/random/english_channel.js index 6ac313707d..ebabf88901 100644 --- a/binaries/data/mods/public/maps/random/english_channel.js +++ b/binaries/data/mods/public/maps/random/english_channel.js @@ -38,7 +38,11 @@ const aLillies = "actor|props/flora/water_lillies.xml"; const pForestD = [tGrassDForest + TERRAIN_SEPARATOR + oBeech, tGrassDForest]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +var heightSeaGround = -4; +var heightShore = 1; +var heightLand = 3; + +InitMap(heightShore, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); const mapCenter = getMapCenter(); @@ -55,9 +59,6 @@ var clFood = createTileClass(); var clBaseResource = createTileClass(); var clShallow = createTileClass(); -var landHeight = 3; -var waterHeight = -4; - placePlayerBases({ "PlayerPlacement": playerPlacementRiver(Math.PI / 2, fractionToTiles(0.6)), "PlayerTileClass": clPlayer, @@ -94,15 +95,15 @@ paintRiver({ "width": fractionToTiles(0.25), "fadeDist": scaleByMapSize(3, 10), "deviation": 0, - "waterHeight": waterHeight, - "landHeight": landHeight, + "heightRiverbed": heightSeaGround, + "heightLand": heightLand, "meanderShort": 20, "meanderLong": 0, "waterFunc": (ix, iz, height, riverFraction) => { createTerrain(height < -1.5 ? tWater : tShore).place(ix, iz); }, "landFunc": (ix, iz, shoreDist1, shoreDist2) => { - setHeight(ix, iz, landHeight + 0.1); + setHeight(ix, iz, heightLand + 0.1); } }); @@ -112,7 +113,7 @@ createTributaryRivers( true, randIntInclusive(9, scaleByMapSize(13, 21)), scaleByMapSize(10, 20), - waterHeight, + heightSeaGround, [-6, -1.5], Math.PI / 5, clWater, @@ -120,7 +121,7 @@ createTributaryRivers( avoidClasses(clPlayer, 8, clBaseResource, 4)); paintTerrainBasedOnHeight(-5, 1, 1, tWater); -paintTerrainBasedOnHeight(1, landHeight, 1, tShore); +paintTerrainBasedOnHeight(1, heightLand, 1, tShore); paintTileClassBasedOnHeight(-6, 0.5, 1, clWater); Engine.SetProgress(25); diff --git a/binaries/data/mods/public/maps/random/english_channel.json b/binaries/data/mods/public/maps/random/english_channel.json index ea903298f6..43e1e4e5bd 100644 --- a/binaries/data/mods/public/maps/random/english_channel.json +++ b/binaries/data/mods/public/maps/random/english_channel.json @@ -4,9 +4,8 @@ "Script" : "english_channel.js", "Description" : "Players start in either northern France or southern Britain while the English channel separates them.", "BaseTerrain" : ["temp_grass_long"], - "BaseHeight" : 1, "Keywords": ["naval"], "Preview" : "english_channel.png", "CircularMap" : true } -} \ No newline at end of file +} diff --git a/binaries/data/mods/public/maps/random/extinct_volcano.js b/binaries/data/mods/public/maps/random/extinct_volcano.js index 296002d6d3..195c8b21f6 100644 --- a/binaries/data/mods/public/maps/random/extinct_volcano.js +++ b/binaries/data/mods/public/maps/random/extinct_volcano.js @@ -50,7 +50,12 @@ const pForestP = [ tForestFloor1 ]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +var heightSeaGround = -4; +var heightLand = 1; +var heightHill = 18; +var heightPlayerHill = 25; + +InitMap(heightLand, g_MapSettings.BaseTerrain); var numPlayers = getNumPlayers(); var mapCenter = getMapCenter(); @@ -69,8 +74,7 @@ var clBumps = createTileClass(); var clTower = createTileClass(); var clRain = createTileClass(); -var ccMountainHeight = 25; -var ccMountainSize = defaultPlayerBaseRadius(); +var playerMountainSize = defaultPlayerBaseRadius(); var [playerIDs, playerPosition] = playerPlacementCircle(fractionToTiles(0.35)); @@ -80,9 +84,9 @@ if (!isNomad()) { // This one consists of many bumps, creating an omnidirectional ramp createMountain( - ccMountainHeight, - ccMountainSize, - ccMountainSize, + heightPlayerHill, + playerMountainSize, + playerMountainSize, Math.floor(scaleByMapSize(4, 10)), undefined, playerPosition[i].x, @@ -93,10 +97,10 @@ if (!isNomad()) // Flatten the initial CC area createArea( - new ClumpPlacer(diskArea(ccMountainSize), 0.95, 0.6, 10, playerPosition[i].x,playerPosition[i].y), + new ClumpPlacer(diskArea(playerMountainSize), 0.95, 0.6, 10, playerPosition[i].x,playerPosition[i].y), [ - new LayeredPainter([tHillVeryDark, tHillMedium1], [ccMountainSize]), - new SmoothElevationPainter(ELEVATION_SET, ccMountainHeight, ccMountainSize), + new LayeredPainter([tHillVeryDark, tHillMedium1], [playerMountainSize]), + new SmoothElevationPainter(ELEVATION_SET, heightPlayerHill, playerMountainSize), paintClass(clPlayer) ]); } @@ -138,7 +142,7 @@ createAreas( new ChainPlacer(5, 6, Math.floor(scaleByMapSize(10, 14)), 0.1), [ new LayeredPainter([tShoreBlend, tShore, tWater], [1, 1]), - new SmoothElevationPainter(ELEVATION_SET, -4, 3), + new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 3), paintClass(clWater) ], avoidClasses(clPlayer, 0, clHill, 2, clWater, 12), @@ -154,7 +158,7 @@ createAreas( new ClumpPlacer(scaleByMapSize(20, 150), 0.2, 0.1, 1), [ new LayeredPainter([tHillDark, tHillDark, tHillDark], [2, 2]), - new SmoothElevationPainter(ELEVATION_SET, 18, 2), + new SmoothElevationPainter(ELEVATION_SET, heightHill, 2), paintClass(clHill) ], avoidClasses(clPlayer, 0, clHill, 15, clWater, 2, clBaseResource, 2), diff --git a/binaries/data/mods/public/maps/random/extinct_volcano.json b/binaries/data/mods/public/maps/random/extinct_volcano.json index ee6ea0bf6c..04d8e7b6de 100644 --- a/binaries/data/mods/public/maps/random/extinct_volcano.json +++ b/binaries/data/mods/public/maps/random/extinct_volcano.json @@ -7,7 +7,6 @@ "structures/ptol_lighthouse" ], "BaseTerrain" : "ocean_rock_a", - "BaseHeight" : 1, "Keywords": ["trigger"], "CircularMap" : true, "Preview" : "extinctvolcano.png", diff --git a/binaries/data/mods/public/maps/random/flood.js b/binaries/data/mods/public/maps/random/flood.js index 55ea0084e0..51d01922a8 100644 --- a/binaries/data/mods/public/maps/random/flood.js +++ b/binaries/data/mods/public/maps/random/flood.js @@ -46,7 +46,11 @@ const aBushSmall = g_Decoratives.bushSmall; const pForest1 = [tForestFloor2 + TERRAIN_SEPARATOR + oTree1, tForestFloor2 + TERRAIN_SEPARATOR + oTree2, tForestFloor2]; const pForest2 = [tForestFloor1 + TERRAIN_SEPARATOR + oTree4, tForestFloor1 + TERRAIN_SEPARATOR + oTree5, tForestFloor1]; -InitMap(g_MapSettings.BaseHeight, tWater); +const heightSeaGround = -2; +const heightLand = 2; +const shoreRadius = 6; + +InitMap(heightSeaGround, tWater); const clPlayer = createTileClass(); const clHill = createTileClass(); @@ -62,16 +66,12 @@ const numPlayers = getNumPlayers(); const mapSize = getMapSize(); const mapCenter = getMapCenter(); -const landHeight = 2; -const waterHeight = getMapBaseHeight(); -const shoreRadius = 6; - log("Creating the water..."); createArea( new ClumpPlacer(getMapArea(), 1, 1, 1, mapCenter.x, mapCenter.y), [ new LayeredPainter([tWater, tWater, tShore], [1, 4]), - new SmoothElevationPainter(ELEVATION_SET, waterHeight, 2) + new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 2) ], avoidClasses(clPlayer, 5)); @@ -89,7 +89,7 @@ for (let i = 0; i < numPlayers; ++i) playerPosition[i].y), [ new LayeredPainter([tShore, tMainTerrain], [shoreRadius]), - new SmoothElevationPainter(ELEVATION_SET, landHeight, shoreRadius), + new SmoothElevationPainter(ELEVATION_SET, heightLand, shoreRadius), paintClass(clHill) ]); @@ -138,7 +138,7 @@ createArea( [Math.floor(mapSize * 0.01)]), [ new LayeredPainter([tShore, tMainTerrain], [shoreRadius, 100]), - new SmoothElevationPainter(ELEVATION_SET, landHeight, shoreRadius), + new SmoothElevationPainter(ELEVATION_SET, heightLand, shoreRadius), paintClass(clHill) ], avoidClasses(clPlayer, 40)); @@ -242,8 +242,8 @@ for (let size of [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8, numb * scaleByMapSize(15, 45)); log("Painting shorelines..."); -paintTerrainBasedOnHeight(1, landHeight, 0, tMainTerrain); -paintTerrainBasedOnHeight(waterHeight, 1, 3, tTier1Terrain); +paintTerrainBasedOnHeight(1, heightLand, 0, tMainTerrain); +paintTerrainBasedOnHeight(heightSeaGround, 1, 3, tTier1Terrain); log("Creating grass patches..."); for (let size of [scaleByMapSize(2, 4), scaleByMapSize(3, 7), scaleByMapSize(5, 15)]) diff --git a/binaries/data/mods/public/maps/random/flood.json b/binaries/data/mods/public/maps/random/flood.json index 44643bde26..08d7847e06 100644 --- a/binaries/data/mods/public/maps/random/flood.json +++ b/binaries/data/mods/public/maps/random/flood.json @@ -4,7 +4,6 @@ "Script" : "flood.js", "Description" : "A great flood has moved across the valley enabling ships and troops to battle in chest deep waters.", "BaseTerrain" : ["medit_sand_wet"], - "BaseHeight" : -2, "SupportedBiomes": [ "temperate", "snowy", diff --git a/binaries/data/mods/public/maps/random/fortress.js b/binaries/data/mods/public/maps/random/fortress.js index 567b8f55ca..ad9de8ff19 100644 --- a/binaries/data/mods/public/maps/random/fortress.js +++ b/binaries/data/mods/public/maps/random/fortress.js @@ -40,7 +40,10 @@ const pForestD = [tForestFloor + TERRAIN_SEPARATOR + oBeech, tForestFloor]; const pForestO = [tForestFloor + TERRAIN_SEPARATOR + oOak, tForestFloor]; const pForestP = [tForestFloor + TERRAIN_SEPARATOR + oPine, tForestFloor]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +var heightSeaGround = -4; +var heightLand = 3; + +InitMap(heightLand, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -137,7 +140,7 @@ var waterAreas = createAreas( new ClumpPlacer(scaleByMapSize(100,250), 0.8, 0.1, 10), [ new LayeredPainter([tShore, tWater, tWater], [1, 1]), - new SmoothElevationPainter(ELEVATION_SET, -4, 3), + new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 3), paintClass(clWater) ], avoidClasses(clPlayer, 7, clWater, 20), diff --git a/binaries/data/mods/public/maps/random/fortress.json b/binaries/data/mods/public/maps/random/fortress.json index 184b4beea7..43e10be319 100644 --- a/binaries/data/mods/public/maps/random/fortress.json +++ b/binaries/data/mods/public/maps/random/fortress.json @@ -4,8 +4,7 @@ "Script" : "fortress.js", "Description" : "Players start in a ready-made fortress with piles of resources.", "BaseTerrain" : ["temp_grass_aut", "temp_grass_aut", "temp_grass_d_aut"], - "BaseHeight" : 3, "CircularMap" : true, "Preview" : "fortress.png" } -} \ No newline at end of file +} diff --git a/binaries/data/mods/public/maps/random/frontier.json b/binaries/data/mods/public/maps/random/frontier.json index bb14542f28..b51cb30f08 100644 --- a/binaries/data/mods/public/maps/random/frontier.json +++ b/binaries/data/mods/public/maps/random/frontier.json @@ -5,7 +5,6 @@ "Description" : "A wild, unknown landscape awaits rival explorers.", "BaseTerrain" : ["medit_sea_depths"], "Preview" : "frontier.png", - "BaseHeight" : 2, "SupportedBiomes": true, "CircularMap" : true } diff --git a/binaries/data/mods/public/maps/random/gear.js b/binaries/data/mods/public/maps/random/gear.js index 0502b63585..06d789d145 100644 --- a/binaries/data/mods/public/maps/random/gear.js +++ b/binaries/data/mods/public/maps/random/gear.js @@ -42,7 +42,13 @@ const aBushSmall = g_Decoratives.bushSmall; const pForest1 = [tForestFloor2 + TERRAIN_SEPARATOR + oTree1, tForestFloor2 + TERRAIN_SEPARATOR + oTree2, tForestFloor2]; const pForest2 = [tForestFloor1 + TERRAIN_SEPARATOR + oTree4, tForestFloor1 + TERRAIN_SEPARATOR + oTree5, tForestFloor1]; -InitMap(g_MapSettings.BaseHeight, tMainTerrain); +var heightSeaGround = -4; +var heightShallow = -2; +var heightLand = 3; +var heighRing = 4; +var heightHill = 20; + +InitMap(heightLand, tMainTerrain); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -105,7 +111,7 @@ else if (mapSize == 448) log("Creating big circular lake..."); createArea( new ClumpPlacer(mapArea * 0.23, 1, 1, 10, mapCenter.x, mapCenter.y), - new SmoothElevationPainter(ELEVATION_SET, -3, 4)); + new SmoothElevationPainter(ELEVATION_SET, heightShallow, 4)); for (let m = 0; m < numPlayers * split; ++m) { @@ -115,7 +121,7 @@ for (let m = 0; m < numPlayers * split; ++m) let position2 = Vector2D.add(mapCenter, new Vector2D(fractionToTiles(0.6), 0).rotate(-angle)); createArea( new PathPlacer(position1.x, position1.y, position2.x, position2.y, scaleByMapSize(14, 40), 0, scaleByMapSize(3, 9), 0.2, 0.05), - new SmoothElevationPainter(ELEVATION_SET, -4, 4), + new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 4), avoidClasses(clPlayer, 5)); log("Create path from the island to the center..."); @@ -124,28 +130,28 @@ for (let m = 0; m < numPlayers * split; ++m) position2 = Vector2D.add(mapCenter, new Vector2D(fractionToTiles(0.49), 0).rotate(-angle)); createArea( new PathPlacer(position1.x, position1.y, position2.x, position2.y, scaleByMapSize(10, 40), 0, scaleByMapSize(3, 9), 0.2, 0.05), - new SmoothElevationPainter(ELEVATION_SET, 3, 4)); + new SmoothElevationPainter(ELEVATION_SET, heightLand, 4)); } log("Creating ring of land connecting players..."); createArea( new ClumpPlacer(mapArea * 0.15, 1, 1, 10, mapCenter.x, mapCenter.y), - new SmoothElevationPainter(ELEVATION_SET, 4, 4)); + new SmoothElevationPainter(ELEVATION_SET, heighRing, 4)); log("Creating ring of water separating the central hill from the ring..."); createArea( new ClumpPlacer(mapArea * 0.09, 1, 1, 10, mapCenter.x, mapCenter.y), - new SmoothElevationPainter(ELEVATION_SET, -2, 3)); + new SmoothElevationPainter(ELEVATION_SET, heightShallow, 3)); log("Creating central island..."); createArea( new ClumpPlacer(Math.square(mapSize - 50) * 0.09, 1, 1, 10, mapCenter.x, mapCenter.y), - new SmoothElevationPainter(ELEVATION_SET, 4, 3)); + new SmoothElevationPainter(ELEVATION_SET, heighRing, 3)); log("Creating hill on the central island..."); createArea( new ClumpPlacer(diskArea(scaleByMapSize(6, 18)) * 7, 1, 1, 10, mapCenter.x, mapCenter.y), - new SmoothElevationPainter(ELEVATION_SET, 20, 8)); + new SmoothElevationPainter(ELEVATION_SET, heightHill, 8)); paintTerrainBasedOnHeight(-6, 1, 1, tWater); paintTerrainBasedOnHeight(1, 2, 1, tShore); diff --git a/binaries/data/mods/public/maps/random/gear.json b/binaries/data/mods/public/maps/random/gear.json index 9fb68d38c2..b304f6cc57 100644 --- a/binaries/data/mods/public/maps/random/gear.json +++ b/binaries/data/mods/public/maps/random/gear.json @@ -4,7 +4,6 @@ "Script" : "gear.js", "Description" : "A land with waterways decorated in a manner similar to spider web.", "BaseTerrain" : ["medit_sea_depths"], - "BaseHeight" : 4, "CircularMap" : true, "SupportedBiomes": true, "Preview" : "gear.png" diff --git a/binaries/data/mods/public/maps/random/guadalquivir_river.js b/binaries/data/mods/public/maps/random/guadalquivir_river.js index 2d1811797f..fe5220e005 100644 --- a/binaries/data/mods/public/maps/random/guadalquivir_river.js +++ b/binaries/data/mods/public/maps/random/guadalquivir_river.js @@ -35,7 +35,12 @@ const aBushSmall = "actor|props/flora/bush_medit_sm.xml"; const pForestP = [tForestFloorP + TERRAIN_SEPARATOR + oPoplar, tForestFloorP]; const pForestC = [tForestFloorC + TERRAIN_SEPARATOR + oCarob, tForestFloorC]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +var heightSeaGround = -3; +var heightShallow = -1.5; +var heightShore = 2; +var heightLand = 3; + +InitMap(heightSeaGround, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -53,11 +58,6 @@ var clLand = createTileClass(); var clRiver = createTileClass(); var clShallow = createTileClass(); -var landHeight = 3; -var shoreHeight = 2; -var shallowHeight = -1.5; -var waterHeight = -3; - log("Create the continent body"); var continentCenter = new Vector2D(fractionToTiles(0.5), fractionToTiles(0.7)).round(); createArea( @@ -72,7 +72,7 @@ createArea( [Math.floor(fractionToTiles(0.49))]), [ new LayeredPainter([tGrass, tGrass, tGrass], [4, 2]), - new SmoothElevationPainter(ELEVATION_SET, landHeight, 4), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 4), paintClass(clLand) ]); @@ -117,20 +117,20 @@ paintRiver({ "width": fractionToTiles(0.07), "fadeDist": scaleByMapSize(3, 12), "deviation": 1, - "waterHeight": waterHeight, - "landHeight": shoreHeight, + "heightRiverbed": heightSeaGround, + "heightLand": heightShore, "meanderShort": 12, "meanderLong": 0, "waterFunc": (ix, iz, height, z) => { addToClass(ix, iz, clRiver); createTerrain(tWater).place(ix, iz); - if (height < shallowHeight && ( + if (height < heightShallow && ( z > 0.3 && z < 0.4 || z > 0.5 && z < 0.6 || z > 0.7 && z < 0.8)) { - setHeight(ix, iz, shallowHeight); + setHeight(ix, iz, heightShallow); addToClass(ix, iz, clShallow); } } diff --git a/binaries/data/mods/public/maps/random/guadalquivir_river.json b/binaries/data/mods/public/maps/random/guadalquivir_river.json index eefce2b008..826643f742 100644 --- a/binaries/data/mods/public/maps/random/guadalquivir_river.json +++ b/binaries/data/mods/public/maps/random/guadalquivir_river.json @@ -4,7 +4,6 @@ "Script" : "guadalquivir_river.js", "Description" : "Players start in the shores of the Mediterranean Sea with a river flowing between them.\n\nThe Guadalquivir is the fifth longest river in the Iberian peninsula and the second longest river with its entire length in Spain. The Guadalquivir river is the only great navigable river in Spain. Currently it is navigable to Seville, but in Roman times it was navigable to Cordoba. The ancient city of Tartessos was said to have been located at the mouth of the Guadalquivir, although its site has not yet been found.", "BaseTerrain" : ["medit_sand_wet"], - "BaseHeight" : -5, "Preview" : "guadalquivir_river.png", "CircularMap" : true } diff --git a/binaries/data/mods/public/maps/random/gulf_of_bothnia.js b/binaries/data/mods/public/maps/random/gulf_of_bothnia.js index 270abb1385..e0116f67e1 100644 --- a/binaries/data/mods/public/maps/random/gulf_of_bothnia.js +++ b/binaries/data/mods/public/maps/random/gulf_of_bothnia.js @@ -7,8 +7,9 @@ var biome = pickRandom(["late_spring", "winter", "frozen_lake"]); if (biome == "late_spring") { log("Late spring biome..."); - var waterHeight = -3; - var shoreHeight = 1; + var heightSeaGround = -3; + var heightShore = 1; + var heightLand = 3; var fishCount = { "min": 20, "max": 80 }; var bushCount = { "min": 13, "max": 200 }; @@ -51,8 +52,9 @@ if (biome == "late_spring") else if (biome == "winter") { log("Winter biome..."); - var waterHeight = -3; - var shoreHeight = 1; + var heightSeaGround = -3; + var heightShore = 1; + var heightLand = 3; var fishCount = { "min": 20, "max": 80 }; var bushCount = { "min": 13, "max": 200 }; @@ -92,8 +94,9 @@ else if (biome == "winter") else if (biome == "frozen_lake") { log("Frozen lake biome..."); - var waterHeight = 0; - var shoreHeight = 2; + var heightSeaGround = 0; + var heightShore = 2; + var heightLand = 3; var fishCount = { "min": 0, "max": 0 }; var bushCount = { "min": 0, "max": 0 }; @@ -133,7 +136,7 @@ else if (biome == "frozen_lake") const pForest = [tForestFloor + TERRAIN_SEPARATOR + oPine, tForestFloor]; -InitMap(g_MapSettings.BaseHeight, tPrimary); +InitMap(heightLand, tPrimary); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -203,13 +206,13 @@ for (let position of gulfLakePositions) [Math.floor(position.radius)]), [ new LayeredPainter([tPrimary, tPrimary, tPrimary, tPrimary], [1, 4, 2]), - new SmoothElevationPainter(ELEVATION_SET, waterHeight, 4), + new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 4), paintClass(clWater) ], avoidClasses(clPlayer,scaleByMapSize(20, 28))); -paintTerrainBasedOnHeight(shoreHeight, getMapBaseHeight(), Elevation_ExcludeMin_ExcludeMax, tShore); -paintTerrainBasedOnHeight(-Infinity, shoreHeight, Elevation_ExcludeMin_IncludeMax, tWater); +paintTerrainBasedOnHeight(heightShore, heightLand, Elevation_ExcludeMin_ExcludeMax, tShore); +paintTerrainBasedOnHeight(-Infinity, heightShore, Elevation_ExcludeMin_IncludeMax, tWater); createBumps(avoidClasses(clWater, 2, clPlayer, 10)); diff --git a/binaries/data/mods/public/maps/random/gulf_of_bothnia.json b/binaries/data/mods/public/maps/random/gulf_of_bothnia.json index ad7e579997..b05d4abee4 100644 --- a/binaries/data/mods/public/maps/random/gulf_of_bothnia.json +++ b/binaries/data/mods/public/maps/random/gulf_of_bothnia.json @@ -4,8 +4,7 @@ "Script" : "gulf_of_bothnia.js", "Description" : "Players start around a gulf dotted with small islands.\n\nThe Gulf of Bothnia is the northernmost arm of the Baltic Sea.", "BaseTerrain" : ["alpine_dirt_grass_50"], - "BaseHeight" : 3, "Preview" : "gulf_of_bothnia.png", "CircularMap" : true } -} \ No newline at end of file +} diff --git a/binaries/data/mods/public/maps/random/harbor.js b/binaries/data/mods/public/maps/random/harbor.js index 2b67449639..e35530a31a 100644 --- a/binaries/data/mods/public/maps/random/harbor.js +++ b/binaries/data/mods/public/maps/random/harbor.js @@ -4,7 +4,11 @@ Engine.LoadLibrary("rmbiome"); setSelectedBiome(); -InitMap(g_MapSettings.BaseHeight, g_Terrains.mainTerrain); +var heightSeaGround = -18; +var heightLand = 2; +var heightOffsetHarbor = -11; + +InitMap(heightLand, g_Terrains.mainTerrain); initTileClasses(); @@ -84,7 +88,7 @@ addElements(shuffleArray([ }, { "func": addBluffs, - "baseHeight": getMapBaseHeight(), + "baseHeight": heightLand, "avoid": [ g_TileClasses.bluff, 20, g_TileClasses.mountain, 25, @@ -291,7 +295,7 @@ function addCenterLake() ], [1, 100] ), - new SmoothElevationPainter(ELEVATION_SET, -18, 10), + new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 10), paintClass(g_TileClasses.water) ], avoidClasses(g_TileClasses.player, 20) @@ -322,14 +326,12 @@ function addHarbors(players) { for (let player of players) { - let playerPosition = player.position; - let harborPosition = Vector2D.add(playerPosition, Vector2D.sub(mapCenter, playerPosition).div(2.5).round()); - + let harborPosition = Vector2D.add(player.position, Vector2D.sub(mapCenter, player.position).div(2.5).round()); createArea( - new ClumpPlacer(scaleByMapSize(1200, 1200), 0.5, 0.5, 1, harborPosition.x, harborPosition.y), + new ClumpPlacer(1200, 0.5, 0.5, 1, harborPosition.x, harborPosition.y), [ new LayeredPainter([g_Terrains.shore, g_Terrains.water], [2]), - new SmoothElevationPainter(ELEVATION_MODIFY, -11, 3), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetHarbor, 3), paintClass(g_TileClasses.water) ], avoidClasses( @@ -358,9 +360,13 @@ function addHarbors(players) function addSpines() { + let smallSpines = mapSize <= 192; + let spineSize = smallSpines ? 0.5 : 0.02; + let spineTapering = smallSpines ? -1.4 : -0.1; + let heightOffsetSpine = smallSpines ? 20 : 35; + let numPlayers = getNumPlayers(); let spineTile = g_Terrains.dirt; - let elevation = 35; if (currentBiome() == "snowy") spineTile = g_Terrains.tier1Terrain; @@ -378,37 +384,14 @@ function addSpines() for (let i = 0; i < numPlayers * split; ++i) { let tang = startAngle + (i + 0.5) * 2 * Math.PI / (numPlayers * split); - - let mStartCo = 0.12; - let mStopCo = 0.40; - let mSize = 0.5; - let mWaviness = 0.6; - let mOffset = 0.4; - let mTaper = -1.4; - - // make small mountain dividers if we're on a small map - if (mapSize <= 192) - { - mSize = 0.02; - mTaper = -0.1; - elevation = 20; - } + let start = Vector2D.add(mapCenter, new Vector2D(fractionToTiles(0.12), 0).rotate(-tang)); + let end = Vector2D.add(mapCenter, new Vector2D(fractionToTiles(0.4), 0).rotate(-tang)); createArea( - new PathPlacer( - fractionToTiles(0.5 + mStartCo * Math.cos(tang)), - fractionToTiles(0.5 + mStartCo * Math.sin(tang)), - fractionToTiles(0.5 + mStopCo * Math.cos(tang)), - fractionToTiles(0.5 + mStopCo * Math.sin(tang)), - scaleByMapSize(14, mSize), - mWaviness, - 0.1, - mOffset, - mTaper - ), + new PathPlacer(start.x, start.y, end.x, end.y, scaleByMapSize(14, spineSize), 0.6, 0.1, 0.4, spineTapering), [ new LayeredPainter([g_Terrains.cliff, spineTile], [3]), - new SmoothElevationPainter(ELEVATION_MODIFY, elevation, 3), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetSpine, 3), paintClass(g_TileClasses.spine) ], avoidClasses(g_TileClasses.player, 5) diff --git a/binaries/data/mods/public/maps/random/harbor.json b/binaries/data/mods/public/maps/random/harbor.json index e9ed18ed84..ea6446d9ec 100644 --- a/binaries/data/mods/public/maps/random/harbor.json +++ b/binaries/data/mods/public/maps/random/harbor.json @@ -4,7 +4,6 @@ "Script" : "harbor.js", "Description" : "Players start with some light fishing opportunities in the calm waters of a sheltered harbor. A large bounty of seafood lays beyond the protective cliffs in the deep ocean. Small passages at the base of the cliffs make for tight fighting and easy fortification. Will you fight your way through the narrow passageways or take to the sea?", "BaseTerrain" : ["medit_sea_depths"], - "BaseHeight" : 2, "Keywords": [], "Preview" : "harbor.png", "SupportedBiomes": true, diff --git a/binaries/data/mods/public/maps/random/hells_pass.js b/binaries/data/mods/public/maps/random/hells_pass.js index a15c54dac5..bd6e2e5d25 100644 --- a/binaries/data/mods/public/maps/random/hells_pass.js +++ b/binaries/data/mods/public/maps/random/hells_pass.js @@ -4,10 +4,15 @@ Engine.LoadLibrary("rmbiome"); setSelectedBiome(); -InitMap(g_MapSettings.BaseHeight, Terrains.mainTerrain); +const heightLand = 1; +const heightBarrier = 30; + +InitMap(heightLand, g_Terrains.mainTerrain); initTileClasses(); +const mapCenter = getMapCenter(); + createArea( new MapBoundsPlacer(), paintClass(g_TileClasses.land)); @@ -25,7 +30,7 @@ Engine.SetProgress(40); addElements(shuffleArray([ { "func": addBluffs, - "baseHeight": getMapBaseHeight(), + "baseHeight": heightLand, "avoid": [ g_TileClasses.bluff, 20, g_TileClasses.hill, 5, @@ -258,8 +263,6 @@ function placeBarriers() for (let i = 0; i < spineCount; ++i) { - var mStartCo = 0.07; - var mStopCo = 0.42; var mSize = 8; var mWaviness = 0.6; var mOffset = 0.5; @@ -281,20 +284,13 @@ function placeBarriers() } let angle = startAngle + (i + 0.5) * 2 * Math.PI / spineCount; + let start = Vector2D.add(mapCenter, new Vector2D(fractionToTiles(0.075), 0).rotate(-angle)); + let end = Vector2D.add(mapCenter, new Vector2D(fractionToTiles(0.42), 0).rotate(-angle)); createArea( - new PathPlacer( - fractionToTiles(0.5 + mStartCo * Math.cos(angle)), - fractionToTiles(0.5 + mStartCo * Math.sin(angle)), - fractionToTiles(0.5 + mStopCo * Math.cos(angle)), - fractionToTiles(0.5 + mStopCo * Math.sin(angle)), - scaleByMapSize(14, mSize), - mWaviness, - 0.1, - mOffset, - mTaper), + new PathPlacer(start.x, start.y, end.x, end.y, scaleByMapSize(14, mSize), mWaviness, 0.1, mOffset, mTaper), [ new LayeredPainter([g_Terrains.cliff, spineTerrain], [2]), - new SmoothElevationPainter(ELEVATION_SET, 30, 2), + new SmoothElevationPainter(ELEVATION_SET, heightBarrier, 2), paintClass(g_TileClasses.spine) ], avoidClasses(g_TileClasses.player, 5, g_TileClasses.baseResource, 5)); diff --git a/binaries/data/mods/public/maps/random/hells_pass.json b/binaries/data/mods/public/maps/random/hells_pass.json index 8fa5971d4f..edfe2c0124 100644 --- a/binaries/data/mods/public/maps/random/hells_pass.json +++ b/binaries/data/mods/public/maps/random/hells_pass.json @@ -4,7 +4,6 @@ "Script" : "hells_pass.js", "Description" : "A narrow pass between steep mountains promotes tight, defensive combat. With bountiful resources far from the front lines, teams may choose to support their exposed teammates financially, or retreat to more fertile, but less defensible ground.", "BaseTerrain" : ["medit_sea_depths"], - "BaseHeight" : 1, "Preview" : "hells_pass.png", "SupportedBiomes": true, "CircularMap" : true diff --git a/binaries/data/mods/public/maps/random/hyrcanian_shores.js b/binaries/data/mods/public/maps/random/hyrcanian_shores.js index 589796b2f6..48daf58148 100644 --- a/binaries/data/mods/public/maps/random/hyrcanian_shores.js +++ b/binaries/data/mods/public/maps/random/hyrcanian_shores.js @@ -37,7 +37,14 @@ const aBushSmall = "actor|props/flora/bush_medit_sm_lush.xml"; const pForestD = [tGrassDForest + TERRAIN_SEPARATOR + oPoplar, tGrassDForest]; const pForestP = [tGrassPForest + TERRAIN_SEPARATOR + oOak, tGrassPForest]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightSeaGround1 = -3; +const heightShore1 = -1.5; +const heightShore2 = 0; +const heightLand = 1; +const heightOffsetBump = 4; +const heightHill = 15; + +InitMap(heightLand, g_MapSettings.BaseTerrain); const mapCenter = getMapCenter(); const mapBounds = getMapBounds(); @@ -92,16 +99,16 @@ paintRiver({ "width": fractionToTiles(0.5), "fadeDist": scaleByMapSize(6, 25), "deviation": 0, - "waterHeight": -3, - "landHeight": 1, + "heightRiverbed": heightSeaGround1, + "heightLand": heightLand, "meanderShort": 20, "meanderLong": 0, "waterFunc": (ix, iz, height, riverFraction) => { - if (height < 0) + if (height < heightShore2) addToClass(ix, iz, clWater); - createTerrain(height < -1.5 ? tWater : tShore).place(ix, iz); + createTerrain(height < heightShore1 ? tWater : tShore).place(ix, iz); } }); Engine.SetProgress(20); @@ -122,8 +129,8 @@ createArea( log("Creating bumps..."); createAreas( - new ClumpPlacer(scaleByMapSize(20, 50), 0.3, 0.06, 1), - new SmoothElevationPainter(ELEVATION_MODIFY, 4, 3), + new ClumpPlacer(scaleByMapSize(10, 60), 0.3, 0.06, 1), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetBump, 3), stayClasses(clHighlands, 1), scaleByMapSize(300, 600)); @@ -134,7 +141,7 @@ createAreas( new ClumpPlacer(scaleByMapSize(20, 150), 0.2, 0.1, 1), [ new LayeredPainter([tCliff, tHill], [2]), - new SmoothElevationPainter(ELEVATION_SET, 15, 2), + new SmoothElevationPainter(ELEVATION_SET, heightHill, 2), paintClass(clHill) ], avoidClasses(clPlayer, 20, clWater, 5, clHill, 15, clHighlands, 5), diff --git a/binaries/data/mods/public/maps/random/hyrcanian_shores.json b/binaries/data/mods/public/maps/random/hyrcanian_shores.json index 3cf3682ad3..2492fbb55b 100644 --- a/binaries/data/mods/public/maps/random/hyrcanian_shores.json +++ b/binaries/data/mods/public/maps/random/hyrcanian_shores.json @@ -4,8 +4,7 @@ "Script" : "hyrcanian_shores.js", "Description" : "Each player starts in a coastal area between forested hills and the Caspian Sea.", "BaseTerrain" : ["temp_grass_long"], - "BaseHeight" : 1, "Preview" : "hyrcanian_shores.png", "CircularMap" : true } -} \ No newline at end of file +} diff --git a/binaries/data/mods/public/maps/random/india.js b/binaries/data/mods/public/maps/random/india.js index ecbd336831..a520dd3a7d 100644 --- a/binaries/data/mods/public/maps/random/india.js +++ b/binaries/data/mods/public/maps/random/india.js @@ -22,7 +22,12 @@ const oMetalLarge = "gaia/geology_metal_savanna_slabs"; const aBush = "actor|props/flora/bush_medit_sm_dry.xml"; const aRock = "actor|geology/stone_savanna_med.xml"; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightSeaGround = -3; +const heightLand = 1; +const heightShore = 3; +const heightOffsetBump = 2; + +InitMap(heightLand, g_MapSettings.BaseTerrain); var numPlayers = getNumPlayers(); var mapSize = getMapSize(); @@ -73,7 +78,7 @@ Engine.SetProgress(20); log("Creating bumps..."); createAreas( new ClumpPlacer(scaleByMapSize(20, 50), 0.5, 0.08, 1), - new SmoothElevationPainter(ELEVATION_MODIFY, 2, 2), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetBump, 2), avoidClasses(clPlayer, 13), scaleByMapSize(300, 800) ); @@ -90,7 +95,7 @@ createArea( 0, [Math.floor(mapSize * 0.008 * Math.pow(scaleByMapSize(1, 66), 1/8))]), [ - new SmoothElevationPainter(ELEVATION_SET, -3, 4), + new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 4), paintClass(clWater) ], avoidClasses(clPlayer, 20)); @@ -99,7 +104,7 @@ log("Creating more shore jaggedness..."); createAreas( new ChainPlacer(2, Math.floor(scaleByMapSize(4, 6)), 3, 1), [ - new SmoothElevationPainter(ELEVATION_SET, 3, 4), + new SmoothElevationPainter(ELEVATION_SET, heightShore, 4), unPaintClass(clWater) ], borderClasses(clWater, 4, 7), diff --git a/binaries/data/mods/public/maps/random/india.json b/binaries/data/mods/public/maps/random/india.json index 07fef3c685..3da6eb821a 100644 --- a/binaries/data/mods/public/maps/random/india.json +++ b/binaries/data/mods/public/maps/random/india.json @@ -4,7 +4,6 @@ "Script" : "india.js", "Description" : "Central India just before the monsoon season - a parched land awaits the life-bringing rain which is already two months late. Due to the extended dryness and scorching heat, only the largest lake remains. The hardy trees which have survived the climate are spread out, yet not too scarce.", "BaseTerrain" : "savanna_grass_a", - "BaseHeight" : 1, "Preview" : "india.png", "Keywords": [], "CircularMap" : true diff --git a/binaries/data/mods/public/maps/random/island_stronghold.js b/binaries/data/mods/public/maps/random/island_stronghold.js index 3d96ff1b80..eb8010c18f 100644 --- a/binaries/data/mods/public/maps/random/island_stronghold.js +++ b/binaries/data/mods/public/maps/random/island_stronghold.js @@ -45,7 +45,11 @@ const aRockMedium = g_Decoratives.rockMedium; const pForest1 = [tForestFloor2 + TERRAIN_SEPARATOR + oTree1, tForestFloor2 + TERRAIN_SEPARATOR + oTree2, tForestFloor2]; const pForest2 = [tForestFloor1 + TERRAIN_SEPARATOR + oTree4, tForestFloor1 + TERRAIN_SEPARATOR + oTree5, tForestFloor1]; -InitMap(g_MapSettings.BaseHeight, tWater); +const heightSeaGround = -10; +const heightLand = 3; +const heightHill = 18; + +InitMap(heightSeaGround, tWater); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -61,9 +65,6 @@ const clFood = createTileClass(); const clBaseResource = createTileClass(); const clLand = createTileClass(); -const shoreRadius = 6; -const landHeight = 3; - var startAngle = randomAngle(); var teams = getTeamsArray(); @@ -90,8 +91,8 @@ for (let i = 0; i < teams.length; ++i) createArea( new ChainPlacer(2, Math.floor(scaleByMapSize(5, 11)), Math.floor(scaleByMapSize(60, 250)), 1, playerPosition[p].x, playerPosition[p].y, 0, [Math.floor(fractionToTiles(0.01))]), [ - new LayeredPainter([tMainTerrain, tMainTerrain, tMainTerrain], [1, shoreRadius]), - new SmoothElevationPainter(ELEVATION_SET, landHeight, shoreRadius), + new LayeredPainter([tMainTerrain, tMainTerrain, tMainTerrain], [1, 6]), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 6), paintClass(clLand) ]); @@ -199,7 +200,7 @@ for (let i = 0; i < numIslands; ++i) scaleByMapSize(30, 70)), [ new LayeredPainter([tMainTerrain, tMainTerrain], [2]), - new SmoothElevationPainter(ELEVATION_SET, landHeight, 6), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 6), paintClass(clLand) ], avoidClasses(clLand, 3, clPlayer, 3), @@ -237,7 +238,7 @@ for (let i = 0; i < numIslands; ++i) new ChainPlacer(Math.floor(scaleByMapSize(4, 7)), Math.floor(scaleByMapSize(7, 10)), Math.floor(scaleByMapSize(16, 40)), 0.07, chosenPoint[0], chosenPoint[1], scaleByMapSize(22, 40)), [ new LayeredPainter([tMainTerrain, tMainTerrain], [2]), - new SmoothElevationPainter(ELEVATION_SET, landHeight, 6), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 6), paintClass(clLand) ], avoidClasses(clLand, 3, clPlayer, 3), @@ -301,7 +302,7 @@ createAreas( new ChainPlacer(1, Math.floor(scaleByMapSize(4, 6)), Math.floor(scaleByMapSize(16, 40)), 0.5), [ new LayeredPainter([tCliff, tHill], [2]), - new SmoothElevationPainter(ELEVATION_SET, 18, 2), + new SmoothElevationPainter(ELEVATION_SET, heightHill, 2), paintClass(clHill) ], [avoidClasses(clBaseResource, 20, clHill, 15, clRock, 6, clMetal, 6), stayClasses(clLand, 0)], @@ -455,7 +456,7 @@ createObjectGroupsDeprecated(group, 0, ); paintTerrainBasedOnHeight(1, 2, 0, tShore); -paintTerrainBasedOnHeight(getMapBaseHeight(), 1, 3, tWater); +paintTerrainBasedOnHeight(heightSeaGround, 1, 3, tWater); placePlayersNomad(clPlayer, [stayClasses(clLand, 4), avoidClasses(clHill, 2, clForest, 1, clMetal, 4, clRock, 4, clFood, 2)]); diff --git a/binaries/data/mods/public/maps/random/island_stronghold.json b/binaries/data/mods/public/maps/random/island_stronghold.json index 5d5b30193e..5bdc34c1f4 100644 --- a/binaries/data/mods/public/maps/random/island_stronghold.json +++ b/binaries/data/mods/public/maps/random/island_stronghold.json @@ -4,7 +4,6 @@ "Script" : "island_stronghold.js", "Description" : "Teams start off with nearly adjacent civic centers on a small island, offering a fortified base from which to expand.", "BaseTerrain" : ["medit_sand_wet"], - "BaseHeight" : -10, "Keywords": ["naval"], "Preview" : "island_stronghold.png", "SupportedBiomes": [ diff --git a/binaries/data/mods/public/maps/random/islands.js b/binaries/data/mods/public/maps/random/islands.js index 4152dd3d02..11ed42b42b 100644 --- a/binaries/data/mods/public/maps/random/islands.js +++ b/binaries/data/mods/public/maps/random/islands.js @@ -44,7 +44,12 @@ const aBushSmall = g_Decoratives.bushSmall; const pForest1 = [tForestFloor2 + TERRAIN_SEPARATOR + oTree1, tForestFloor2 + TERRAIN_SEPARATOR + oTree2, tForestFloor2]; const pForest2 = [tForestFloor1 + TERRAIN_SEPARATOR + oTree4, tForestFloor1 + TERRAIN_SEPARATOR + oTree5, tForestFloor1]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightSeaGround = -5; +const heightLand = 3; +const heightOffsetBump = 2; +const heightHill = 18; + +InitMap(heightSeaGround, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -60,7 +65,6 @@ var clFood = createTileClass(); var clBaseResource = createTileClass(); var clLand = createTileClass(); -var landHeight = 3; var playerIslandRadius = scaleByMapSize(20, 29); var [playerIDs, playerPosition, playerAngle] = playerPlacementCircle(fractionToTiles(0.35)); @@ -74,12 +78,12 @@ if (!isNomad()) new ClumpPlacer(diskArea(playerIslandRadius), 0.8, 0.1, 10, playerPosition[i].x, playerPosition[i].y), [ new LayeredPainter([tMainTerrain , tMainTerrain, tMainTerrain], [1, 6]), - new SmoothElevationPainter(ELEVATION_SET, landHeight, 6), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 6), paintClass(clLand), paintClass(clPlayer) ]); - let dockLocation = findLocationInDirectionBasedOnHeight(playerPosition[i], mapCenter, -3 , landHeight - 0.5, landHeight); + let dockLocation = findLocationInDirectionBasedOnHeight(playerPosition[i], mapCenter, -3 , heightLand - 0.5, heightLand); placeObject(dockLocation.x, dockLocation.y, oDock, playerIDs[i], playerAngle[i] + Math.PI); } } @@ -93,7 +97,7 @@ createAreas( 0.07), [ new LayeredPainter([tMainTerrain, tMainTerrain], [2]), - new SmoothElevationPainter(ELEVATION_SET, landHeight, 6), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 6), paintClass(clLand) ], avoidClasses(clLand, scaleByMapSize(8, 12)), @@ -108,7 +112,7 @@ createAreas( 0.07), [ new LayeredPainter([tMainTerrain, tMainTerrain], [2]), - new SmoothElevationPainter(ELEVATION_SET, landHeight, 6), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 6), paintClass(clLand) ], avoidClasses(clLand, scaleByMapSize(8, 12)), @@ -158,7 +162,7 @@ placePlayerBases({ log("Creating bumps..."); createAreas( new ClumpPlacer(scaleByMapSize(20, 50), 0.3, 0.06, 1), - new SmoothElevationPainter(ELEVATION_MODIFY, 2, 2), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetBump, 2), [avoidClasses(clPlayer, 0), stayClasses(clLand, 3)], scaleByMapSize(20, 100)); @@ -167,7 +171,7 @@ createAreas( new ChainPlacer(1, Math.floor(scaleByMapSize(4, 6)), Math.floor(scaleByMapSize(16, 40)), 0.5), [ new LayeredPainter([tCliff, tHill], [2]), - new SmoothElevationPainter(ELEVATION_SET, 18, 2), + new SmoothElevationPainter(ELEVATION_SET, heightHill, 2), paintClass(clHill) ], [avoidClasses(clPlayer, 2, clHill, 15), stayClasses(clLand, 0)], diff --git a/binaries/data/mods/public/maps/random/islands.json b/binaries/data/mods/public/maps/random/islands.json index f97195c12f..d031a24e75 100644 --- a/binaries/data/mods/public/maps/random/islands.json +++ b/binaries/data/mods/public/maps/random/islands.json @@ -4,7 +4,6 @@ "Script" : "islands.js", "Description" : "Players start in small islands while there are many others around.", "BaseTerrain" : ["medit_sand_wet"], - "BaseHeight" : -5, "Keywords": ["naval"], "Preview" : "islands.png", "SupportedBiomes": true, diff --git a/binaries/data/mods/public/maps/random/kerala.js b/binaries/data/mods/public/maps/random/kerala.js index 62773d5f6d..60d11f8297 100644 --- a/binaries/data/mods/public/maps/random/kerala.js +++ b/binaries/data/mods/public/maps/random/kerala.js @@ -32,10 +32,13 @@ const aBush3 = "actor|props/flora/plant_tropic_large.xml"; const pForestD = [tForestFloor + TERRAIN_SEPARATOR + oTree, tForestFloor]; const pForestP = [tForestFloor + TERRAIN_SEPARATOR + oPalm, tForestFloor]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightSeaGround = -5; +const heightLand = 3; +const heightHill = 25; + +InitMap(heightLand, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); -const mapSize = getMapSize(); const mapCenter = getMapCenter(); const mapBounds = getMapBounds(); @@ -91,8 +94,8 @@ paintRiver({ "width": 2 * waterPosition, "fadeDist": 8, "deviation": 0, - "waterHeight": -5, - "landHeight": 3, + "heightRiverbed": heightSeaGround, + "heightLand": heightLand, "meanderShort": 20, "meanderLong": 0, "waterFunc": (ix, iz, height, riverFraction) => { @@ -116,7 +119,7 @@ for (let i = 0; i < scaleByMapSize(20, 120); ++i) Math.floor(fractionToTiles(randFloat(0.1, 0.9)))), [ new LayeredPainter([tGrass, tGrass], [2]), - new SmoothElevationPainter(ELEVATION_SET, 3, 3), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 3), unPaintClass(clWater) ]); @@ -132,7 +135,7 @@ createAreas( new ChainPlacer(1, Math.floor(scaleByMapSize(4, 6)), Math.floor(scaleByMapSize(16, 40)), 0.1), [ new LayeredPainter([tCliff, tGrass], [3]), - new SmoothElevationPainter(ELEVATION_SET, 25, 3), + new SmoothElevationPainter(ELEVATION_SET, heightHill, 3), paintClass(clHill) ], [avoidClasses(clPlayer, 20, clHill, 5, clWater, 2, clBaseResource, 2), stayClasses(clMountains, 0)], diff --git a/binaries/data/mods/public/maps/random/kerala.json b/binaries/data/mods/public/maps/random/kerala.json index 57804a13ca..c9264120b3 100644 --- a/binaries/data/mods/public/maps/random/kerala.json +++ b/binaries/data/mods/public/maps/random/kerala.json @@ -4,8 +4,7 @@ "Script" : "kerala.js", "Description" : "Players start in the southwestern shores of India between a sea and mountains.", "BaseTerrain" : ["tropic_grass_c", "tropic_grass_c", "tropic_grass_c", "tropic_grass_c", "tropic_grass_plants", "tropic_plants", "tropic_plants_b"], - "BaseHeight" : 3, "Preview" : "kerala.png", "CircularMap" : true } -} \ No newline at end of file +} diff --git a/binaries/data/mods/public/maps/random/lake.js b/binaries/data/mods/public/maps/random/lake.js index 5a5d7ded3c..040a4f11fb 100644 --- a/binaries/data/mods/public/maps/random/lake.js +++ b/binaries/data/mods/public/maps/random/lake.js @@ -40,7 +40,10 @@ const aBushSmall = g_Decoratives.bushSmall; const pForest1 = [tForestFloor2 + TERRAIN_SEPARATOR + oTree1, tForestFloor2 + TERRAIN_SEPARATOR + oTree2, tForestFloor2]; const pForest2 = [tForestFloor1 + TERRAIN_SEPARATOR + oTree4, tForestFloor1 + TERRAIN_SEPARATOR + oTree5, tForestFloor1]; -InitMap(g_MapSettings.BaseHeight, tMainTerrain); +const heightSeaGround = -3; +const heightLand = 3; + +InitMap(heightLand, tMainTerrain); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -74,7 +77,7 @@ createArea( 0, [Math.floor(fractionToTiles(0.2))]), [ - new SmoothElevationPainter(ELEVATION_SET, -3, 4), + new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 4), paintClass(clWater) ], avoidClasses(clPlayer, 20)); diff --git a/binaries/data/mods/public/maps/random/lake.json b/binaries/data/mods/public/maps/random/lake.json index 7607f79f94..395ad7808a 100644 --- a/binaries/data/mods/public/maps/random/lake.json +++ b/binaries/data/mods/public/maps/random/lake.json @@ -4,7 +4,6 @@ "Script" : "lake.js", "Description" : "Players start around a lake in the center of the map.", "BaseTerrain" : ["medit_sea_depths"], - "BaseHeight" : 3, "Preview" : "lake.png", "SupportedBiomes": true, "CircularMap" : true diff --git a/binaries/data/mods/public/maps/random/latium.js b/binaries/data/mods/public/maps/random/latium.js index 6c125b5a66..77e012d092 100644 --- a/binaries/data/mods/public/maps/random/latium.js +++ b/binaries/data/mods/public/maps/random/latium.js @@ -49,7 +49,12 @@ const pPineForest = [tForestFloor+TERRAIN_SEPARATOR+oPine, tGrass]; const pPoplarForest = [tForestFloor+TERRAIN_SEPARATOR+oLombardyPoplar, tGrass]; const pMainForest = [tForestFloor+TERRAIN_SEPARATOR+oCarob, tForestFloor+TERRAIN_SEPARATOR+oBeech, tGrass, tGrass]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightSeaGround = -16; +const heightLand = 0; +const heightPlayer = 5; +const heightHill = 12; + +InitMap(heightLand, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -67,10 +72,6 @@ var clBaseResource = createTileClass(); var WATER_WIDTH = 0.1; -var waterHeight = -16; -var landHeight = getMapBaseHeight(); -var hillHeight = 12; - log("Creating players..."); var [playerIDs, playerPosition] = playerPlacementLine(false, mapCenter, fractionToTiles(randFloat(0.42, 0.46))); @@ -107,8 +108,8 @@ for (let x of [mapBounds.left, mapBounds.right]) "width": 2 * fractionToTiles(WATER_WIDTH), "fadeDist": 16, "deviation": 0, - "waterHeight": waterHeight, - "landHeight": landHeight, + "heightRiverbed": heightSeaGround, + "heightLand": heightLand, "meanderShort": 0, "meanderLong": 0, "waterFunc": (ix, iz, height, z) => { @@ -137,7 +138,7 @@ for (var ix = 0; ix <= mapSize; ix++) var pn = playerNearness(x, z); let distToWater = stayClasses(clWater, 1).allows(ix, iz) ? 0 : (0.5 - WATER_WIDTH - Math.abs(x - 0.5)); - let h = distToWater ? hillHeight * (1 - Math.abs(x - 0.5) / (0.5 - WATER_WIDTH)) : getHeight(ix, iz); + let h = distToWater ? heightHill * (1 - Math.abs(x - 0.5) / (0.5 - WATER_WIDTH)) : getHeight(ix, iz); // add some base noise var baseNoise = 16*noise0.get(x,z) + 8*noise1.get(x,z) + 4*noise2.get(x,z) - (16+8+4)/2; @@ -323,7 +324,7 @@ placePlayerBases({ "innerTerrain": tCity, "width": 4, "painters": [ - new SmoothElevationPainter(ELEVATION_SET, 5, 2) + new SmoothElevationPainter(ELEVATION_SET, heightPlayer, 2) ] }, "Chicken": { diff --git a/binaries/data/mods/public/maps/random/latium.json b/binaries/data/mods/public/maps/random/latium.json index 7fc87bad6c..6687bd9f58 100644 --- a/binaries/data/mods/public/maps/random/latium.json +++ b/binaries/data/mods/public/maps/random/latium.json @@ -4,8 +4,7 @@ "Script" : "latium.js", "Description" : "The Italian peninsula \n\n Latium is the region of central western Italy in which the city of Rome was founded and grew to be the capital city of the Roman Empire. Latium was originally a small triangle of fertile, volcanic soil on which resided the tribe of the Latins. It was located on the left bank (east and south) of the Tiber river, extending northward to the Anio river (a left-bank tributary of the Tiber) and southeastward to the Pomptina Palus (Pontine Marshes, now the Pontine Fields) as far south as the Circeian promontory. The right bank of the Tiber was occupied by the Etruscan city of Veii, and the other borders were occupied by Italic tribes. Subsequently Rome defeated Veii and then its Italic neighbors, expanding Latium to the Apennine Mountains in the northeast and to the opposite end of the marsh in the southeast. The modern descendant, the Italian Regione of Lazio, also called Latium in Latin, and occasionally in modern English, is somewhat larger still, but not as much as double the original Latium.", "BaseTerrain" : ["medit_grass_field_dry", "medit_grass_field_brown", "medit_grass_field_b"], - "BaseHeight" : 0, "Preview" : "latium.png", "CircularMap" : false } -} \ No newline at end of file +} diff --git a/binaries/data/mods/public/maps/random/lions_den.js b/binaries/data/mods/public/maps/random/lions_den.js index ef9b63e344..79eddc2783 100644 --- a/binaries/data/mods/public/maps/random/lions_den.js +++ b/binaries/data/mods/public/maps/random/lions_den.js @@ -6,12 +6,13 @@ setSelectedBiome(); const topTerrain = g_Terrains.tier2Terrain; -const valleyHeight = 0; -const pathHeight = 10; -const denHeight = 15; -const hillHeight = getMapBaseHeight(); +const heightValley = 0; +const heightPath = 10; +const heightDen = 15; +const heightHill = 50; + +InitMap(heightHill, topTerrain); -InitMap(hillHeight, topTerrain); const mapArea = getMapArea(); const mapCenter = getMapCenter(); const numPlayers = getNumPlayers(); @@ -414,7 +415,7 @@ Engine.SetProgress(95); placePlayersNomad( g_TileClasses.player, [ - new HeightConstraint(valleyHeight, pathHeight), + new HeightConstraint(heightValley, heightPath), avoidClasses( g_TileClasses.forest, 1, g_TileClasses.metal, 4, @@ -485,7 +486,7 @@ function createSunkenTerrain() new ClumpPlacer(mapArea * 0.26, 1, 1, 1, mapCenter.x, mapCenter.y), [ new LayeredPainter([g_Terrains.cliff, lower], [3]), - new SmoothElevationPainter(ELEVATION_SET, valleyHeight, 3), + new SmoothElevationPainter(ELEVATION_SET, heightValley, 3), paintClass(g_TileClasses.valley) ]); @@ -494,57 +495,58 @@ function createSunkenTerrain() new ClumpPlacer(mapArea * 0.14, 1, 1, 1, mapCenter.x, mapCenter.y), [ new LayeredPainter([g_Terrains.cliff, topTerrain], [3]), - new SmoothElevationPainter(ELEVATION_SET, hillHeight, 3), + new SmoothElevationPainter(ELEVATION_SET, heightHill, 3), paintClass(g_TileClasses.mountain) ]); let getCoords = (distance, playerID, playerIDOffset) => { let angle = startAngle + (playerID + playerIDOffset) * 2 * Math.PI / numPlayers; - return [ - Math.round(fractionToTiles(0.5 + distance * Math.cos(angle))), - Math.round(fractionToTiles(0.5 + distance * Math.sin(angle))) - ]; + return Vector2D.add(mapCenter, new Vector2D(fractionToTiles(distance), 0).rotate(-angle)).round(); }; for (let i = 0; i < numPlayers; ++i) { - let playerCoords = getCoords(0.4, i, 0); + let playerPosition = getCoords(0.4, i, 0); log("Creating path from player to expansion..."); - let expansionCoords = getCoords(expDist, i, expAngle); + let expansionPosition = getCoords(expDist, i, expAngle); createArea( - new PathPlacer(...playerCoords, ...expansionCoords, 12, 0.7, 0.5, 0.1, -1), + new PathPlacer(playerPosition.x, playerPosition.y, expansionPosition.x, expansionPosition.y, 12, 0.7, 0.5, 0.1, -1), [ new LayeredPainter([g_Terrains.cliff, middle, road], [3, 4]), - new SmoothElevationPainter(ELEVATION_SET, pathHeight, 3), + new SmoothElevationPainter(ELEVATION_SET, heightPath, 3), paintClass(g_TileClasses.step) ]); log("Creating path from player to the neighbor..."); for (let neighborOffset of [-0.5, 0.5]) + { + let neighborPosition = getCoords(nRoad, i, neighborOffset); + let pathPosition = getCoords(0.47, i, 0); createArea( - new PathPlacer(...getCoords(0.47, i, 0), ...getCoords(nRoad, i, neighborOffset), 19, 0.4, 0.5, 0.1, -0.6), + new PathPlacer(pathPosition.x, pathPosition.y, neighborPosition.x, neighborPosition.y, 19, 0.4, 0.5, 0.1, -0.6), [ new LayeredPainter([g_Terrains.cliff, middle, road], [3, 6]), - new SmoothElevationPainter(ELEVATION_SET, pathHeight, 3), + new SmoothElevationPainter(ELEVATION_SET, heightPath, 3), paintClass(g_TileClasses.step) ]); + } log("Creating the den of the player..."); createArea( - new ClumpPlacer(mapArea * 0.03 / (isNomad() ? 2 : 1), 0.9, 0.3, 1, ...playerCoords), + new ClumpPlacer(mapArea * 0.03 / (isNomad() ? 2 : 1), 0.9, 0.3, 1, playerPosition.x, playerPosition.y), [ new LayeredPainter([g_Terrains.cliff, base], [3]), - new SmoothElevationPainter(ELEVATION_SET, denHeight, 3), + new SmoothElevationPainter(ELEVATION_SET, heightDen, 3), paintClass(g_TileClasses.valley) ]); log("Creating the expansion of the player..."); createArea( - new ClumpPlacer(expSize, 0.9, 0.3, 1, ...expansionCoords), + new ClumpPlacer(expSize, 0.9, 0.3, 1, expansionPosition.x, expansionPosition.y), [ new LayeredPainter([g_Terrains.cliff, base], [3]), - new SmoothElevationPainter(ELEVATION_SET, denHeight, 3), + new SmoothElevationPainter(ELEVATION_SET, heightDen, 3), paintClass(g_TileClasses.settlement) ], [avoidClasses(g_TileClasses.settlement, 2)]); @@ -552,11 +554,14 @@ function createSunkenTerrain() log("Creating the expansions between players after the paths were created..."); for (let i = 0; i < numPlayers; ++i) + { + let position = getCoords(nExp, i, 0.5); createArea( - new ClumpPlacer(expSize, 0.9, 0.3, 1, ...getCoords(nExp, i, 0.5)), + new ClumpPlacer(expSize, 0.9, 0.3, 1, position.x, position.y), [ new LayeredPainter([g_Terrains.cliff, lower], [3]), - new SmoothElevationPainter(ELEVATION_SET, valleyHeight, 3), + new SmoothElevationPainter(ELEVATION_SET, heightValley, 3), paintClass(g_TileClasses.settlement) ]); + } } diff --git a/binaries/data/mods/public/maps/random/lions_den.json b/binaries/data/mods/public/maps/random/lions_den.json index 9159b2d4e2..5336fac3c2 100644 --- a/binaries/data/mods/public/maps/random/lions_den.json +++ b/binaries/data/mods/public/maps/random/lions_den.json @@ -4,7 +4,6 @@ "Script" : "lions_den.js", "Description" : "High cliffs protect each player's main base. Venturing into the unknown can be risky, but necessary.", "BaseTerrain" : ["medit_sea_depths"], - "BaseHeight" : 50, "Preview" : "lions_den.png", "Keywords": [], "SupportedBiomes": true, diff --git a/binaries/data/mods/public/maps/random/lorraine_plain.js b/binaries/data/mods/public/maps/random/lorraine_plain.js index f416480cb6..e726434771 100644 --- a/binaries/data/mods/public/maps/random/lorraine_plain.js +++ b/binaries/data/mods/public/maps/random/lorraine_plain.js @@ -35,7 +35,12 @@ const pForestB = [tGrassDForest + TERRAIN_SEPARATOR + oBeech, tGrassDForest]; const pForestO = [tGrassPForest + TERRAIN_SEPARATOR + oOak, tGrassPForest]; const pForestR = [tGrassDForest + TERRAIN_SEPARATOR + oBeech, tGrassDForest, tGrassDForest + TERRAIN_SEPARATOR + oOak, tGrassDForest, tGrassDForest, tGrassDForest]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightSeaGround = -4; +const heightShallows = -2; +const heightLand = 3; +const heightOffsetBump = 2; + +InitMap(heightLand, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -53,8 +58,6 @@ var clFood = createTileClass(); var clBaseResource = createTileClass(); var clShallow = createTileClass(); -var waterHeight = -4; -var shallowHeight = -2; var shallowWidth = scaleByMapSize(8, 12); placePlayerBases({ @@ -98,7 +101,7 @@ var riverPositions = [ log("Creating the main river..."); createArea( new PathPlacer(riverPositions[0].x, riverPositions[0].y, riverPositions[1].x, riverPositions[1].y, scaleByMapSize(10, 20), 0.5, 3 * scaleByMapSize(1, 4), 0.1, 0.01), - new SmoothElevationPainter(ELEVATION_SET, waterHeight, 4), + new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 4), avoidClasses(clPlayer, 4)); Engine.SetProgress(25); @@ -106,7 +109,7 @@ log("Creating small puddles at the map border to ensure players being separated. for (let riverPosition of riverPositions) createArea( new ClumpPlacer(Math.floor(diskArea(scaleByMapSize(5, 10))), 0.95, 0.6, 10, riverPosition.x, riverPosition.y), - new SmoothElevationPainter(ELEVATION_SET, waterHeight, 2), + new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 2), avoidClasses(clPlayer, 8)); Engine.SetProgress(30); @@ -120,9 +123,9 @@ for (let i = 0; i <= randIntInclusive(3, scaleByMapSize(4, 6)); ++i) "startWidth": shallowWidth, "endWidth": shallowWidth, "smoothWidth": 2, - "startHeight": shallowHeight, - "endHeight": shallowHeight, - "maxHeight": shallowHeight, + "startHeight": heightShallows, + "endHeight": heightShallows, + "maxHeight": heightShallows, "tileClass": clShallow }); } @@ -132,7 +135,7 @@ createTributaryRivers( true, randIntInclusive(9, scaleByMapSize(13, 21)), scaleByMapSize(10, 20), - waterHeight, + heightSeaGround, [-6, -1.5], Math.PI / 5, clWater, @@ -150,7 +153,7 @@ Engine.SetProgress(50); log("Creating bumps..."); createAreas( new ClumpPlacer(scaleByMapSize(20, 50), 0.3, 0.06, 1), - new SmoothElevationPainter(ELEVATION_MODIFY, 2, 2), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetBump, 2), avoidClasses(clWater, 2, clPlayer, 15), scaleByMapSize(100, 200) ); diff --git a/binaries/data/mods/public/maps/random/lorraine_plain.json b/binaries/data/mods/public/maps/random/lorraine_plain.json index 62c4061e43..1df8221eb3 100644 --- a/binaries/data/mods/public/maps/random/lorraine_plain.json +++ b/binaries/data/mods/public/maps/random/lorraine_plain.json @@ -4,8 +4,7 @@ "Script" : "lorraine_plain.js", "Description" : "Players start in a nearly flat Gallic plain divided by a river and its tributaries.", "BaseTerrain" : ["temp_grass_long"], - "BaseHeight" : 3, "Preview" : "lorraine_plain.png", "CircularMap" : true } -} \ No newline at end of file +} diff --git a/binaries/data/mods/public/maps/random/mainland.js b/binaries/data/mods/public/maps/random/mainland.js index 355feebf7e..3182be869c 100644 --- a/binaries/data/mods/public/maps/random/mainland.js +++ b/binaries/data/mods/public/maps/random/mainland.js @@ -37,7 +37,9 @@ const aBushSmall = g_Decoratives.bushSmall; const pForest1 = [tForestFloor2 + TERRAIN_SEPARATOR + oTree1, tForestFloor2 + TERRAIN_SEPARATOR + oTree2, tForestFloor2]; const pForest2 = [tForestFloor1 + TERRAIN_SEPARATOR + oTree4, tForestFloor1 + TERRAIN_SEPARATOR + oTree5, tForestFloor1]; -InitMap(g_MapSettings.BaseHeight, tMainTerrain); +const heightLand = 3; + +InitMap(heightLand, tMainTerrain); const numPlayers = getNumPlayers(); diff --git a/binaries/data/mods/public/maps/random/mainland.json b/binaries/data/mods/public/maps/random/mainland.json index 51f09b1969..2d7663f0b5 100644 --- a/binaries/data/mods/public/maps/random/mainland.json +++ b/binaries/data/mods/public/maps/random/mainland.json @@ -4,7 +4,6 @@ "Script" : "mainland.js", "Description" : "A typical map without any water.", "BaseTerrain" : ["medit_sea_depths"], - "BaseHeight" : 3, "Preview" : "mainland.png", "SupportedBiomes": true, "CircularMap" : true diff --git a/binaries/data/mods/public/maps/random/migration.js b/binaries/data/mods/public/maps/random/migration.js index e95ed2240a..f5d34fe4f9 100644 --- a/binaries/data/mods/public/maps/random/migration.js +++ b/binaries/data/mods/public/maps/random/migration.js @@ -42,7 +42,12 @@ const aBushSmall = g_Decoratives.bushSmall; const pForest1 = [tForestFloor2 + TERRAIN_SEPARATOR + oTree1, tForestFloor2 + TERRAIN_SEPARATOR + oTree2, tForestFloor2]; const pForest2 = [tForestFloor1 + TERRAIN_SEPARATOR + oTree4, tForestFloor1 + TERRAIN_SEPARATOR + oTree5, tForestFloor1]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightSeaGround = -5; +const heightLand = 3; +const heightHill = 18; +const heightOffsetBump = 2; + +InitMap(heightSeaGround, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -60,8 +65,6 @@ var clBaseResource = createTileClass(); var clLand = createTileClass(); var clIsland = createTileClass(); -var landHeight = 3; - var startAngle = 4/7 * Math.PI; var playerIDs = sortAllPlayers(); var [playerPosition, playerAngle] = playerPlacementCustomAngle( @@ -76,7 +79,7 @@ for (let i = 0; i < numPlayers; ++i) new ClumpPlacer(diskArea(defaultPlayerBaseRadius()), 0.8, 0.1, 10, playerPosition[i].x, playerPosition[i].y), [ new LayeredPainter([tWater, tShore, tMainTerrain], [1, 4]), - new SmoothElevationPainter(ELEVATION_SET, landHeight, 4), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 4), paintClass(clIsland), paintClass(isNomad() ? clLand : clPlayer) ]); @@ -129,7 +132,7 @@ createArea( new ClumpPlacer(mapArea * 0.50, 0.8, 0.08, 10, Math.round(fractionToTiles(0.12)), Math.round(fractionToTiles(0.5))), [ new LayeredPainter([tWater, tShore, tMainTerrain], [4, 2]), - new SmoothElevationPainter(ELEVATION_SET, landHeight, 4), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 4), paintClass(clLand) ], avoidClasses(clIsland, 8)); @@ -140,7 +143,7 @@ createAreas( new ClumpPlacer(scaleByMapSize(15, 80), 0.2, 0.1, 1), [ new LayeredPainter([tMainTerrain, tMainTerrain], [2]), - new SmoothElevationPainter(ELEVATION_SET, landHeight, 4), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 4), paintClass(clLand) ], [ @@ -157,7 +160,7 @@ Engine.SetProgress(25); log("Creating bumps..."); createAreas( new ClumpPlacer(scaleByMapSize(20, 50), 0.3, 0.06, 1), - new SmoothElevationPainter(ELEVATION_MODIFY, 2, 2), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetBump, 2), [avoidClasses(clIsland, 10), stayClasses(clLand, 3)], scaleByMapSize(100, 200) ); @@ -168,7 +171,7 @@ createAreas( new ClumpPlacer(scaleByMapSize(20, 150), 0.2, 0.1, 1), [ new LayeredPainter([tCliff, tHill], [2]), - new SmoothElevationPainter(ELEVATION_SET, 18, 2), + new SmoothElevationPainter(ELEVATION_SET, heightHill, 2), paintClass(clHill) ], [avoidClasses(clIsland, 10, clHill, 15), stayClasses(clLand, 7)], diff --git a/binaries/data/mods/public/maps/random/migration.json b/binaries/data/mods/public/maps/random/migration.json index aa3a7d7af9..ab6023d64f 100644 --- a/binaries/data/mods/public/maps/random/migration.json +++ b/binaries/data/mods/public/maps/random/migration.json @@ -4,7 +4,6 @@ "Script" : "migration.js", "Description" : "Players start in small islands in the eastern part of the map. There is a big continent in the west ready for expansion.", "BaseTerrain" : ["medit_sand_wet"], - "BaseHeight" : -5, "Keywords": ["naval"], "Preview" : "migration.png", "SupportedBiomes": true, diff --git a/binaries/data/mods/public/maps/random/neareastern_badlands.js b/binaries/data/mods/public/maps/random/neareastern_badlands.js index 76d75a03ce..a08340647e 100644 --- a/binaries/data/mods/public/maps/random/neareastern_badlands.js +++ b/binaries/data/mods/public/maps/random/neareastern_badlands.js @@ -36,7 +36,15 @@ const aDecorativeRock = "actor|geology/stone_desert_med.xml"; const pForest = [tForestFloor + TERRAIN_SEPARATOR + oDatePalm, tForestFloor + TERRAIN_SEPARATOR + oSDatePalm, tForestFloor]; const pForestOasis = [tGrass + TERRAIN_SEPARATOR + oDatePalm, tGrass + TERRAIN_SEPARATOR + oSDatePalm, tGrass]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightLand = 10; + +const heightOffsetOasis = -11; +const heightOffsetHill1 = 16; +const heightOffsetHill2 = 16; +const heightOffsetHill3 = 16; +const heightOffsetBump = 2; + +InitMap(heightLand, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -53,11 +61,6 @@ var clFood = createTileClass(); var clBaseResource = createTileClass(); var oasisRadius = scaleByMapSize(14, 40); -var oasisHeight = -11; - -var hillHeight1 = 16; -var hillHeight2 = 16; -var hillHeight3 = 16; var [playerIDs, playerPosition] = playerPlacementCircle(fractionToTiles(0.35)); @@ -139,7 +142,7 @@ createArea( new ClumpPlacer(diskArea(oasisRadius), 0.6, 0.15, 0, mapCenter.x, mapCenter.y), [ new LayeredPainter([[tSand, pForest], [tGrassSand25, pForestOasis], tGrassSand25, tShore, tWaterDeep], [2, 3, 1, 1]), - new SmoothElevationPainter(ELEVATION_MODIFY, oasisHeight, 8), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetOasis, 8), paintClass(clOasis) ]); @@ -199,7 +202,7 @@ var hillAreas = createAreas( new ClumpPlacer(scaleByMapSize(50,300), 0.25, 0.1, 0.5), [ new LayeredPainter([tCliff, tSand], [1]), - new SmoothElevationPainter(ELEVATION_MODIFY, hillHeight1, 1), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetHill1, 1), paintClass(clHill1) ], avoidClasses(clOasis, 3, clPlayer, 0, clHill1, 10), @@ -213,7 +216,7 @@ hillAreas = hillAreas.concat( new ClumpPlacer(scaleByMapSize(25,150), 0.25, 0.1, 0.5), [ new LayeredPainter([tCliff, tSand], [1]), - new SmoothElevationPainter(ELEVATION_MODIFY, hillHeight2, 1), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetHill2, 1), paintClass(clHill1) ], avoidClasses(clOasis, 3, clPlayer, 0, clHill1, 3), @@ -239,7 +242,7 @@ createAreasInAreas( new ClumpPlacer(scaleByMapSize(25, 150), 0.25, 0.1, 0), [ new LayeredPainter([tCliff, tSand], [1]), - new SmoothElevationPainter(ELEVATION_MODIFY, hillHeight2, 1) + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetHill2, 1) ], [stayClasses(clHill1, 0)], scaleByMapSize(15, 25), @@ -253,7 +256,7 @@ createAreas( new ClumpPlacer(scaleByMapSize(12, 75), 0.25, 0.1, 0), [ new LayeredPainter([tCliff, tSand], [1]), - new SmoothElevationPainter(ELEVATION_MODIFY, hillHeight3, 1) + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetHill3, 1) ], [stayClasses(clHill1, 0)], scaleByMapSize(15,25), @@ -264,7 +267,7 @@ Engine.SetProgress(60); log("Creating bumps..."); createAreas( new ClumpPlacer(scaleByMapSize(20, 50), 0.3, 0.06, 0), - new SmoothElevationPainter(ELEVATION_MODIFY, 2, 2), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetBump, 2), avoidClasses(clOasis, 0, clPlayer, 0, clHill1, 2), scaleByMapSize(100, 200) ); diff --git a/binaries/data/mods/public/maps/random/neareastern_badlands.json b/binaries/data/mods/public/maps/random/neareastern_badlands.json index 0c34005470..b031435199 100644 --- a/binaries/data/mods/public/maps/random/neareastern_badlands.json +++ b/binaries/data/mods/public/maps/random/neareastern_badlands.json @@ -4,8 +4,7 @@ "Script" : "neareastern_badlands.js", "Description" : "A jumbled maze of cliffs, canyons, and rugged terrain with an oasis in the center\n\nCappadocia is a historical region in Central Anatolia. In the time of Herodotus, the Cappadocians were reported as occupying the whole region from Mount Taurus to the vicinity of the the Black Sea. Cappadocia, in this sense, was bounded in the south by the chain of the Taurus Mountains that separate it from Cilicia, to the east by the upper Euphrates and the Armenian Highland, to the north by Pontus, and to the west by Lycaonia and eastern Galatia. Cappadocia lies in eastern Anatolia. The relief consists of a high plateau over 1000 m in altitude that is pierced by volcanic peaks. Due to its inland location and high altitude, Cappadocia has a markedly continental climate, with hot dry summers and cold snowy winters. Rainfall is sparse and the region is largely semi-arid.", "BaseTerrain" : ["desert_sand_smooth", "desert_sand_smooth_b"], - "BaseHeight" : 10, "Preview" : "neareastern_badlands.png", "CircularMap" : true } -} \ No newline at end of file +} diff --git a/binaries/data/mods/public/maps/random/new_rms_test.js b/binaries/data/mods/public/maps/random/new_rms_test.js index 2f0a93d70c..0b6eecbca1 100644 --- a/binaries/data/mods/public/maps/random/new_rms_test.js +++ b/binaries/data/mods/public/maps/random/new_rms_test.js @@ -1,12 +1,11 @@ Engine.LoadLibrary("rmgen"); -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +InitMap(0, g_MapSettings.BaseTerrain); -if (isNomad()) - placePlayersNomad(createTileClass()); -else - placePlayerBases({ - "PlayerPlacement": playerPlacementCircle(fractionToTiles(0.39)) - }); +placePlayerBases({ + "PlayerPlacement": playerPlacementCircle(fractionToTiles(0.39)) +}); + +placePlayersNomad(createTileClass()); ExportMap(); diff --git a/binaries/data/mods/public/maps/random/new_rms_test.json b/binaries/data/mods/public/maps/random/new_rms_test.json index 4236aa0001..10b340461c 100644 --- a/binaries/data/mods/public/maps/random/new_rms_test.json +++ b/binaries/data/mods/public/maps/random/new_rms_test.json @@ -4,7 +4,6 @@ "Script" : "new_rms_test.js", "Description" : "A basic test of the random map generator - not playable.", "BaseTerrain" : "grass1_spring", - "BaseHeight" : 0, "Keywords": ["demo"] } } diff --git a/binaries/data/mods/public/maps/random/northern_lights.js b/binaries/data/mods/public/maps/random/northern_lights.js index 898d733039..6be3a3fb53 100644 --- a/binaries/data/mods/public/maps/random/northern_lights.js +++ b/binaries/data/mods/public/maps/random/northern_lights.js @@ -26,7 +26,12 @@ const aIceberg = "actor|props/special/eyecandy/iceberg.xml"; const pForestD = [tForestFloor + TERRAIN_SEPARATOR + oPine, tForestFloor, tForestFloor]; const pForestS = [tForestFloor + TERRAIN_SEPARATOR + oPine, tForestFloor, tForestFloor, tForestFloor]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightSeaGround = -5; +const heightLake = -4; +const heightLand = 3; +const heightHill = 25; + +InitMap(heightLand, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -44,8 +49,6 @@ var clMetal = createTileClass(); var clFood = createTileClass(); var clBaseResource = createTileClass(); -var landHeight = getMapBaseHeight(); - placePlayerBases({ "PlayerPlacement": playerPlacementLine(true, new Vector2D(fractionToTiles(0.45), mapCenter.y), fractionToTiles(0.2)), "PlayerTileClass": clPlayer, @@ -76,8 +79,8 @@ paintRiver({ "width": 2 * fractionToTiles(0.31), "fadeDist": 8, "deviation": 0, - "waterHeight": -5, - "landHeight": landHeight, + "heightRiverbed": heightSeaGround, + "heightLand": heightLand, "meanderShort": 0, "meanderLong": 0 }); @@ -96,7 +99,7 @@ for (let i = 0; i < scaleByMapSize(20, 120); ++i) Math.floor(fractionToTiles(randFloat(0.67, 0.74)))), [ new LayeredPainter([tSnowA, tSnowA], [2]), - new SmoothElevationPainter(ELEVATION_SET, landHeight, 3), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 3), unPaintClass(clWater) ]); @@ -105,7 +108,7 @@ createAreas( new ChainPlacer(1, Math.floor(scaleByMapSize(4, 6)), Math.floor(scaleByMapSize(16, 40)), 0.1), [ new LayeredPainter([tSnowA, tSnowA], [3]), - new SmoothElevationPainter(ELEVATION_SET, landHeight, 3), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 3), paintClass(clIsland), unPaintClass(clWater) ], @@ -119,7 +122,7 @@ createAreas( new ChainPlacer(1, Math.floor(scaleByMapSize(5, 7)), Math.floor(scaleByMapSize(20, 50)), 0.1), [ new LayeredPainter([tShoreBlend, tShore, tWater], [1, 1]), - new SmoothElevationPainter(ELEVATION_SET, -4, 3), + new SmoothElevationPainter(ELEVATION_SET, heightLake, 3), paintClass(clWater) ], avoidClasses(clPlayer, 20, clWater, 20), @@ -135,7 +138,7 @@ createAreas( new ChainPlacer(1, Math.floor(scaleByMapSize(4, 6)), Math.floor(scaleByMapSize(16, 40)), 0.1), [ new LayeredPainter([tCliff, tSnowA], [3]), - new SmoothElevationPainter(ELEVATION_SET, 25, 3), + new SmoothElevationPainter(ELEVATION_SET, heightHill, 3), paintClass(clHill) ], avoidClasses(clPlayer, 20, clHill, 15, clWater, 2, clBaseResource, 2), diff --git a/binaries/data/mods/public/maps/random/northern_lights.json b/binaries/data/mods/public/maps/random/northern_lights.json index 2fee5d3557..cca8ae6301 100644 --- a/binaries/data/mods/public/maps/random/northern_lights.json +++ b/binaries/data/mods/public/maps/random/northern_lights.json @@ -4,8 +4,7 @@ "Script" : "northern_lights.js", "Description" : "Players start in a tough map to play with scarce wood and dangerous polar animals.", "BaseTerrain" : ["polar_snow_b"], - "BaseHeight" : 3, "Preview" : "northern_lights.png", "CircularMap" : true } -} \ No newline at end of file +} diff --git a/binaries/data/mods/public/maps/random/oasis.js b/binaries/data/mods/public/maps/random/oasis.js index 5fda9924e9..749c4a0fe6 100644 --- a/binaries/data/mods/public/maps/random/oasis.js +++ b/binaries/data/mods/public/maps/random/oasis.js @@ -32,7 +32,13 @@ const pForestMain = [tForestFloor + TERRAIN_SEPARATOR + ePalmShort, tForestFloor const pOasisForestLight = [tForestFloor + TERRAIN_SEPARATOR + ePalmShort, tForestFloor + TERRAIN_SEPARATOR + ePalmTall, tForestFloor,tForestFloor,tForestFloor ,tForestFloor,tForestFloor,tForestFloor,tForestFloor]; -InitMap(g_MapSettings.BaseHeight, tSand); +const heightSeaGround = -3; +const heightLand = 1; +const heightOasisPath = 4; +const heightOffsetBump = 4; +const heightOffsetDune = 18; + +InitMap(heightLand, tSand); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -105,7 +111,7 @@ for (let i = 0; i < numPlayers; ++i) new ClumpPlacer(60, 0.9, 0.4, 5, watX, watY), [ new LayeredPainter([tShore, tWater], [1]), - new SmoothElevationPainter(ELEVATION_MODIFY, -5, 3) + new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 3) ], avoidClasses(clBaseResource, 0))); } @@ -146,7 +152,7 @@ createArea( new ClumpPlacer(diskArea(forestDistance + shoreDistance + waterRadius), 0.8, 0.2, 10, mapCenter.x, mapCenter.y), [ new LayeredPainter([pOasisForestLight, tWater], [forestDistance]), - new SmoothElevationPainter(ELEVATION_SET, -3, forestDistance + shoreDistance), + new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, forestDistance + shoreDistance), paintClass(clOasis) ]); @@ -155,7 +161,7 @@ Engine.SetProgress(40); log("Creating bumps..."); createAreas( new ClumpPlacer(scaleByMapSize(20, 50), 0.3, 0.06, 1), - new SmoothElevationPainter(ELEVATION_MODIFY, 4, 3), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetBump, 3), avoidClasses(clPlayer, 10, clBaseResource, 6, clOasis, 4), scaleByMapSize(30, 70)); @@ -171,7 +177,7 @@ createAreas( new ClumpPlacer(120, 0.3, 0.06, 1), [ new TerrainPainter(tDune), - new SmoothElevationPainter(ELEVATION_MODIFY, 18, 30) + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetDune, 30) ], avoidClasses(clPlayer, 10, clBaseResource, 6, clOasis, 4, clForest, 4), scaleByMapSize(15, 50)); @@ -187,7 +193,7 @@ if (mapSize > 150 && randBool()) new PathPlacer(points[0].x, points[0].y, points[1].x, points[1].y, pathWidth, 0.4, 1, 0.2, 0), [ new TerrainPainter(tSand), - new SmoothElevationPainter(ELEVATION_SET, 4, 5), + new SmoothElevationPainter(ELEVATION_SET, hOasisPath, 5), paintClass(clPassage) ]); } diff --git a/binaries/data/mods/public/maps/random/oasis.json b/binaries/data/mods/public/maps/random/oasis.json index 9fd6b0ec03..8507301fc9 100644 --- a/binaries/data/mods/public/maps/random/oasis.json +++ b/binaries/data/mods/public/maps/random/oasis.json @@ -4,8 +4,7 @@ "Script" : "oasis.js", "Description" : "Players start around a small oasis in the center of the map which holds much of the available wood on the map.", "BaseTerrain" : ["medit_dirt", "medit_dirt_b", "medit_dirt_c"], - "BaseHeight" : 1, "Preview" : "oasis.png", "CircularMap" : true } -} \ No newline at end of file +} diff --git a/binaries/data/mods/public/maps/random/persian_highlands.js b/binaries/data/mods/public/maps/random/persian_highlands.js index c7763e1a8c..4445f8cfd1 100644 --- a/binaries/data/mods/public/maps/random/persian_highlands.js +++ b/binaries/data/mods/public/maps/random/persian_highlands.js @@ -47,7 +47,10 @@ const aDecorativeRock = "actor|geology/stone_desert_med.xml"; const pForestO = [tForestFloor + TERRAIN_SEPARATOR + oOak, tForestFloor + TERRAIN_SEPARATOR + oOak, tForestFloor, tDirtMain, tDirtMain]; -InitMap(g_MapSettings.BaseHeight, tDirtMain); +const heightLand = 10; +const heightOffsetValley = -10; + +InitMap(heightLand, tDirtMain); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -143,7 +146,7 @@ createArea( [Math.floor(scaleByMapSize(18, 68))]), [ new LayeredPainter([tLakebed2, tLakebed1], [6]), - new SmoothElevationPainter(ELEVATION_MODIFY, -10, 8), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetValley, 8), paintClass(clCP) ], avoidClasses(clPlayer, 18)); diff --git a/binaries/data/mods/public/maps/random/persian_highlands.json b/binaries/data/mods/public/maps/random/persian_highlands.json index 59949fbeeb..b61974a41f 100644 --- a/binaries/data/mods/public/maps/random/persian_highlands.json +++ b/binaries/data/mods/public/maps/random/persian_highlands.json @@ -4,8 +4,7 @@ "Script" : "persian_highlands.js", "Description" : "A dry central plateau rich in minerals surrounded by rocky hills\n\nThe southern parts of Zagros Mountains were the heart of the Persian empires and population. Although the altitude is high, the southern parts are drier that the northern Zagros, leading to a semi-arid climate. Still there are some sparse oak forests in the higher grounds.", "BaseTerrain" : ["desert_dirt_persia_2", "desert_dirt_persia_1" , "desert_dirt_persia_2", "grass_field_dry", "grass_field_dry"], - "BaseHeight" : 10, "Preview" : "persian_highlands.png", "CircularMap" : true } -} \ No newline at end of file +} diff --git a/binaries/data/mods/public/maps/random/phoenician_levant.js b/binaries/data/mods/public/maps/random/phoenician_levant.js index b5135fd83c..7c434d95c0 100644 --- a/binaries/data/mods/public/maps/random/phoenician_levant.js +++ b/binaries/data/mods/public/maps/random/phoenician_levant.js @@ -39,7 +39,14 @@ const aDecorativeRock = "actor|geology/stone_granite_med.xml"; const pForest = [tForestFloor + TERRAIN_SEPARATOR + oDatePalm, tForestFloor + TERRAIN_SEPARATOR + oSDatePalm, tForestFloor + TERRAIN_SEPARATOR + oCarob, tForestFloor, tForestFloor]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightSeaGround = -3; +const heightShore = -1.5; +const heightLand = 1; +const heightIsland = 6; +const heightHill = 15; +const heightOffsetBump = 2; + +InitMap(heightLand, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -58,10 +65,6 @@ var clGrass = createTileClass(); var clHill = createTileClass(); var clIsland = createTileClass(); -var waterHeight = -3; -var shoreHeight = -1.5; -var landHeight = getMapBaseHeight(); - placePlayerBases({ "PlayerPlacement": playerPlacementLine(false, new Vector2D(fractionToTiles(0.76), mapCenter.y), fractionToTiles(0.2)), "PlayerTileClass": clPlayer, @@ -98,21 +101,21 @@ paintRiver({ "width": mapSize, "fadeDist": scaleByMapSize(6, 25), "deviation": 0, - "waterHeight": waterHeight, - "landHeight": landHeight, + "heightRiverbed": heightSeaGround, + "heightLand": heightLand, "meanderShort": 20, "meanderLong": 0 }); Engine.SetProgress(40); -paintTileClassBasedOnHeight(-Infinity, landHeight, Elevation_ExcludeMin_ExcludeMax, clWater); -paintTerrainBasedOnHeight(-Infinity, shoreHeight, Elevation_ExcludeMin_ExcludeMax, tWater); -paintTerrainBasedOnHeight(shoreHeight, landHeight, Elevation_ExcludeMin_ExcludeMax, tShore); +paintTileClassBasedOnHeight(-Infinity, heightLand, Elevation_ExcludeMin_ExcludeMax, clWater); +paintTerrainBasedOnHeight(-Infinity, heightShore, Elevation_ExcludeMin_ExcludeMax, tWater); +paintTerrainBasedOnHeight(heightShore, heightLand, Elevation_ExcludeMin_ExcludeMax, tShore); log("Creating bumps..."); createAreas( new ClumpPlacer(scaleByMapSize(20, 50), 0.3, 0.06, 1), - new SmoothElevationPainter(ELEVATION_MODIFY, 2, 2), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetBump, 2), avoidClasses(clWater, 2, clPlayer, 20), scaleByMapSize(100, 200)); @@ -121,7 +124,7 @@ createAreas( new ChainPlacer(1, Math.floor(scaleByMapSize(4, 6)), Math.floor(scaleByMapSize(16, 40)), 0.5), [ new LayeredPainter([tCliff, tHill], [2]), - new SmoothElevationPainter(ELEVATION_SET, 15, 2), + new SmoothElevationPainter(ELEVATION_SET, heightHill, 2), paintClass(clHill) ], avoidClasses(clPlayer, 20, clForest, 1, clHill, 15, clWater, 0), @@ -174,7 +177,7 @@ createAreas( new ClumpPlacer(diskArea(fractionToTiles(0.08)), 0.2, 0.1, 0.01), [ new LayeredPainter([tShore, tHill], [12]), - new SmoothElevationPainter(ELEVATION_SET, 6, 8), + new SmoothElevationPainter(ELEVATION_SET, heightIsland, 8), paintClass(clIsland), unPaintClass(clWater) ], diff --git a/binaries/data/mods/public/maps/random/phoenician_levant.json b/binaries/data/mods/public/maps/random/phoenician_levant.json index 3fe573390a..a3a2fe223c 100644 --- a/binaries/data/mods/public/maps/random/phoenician_levant.json +++ b/binaries/data/mods/public/maps/random/phoenician_levant.json @@ -4,8 +4,7 @@ "Script" : "phoenician_levant.js", "Description" : "Players start in the eastern part of the map while a great sea is located to the west.", "BaseTerrain" : ["medit_dirt", "medit_dirt_b", "medit_dirt_c", "medit_rocks_grass", "medit_rocks_grass"], - "BaseHeight" : 1, "Preview" : "phoenician_levant.png", "CircularMap" : false } -} \ No newline at end of file +} diff --git a/binaries/data/mods/public/maps/random/polar_sea.js b/binaries/data/mods/public/maps/random/polar_sea.js index 05305c68e3..ac07f0e3ef 100644 --- a/binaries/data/mods/public/maps/random/polar_sea.js +++ b/binaries/data/mods/public/maps/random/polar_sea.js @@ -1,7 +1,6 @@ Engine.LoadLibrary("rmgen"); var tPrimary = ["polar_snow_a"]; -var tCliff = ["polar_cliff_a", "polar_cliff_b", "polar_cliff_snow"]; var tSecondary = "polar_snow_glacial"; var tHalfSnow = ["ice_01", "ice_dirt"]; var tSnowLimited = ["polar_snow_b", "polar_ice"]; @@ -28,7 +27,11 @@ var aRockLarge = "actor|geology/stone_granite_med.xml"; var aRockMedium = "actor|geology/stone_granite_med.xml"; var aIceberg = "actor|props/special/eyecandy/iceberg.xml"; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +var heightSeaGround = -4; +var heightLand = 2; +var heightCliff = 3; + +InitMap(heightLand, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -44,10 +47,6 @@ var clFood = createTileClass(); var clBaseResource = createTileClass(); var clArcticWolf = createTileClass(); -var waterHeight = -4; -var cliffHeight = getMapBaseHeight() + 1; -var snowHeight = Math.floor(scaleByMapSize(20, 40)); - var [playerIDs, playerPosition] = playerPlacementCircle(fractionToTiles(0.35)); var treasures = [{ @@ -102,13 +101,11 @@ createArea( [Math.floor(fractionToTiles(0.17))]), [ new LayeredPainter([tShore, tWater, tWater, tWater], [1, 4, 2]), - new SmoothElevationPainter(ELEVATION_SET, waterHeight, 4), + new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 4), paintClass(clWater) ], avoidClasses(clPlayer, 20)); -paintTerrainBasedOnHeight(cliffHeight, snowHeight, Elevation_ExcludeMin_ExcludeMax, tCliff); -paintTerrainBasedOnHeight(snowHeight, Infinity, Elevation_IncludeMin_IncludeMax, tSnowLimited); Engine.SetProgress(40); log("Creating small lakes..."); @@ -137,7 +134,7 @@ for (let i = 0; i < numLakes ; ++i) chosenPoint[1]), [ new LayeredPainter([tShore, tWater, tWater], [1, 3]), - new SmoothElevationPainter(ELEVATION_SET, waterHeight, 5), + new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 5), paintClass(clWater) ], avoidClasses(clPlayer, 20), @@ -153,7 +150,8 @@ log("Creating hills..."); createHills( [tPrimary, tPrimary, tSecondary], avoidClasses(clPlayer, 20, clHill, 35), - clHill, scaleByMapSize(20, 240)); + clHill, + scaleByMapSize(20, 240)); Engine.SetProgress(65); log("Creating dirt patches..."); diff --git a/binaries/data/mods/public/maps/random/polar_sea.json b/binaries/data/mods/public/maps/random/polar_sea.json index a7bfd9dc00..e728655c0a 100644 --- a/binaries/data/mods/public/maps/random/polar_sea.json +++ b/binaries/data/mods/public/maps/random/polar_sea.json @@ -4,7 +4,6 @@ "Script" : "polar_sea.js", "Description" : "Players start in a cold polar region barren of vegetation. In the sea fish and whales abound, while the fragile icy land teems with huntable walruses and deadly wolves. These wolves, made ravenous by the harsh and forbidding climate, drawn by the scent of prey, have started appearing in terrifying numbers. A wise and strong ruler will not only achieve victory over his enemies, but also keep the number of these beasts at bay, lest they undermine his economy and cause his downfall. [color=\"red\"]Warning: It is inadvisable to disable treasures, since there is no gatherable wood. Not recommended for inexperienced players.[/color]", "BaseTerrain" : ["polar_snow_a"], - "BaseHeight" : 2, "Keywords": ["trigger"], "Preview" : "polar_sea.png", "CircularMap" : true, diff --git a/binaries/data/mods/public/maps/random/pyrenean_sierra.js b/binaries/data/mods/public/maps/random/pyrenean_sierra.js index c97a6c8114..63c95df92f 100644 --- a/binaries/data/mods/public/maps/random/pyrenean_sierra.js +++ b/binaries/data/mods/public/maps/random/pyrenean_sierra.js @@ -58,7 +58,11 @@ const pForestLandVeryLight = [ tGrassLandForest2 + TERRAIN_SEPARATOR + oPine,tGr tGrassLandForest,tForestTransition,tGrassLandForest2,tForestTransition, tGrassLandForest2,tGrassLandForest2,tGrassLandForest2,tGrassLandForest2]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightLand = -100; +const heightOffsetHill = 7; +const heightOffsetHillRandom = 2; + +InitMap(heightLand, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -204,7 +208,6 @@ Engine.SetProgress(48); log("Creating passages..."); var passageLocation = 0.35; -var passageHeight = MountainHeight - 25; var passageLength = scaleByMapSize(8, 50); var passageVec = mountainVec.perpendicular().normalize().mult(passageLength); @@ -217,7 +220,7 @@ for (let passLoc of [passageLocation, 1 - passageLocation]) createPassage({ "start": passageStart, "end": passageEnd, - "startHeight": passageHeight, + "startHeight": MountainHeight - 25, "startWidth": 7, "endWidth": 7, "smoothWidth": 2, @@ -289,7 +292,7 @@ log("Creating hills..."); createAreas( new ClumpPlacer(scaleByMapSize(60, 120), 0.3, 0.06, 5), [ - new SmoothElevationPainter(ELEVATION_MODIFY, 7, 4, 2), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetHill, 4, heightOffsetHillRandom), new TerrainPainter(tGrassSpecific), paintClass(clHill) ], diff --git a/binaries/data/mods/public/maps/random/pyrenean_sierra.json b/binaries/data/mods/public/maps/random/pyrenean_sierra.json index 7072c0bff4..4b4a74af81 100644 --- a/binaries/data/mods/public/maps/random/pyrenean_sierra.json +++ b/binaries/data/mods/public/maps/random/pyrenean_sierra.json @@ -4,8 +4,7 @@ "Script" : "pyrenean_sierra.js", "Description" : "High mountains separating the enemies.\n\nThe Pyrenees is a great mountain range located between modern France and Spain.", "BaseTerrain" : ["alpine_dirt_grass_50"], - "BaseHeight" : -100, "Preview" : "pyrenean_sierra.png", "CircularMap" : true } -} \ No newline at end of file +} diff --git a/binaries/data/mods/public/maps/random/rhine_marshlands.js b/binaries/data/mods/public/maps/random/rhine_marshlands.js index fb0d0c8ca1..91b5c76000 100644 --- a/binaries/data/mods/public/maps/random/rhine_marshlands.js +++ b/binaries/data/mods/public/maps/random/rhine_marshlands.js @@ -34,7 +34,12 @@ const aBushSmall = "actor|props/flora/bush_medit_sm.xml"; const pForestD = [tForestFloor + TERRAIN_SEPARATOR + oBeech, tForestFloor]; const pForestP = [tForestFloor + TERRAIN_SEPARATOR + oOak, tForestFloor]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightMarsh = -2 +const heightLand = 1; +const heightOffsetBumpWater = 1; +const heightOffsetBumpLand = 2; + +InitMap(heightLand, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); @@ -78,7 +83,7 @@ Engine.SetProgress(15); log("Creating bumps..."); createAreas( new ClumpPlacer(scaleByMapSize(20, 50), 0.3, 0.06, 1), - new SmoothElevationPainter(ELEVATION_MODIFY, 2, 2), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetBumpLand, 2), avoidClasses(clPlayer, 13), scaleByMapSize(300, 800)); @@ -88,7 +93,7 @@ for (let i = 0; i < 7; ++i) new ChainPlacer(1, Math.floor(scaleByMapSize(6, 12)), Math.floor(scaleByMapSize(15, 60)), 0.8), [ new LayeredPainter([tShoreBlend, tShore, tWater], [1, 1]), - new SmoothElevationPainter(ELEVATION_SET, -2, 3), + new SmoothElevationPainter(ELEVATION_SET, heightMarsh, 3), paintClass(clWater) ], avoidClasses(clPlayer, 20, clWater, Math.round(scaleByMapSize(7,16)*randFloat(0.8,1.35))), @@ -105,7 +110,7 @@ Engine.SetProgress(40); log("Creating bumps..."); createAreas( new ClumpPlacer(scaleByMapSize(20, 50), 0.3, 0.06, 1), - new SmoothElevationPainter(ELEVATION_MODIFY, 1, 2), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetBumpWater, 2), stayClasses(clWater, 2), scaleByMapSize(50, 100)); diff --git a/binaries/data/mods/public/maps/random/rhine_marshlands.json b/binaries/data/mods/public/maps/random/rhine_marshlands.json index df5aad0337..305c015dfe 100644 --- a/binaries/data/mods/public/maps/random/rhine_marshlands.json +++ b/binaries/data/mods/public/maps/random/rhine_marshlands.json @@ -4,8 +4,7 @@ "Script" : "rhine_marshlands.js", "Description" : "Shallow, passable wetlands with little room for building. Represents the lowlands of the Rhine basin in Europe.", "BaseTerrain" : ["temp_grass", "temp_grass", "temp_grass_d"], - "BaseHeight" : 1, "Preview" : "rhine_marshlands.png", "CircularMap" : true } -} \ No newline at end of file +} diff --git a/binaries/data/mods/public/maps/random/river_archipelago.js b/binaries/data/mods/public/maps/random/river_archipelago.js index df3ffa9dee..8e1ee2bcbf 100644 --- a/binaries/data/mods/public/maps/random/river_archipelago.js +++ b/binaries/data/mods/public/maps/random/river_archipelago.js @@ -39,7 +39,11 @@ const pForestD = [tForestFloor + TERRAIN_SEPARATOR + oTree, tForestFloor]; const pForestP1 = [tForestFloor + TERRAIN_SEPARATOR + oPalm1, tForestFloor]; const pForestP2 = [tForestFloor + TERRAIN_SEPARATOR + oPalm2, tForestFloor]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightSeaGround = -8; +const heightLand = 3; +const heightHill = 25; + +InitMap(heightSeaGround, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); const mapCenter = getMapCenter(); @@ -88,7 +92,7 @@ for (let i = 0; i < stripWidths.length; ++i) Math.floor(fractionToTiles(randFloat(0, 1)))), [ new LayeredPainter([tGrass, tGrass], [2]), - new SmoothElevationPainter(ELEVATION_SET, 3, 3), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 3), paintClass(clStrip[i]) ]); } @@ -106,7 +110,7 @@ for (let i = 0; i < numPlayers; ++i) new ChainPlacer(1, 6, 40, 1, playerPosition[i].x, playerPosition[i].y, 0, [Math.floor(playerRadius)]), [ new LayeredPainter([tGrass, tGrass, tGrass], [1, 4]), - new SmoothElevationPainter(ELEVATION_SET, 3, 4), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 4), paintClass(clPlayerTerritory) ]); @@ -114,6 +118,7 @@ placePlayerBases({ "PlayerPlacement": [playerIDs, playerPosition], "PlayerTileClass": clPlayer, "BaseResourceClass": clBaseResource, + "baseResourceConstraint": stayClasses(clPlayerTerritory, 4), "Walls": "towers", "CityPatch": { "outerTerrain": tRoadWild, @@ -179,7 +184,7 @@ createAreas( new ChainPlacer(1, Math.floor(scaleByMapSize(4, 6)), Math.floor(scaleByMapSize(16, 40)), 0.1), [ new LayeredPainter([tCliff, tGrass], [3]), - new SmoothElevationPainter(ELEVATION_SET, 25, 3), + new SmoothElevationPainter(ELEVATION_SET, heightHill, 3), paintClass(clHill) ], [ diff --git a/binaries/data/mods/public/maps/random/river_archipelago.json b/binaries/data/mods/public/maps/random/river_archipelago.json index b78526b766..84e185402a 100644 --- a/binaries/data/mods/public/maps/random/river_archipelago.json +++ b/binaries/data/mods/public/maps/random/river_archipelago.json @@ -4,7 +4,6 @@ "Script" : "river_archipelago.js", "Description" : "Narrow strips of lands are separated by waterways, leaving few and shallow landbridges between them. Tropical wetlands provide plenty of game, but beware of Mauryan tribesmen when exploring the outermost islands.", "BaseTerrain" : ["tropic_grass_c", "tropic_grass_c", "tropic_grass_c", "tropic_grass_c", "tropic_grass_plants", "tropic_plants", "tropic_plants_b"], - "BaseHeight" : -8, "Keywords": ["naval"], "Preview" : "river_archipelago.png", "CircularMap" : true diff --git a/binaries/data/mods/public/maps/random/rivers.js b/binaries/data/mods/public/maps/random/rivers.js index 672ea1f909..310685e7b9 100644 --- a/binaries/data/mods/public/maps/random/rivers.js +++ b/binaries/data/mods/public/maps/random/rivers.js @@ -46,7 +46,11 @@ const aBushSmall = g_Decoratives.bushSmall; const pForest1 = [tForestFloor2 + TERRAIN_SEPARATOR + oTree1, tForestFloor2 + TERRAIN_SEPARATOR + oTree2, tForestFloor2]; const pForest2 = [tForestFloor1 + TERRAIN_SEPARATOR + oTree4, tForestFloor1 + TERRAIN_SEPARATOR + oTree5, tForestFloor1]; -InitMap(g_MapSettings.BaseHeight, tMainTerrain); +const heightSeaGround = -3; +const heightShallows = -1; +const heightLand = 1; + +InitMap(heightLand, tMainTerrain); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -63,9 +67,6 @@ var clFood = createTileClass(); var clBaseResource = createTileClass(); var clShallow = createTileClass(); -var waterHeight = -3; -var shallowHeight = -1; - var [playerIDs, playerPosition, playerAngle, startAngle] = playerPlacementCircle(fractionToTiles(0.35)); placePlayerBases({ @@ -101,7 +102,7 @@ createArea( new ClumpPlacer(diskArea(fractionToTiles(0.075)), 0.7, 0.1, 10, mapCenter.x, mapCenter.y), [ new LayeredPainter([tShore, tWater, tWater, tWater], [1, 4, 2]), - new SmoothElevationPainter(ELEVATION_SET, waterHeight, 4), + new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 4), paintClass(clWater) ]); @@ -123,20 +124,20 @@ for (let i = 0; i < numRivers; ++i) "width": scaleByMapSize(10, 30), "fadeDist": 5, "deviation": 0, - "landHeight": getMapBaseHeight(), - "waterHeight": waterHeight, - "minHeight": waterHeight, + "heightLand": heightLand, + "heightRiverbed": heightSeaGround, + "minHeight": heightSeaGround, "meanderShort": 10, "meanderLong": 0, "waterFunc": (ix, iz, height, riverFraction) => { addToClass(ix, iz, clWater); - let isShallow = height < shallowHeight && + let isShallow = height < heightShallows && riverFraction > shallowLocation && riverFraction < shallowLocation + shallowWidth; - let newHeight = isShallow ? shallowHeight : Math.max(height, waterHeight); + let newHeight = isShallow ? heightShallows : Math.max(height, heightSeaGround); if (getHeight(ix, iz) < newHeight) return; diff --git a/binaries/data/mods/public/maps/random/rivers.json b/binaries/data/mods/public/maps/random/rivers.json index c184b544d5..9ad8f717d8 100644 --- a/binaries/data/mods/public/maps/random/rivers.json +++ b/binaries/data/mods/public/maps/random/rivers.json @@ -4,7 +4,6 @@ "Script" : "rivers.js", "Description" : "Rivers flow between players and join each other in the center of the map.", "BaseTerrain" : ["temp_grass", "temp_grass_c"], - "BaseHeight" : 1, "Preview" : "rivers.png", "SupportedBiomes": true, "CircularMap" : true diff --git a/binaries/data/mods/public/maps/random/rmgen/gaia_terrain.js b/binaries/data/mods/public/maps/random/rmgen/gaia_terrain.js index ac686976d0..ae1bedaea4 100644 --- a/binaries/data/mods/public/maps/random/rmgen/gaia_terrain.js +++ b/binaries/data/mods/public/maps/random/rmgen/gaia_terrain.js @@ -319,8 +319,8 @@ function createLayeredPatches(sizes, terrains, terrainWidths, constraint, count, * @property width - Size between the two shorelines. * @property fadeDist - Size of the shoreline. * @property deviation - Fuzz effect on the shoreline if greater than 0. - * @property waterHeight - Ground height of the riverbed. - * @proeprty landHeight - Ground height of the end of the shoreline. + * @property heightRiverbed - Ground height of the riverbed. + * @proeprty heightLand - Ground height of the end of the shoreline. * @property meanderShort - Strength of frequent meanders. * @property meanderLong - Strength of less frequent meanders. * @property [constraint] - If given, ignores any tiles that don't satisfy the given Constraint. @@ -398,12 +398,12 @@ function paintRiver(args) // Create the elevation for the water and the slopy shoreline and call the user functions. if (shoreDist1 < 0 && shoreDist2 > 0) { - let height = args.waterHeight; + let height = args.heightRiverbed; if (shoreDist1 > -args.fadeDist) - height += (args.landHeight - args.waterHeight) * (1 + shoreDist1 / args.fadeDist); + height += (args.heightLand - args.heightRiverbed) * (1 + shoreDist1 / args.fadeDist); else if (shoreDist2 < args.fadeDist) - height += (args.landHeight - args.waterHeight) * (1 - shoreDist2 / args.fadeDist); + height += (args.heightLand - args.heightRiverbed) * (1 - shoreDist2 / args.fadeDist); if (args.minHeight === undefined || height < args.minHeight) setHeight(ix, iz, height); @@ -448,14 +448,14 @@ function rndRiver(f, seed) /** * Add small rivers with shallows starting at a central river ending at the map border, if the given Constraint is met. */ -function createTributaryRivers(horizontal, riverCount, riverWidth, waterHeight, heightRange, maxAngle, tributaryRiverTileClass, shallowTileClass, constraint) +function createTributaryRivers(horizontal, riverCount, riverWidth, heightRiverbed, heightRange, maxAngle, tributaryRiverTileClass, shallowTileClass, constraint) { log("Creating tributary rivers..."); let waviness = 0.4; let smoothness = scaleByMapSize(3, 12); let offset = 0.1; let tapering = 0.05; - let shallowHeight = -2; + let heightShallow = -2; let riverAngle = horizontal ? 0 : Math.PI / 2; let mapSize = getMapSize(); @@ -495,7 +495,7 @@ function createTributaryRivers(horizontal, riverCount, riverWidth, waterHeight, offset, tapering), [ - new SmoothElevationPainter(ELEVATION_SET, waterHeight, 4), + new SmoothElevationPainter(ELEVATION_SET, heightRiverbed, 4), paintClass(tributaryRiverTileClass) ], new AndConstraint([constraint, riverConstraint]))) @@ -504,7 +504,7 @@ function createTributaryRivers(horizontal, riverCount, riverWidth, waterHeight, // Create small puddles at the map border to ensure players being separated createArea( new ClumpPlacer(Math.floor(diskArea(riverWidth / 2)), 0.95, 0.6, 10, end.x, end.y), - new SmoothElevationPainter(ELEVATION_SET, waterHeight, 3), + new SmoothElevationPainter(ELEVATION_SET, heightRiverbed, 3), constraint); } @@ -517,9 +517,9 @@ function createTributaryRivers(horizontal, riverCount, riverWidth, waterHeight, "startWidth": scaleByMapSize(8, 12), "endWidth": scaleByMapSize(8, 12), "smoothWidth": 2, - "startHeight": shallowHeight, - "endHeight": shallowHeight, - "maxHeight": shallowHeight, + "startHeight": heightShallow, + "endHeight": heightShallow, + "maxHeight": heightShallow, "tileClass": shallowTileClass }); } diff --git a/binaries/data/mods/public/maps/random/rmgen/library.js b/binaries/data/mods/public/maps/random/rmgen/library.js index 6f70287057..946fc1181e 100644 --- a/binaries/data/mods/public/maps/random/rmgen/library.js +++ b/binaries/data/mods/public/maps/random/rmgen/library.js @@ -199,11 +199,6 @@ function isCircularMap() return !!g_MapSettings.CircularMap; } -function getMapBaseHeight() -{ - return g_MapSettings.BaseHeight; -} - function createTileClass() { return g_Map.createTileClass(); diff --git a/binaries/data/mods/public/maps/random/saharan_oases.js b/binaries/data/mods/public/maps/random/saharan_oases.js index b313f84bca..35e6bf8f76 100644 --- a/binaries/data/mods/public/maps/random/saharan_oases.js +++ b/binaries/data/mods/public/maps/random/saharan_oases.js @@ -32,7 +32,10 @@ const aDecorativeRock = "actor|geology/stone_desert_med.xml"; const pForest = [tLush + TERRAIN_SEPARATOR + oDatePalm, tLush + TERRAIN_SEPARATOR + oSDatePalm, tLush]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightLand = 1; +const heightOffsetOasis = -3; + +InitMap(heightLand, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -89,7 +92,7 @@ for (let i = 0; i < numPlayers; ++i) new LayeredPainter( [tSLush ,[tLush, pForest], [tLush, pForest], tShore, tShore, tWaterDeep], [2, 2, 1, 3, 1]), - new SmoothElevationPainter(ELEVATION_MODIFY, -3, 10), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetOasis, 10), paintClass(clWater) ]); } diff --git a/binaries/data/mods/public/maps/random/saharan_oases.json b/binaries/data/mods/public/maps/random/saharan_oases.json index 92bd9745d5..2c53177494 100644 --- a/binaries/data/mods/public/maps/random/saharan_oases.json +++ b/binaries/data/mods/public/maps/random/saharan_oases.json @@ -4,8 +4,7 @@ "Script" : "saharan_oases.js", "Description" : "Each players starts near a lush oasis in a large, desolate desert.", "BaseTerrain" : ["desert_sand_dunes_100"], - "BaseHeight" : 1, "Preview" : "saharan_oases.png", "CircularMap" : true } -} \ No newline at end of file +} diff --git a/binaries/data/mods/public/maps/random/sahel.js b/binaries/data/mods/public/maps/random/sahel.js index ab50a29159..b1d0da6b9a 100644 --- a/binaries/data/mods/public/maps/random/sahel.js +++ b/binaries/data/mods/public/maps/random/sahel.js @@ -26,7 +26,10 @@ const oMetalLarge = "gaia/geology_metal_savanna_slabs"; const aBush = "actor|props/flora/bush_medit_sm_dry.xml"; const aRock = "actor|geology/stone_savanna_med.xml"; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightSeaGround = -5; +const heightLand = 1; + +InitMap(heightLand, g_MapSettings.BaseTerrain); var numPlayers = getNumPlayers(); var mapSize = getMapSize(); @@ -97,7 +100,7 @@ createAreas( new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), Math.floor(scaleByMapSize(20, 60)), 1), [ new LayeredPainter([tShore, tWater], [1]), - new SmoothElevationPainter(ELEVATION_SET, -5, 7), + new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 7), paintClass(clWater) ], avoidClasses(clPlayer, 24), diff --git a/binaries/data/mods/public/maps/random/sahel.json b/binaries/data/mods/public/maps/random/sahel.json index 953940bb9b..e1348cc205 100644 --- a/binaries/data/mods/public/maps/random/sahel.json +++ b/binaries/data/mods/public/maps/random/sahel.json @@ -4,7 +4,6 @@ "Script" : "sahel.js", "Description" : "A somewhat open map with an abundance of food and mineral resources, while wood is somewhat scarce.", "BaseTerrain" : "savanna_grass_a", - "BaseHeight" : 1, "Preview" : "sahel.png", "CircularMap" : true } diff --git a/binaries/data/mods/public/maps/random/sahel_watering_holes.js b/binaries/data/mods/public/maps/random/sahel_watering_holes.js index 83c5d2445d..f6e4cf6626 100644 --- a/binaries/data/mods/public/maps/random/sahel_watering_holes.js +++ b/binaries/data/mods/public/maps/random/sahel_watering_holes.js @@ -35,7 +35,13 @@ const aBushSmall = "actor|props/flora/bush_dry_a.xml"; const pForest = [tForestFloor + TERRAIN_SEPARATOR + oBaobab, tForestFloor + TERRAIN_SEPARATOR + oBaobab, tForestFloor]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightSeaGround = -4; +const heightShallows = -2; +const heightLand = 3; +const heightHill = 35; +const heightOffsetBump = 2; + +InitMap(heightLand, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -52,9 +58,6 @@ var clFood = createTileClass(); var clBaseResource = createTileClass(); var clShallows = createTileClass(); -var waterHeight = -4; -var shallowHeight = -2; - var [playerIDs, playerPosition, playerAngle, startAngle] = playerPlacementCircle(fractionToTiles(0.35)); placePlayerBases({ @@ -98,7 +101,7 @@ for (let i = 0; i < numPlayers; ++i) createArea( new ClumpPlacer(Math.floor(diskArea(scaleByMapSize(10, 50)) / 3), 0.95, 0.6, 10, riverStart[i].x, riverStart[i].y), [ - new SmoothElevationPainter(ELEVATION_SET, waterHeight, 4), + new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 4), paintClass(clWater) ], avoidClasses(clPlayer, 5)); @@ -108,7 +111,7 @@ for (let i = 0; i < numPlayers; ++i) new PathPlacer(riverStart[i].x, riverStart[i].y, riverEnd[i].x, riverEnd[i].y, scaleByMapSize(10, 50), 0.2, 3 * scaleByMapSize(1, 4), 0.2, 0.05), [ new LayeredPainter([tShore, tWater, tWater], [1, 3]), - new SmoothElevationPainter(ELEVATION_SET, waterHeight, 4), + new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 4), paintClass(clWater) ], avoidClasses(clPlayer, 5)); @@ -117,7 +120,7 @@ for (let i = 0; i < numPlayers; ++i) createArea( new ClumpPlacer(Math.floor(diskArea(scaleByMapSize(10, 50)) / 5), 0.95, 0.6, 10, riverEnd[i].x, riverEnd[i].y), [ - new SmoothElevationPainter(ELEVATION_SET, waterHeight, 4), + new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 4), paintClass(clWater) ], avoidClasses(clPlayer, 5)); @@ -129,9 +132,9 @@ for (let i = 0; i < numPlayers; ++i) "startWidth": 10, "endWidth": 10, "smoothWidth": 4, - "startHeight": shallowHeight, - "endHeight": shallowHeight, - "maxHeight": shallowHeight, + "startHeight": heightShallows, + "endHeight": heightShallows, + "maxHeight": heightShallows, "tileClass": clShallows }); @@ -157,7 +160,7 @@ paintTerrainBasedOnHeight(-6, 2, 1, tWater); log("Creating bumps..."); createAreas( new ClumpPlacer(scaleByMapSize(20, 50), 0.3, 0.06, 1), - new SmoothElevationPainter(ELEVATION_MODIFY, 2, 2), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetBump, 2), avoidClasses(clWater, 2, clPlayer, 20), scaleByMapSize(100, 200)); @@ -166,7 +169,7 @@ createAreas( new ClumpPlacer(scaleByMapSize(20, 150), 0.2, 0.1, 1), [ new LayeredPainter([tGrass, tCliff, tHill], [1, 2]), - new SmoothElevationPainter(ELEVATION_SET, 35, 3), + new SmoothElevationPainter(ELEVATION_SET, heightHill, 3), paintClass(clHill) ], avoidClasses(clPlayer, 20, clHill, 15, clWater, 3), diff --git a/binaries/data/mods/public/maps/random/sahel_watering_holes.json b/binaries/data/mods/public/maps/random/sahel_watering_holes.json index 925a52f559..083ffb291b 100644 --- a/binaries/data/mods/public/maps/random/sahel_watering_holes.json +++ b/binaries/data/mods/public/maps/random/sahel_watering_holes.json @@ -4,8 +4,7 @@ "Script" : "sahel_watering_holes.js", "Description" : "Players start around the map with lines of water between them\n\nThe African savanna is chocked full of animal life for hunting, while the nearby mineral deposits are plentiful. The dry season is approaching and the watering holes are drying up.", "BaseTerrain" : ["savanna_grass_a"], - "BaseHeight" : 3, "CircularMap" : true, "Preview" : "sahel_watering_holes.png" } -} \ No newline at end of file +} diff --git a/binaries/data/mods/public/maps/random/schwarzwald.js b/binaries/data/mods/public/maps/random/schwarzwald.js index f656322e70..6069fd2e03 100644 --- a/binaries/data/mods/public/maps/random/schwarzwald.js +++ b/binaries/data/mods/public/maps/random/schwarzwald.js @@ -3,7 +3,10 @@ Engine.LoadLibrary("heightmap"); log('Initializing map...'); -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightLand = 1; +const heightOffsetPath = -0.1; + +InitMap(heightLand, g_MapSettings.BaseTerrain); setSkySet("fog"); setFogFactor(0.35); @@ -111,9 +114,9 @@ var heightRange = {'min': MIN_HEIGHT * (g_Map.size + 512) / 8192, 'max': MAX_HEI // Set average water coverage var averageWaterCoverage = 1/5; // NOTE: Since erosion is not predictable actual water coverage might vary much with the same values -var waterHeight = -MIN_HEIGHT + heightRange.min + averageWaterCoverage * (heightRange.max - heightRange.min); -var waterHeightAdjusted = waterHeight + MIN_HEIGHT; -setWaterHeight(waterHeight); +var heightSeaGround = -MIN_HEIGHT + heightRange.min + averageWaterCoverage * (heightRange.max - heightRange.min); +var heightSeaGroundAdjusted = heightSeaGround + MIN_HEIGHT; +setWaterHeight(heightSeaGround); // Setting a 3x3 Grid as initial heightmap var initialReliefmap = [[heightRange.max, heightRange.max, heightRange.max], [heightRange.max, heightRange.min, heightRange.max], [heightRange.max, heightRange.max, heightRange.max]]; @@ -126,17 +129,17 @@ for (var i = 0; i < 5; i++) rescaleHeightmap(heightRange.min, heightRange.max); var heighLimits = [ - heightRange.min + 1/3 * (waterHeightAdjusted - heightRange.min), // 0 Deep water - heightRange.min + 2/3 * (waterHeightAdjusted - heightRange.min), // 1 Medium Water - heightRange.min + (waterHeightAdjusted - heightRange.min), // 2 Shallow water - waterHeightAdjusted + 1/8 * (heightRange.max - waterHeightAdjusted), // 3 Shore - waterHeightAdjusted + 2/8 * (heightRange.max - waterHeightAdjusted), // 4 Low ground - waterHeightAdjusted + 3/8 * (heightRange.max - waterHeightAdjusted), // 5 Player and path height - waterHeightAdjusted + 4/8 * (heightRange.max - waterHeightAdjusted), // 6 High ground - waterHeightAdjusted + 5/8 * (heightRange.max - waterHeightAdjusted), // 7 Lower forest border - waterHeightAdjusted + 6/8 * (heightRange.max - waterHeightAdjusted), // 8 Forest - waterHeightAdjusted + 7/8 * (heightRange.max - waterHeightAdjusted), // 9 Upper forest border - waterHeightAdjusted + (heightRange.max - waterHeightAdjusted)]; // 10 Hilltop + heightRange.min + 1/3 * (heightSeaGroundAdjusted - heightRange.min), // 0 Deep water + heightRange.min + 2/3 * (heightSeaGroundAdjusted - heightRange.min), // 1 Medium Water + heightRange.min + (heightSeaGroundAdjusted - heightRange.min), // 2 Shallow water + heightSeaGroundAdjusted + 1/8 * (heightRange.max - heightSeaGroundAdjusted), // 3 Shore + heightSeaGroundAdjusted + 2/8 * (heightRange.max - heightSeaGroundAdjusted), // 4 Low ground + heightSeaGroundAdjusted + 3/8 * (heightRange.max - heightSeaGroundAdjusted), // 5 Player and path height + heightSeaGroundAdjusted + 4/8 * (heightRange.max - heightSeaGroundAdjusted), // 6 High ground + heightSeaGroundAdjusted + 5/8 * (heightRange.max - heightSeaGroundAdjusted), // 7 Lower forest border + heightSeaGroundAdjusted + 6/8 * (heightRange.max - heightSeaGroundAdjusted), // 8 Forest + heightSeaGroundAdjusted + 7/8 * (heightRange.max - heightSeaGroundAdjusted), // 9 Upper forest border + heightSeaGroundAdjusted + (heightRange.max - heightSeaGroundAdjusted)]; // 10 Hilltop var startLocations = getStartLocationsByHeightmap({'min': heighLimits[4], 'max': heighLimits[5]}); var playerHeight = (heighLimits[4] + heighLimits[5]) / 2; @@ -230,7 +233,7 @@ for (let i = 0; i < numPlayers + (pathBlending ? 1 : 0); ++i) new RandomPathPlacer(pathStart, pathEnd, 1.75, baseRadius / 2, pathBlending), [ new TerrainPainter(terrainPath), - new SmoothElevationPainter(ELEVATION_MODIFY, -0.1, 1), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetPath, 1), paintClass(clPath) ], avoidClasses(clPath, 0, clOpen, 0 ,clWater, 4, clBaseResource, 4)); diff --git a/binaries/data/mods/public/maps/random/schwarzwald.json b/binaries/data/mods/public/maps/random/schwarzwald.json index 5e768e4775..a96961e7bc 100644 --- a/binaries/data/mods/public/maps/random/schwarzwald.json +++ b/binaries/data/mods/public/maps/random/schwarzwald.json @@ -5,7 +5,6 @@ "Description" : "A forest heavy map with a lake in the middle and plenty of resources.", "CircularMap" : true, "BaseTerrain" : ["temp_grass_plants", "temp_plants_bog"], - "BaseHeight" : 0, "Preview" : "schwarzwald.png" } } diff --git a/binaries/data/mods/public/maps/random/snowflake_searocks.js b/binaries/data/mods/public/maps/random/snowflake_searocks.js index a46f98823e..5f54b6f334 100644 --- a/binaries/data/mods/public/maps/random/snowflake_searocks.js +++ b/binaries/data/mods/public/maps/random/snowflake_searocks.js @@ -38,7 +38,10 @@ const aBushSmall = g_Decoratives.bushSmall; const pForest1 = [tForestFloor2 + TERRAIN_SEPARATOR + oTree1, tForestFloor2 + TERRAIN_SEPARATOR + oTree2, tForestFloor2]; const pForest2 = [tForestFloor1 + TERRAIN_SEPARATOR + oTree4, tForestFloor1 + TERRAIN_SEPARATOR + oTree5, tForestFloor1]; -InitMap(g_MapSettings.BaseHeight, tWater); +const heightIsland = 20; +const heightSeaGround = -5; + +InitMap(heightSeaGround, tWater); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -54,7 +57,6 @@ var clBaseResource = createTileClass(); var clLand = createTileClass(); const playerIslandRadius = scaleByMapSize(15, 30); -const islandHeight = 20; const islandBetweenPlayerAndCenterDist = 0.16; const islandBetweenPlayerAndCenterRadius = 0.81; @@ -82,7 +84,7 @@ function createIsland(islandID, size, tileClass) new ClumpPlacer(size * diskArea(playerIslandRadius), 0.95, 0.6, 10, islandPos[islandID].x, islandPos[islandID].y), [ new LayeredPainter([tCliff, tHill], [2]), - new SmoothElevationPainter(ELEVATION_SET, islandHeight, 2), + new SmoothElevationPainter(ELEVATION_SET, heightIsland, 2), paintClass(tileClass) ]); } @@ -260,7 +262,7 @@ for (let i = 0; i < numIslands; ++i) "startWidth": 11, "endWidth": 11, "smoothWidth": 3, - "maxHeight": islandHeight - 1, + "maxHeight": heightIsland - 1, "tileClass": clLand, "terrain": tHill, "edgeTerrain": tCliff diff --git a/binaries/data/mods/public/maps/random/snowflake_searocks.json b/binaries/data/mods/public/maps/random/snowflake_searocks.json index b47501fa78..d489c0fd44 100644 --- a/binaries/data/mods/public/maps/random/snowflake_searocks.json +++ b/binaries/data/mods/public/maps/random/snowflake_searocks.json @@ -4,7 +4,6 @@ "Script" : "snowflake_searocks.js", "Description" : "Many small islands connected to each other by narrow passages.", "BaseTerrain" : ["medit_sea_depths"], - "BaseHeight" : -5, "Preview" : "snowflake_searocks.png", "SupportedBiomes": true, "CircularMap" : true diff --git a/binaries/data/mods/public/maps/random/stronghold.js b/binaries/data/mods/public/maps/random/stronghold.js index 8f73aec018..61898ea338 100644 --- a/binaries/data/mods/public/maps/random/stronghold.js +++ b/binaries/data/mods/public/maps/random/stronghold.js @@ -4,7 +4,9 @@ Engine.LoadLibrary("rmbiome"); setSelectedBiome(); -InitMap(g_MapSettings.BaseHeight, g_Terrains.mainTerrain); +const heightLand = 30; + +InitMap(heightLand, g_Terrains.mainTerrain); initTileClasses(); @@ -20,7 +22,7 @@ Engine.SetProgress(30); addElements(shuffleArray([ { "func": addBluffs, - "baseHeight": getMapBaseHeight(), + "baseHeight": heightLand, "avoid": [ g_TileClasses.bluff, 20, g_TileClasses.hill, 5, @@ -79,7 +81,7 @@ addElements(shuffleArray([ }, { "func": addValleys, - "baseHeight": getMapBaseHeight(), + "baseHeight": heightLand, "avoid": [ g_TileClasses.bluff, 5, g_TileClasses.hill, 5, diff --git a/binaries/data/mods/public/maps/random/stronghold.json b/binaries/data/mods/public/maps/random/stronghold.json index beb92c70f3..5f4d8e01d3 100644 --- a/binaries/data/mods/public/maps/random/stronghold.json +++ b/binaries/data/mods/public/maps/random/stronghold.json @@ -4,7 +4,6 @@ "Script" : "stronghold.js", "Description" : "Teams start off with nearly adjacent civic centers, offering easy military and construction cooperation. With slivers of personal territory, teammates must rely on each other to defend their rear.", "BaseTerrain" : ["medit_sea_depths"], - "BaseHeight" : 30, "Preview" : "stronghold.png", "SupportedBiomes": true, "CircularMap" : true diff --git a/binaries/data/mods/public/maps/random/survivalofthefittest.js b/binaries/data/mods/public/maps/random/survivalofthefittest.js index 2a6f9e7280..9dde92aed2 100644 --- a/binaries/data/mods/public/maps/random/survivalofthefittest.js +++ b/binaries/data/mods/public/maps/random/survivalofthefittest.js @@ -39,7 +39,10 @@ const triggerPointTreasures = [ "trigger/trigger_point_D" ]; -InitMap(g_MapSettings.BaseHeight, tMainTerrain); +const heightLand = 3; +const heightHill = 30; + +InitMap(heightHill, tMainTerrain); var numPlayers = getNumPlayers(); var mapSize = getMapSize(); @@ -59,7 +62,7 @@ createArea( new ClumpPlacer(mapArea * scaleByMapSize(0.065, 0.09), 0.7, 0.1, 10, mapCenter.x, mapCenter.y), [ new LayeredPainter([tMainTerrain, tMainTerrain], [3]), - new SmoothElevationPainter(ELEVATION_SET, 3, 3), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 3), paintClass(clLand) ]); Engine.SetProgress(10); @@ -86,7 +89,7 @@ for (let i = 0; i < numPlayers; ++i) new PathPlacer(mapCenter.x, mapCenter.y, passage[i].x, passage[i].y, scaleByMapSize(14, 24), 0.4, scaleByMapSize(3, 9), 0.2, 0.05), [ new LayeredPainter([tMainTerrain, tMainTerrain], [1]), - new SmoothElevationPainter(ELEVATION_SET, 3, 4) + new SmoothElevationPainter(ELEVATION_SET, heightLand, 4) ]); log("Placing treasure seeker woman..."); diff --git a/binaries/data/mods/public/maps/random/survivalofthefittest.json b/binaries/data/mods/public/maps/random/survivalofthefittest.json index 2f8ef7f40b..b3fb3c6d50 100644 --- a/binaries/data/mods/public/maps/random/survivalofthefittest.json +++ b/binaries/data/mods/public/maps/random/survivalofthefittest.json @@ -4,7 +4,6 @@ "Script" : "survivalofthefittest.js", "Description" : "[color=\"red\"]IMPORTANT NOTE: AI PLAYERS DO NOT WORK WITH THIS MAP[/color]\n\nProtect your base against endless waves of enemies. Use your woman citizen to collect the treasures at the center of the map before others do, and try to build your base up. The last player remaining will be the winner!", "BaseTerrain" : ["medit_sea_depths"], - "BaseHeight" : 30, "Keywords": ["trigger"], "Preview" : "survivalofthefittest.png", "SupportedBiomes": true, diff --git a/binaries/data/mods/public/maps/random/syria.js b/binaries/data/mods/public/maps/random/syria.js index 3a530f2359..f0fb93c09c 100644 --- a/binaries/data/mods/public/maps/random/syria.js +++ b/binaries/data/mods/public/maps/random/syria.js @@ -31,7 +31,11 @@ const aBushes = [aBushA, aBushB]; const pForestP = [tForestFloor2 + TERRAIN_SEPARATOR + oPalm, tForestFloor2]; const pForestT = [tForestFloor1 + TERRAIN_SEPARATOR + oTamarix,tForestFloor2]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightLand = 1; +const heightHill = 22; +const heightOffsetBump = 2; + +InitMap(heightLand, g_MapSettings.BaseTerrain); const mapCenter = getMapCenter(); const numPlayers = getNumPlayers(); @@ -106,7 +110,7 @@ Engine.SetProgress(20); log("Creating bumps..."); createAreas( new ClumpPlacer(scaleByMapSize(20, 50), 0.3, 0.06, 1), - new SmoothElevationPainter(ELEVATION_MODIFY, 2, 2), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetBump, 2), avoidClasses(clPlayer, 13), scaleByMapSize(300, 800)); @@ -115,7 +119,7 @@ createAreas( new ChainPlacer(1, Math.floor(scaleByMapSize(4, 6)), Math.floor(scaleByMapSize(16, 40)), 0.5), [ new LayeredPainter([tCliff, tHill], [2]), - new SmoothElevationPainter(ELEVATION_SET, 22, 2), + new SmoothElevationPainter(ELEVATION_SET, heightHill, 2), paintClass(clHill) ], avoidClasses(clPlayer, 3, clGrass, 1, clHill, 10), diff --git a/binaries/data/mods/public/maps/random/syria.json b/binaries/data/mods/public/maps/random/syria.json index d95a0ad5a2..af3969da46 100644 --- a/binaries/data/mods/public/maps/random/syria.json +++ b/binaries/data/mods/public/maps/random/syria.json @@ -4,8 +4,7 @@ "Script" : "syria.js", "Description" : "Players start in a plains with slightly rolling highlands.", "BaseTerrain" : ["desert_dirt_rocks_1", "desert_dirt_cracks"], - "BaseHeight" : 1, "Preview" : "syria.png", "CircularMap" : true } -} \ No newline at end of file +} diff --git a/binaries/data/mods/public/maps/random/the_nile.js b/binaries/data/mods/public/maps/random/the_nile.js index b1798c9ee9..fb6ff70a69 100644 --- a/binaries/data/mods/public/maps/random/the_nile.js +++ b/binaries/data/mods/public/maps/random/the_nile.js @@ -38,7 +38,13 @@ var aLillies = "actor|props/flora/water_lillies.xml"; var pForest = [tForestFloor + TERRAIN_SEPARATOR + oDatePalm, tForestFloor + TERRAIN_SEPARATOR + oSDatePalm, tForestFloor]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightLand = 1; +const heightShore = 2; +const heightPonds = -7; +const heightSeaGround = -3; +const heightOffsetBump = 2; + +InitMap(heightLand, g_MapSettings.BaseTerrain); const mapSize = getMapSize(); const mapCenter = getMapCenter(); @@ -123,8 +129,8 @@ paintRiver({ "width": fractionToTiles(0.1), "fadeDist": scaleByMapSize(3, 12), "deviation": 0.5, - "waterHeight": -3, - "landHeight": 2, + "heightRiverbed": heightSeaGround, + "heightLand": heightShore, "meanderShort": 12, "meanderLong": 50, "waterFunc": (ix, iz, height, riverFraction) => { @@ -165,7 +171,7 @@ for (let [left, right] of [[mapBounds.left, mapBounds.left + desertWidth], [mapB log("Creating bumps..."); createAreas( new ClumpPlacer(scaleByMapSize(20, 50), 0.3, 0.06, 1), - new SmoothElevationPainter(ELEVATION_MODIFY, 2, 2), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetBump, 2), avoidClasses(clWater, 2, clPlayer, 6), scaleByMapSize(100, 200)); @@ -175,7 +181,7 @@ var waterAreas = createAreas( new ClumpPlacer(scaleByMapSize(2, 5) * 50, 0.8, 0.1, 10), [ new LayeredPainter([tShore, tShore, tShore], [1, 1]), - new SmoothElevationPainter(ELEVATION_SET, -7, 4), + new SmoothElevationPainter(ELEVATION_SET, heightPonds, 4), paintClass(clPond) ], avoidClasses(clPlayer, 25, clWater, 20, clPond, 10), diff --git a/binaries/data/mods/public/maps/random/the_nile.json b/binaries/data/mods/public/maps/random/the_nile.json index e1347421eb..d6a03ded0b 100644 --- a/binaries/data/mods/public/maps/random/the_nile.json +++ b/binaries/data/mods/public/maps/random/the_nile.json @@ -4,7 +4,6 @@ "Script" : "the_nile.js", "Description" : "A calm wide river, representing the Nile River in Egypt, divides the map into western and eastern parts.", "BaseTerrain" : ["desert_sand_dunes_100"], - "BaseHeight" : 1, "Keywords": ["naval"], "Preview" : "the_nile.png", "CircularMap" : true diff --git a/binaries/data/mods/public/maps/random/the_unknown/unknown_common.js b/binaries/data/mods/public/maps/random/the_unknown/unknown_common.js index 4b3c42ec03..568edb6360 100644 --- a/binaries/data/mods/public/maps/random/the_unknown/unknown_common.js +++ b/binaries/data/mods/public/maps/random/the_unknown/unknown_common.js @@ -50,7 +50,13 @@ const aBushSmall = g_Decoratives.bushSmall; const pForest1 = [tForestFloor2 + TERRAIN_SEPARATOR + oTree1, tForestFloor2 + TERRAIN_SEPARATOR + oTree2, tForestFloor2]; const pForest2 = [tForestFloor1 + TERRAIN_SEPARATOR + oTree4, tForestFloor1 + TERRAIN_SEPARATOR + oTree5, tForestFloor1]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightSeaGround = -5; +const heightLand = 3; +const heightCliff = 3.12; +const heightHill = 18; +const heightOffsetBump = 2; + +InitMap(heightSeaGround, g_MapSettings.BaseTerrain); const numPlayers = getNumPlayers(); const mapSize = getMapSize(); @@ -71,9 +77,7 @@ var clBaseResource = createTileClass(); var clLand = createTileClass(); var clShallow = createTileClass(); -var landHeight = 3; -var cliffHeight = 3.12; -var landElevationPainter = new SmoothElevationPainter(ELEVATION_SET, landHeight, 4); +var landElevationPainter = new SmoothElevationPainter(ELEVATION_SET, heightLand, 4); var unknownMapFunctions = { "land": [ @@ -161,7 +165,7 @@ function unknownArchipelago() createAreas( new ClumpPlacer(scaleByMapSize(15, 80), 0.2, 0.1, 1), [ - new SmoothElevationPainter(ELEVATION_SET, landHeight, 4), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 4), paintClass(clLand) ], borderClasses(clLand, 6, 3), @@ -184,7 +188,7 @@ function unknownArchipelago() createAreas( new ClumpPlacer(Math.floor(islandSize * randFloat(0.3, 0.7)), 0.8, 0.1, 0.07), [ - new SmoothElevationPainter(ELEVATION_SET, landHeight, 6), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 6), paintClass(clLand) ], avoidClasses(clLand, 3, clPlayerTerritory, 3), @@ -281,8 +285,8 @@ function unknownCentralSea() "width": fractionToTiles(scaleByMapSize(0.27, 0.42) + randFloat(0, 0.08)), "fadeDist": scaleByMapSize(3, 12), "deviation": 0, - "waterHeight": waterHeight, - "landHeight": landHeight, + "heightRiverbed": waterHeight, + "heightLand": heightLand, "meanderShort": 20, "meanderLong": 0, "waterFunc": (ix, iz, height, riverFraction) => { @@ -333,11 +337,11 @@ function unknownCentralSea() function unknownCentralRiver() { let waterHeight = -4; - let shallowHeight = -2; + let heightShallow = -2; createArea( new MapBoundsPlacer(), - new ElevationPainter(landHeight)); + new ElevationPainter(heightLand)); let horizontal = randBool(); let riverAngle = horizontal ? 0 : Math.PI / 2; @@ -374,9 +378,9 @@ function unknownCentralRiver() "startWidth": scaleByMapSize(8, 12), "endWidth": scaleByMapSize(8, 12), "smoothWidth": 2, - "startHeight": shallowHeight, - "endHeight": shallowHeight, - "maxHeight": shallowHeight, + "startHeight": heightShallow, + "endHeight": heightShallow, + "maxHeight": heightShallow, "tileClass": clShallow }); } @@ -403,7 +407,7 @@ function unknownRiversAndLake() let waterHeight = -4; createArea( new MapBoundsPlacer(), - new ElevationPainter(landHeight)); + new ElevationPainter(heightLand)); let startAngle; if (!isNomad()) @@ -480,7 +484,7 @@ function unknownEdgeSeas() createArea( new MapBoundsPlacer(), - new ElevationPainter(landHeight)); + new ElevationPainter(heightLand)); let horizontal = randBool(); if (!isNomad()) @@ -500,15 +504,15 @@ function unknownEdgeSeas() "width": scaleByMapSize(80, randFloat(270, 320)), "fadeDist": scaleByMapSize(2, 8), "deviation": 0, - "waterHeight": waterHeight, - "landHeight": landHeight, + "heightRiverbed": waterHeight, + "heightLand": heightLand, "meanderShort": 20, "meanderLong": 0 }); } createExtensionsOrIslands(); - paintTileClassBasedOnHeight(0, cliffHeight, 1, clLand); + paintTileClassBasedOnHeight(0, heightCliff, 1, clLand); createShoreJaggedness(waterHeight, clLand, 7, false); } @@ -521,7 +525,7 @@ function unknownGulf() createArea( new MapBoundsPlacer(), - new ElevationPainter(landHeight)); + new ElevationPainter(heightLand)); let startAngle = randomAngle(); if (!isNomad()) @@ -564,7 +568,7 @@ function unknownLakes() createArea( new MapBoundsPlacer(), - new ElevationPainter(landHeight)); + new ElevationPainter(heightLand)); if (!isNomad()) { @@ -588,12 +592,12 @@ function unknownLakes() */ function unknownPasses() { - let mountainHeight = 24; + let heightMountain = 24; let waterHeight = -4; createArea( new MapBoundsPlacer(), - new ElevationPainter(landHeight)); + new ElevationPainter(heightLand)); let playerAngle; let startAngle; @@ -612,7 +616,7 @@ function unknownPasses() new PathPlacer(mapCenter.x, mapCenter.y, mountain.x, mountain.y, scaleByMapSize(14, 24), 0.4, 3 * scaleByMapSize(1, 3), 0.2, 0.05), [ // More smoothing than this often results in the mountainrange becoming passable to one player. - new SmoothElevationPainter(ELEVATION_SET, mountainHeight, 1), + new SmoothElevationPainter(ELEVATION_SET, heightMountain, 1), paintClass(clWater) ], avoidClasses(clPlayer, 5)); @@ -620,7 +624,7 @@ function unknownPasses() log("Creating small mountain at the map border between the players to ensure separation of players..."); createArea( new ClumpPlacer(Math.floor(diskArea(scaleByMapSize(10, 50)) / 5), 0.95, 0.6, 10, mountain.x, mountain.y), - new SmoothElevationPainter(ELEVATION_SET, mountainHeight, 0), + new SmoothElevationPainter(ELEVATION_SET, heightMountain, 0), avoidClasses(clPlayer, 5)); } @@ -639,7 +643,7 @@ function unknownPasses() 3 * scaleByMapSize(1, 3), 0.2, 0.05), - new SmoothElevationPainter(ELEVATION_SET, landHeight, 2)); + new SmoothElevationPainter(ELEVATION_SET, heightLand, 2)); } if (randBool(2/5)) @@ -658,7 +662,7 @@ function unknownPasses() createArea( new ClumpPlacer(diskArea(fractionToTiles(0.05)), 0.7, 0.1, 10, mapCenter.x, mapCenter.y), [ - new SmoothElevationPainter(ELEVATION_SET, mountainHeight, 4), + new SmoothElevationPainter(ELEVATION_SET, heightMountain, 4), paintClass(clWater) ]); } @@ -669,12 +673,12 @@ function unknownPasses() */ function unknownLowlands() { - let mountainHeight = 30; + let heightMountain = 30; log("Creating mountain that is going to separate players..."); createArea( new MapBoundsPlacer(), - new ElevationPainter(mountainHeight)); + new ElevationPainter(heightMountain)); let playerAngle; let startAngle; @@ -701,7 +705,7 @@ function unknownLowlands() createArea( new ClumpPlacer(diskArea(scaleByMapSize(18, 32)), 0.65, 0.1, 10, valley.x, valley.y), [ - new SmoothElevationPainter(ELEVATION_SET, landHeight, 2), + new SmoothElevationPainter(ELEVATION_SET, heightLand, 2), paintClass(clLand) ]); @@ -755,7 +759,7 @@ function createShoreJaggedness(waterHeight, borderClass, shoreDist, inwards = tr createAreas( new ChainPlacer(2, Math.floor(scaleByMapSize(4, 6)), 15, 1), [ - new SmoothElevationPainter(ELEVATION_SET, i ? landHeight : waterHeight, 4), + new SmoothElevationPainter(ELEVATION_SET, i ? heightLand : waterHeight, 4), i ? paintClass(clLand) : unPaintClass(clLand) ], [ @@ -814,17 +818,17 @@ function markPlayerArea(size) function paintUnknownMapBasedOnHeight() { - paintTerrainBasedOnHeight(cliffHeight, 40, 1, tCliff); - paintTerrainBasedOnHeight(3, cliffHeight, 1, tMainTerrain); + paintTerrainBasedOnHeight(heightCliff, 40, 1, tCliff); + paintTerrainBasedOnHeight(3, heightCliff, 1, tMainTerrain); paintTerrainBasedOnHeight(1, 3, 1, tShore); paintTerrainBasedOnHeight(-8, 1, 2, tWater); - unPaintTileClassBasedOnHeight(0, cliffHeight, 1, clWater); + unPaintTileClassBasedOnHeight(0, heightCliff, 1, clWater); unPaintTileClassBasedOnHeight(-6, 0, 1, clLand); paintTileClassBasedOnHeight(-6, 0, 1, clWater); - paintTileClassBasedOnHeight(0, cliffHeight, 1, clLand); - paintTileClassBasedOnHeight(cliffHeight, 40, 1, clHill); + paintTileClassBasedOnHeight(0, heightCliff, 1, clLand); + paintTileClassBasedOnHeight(heightCliff, 40, 1, clHill); } /** @@ -835,7 +839,7 @@ function createUnknownObjects() log("Creating bumps..."); createAreas( new ClumpPlacer(scaleByMapSize(20, 50), 0.3, 0.06, 1), - new SmoothElevationPainter(ELEVATION_MODIFY, 2, 2), + new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetBump, 2), [avoidClasses(clWater, 2, clPlayer, 10), stayClasses(clLand, 3)], randIntInclusive(0, scaleByMapSize(1, 2) * 200)); @@ -844,7 +848,7 @@ function createUnknownObjects() new ClumpPlacer(scaleByMapSize(20, 150), 0.2, 0.1, 1), [ new LayeredPainter([tCliff, tHill], [2]), - new SmoothElevationPainter(ELEVATION_SET, 18, 2), + new SmoothElevationPainter(ELEVATION_SET, heightHill, 2), paintClass(clHill) ], [avoidClasses(clPlayer, 15, clHill, randIntInclusive(6, 18)), stayClasses(clLand, 0)], diff --git a/binaries/data/mods/public/maps/random/unknown.json b/binaries/data/mods/public/maps/random/unknown.json index 7b5edb7ac8..eebd76c31b 100644 --- a/binaries/data/mods/public/maps/random/unknown.json +++ b/binaries/data/mods/public/maps/random/unknown.json @@ -4,7 +4,6 @@ "Script" : "unknown.js", "Description" : "The unknown. Warning: May be a naval map.", "BaseTerrain" : ["medit_sand_wet"], - "BaseHeight" : -5, "Preview" : "unknown.png", "SupportedBiomes": true, "CircularMap" : true diff --git a/binaries/data/mods/public/maps/random/unknown_land.json b/binaries/data/mods/public/maps/random/unknown_land.json index 68ace24f1f..f4843926a2 100644 --- a/binaries/data/mods/public/maps/random/unknown_land.json +++ b/binaries/data/mods/public/maps/random/unknown_land.json @@ -4,7 +4,6 @@ "Script" : "unknown_land.js", "Description" : "The unknown.", "BaseTerrain" : ["medit_sand_wet"], - "BaseHeight" : -5, "Preview" : "unknown.png", "SupportedBiomes": true, "CircularMap" : true diff --git a/binaries/data/mods/public/maps/random/volcanic_lands.js b/binaries/data/mods/public/maps/random/volcanic_lands.js index 71e2fd7dd2..1bf3a375f2 100644 --- a/binaries/data/mods/public/maps/random/volcanic_lands.js +++ b/binaries/data/mods/public/maps/random/volcanic_lands.js @@ -22,7 +22,10 @@ var aRockMedium = "actor|geology/stone_granite_med.xml"; var pForestD = [tGrassC + TERRAIN_SEPARATOR + oTree, tGrassC]; var pForestP = [tGrassB + TERRAIN_SEPARATOR + oTree, tGrassB]; -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightLand = 1; +const heightHill = 18; + +InitMap(heightLand, g_MapSettings.BaseTerrain); var numPlayers = getNumPlayers(); var mapCenter = getMapCenter(); @@ -65,7 +68,7 @@ createAreas( new ClumpPlacer(scaleByMapSize(20, 150), 0.2, 0.1, 1), [ new LayeredPainter([tCliff, tGrass], [2]), - new SmoothElevationPainter(ELEVATION_SET, 18, 2), + new SmoothElevationPainter(ELEVATION_SET, heightHill, 2), paintClass(clHill) ], avoidClasses(clPlayer, 12, clHill, 15, clBaseResource, 2), diff --git a/binaries/data/mods/public/maps/random/volcanic_lands.json b/binaries/data/mods/public/maps/random/volcanic_lands.json index c2f99e851c..653f0e2629 100644 --- a/binaries/data/mods/public/maps/random/volcanic_lands.json +++ b/binaries/data/mods/public/maps/random/volcanic_lands.json @@ -4,8 +4,7 @@ "Script" : "volcanic_lands.js", "Description" : "A charred dead land where players start around a smoking volcano.", "BaseTerrain" : "ocean_rock_a", - "BaseHeight" : 1, "CircularMap" : true, "Preview" : "volcanic_lands.png" } -} \ No newline at end of file +} diff --git a/binaries/data/mods/public/maps/random/wall_demo.js b/binaries/data/mods/public/maps/random/wall_demo.js index 791d0f1d15..a312776497 100644 --- a/binaries/data/mods/public/maps/random/wall_demo.js +++ b/binaries/data/mods/public/maps/random/wall_demo.js @@ -1,6 +1,6 @@ Engine.LoadLibrary("rmgen"); -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +InitMap(0, g_MapSettings.BaseTerrain); /** * Demonstration code for wall placement. diff --git a/binaries/data/mods/public/maps/random/wall_demo.json b/binaries/data/mods/public/maps/random/wall_demo.json index 5e7b059b8a..cae87963fc 100644 --- a/binaries/data/mods/public/maps/random/wall_demo.json +++ b/binaries/data/mods/public/maps/random/wall_demo.json @@ -5,7 +5,6 @@ "Script" : "wall_demo.js", "Description" : "A demonstration of wall placement methods/code in random maps. Giant map size is recommended!", "BaseTerrain" : ["grass1"], - "BaseHeight" : 0, "Keywords": ["demo"], "CircularMap" : false, "TriggerScripts" : [ diff --git a/binaries/data/mods/public/maps/random/wild_lake.js b/binaries/data/mods/public/maps/random/wild_lake.js index 0efcc36143..e63ecded16 100644 --- a/binaries/data/mods/public/maps/random/wild_lake.js +++ b/binaries/data/mods/public/maps/random/wild_lake.js @@ -2,7 +2,9 @@ Engine.LoadLibrary("rmgen"); Engine.LoadLibrary("rmbiome"); Engine.LoadLibrary("heightmap"); -InitMap(g_MapSettings.BaseHeight, g_MapSettings.BaseTerrain); +const heightLand = 0; + +InitMap(heightLand, g_MapSettings.BaseTerrain); /** * getArray - To ensure a terrain texture is contained within an array @@ -406,9 +408,9 @@ let heightRange = { "min": MIN_HEIGHT * heightScale, "max": MAX_HEIGHT * heightS // Water coverage let averageWaterCoverage = 1/5; // NOTE: Since terrain generation is quite unpredictable actual water coverage might vary much with the same value -let waterHeight = -MIN_HEIGHT + heightRange.min + averageWaterCoverage * (heightRange.max - heightRange.min); // Water height in environment and the engine -let waterHeightAdjusted = waterHeight + MIN_HEIGHT; // Water height as terrain height -setWaterHeight(waterHeight); +let heightSeaGround = -MIN_HEIGHT + heightRange.min + averageWaterCoverage * (heightRange.max - heightRange.min); // Water height in environment and the engine +let heightSeaGroundAdjusted = heightSeaGround + MIN_HEIGHT; // Water height as terrain height +setWaterHeight(heightSeaGround); // Generate base terrain shape let lowH = heightRange.min; @@ -463,13 +465,13 @@ Engine.SetProgress(25); * Prepare terrain texture placement */ let heighLimits = [ - heightRange.min + 3/4 * (waterHeightAdjusted - heightRange.min), // 0 Deep water - waterHeightAdjusted, // 1 Shallow water - waterHeightAdjusted + 2/8 * (heightRange.max - waterHeightAdjusted), // 2 Shore - waterHeightAdjusted + 3/8 * (heightRange.max - waterHeightAdjusted), // 3 Low ground - waterHeightAdjusted + 4/8 * (heightRange.max - waterHeightAdjusted), // 4 Player and path height - waterHeightAdjusted + 6/8 * (heightRange.max - waterHeightAdjusted), // 5 High ground - waterHeightAdjusted + 7/8 * (heightRange.max - waterHeightAdjusted), // 6 Lower forest border + heightRange.min + 3/4 * (heightSeaGroundAdjusted - heightRange.min), // 0 Deep water + heightSeaGroundAdjusted, // 1 Shallow water + heightSeaGroundAdjusted + 2/8 * (heightRange.max - heightSeaGroundAdjusted), // 2 Shore + heightSeaGroundAdjusted + 3/8 * (heightRange.max - heightSeaGroundAdjusted), // 3 Low ground + heightSeaGroundAdjusted + 4/8 * (heightRange.max - heightSeaGroundAdjusted), // 4 Player and path height + heightSeaGroundAdjusted + 6/8 * (heightRange.max - heightSeaGroundAdjusted), // 5 High ground + heightSeaGroundAdjusted + 7/8 * (heightRange.max - heightSeaGroundAdjusted), // 6 Lower forest border heightRange.max // 7 Forest ]; let playerHeightRange = { "min" : heighLimits[3], "max" : heighLimits[4] }; diff --git a/binaries/data/mods/public/maps/random/wild_lake.json b/binaries/data/mods/public/maps/random/wild_lake.json index 2f2f08a31e..43ba8f54e2 100644 --- a/binaries/data/mods/public/maps/random/wild_lake.json +++ b/binaries/data/mods/public/maps/random/wild_lake.json @@ -7,7 +7,6 @@ "CircularMap" : true, "BaseTerrain" : "whiteness", "Keywords": [], - "BaseHeight" : 0, "SupportedBiomes": true } }