Index: ps/trunk/binaries/data/mods/public/maps/random/arctic_summer.js =================================================================== --- ps/trunk/binaries/data/mods/public/maps/random/arctic_summer.js (revision 24193) +++ ps/trunk/binaries/data/mods/public/maps/random/arctic_summer.js (revision 24194) @@ -1,324 +1,324 @@ Engine.LoadLibrary("rmgen"); Engine.LoadLibrary("rmgen-common"); setFogThickness(0.46); setFogFactor(0.5); setPPEffect("hdr"); setPPSaturation(0.48); setPPContrast(0.53); setPPBloom(0.12); var tPrimary = ["alpine_grass_rocky"]; var tForestFloor = "alpine_grass"; var tCliff = ["polar_cliff_a", "polar_cliff_b", "polar_cliff_snow"]; var tSecondary = "alpine_grass"; var tHalfSnow = ["polar_grass_snow", "ice_dirt"]; var tSnowLimited = ["polar_snow_rocks", "polar_ice"]; var tDirt = "ice_dirt"; var tShore = "alpine_shore_rocks"; var tWater = "polar_ice_b"; var tHill = "polar_ice_cracked"; var oBush = "gaia/tree/bush_badlands"; var oBush2 = "gaia/tree/bush_temperate"; var oBerryBush = "gaia/fruit/berry_01"; var oRabbit = "gaia/fauna_rabbit"; var oMuskox = "gaia/fauna_muskox"; var oDeer = "gaia/fauna_deer"; var oWolf = "gaia/fauna_wolf"; var oWhaleFin = "gaia/fauna_whale_fin"; var oWhaleHumpback = "gaia/fauna_whale_humpback"; var oFish = "gaia/fish/generic"; var oStoneLarge = "gaia/rock/alpine_large"; var oStoneSmall = "gaia/rock/alpine_small"; var oMetalLarge = "gaia/ore/alpine_large"; var oWoodTreasure = "gaia/treasure/wood"; var aRockLarge = "actor|geology/stone_granite_med.xml"; var aRockMedium = "actor|geology/stone_granite_med.xml"; const pForest = [tForestFloor + TERRAIN_SEPARATOR + oBush, tForestFloor + TERRAIN_SEPARATOR + oBush2, tForestFloor]; var heightSeaGround = -5; var heightLand = 2; var g_Map = new RandomMap(heightLand, tPrimary); const numPlayers = getNumPlayers(); var clPlayer = g_Map.createTileClass(); var clHill = g_Map.createTileClass(); var clForest = g_Map.createTileClass(); var clWater = g_Map.createTileClass(); var clDirt = g_Map.createTileClass(); var clRock = g_Map.createTileClass(); var clMetal = g_Map.createTileClass(); var clFood = g_Map.createTileClass(); var clBaseResource = g_Map.createTileClass(); placePlayerBases({ "PlayerPlacement": playerPlacementCircle(fractionToTiles(0.35)), "PlayerTileClass": clPlayer, "BaseResourceClass": clBaseResource, "CityPatch": { "outerTerrain": tPrimary, "innerTerrain": tSecondary }, "Chicken": { "template": oRabbit }, "Berries": { "template": oBerryBush }, "Mines": { "types": [ { "template": oMetalLarge }, { "template": oStoneLarge } ] }, "Treasures": { "types": [ { "template": oWoodTreasure, "count": 10 } ] }, "Trees": { "template": oBush, "count": 20, "maxDistGroup": 3 } // No decoratives }); Engine.SetProgress(20); createHills( [tPrimary, tCliff, tHill], avoidClasses( clPlayer, 35, clForest, 20, clHill, 50, clWater, 2), clHill, scaleByMapSize(1, 240)); Engine.SetProgress(30); g_Map.log("Creating lakes"); createAreas( new ChainPlacer( 1, Math.floor(scaleByMapSize(4, 8)), Math.floor(scaleByMapSize(40, 180)), Infinity), [ new LayeredPainter([tShore, tWater], [1]), new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 5), new TileClassPainter(clWater) ], avoidClasses(clPlayer, 15), scaleByMapSize(1, 20)); Engine.SetProgress(45); createBumps(avoidClasses(clPlayer, 6, clWater, 2), scaleByMapSize(30, 300), 1, 8, 4, 0, 3); paintTerrainBasedOnHeight(4, 15, 0, tCliff); paintTerrainBasedOnHeight(15, 100, 3, tSnowLimited); var [forestTrees, stragglerTrees] = getTreeCounts(500, 3000, 0.7); createForests( [tSecondary, tForestFloor, tForestFloor, pForest, pForest], avoidClasses( clPlayer, 20, clForest, 14, clHill, 20, clWater, 2), clForest, forestTrees); Engine.SetProgress(60); g_Map.log("Creating dirt patches"); createLayeredPatches( [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8, 21)], [[tDirt,tHalfSnow], [tHalfSnow,tSnowLimited]], [2], avoidClasses( clWater, 3, clForest, 0, clHill, 0, clDirt, 5, clPlayer, 12), scaleByMapSize(15, 45), clDirt); g_Map.log("Creating shrubs"); createPatches( [scaleByMapSize(2, 4), scaleByMapSize(3, 7), scaleByMapSize(5, 15)], tSecondary, avoidClasses( clWater, 3, clForest, 0, clHill, 0, clDirt, 5, clPlayer, 12), scaleByMapSize(15, 45), clDirt); g_Map.log("Creating grass patches"); createPatches( [scaleByMapSize(2, 4), scaleByMapSize(3, 7), scaleByMapSize(5, 15)], tSecondary, avoidClasses( clWater, 3, clForest, 0, clHill, 0, clDirt, 5, clPlayer, 12), scaleByMapSize(15, 45), clDirt); Engine.SetProgress(65); g_Map.log("Creating stone mines"); createMines( [ [new SimpleObject(oStoneSmall, 0, 2, 0, 4, 0, 2 * Math.PI, 1), new SimpleObject(oStoneLarge, 1, 1, 0, 4, 0, 2 * Math.PI, 4)], [new SimpleObject(oStoneSmall, 2, 5, 1, 3)] ], avoidClasses( clWater, 3, clForest, 1, clPlayer, 20, clRock, 18, clHill, 1), clRock); g_Map.log("Creating metal mines"); createMines( [ [new SimpleObject(oMetalLarge, 1, 1, 0, 4)] ], avoidClasses( clWater, 3, clForest, 1, clPlayer, 20, clMetal, 18, clRock, 5, clHill, 1), clMetal); Engine.SetProgress(70); createDecoration( [ [ new SimpleObject(aRockMedium, 1, 3, 0, 1) ], [ new SimpleObject(aRockLarge, 1, 2, 0, 1), new SimpleObject(aRockMedium, 1, 3, 0, 1) ] ], [ scaleByMapSize(16, 262), scaleByMapSize(8, 131), ], avoidClasses( clWater, 0, clForest, 0, clPlayer, 0, clHill, 0)); Engine.SetProgress(75); createFood( [ [new SimpleObject(oWolf, 3, 5, 0, 3)], [new SimpleObject(oRabbit, 6, 8, 0, 6)], [new SimpleObject(oDeer, 3, 4, 0, 3)], [new SimpleObject(oMuskox, 3, 4, 0, 3)] ], [ 3 * numPlayers, 3 * numPlayers, 3 * numPlayers, 3 * numPlayers ], avoidClasses( clFood, 20, clHill, 5, clWater, 5), clFood); createFood( [ [new SimpleObject(oWhaleFin, 1, 1, 0, 3)], [new SimpleObject(oWhaleHumpback, 1, 1, 0, 3)] ], [ 3 * numPlayers, 3 * numPlayers ], [ avoidClasses(clFood, 20), stayClasses(clWater, 6) ], clFood); createFood( [ [new SimpleObject(oBerryBush, 5, 7, 0, 4)] ], [ randIntInclusive(1, 4) * numPlayers + 2 ], avoidClasses( clWater, 3, clForest, 0, clPlayer, 20, clHill, 1, clFood, 10), clFood); createFood( [ [new SimpleObject(oFish, 2, 3, 0, 2)] ], [ 15 * numPlayers ], [ avoidClasses(clFood, 20), stayClasses(clWater, 6) ], clFood); Engine.SetProgress(85); createStragglerTrees( [oBush, oBush2], avoidClasses( clWater, 5, clForest, 3, clHill, 1, clPlayer, 12, clMetal, 4, clRock, 4), clForest, stragglerTrees); placePlayersNomad(clPlayer, avoidClasses(clForest, 1, clWater, 4, clMetal, 4, clRock, 4, clHill, 4, clFood, 2)); setSkySet("sunset 1"); setSunRotation(randomAngle()); setSunColor(0.8, 0.7, 0.6); -setTerrainAmbientColor(0.7, 0.6, 0.7); +setTerrainAmbientColor(0.6, 0.5, 0.6); setUnitsAmbientColor(0.6, 0.5, 0.6); setSunElevation(Math.PI * randFloat(1/12, 1/7)); setWaterColor(0, 0.047, 0.286); setWaterTint(0.462, 0.756, 0.866); setWaterMurkiness(0.92); setWaterWaviness(1); setWaterType("clap"); g_Map.ExportMap(); Index: ps/trunk/binaries/data/mods/public/maps/random/corsica.js =================================================================== --- ps/trunk/binaries/data/mods/public/maps/random/corsica.js (revision 24193) +++ ps/trunk/binaries/data/mods/public/maps/random/corsica.js (revision 24194) @@ -1,520 +1,520 @@ Engine.LoadLibrary("rmgen"); Engine.LoadLibrary("rmgen-common"); var tGrass = ["medit_grass_field", "medit_grass_field_b", "temp_grass_c"]; var tLushGrass = ["medit_grass_field","medit_grass_field_a"]; var tSteepCliffs = ["temp_cliff_b", "temp_cliff_a"]; var tCliffs = ["temp_cliff_b", "medit_cliff_italia", "medit_cliff_italia_grass"]; var tHill = ["medit_cliff_italia_grass","medit_cliff_italia_grass", "medit_grass_field", "medit_grass_field", "temp_grass"]; var tMountain = ["medit_cliff_italia_grass","medit_cliff_italia"]; var tRoad = ["medit_city_tile","medit_rocks_grass","medit_grass_field_b"]; var tRoadWild = ["medit_rocks_grass","medit_grass_field_b"]; var tShoreBlend = ["medit_sand_wet","medit_rocks_wet"]; var tShore = ["medit_rocks","medit_sand","medit_sand"]; var tSandTransition = ["medit_sand","medit_rocks_grass","medit_rocks_grass","medit_rocks_grass"]; var tVeryDeepWater = ["medit_sea_depths","medit_sea_coral_deep"]; var tDeepWater = ["medit_sea_coral_deep","tropic_ocean_coral"]; var tCreekWater = "medit_sea_coral_plants"; var ePine = "gaia/tree/aleppo_pine"; var ePalmTall = "gaia/tree/cretan_date_palm_tall"; var eFanPalm = "gaia/tree/medit_fan_palm"; var eApple = "gaia/fruit/apple"; var eBush = "gaia/fruit/berry_01"; var eFish = "gaia/fish/generic"; var ePig = "gaia/fauna_pig"; var eStoneMine = "gaia/rock/mediterranean_large"; var eMetalMine = "gaia/ore/mediterranean_large"; var aRock = "actor|geology/stone_granite_med.xml"; var aLargeRock = "actor|geology/stone_granite_large.xml"; var aBushA = "actor|props/flora/bush_medit_sm_lush.xml"; var aBushB = "actor|props/flora/bush_medit_me_lush.xml"; var aPlantA = "actor|props/flora/plant_medit_artichoke.xml"; var aPlantB = "actor|props/flora/grass_tufts_a.xml"; var aPlantC = "actor|props/flora/grass_soft_tuft_a.xml"; var aStandingStone = "actor|props/special/eyecandy/standing_stones.xml"; 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; var g_Map = new RandomMap(heightSeaGround, tVeryDeepWater); var numPlayers = getNumPlayers(); var mapSize = g_Map.getSize(); var mapCenter = g_Map.getCenter(); var clIsland = g_Map.createTileClass(); var clCreek = g_Map.createTileClass(); var clWater = g_Map.createTileClass(); var clCliffs = g_Map.createTileClass(); var clForest = g_Map.createTileClass(); var clShore = g_Map.createTileClass(); var clPlayer = g_Map.createTileClass(); var clBaseResource = g_Map.createTileClass(); var clPassage = g_Map.createTileClass(); var clSettlement = g_Map.createTileClass(); var radiusBeach = fractionToTiles(0.57); var radiusCreeks = fractionToTiles(0.52); var radiusIsland = fractionToTiles(0.4); var radiusLevel1 = fractionToTiles(0.35); var radiusPlayer = fractionToTiles(0.25); var radiusLevel2 = fractionToTiles(0.2); var creeksArea = () => randBool() ? randFloat(10, 50) : scaleByMapSize(75, 100) + randFloat(0, 20); var nbCreeks = scaleByMapSize(6, 15); var nbSubIsland = 5; var nbBeaches = scaleByMapSize(2, 5); var nbPassagesLevel1 = scaleByMapSize(4, 8); var nbPassagesLevel2 = scaleByMapSize(2, 4); g_Map.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)); for (let island = 0; island < 2; ++island) { g_Map.log("Creating island area"); createArea( new ClumpPlacer(diskArea(radiusIsland), 1, 0.5, Infinity, islandLocations[island]), [ new LayeredPainter([tCliffs, tGrass], [2]), new SmoothElevationPainter(ELEVATION_SET, heightMain, 0), new TileClassPainter(clIsland) ]); g_Map.log("Creating subislands"); for (let i = 0; i < nbSubIsland + 1; ++i) { let angle = Math.PI * (island + i / (nbSubIsland * 2)) + swapAngle; let location = Vector2D.add(islandLocations[island], new Vector2D(radiusIsland, 0).rotate(-angle)); createArea( new ClumpPlacer(diskArea(fractionToTiles(0.09)), 0.6, 0.03, Infinity, location), [ new LayeredPainter([tCliffs, tGrass], [2]), new SmoothElevationPainter(ELEVATION_SET, heightMain, 1), new TileClassPainter(clIsland) ]); } g_Map.log("Creating creeks"); for (let i = 0; i < nbCreeks + 1; ++i) { let angle = Math.PI * (island + i * (1 / (nbCreeks * 2))) + swapAngle; let location = Vector2D.add(islandLocations[island], new Vector2D(radiusCreeks, 0).rotate(-angle)); createArea( new ClumpPlacer(creeksArea(), 0.4, 0.01, Infinity, location), [ new TerrainPainter(tSteepCliffs), new SmoothElevationPainter(ELEVATION_SET, heightCreeks, 0), new TileClassPainter(clCreek) ]); } g_Map.log("Creating beaches"); for (let i = 0; i < nbBeaches + 1; ++i) { let angle = Math.PI * (island + (i / (nbBeaches * 2.5)) + 1 / (nbBeaches * 6) + randFloat(-1, 1) / (nbBeaches * 7)) + swapAngle; let start = Vector2D.add(islandLocations[island], new Vector2D(radiusIsland, 0).rotate(-angle)); let end = Vector2D.add(islandLocations[island], new Vector2D(radiusBeach, 0).rotate(-angle)); createArea( new ClumpPlacer(130, 0.7, 0.8, Infinity, Vector2D.add(start, Vector2D.mult(end, 3)).div(4)), new SmoothElevationPainter(ELEVATION_SET, heightBeaches, 5)); createPassage({ "start": start, "end": end, "startWidth": 18, "endWidth": 25, "smoothWidth": 4, "tileClass": clShore }); } g_Map.log("Creating main relief"); createArea( new ClumpPlacer(diskArea(radiusIsland), 1, 0.2, Infinity, islandLocations[island]), new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetMainRelief, fractionToTiles(0.45))); g_Map.log("Creating first level plateau"); createArea( new ClumpPlacer(diskArea(radiusLevel1), 0.95, 0.02, Infinity, islandLocations[island]), new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetLevel1, 1)); g_Map.log("Creating first level passages"); for (let i = 0; i <= nbPassagesLevel1; ++i) { let angle = Math.PI * (i / 7 + 1 / 9 + island) + swapAngle; createPassage({ "start": Vector2D.add(islandLocations[island], new Vector2D(radiusLevel1 + 10, 0).rotate(-angle)), "end": Vector2D.add(islandLocations[island], new Vector2D(radiusLevel1 - 4, 0).rotate(-angle)), "startWidth": 10, "endWidth": 6, "smoothWidth": 3, "tileClass": clPassage }); } if (mapSize > 150) { g_Map.log("Creating second level plateau"); createArea( new ClumpPlacer(diskArea(radiusLevel2), 0.98, 0.04, Infinity, islandLocations[island]), [ new LayeredPainter([tCliffs, tGrass], [2]), new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetLevel2, 1) ]); g_Map.log("Creating second level passages"); for (let i = 0; i < nbPassagesLevel2; ++i) { let angle = Math.PI * (i / (2 * nbPassagesLevel2) + 1 / (4 * nbPassagesLevel2) + island) + swapAngle; createPassage({ "start": Vector2D.add(islandLocations[island], new Vector2D(radiusLevel2 + 3, 0).rotate(-angle)), "end": Vector2D.add(islandLocations[island], new Vector2D(radiusLevel2 - 6, 0).rotate(-angle)), "startWidth": 4, "endWidth": 6, "smoothWidth": 2, "tileClass": clPassage }); } } } Engine.SetProgress(30); g_Map.log("Determining player locations"); var playerIDs = sortAllPlayers(); var playerPosition = []; var playerAngle = []; var p = 0; for (let island = 0; island < 2; ++island) { let playersPerIsland = island == 0 ? Math.ceil(numPlayers / 2) : Math.floor(numPlayers / 2); for (let i = 0; i < playersPerIsland; ++i) { playerAngle[p] = Math.PI * ((i + 0.5) / (2 * playersPerIsland) + island) + swapAngle; playerPosition[p] = Vector2D.add(islandLocations[island], new Vector2D(radiusPlayer).rotate(-playerAngle[p])); addCivicCenterAreaToClass(playerPosition[p], clPlayer); ++p; } } placePlayerBases({ "PlayerPlacement": [sortAllPlayers(), playerPosition], "BaseResourceClass": clBaseResource, "baseResourceConstraint": avoidClasses(clPlayer, 2), "Walls": false, "CityPatch": { "outerTerrain": tRoadWild, "innerTerrain": tRoad, "coherence": 0.8, "radius": 6, "painters": [ new TileClassPainter(clSettlement) ] }, "Chicken": { }, "Berries": { "template": eBush }, "Mines": { "types": [ { "template": eMetalMine }, { "template": eStoneMine } ] } // Sufficient starting trees around, no decoratives }); Engine.SetProgress(40); g_Map.log("Creating bumps"); createAreas( new ClumpPlacer(70, 0.6, 0.1, Infinity), [new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetBumps, 3)], [ stayClasses(clIsland, 2), avoidClasses(clPlayer, 6, clPassage, 2) ], scaleByMapSize(20, 100), 5); g_Map.log("Creating anti bumps"); createAreas( new ClumpPlacer(120, 0.3, 0.1, Infinity), new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetAntiBumps, 6), avoidClasses(clPlayer, 6, clPassage, 2, clIsland, 2), scaleByMapSize(20, 100), 5); g_Map.log("Painting water"); paintTileClassBasedOnHeight(-Infinity, 0, Elevation_ExcludeMin_ExcludeMax, clWater); g_Map.log("Painting land"); for (let mapX = 0; mapX < mapSize; ++mapX) for (let mapZ = 0; mapZ < mapSize; ++mapZ) { let position = new Vector2D(mapX, mapZ); let terrain = getCosricaSardiniaTerrain(position); if (!terrain) continue; createTerrain(terrain).place(position); if (terrain == tCliffs || terrain == tSteepCliffs) clCliffs.add(position); } function getCosricaSardiniaTerrain(position) { let isWater = clWater.countMembersInRadius(position, 3); let isShore = clShore.countMembersInRadius(position, 2); let isPassage = clPassage.countMembersInRadius(position, 2); let isSettlement = clSettlement.countMembersInRadius(position, 2); if (isSettlement) return undefined; let height = g_Map.getHeight(position); let slope = g_Map.getSlope(position); if (height >= 0.5 && height < 1.5 && isShore) return tSandTransition; // Paint land cliffs and grass if (height >= 1 && !isWater) { if (isPassage) return tGrass; if (slope >= 1.25) return height > 25 ? tSteepCliffs : tCliffs; if (height < 17) return tGrass; if (slope < 0.625) return tHill; return tMountain; } if (slope >= 1.125) return tCliffs; if (height >= 1.5) return undefined; if (height >= -0.75) return tShore; if (height >= -3) return tShoreBlend; if (height >= -6) return tCreekWater; if (height > -10 && slope < 0.75) return tDeepWater; return undefined; } Engine.SetProgress(65); g_Map.log("Creating mines"); for (let mine of [eMetalMine, eStoneMine]) createObjectGroupsDeprecated( new SimpleGroup( [ new SimpleObject(mine, 1,1, 0,0), new SimpleObject(aBushB, 1,1, 2,2), new SimpleObject(aBushA, 0,2, 1,3) ], true, clBaseResource), 0, [ stayClasses(clIsland, 1), avoidClasses( clWater, 3, clPlayer, 6, clBaseResource, 4, clPassage, 2, clCliffs, 1) ], scaleByMapSize(6, 25), 1000); g_Map.log("Creating grass patches"); createAreas( new ClumpPlacer(20, 0.3, 0.06, 0.5), [ new TerrainPainter(tLushGrass), new TileClassPainter(clForest) ], avoidClasses( clWater, 1, clPlayer, 6, clBaseResource, 3, clCliffs, 1), scaleByMapSize(10, 40)); g_Map.log("Creating forests"); createObjectGroupsDeprecated( new SimpleGroup( [ new SimpleObject(ePine, 3, 6, 1, 3), new SimpleObject(ePalmTall, 1, 3, 1, 3), new SimpleObject(eFanPalm, 0, 2, 0, 2), new SimpleObject(eApple, 0, 1, 1, 2) ], true, clForest), 0, [ stayClasses(clIsland, 3), avoidClasses( clWater, 1, clForest, 0, clPlayer, 3, clBaseResource, 4, clPassage, 2, clCliffs, 2) ], scaleByMapSize(350, 2500), 100); Engine.SetProgress(75); g_Map.log("Creating small decorative rocks"); createObjectGroupsDeprecated( new SimpleGroup( [ new SimpleObject(aRock, 1, 3, 0, 1), new SimpleObject(aStandingStone, 0, 2, 0, 3) ], true), 0, avoidClasses( clWater, 0, clForest, 0, clPlayer, 6, clBaseResource, 4, clPassage, 2), scaleByMapSize(16, 262), 50); g_Map.log("Creating large decorative rocks"); var rocksGroup = new SimpleGroup( [ new SimpleObject(aLargeRock, 1, 2, 0, 1), new SimpleObject(aRock, 1, 3, 0, 2) ], true); createObjectGroupsDeprecated( rocksGroup, 0, avoidClasses( clWater, 0, clForest, 0, clPlayer, 6, clBaseResource, 4, clPassage, 2), scaleByMapSize(8, 131), 50); createObjectGroupsDeprecated( rocksGroup, 0, borderClasses(clWater, 5, 10), scaleByMapSize(100, 800), 500); g_Map.log("Creating decorative plants"); var plantGroups = [ new SimpleGroup( [ new SimpleObject(aPlantA, 3, 7, 0, 3), new SimpleObject(aPlantB, 3,6, 0, 3), new SimpleObject(aPlantC, 1,4, 0, 4) ], true), new SimpleGroup( [ new SimpleObject(aPlantB, 5, 20, 0, 5), new SimpleObject(aPlantC, 4,10, 0,4) ], true) ]; for (let group of plantGroups) createObjectGroupsDeprecated( group, 0, avoidClasses( clWater, 0, clBaseResource, 4, clShore, 3), scaleByMapSize(100, 600), 50); Engine.SetProgress(80); g_Map.log("Creating animals"); createObjectGroupsDeprecated( new SimpleGroup([new SimpleObject(ePig, 2,4, 0,3)]), 0, avoidClasses( clWater, 3, clBaseResource, 4, clPlayer, 6), scaleByMapSize(20, 100), 50); g_Map.log("Creating fish"); createObjectGroupsDeprecated( new SimpleGroup([new SimpleObject(eFish, 1,2, 0,3)]), 0, [ stayClasses(clWater, 3), avoidClasses(clCreek, 3, clShore, 3) ], scaleByMapSize(50, 150), 100); Engine.SetProgress(95); placePlayersNomad(clPlayer, avoidClasses(clWater, 4, clForest, 1, clBaseResource, 4, clCliffs, 4)); setSkySet(pickRandom(["cumulus", "sunny"])); setSunColor(0.8, 0.66, 0.48); setSunElevation(0.828932); setSunRotation((swapAngle ? 0.288 : 0.788) * Math.PI); setTerrainAmbientColor(0.564706,0.543726,0.419608); -setUnitsAmbientColor(0.53,0.55,0.45); +setUnitsAmbientColor(0.564706,0.543726,0.419608); setWaterColor(0.2,0.294,0.49); setWaterTint(0.208, 0.659, 0.925); setWaterMurkiness(0.72); setWaterWaviness(2.0); setWaterType("ocean"); g_Map.ExportMap(); Index: ps/trunk/binaries/data/mods/public/maps/random/danubius.js =================================================================== --- ps/trunk/binaries/data/mods/public/maps/random/danubius.js (revision 24193) +++ ps/trunk/binaries/data/mods/public/maps/random/danubius.js (revision 24194) @@ -1,845 +1,845 @@ Engine.LoadLibrary("rmgen"); Engine.LoadLibrary("rmgen-common"); const day = g_MapSettings.Daytime !== undefined ? g_MapSettings.Daytime == "day" : randBool(2/3); // Spawn ships away from the shoreline, but patrol close to the shoreline const triggerPointShipSpawn = "trigger/trigger_point_A"; const triggerPointShipPatrol = "trigger/trigger_point_B"; const triggerPointShipUnloadLeft = "trigger/trigger_point_C"; const triggerPointShipUnloadRight = "trigger/trigger_point_D"; const triggerPointLandPatrolLeft = "trigger/trigger_point_E"; const triggerPointLandPatrolRight = "trigger/trigger_point_F"; const triggerPointCCAttackerPatrolLeft = "trigger/trigger_point_G"; const triggerPointCCAttackerPatrolRight = "trigger/trigger_point_H"; const triggerPointRiverDirection = "trigger/trigger_point_I"; const tPrimary = ["temp_grass_aut", "temp_grass_plants_aut", "temp_grass_c_aut", "temp_grass_d_aut"]; const tRoad = "steppe_river_rocks"; const tIsland = ["temp_grass_long_b_aut", "temp_grass_plants_aut", "temp_forestfloor_aut"]; const tCliff = "temp_cliff_a"; const tForestFloor = "temp_forestfloor_aut"; const tGrass = "medit_shrubs_golden"; const tGrass2 ="grass_mediterranean_dry_1024test"; const tGrass3 = "medit_grass_field_b"; const tShore = "temp_dirt_gravel_b"; const tWater = "steppe_river_rocks_wet"; const tSeaDepths = "medit_sea_depths"; const oBerryBush = "gaia/fruit/berry_01"; const oDeer = "gaia/fauna_deer"; const oFish = "gaia/fish/generic"; const oSheep = "gaia/fauna_sheep"; const oGoat = "gaia/fauna_goat"; const oWolf = "gaia/fauna_wolf"; const oHawk = "birds/buzzard"; const oRabbit = "gaia/fauna_rabbit"; const oBoar = "gaia/fauna_boar"; const oBear = "gaia/fauna_bear_brown"; const oStoneLarge = "gaia/rock/temperate_large"; const oStoneRuins = "gaia/ruins/standing_stone"; const oMetalLarge = "gaia/ore/mediterranean_large"; const oApple = "gaia/fruit/apple"; const oAcacia = "gaia/tree/acacia"; const oOak = "gaia/tree/oak_aut"; const oOak2 = "gaia/tree/oak_aut_new"; const oOak3 = "gaia/tree/oak_dead"; const oOak4 = "gaia/tree/oak"; const oPopolar = "gaia/tree/poplar_lombardy"; const oBeech = "gaia/tree/euro_beech_aut"; const oBeech2 = "gaia/tree/euro_beech"; const oTreasures = [ "gaia/treasure/food_barrel", "gaia/treasure/food_bin", "gaia/treasure/stone", "gaia/treasure/wood", "gaia/treasure/metal" ]; // Disable capturing on all parts of the village except the // civic center and buildings occurring outside of the village const oCivicCenter = "structures/gaul_civil_centre"; const oTower = "structures/gaul_defense_tower"; const oOutpost = "structures/gaul_outpost"; const oTemple = "uncapturable|structures/gaul_temple"; const oTavern = "uncapturable|structures/gaul_tavern"; const oHouse = "uncapturable|structures/gaul_house"; const oLongHouse = "uncapturable|structures/celt_longhouse"; const oHut = "uncapturable|structures/celt_hut"; const oSentryTower = "uncapturable|structures/gaul_sentry_tower"; const oWatchTower = "uncapturable|structures/palisades_watchtower"; const oPalisadeTallSpikes = "uncapturable|structures/palisades_spikes_tall"; const oPalisadeAngleSpikes = "uncapturable|structures/palisades_spike_angle"; const oPalisadeCurve = "uncapturable|structures/palisades_curve"; const oPalisadeShort = "uncapturable|structures/palisades_short"; const oPalisadeMedium = "uncapturable|structures/palisades_medium"; const oPalisadeLong = "uncapturable|structures/palisades_long"; const oPalisadeGate = "uncapturable|structures/palisades_gate"; const oPalisadePillar = "uncapturable|structures/palisades_tower"; const oFemale = "units/gaul_support_female_citizen"; const oHealer = "units/gaul_support_healer_b"; const oSkirmisher = "units/gaul_infantry_javelineer_b"; const oNakedFanatic = "units/gaul_champion_fanatic"; const aBush1 = "actor|props/flora/bush_tempe_sm.xml"; const aBush2 = "actor|props/flora/bush_tempe_me.xml"; const aBush3 = "actor|props/flora/bush_tempe_la.xml"; const aBush4 = "actor|props/flora/bush_tempe_me.xml"; const aRock1 = "actor|geology/stone_granite_med.xml"; const aRock2 = "actor|geology/stone_granite_boulder.xml"; const aRock3 = "actor|geology/stone_granite_greek_boulder.xml"; const aRock4 = "actor|geology/stonemine_alpine_a.xml"; const aFerns = "actor|props/flora/ferns.xml"; const aBucket = "actor|props/structures/celts/blacksmith_bucket"; const aBarrel = "actor|props/structures/gauls/storehouse_barrel_b"; const aTartan = "actor|props/structures/celts/tartan_a"; const aWheel = "actor|props/special/eyecandy/wheel_laying"; const aWell = "actor|props/special/eyecandy/well_1_b"; const aWoodcord = "actor|props/special/eyecandy/woodcord"; const aWaterLog = "actor|props/flora/water_log.xml"; const aCampfire = "actor|props/special/eyecandy/campfire"; const aBench = "actor|props/special/eyecandy/bench_1"; const aRug = "actor|props/special/eyecandy/rug_stand_iber"; const treeTypes = [oOak, oOak2, oOak3, oOak4, oBeech, oBeech2, oAcacia]; const pForest1 = [ tForestFloor, tForestFloor + TERRAIN_SEPARATOR + oOak, tForestFloor + TERRAIN_SEPARATOR + oOak2, tForestFloor + TERRAIN_SEPARATOR + oOak3, tForestFloor + TERRAIN_SEPARATOR + oOak4, tForestFloor ]; const pForest2 = [ tForestFloor, tForestFloor + TERRAIN_SEPARATOR + oPopolar, tForestFloor + TERRAIN_SEPARATOR + oBeech, tForestFloor + TERRAIN_SEPARATOR + oBeech2, tForestFloor + TERRAIN_SEPARATOR + oAcacia, tForestFloor ]; const smallMapSize = 192; const mediumMapSize = 256; const normalMapSize = 320; // Minimum distance from the map border to ship ungarrison points const ShorelineDistance = 15; const heightSeaGround = -3; const heightShore = 1; const heightLand = 3; const heightPath = 1.5; const heightIsland = 6; var g_Map = new RandomMap(heightLand, tPrimary); const numPlayers = getNumPlayers(); const mapSize = g_Map.getSize(); const mapCenter = g_Map.getCenter(); const mapBounds = g_Map.getBounds(); var clPlayer = g_Map.createTileClass(); var clForest = g_Map.createTileClass(); var clWater = g_Map.createTileClass(); var clLand = [g_Map.createTileClass(), g_Map.createTileClass()]; var clPatrolPointSiegeEngine = [g_Map.createTileClass(), g_Map.createTileClass()]; var clPatrolPointSoldier = [g_Map.createTileClass(), g_Map.createTileClass()]; var clShore = [g_Map.createTileClass(), g_Map.createTileClass()]; var clShoreUngarrisonPoint = [g_Map.createTileClass(), g_Map.createTileClass()]; var clShip = g_Map.createTileClass(); var clShipPatrol = g_Map.createTileClass(); var clDirt = g_Map.createTileClass(); var clRock = g_Map.createTileClass(); var clMetal = g_Map.createTileClass(); var clFood = g_Map.createTileClass(); var clBaseResource = g_Map.createTileClass(); var clHill = g_Map.createTileClass(); var clIsland = g_Map.createTileClass(); var clTreasure = g_Map.createTileClass(); var clWaterLog = g_Map.createTileClass(); var clGauls = g_Map.createTileClass(); var clTower = g_Map.createTileClass(); var clOutpost = g_Map.createTileClass(); var clPath = g_Map.createTileClass(); var clRitualPlace = g_Map.createTileClass(); var startAngle = randomAngle(); var waterWidth = fractionToTiles(0.3); // How many treasures will be placed near the gallic civic centers var gallicCCTreasureCount = randIntInclusive(8, 12); // How many treasures will be placed randomly on the map at most var randomTreasureCount = randIntInclusive(0, scaleByMapSize(0, 2)); var ritualParticipants = [ { "radius": 0.6, "templates": [oFemale], "count": 9, "angle": Math.PI }, { "radius": 0.8, "templates": [oSkirmisher, oHealer, oNakedFanatic], "count": 15, "angle": Math.PI }, { "radius": 1, "templates": [aBench], "count": 10, "angle": Math.PI / 2 }, { "radius": 1.1, "templates": [oGoat], "count": 7, "angle": 0 }, { "radius": 1.2, "templates": [aRug], "count": 8, "angle": Math.PI } ]; g_WallStyles.danubius_village = { "house": { "angle": Math.PI, "length": 0, "indent": 4, "bend": 0, "templateName": oHouse }, "hut": { "angle": Math.PI, "length": 0, "indent": 4, "bend": 0, "templateName": oHut }, "longhouse": { "angle": Math.PI, "length": 0, "indent": 4, "bend": 0, "templateName": oLongHouse }, "tavern": { "angle": Math.PI * 3/2, "length": 0, "indent": 4, "bend": 0, "templateName": oTavern }, "temple": { "angle": Math.PI * 3/2, "length": 0, "indent": 4, "bend": 0, "templateName": oTemple }, "defense_tower": { "angle": Math.PI / 2, "length": 0, "indent": 4, "bend": 0, "templateName": mapSize >= normalMapSize ? (isNomad() ? oSentryTower : oTower) : oWatchTower }, "pillar": readyWallElement(oPalisadePillar), "gate": readyWallElement(oPalisadeGate), "long": readyWallElement(oPalisadeLong), "medium": readyWallElement(oPalisadeMedium), "short": readyWallElement(oPalisadeShort), "cornerIn": readyWallElement(oPalisadeCurve), "overlap": 0.05 }; g_WallStyles.danubius_spikes = { "spikes_tall": readyWallElement(oPalisadeTallSpikes, "gaia"), "spike_single": readyWallElement(oPalisadeAngleSpikes, "gaia"), "overlap": 0 }; var fortressDanubiusVillage = new Fortress( "Geto-Dacian Tribal Confederation", new Array(2).fill([ "gate", "pillar", "hut", "long", "long", "cornerIn", "defense_tower", "long", "temple", "long", "pillar", "house", "long", "short", "pillar", "gate", "pillar", "longhouse", "long", "long", "cornerIn", "defense_tower", "long", "tavern", "long", "pillar" ]).reduce((result, items) => result.concat(items), [])); var palisadeCorner = ["turn_0.25", "spike_single", "turn_0.25"]; var palisadeGate = ["spike_single", "gap_3.6", "spike_single"]; var palisadeWallShort = new Array(3).fill("spikes_tall"); var palisadeWallLong = new Array(5).fill("spikes_tall"); var palisadeSideShort = [...palisadeGate, ...palisadeWallShort, ...palisadeCorner, ...palisadeWallShort]; var palisadeSideLong = [...palisadeGate, ...palisadeWallShort, ...palisadeCorner, ...palisadeWallLong]; var fortressDanubiusSpikes = new Fortress( "Spikes Of The Geto-Dacian Tribal Confederation", [...palisadeSideLong, ...palisadeSideShort, ...palisadeSideLong, ...palisadeSideShort]); // Place a gallic village on small maps and larger var gallicCC = mapSize >= smallMapSize; if (gallicCC) { g_Map.log("Creating gallic villages"); let gaulCityRadius = 12; let gaulCityBorderDistance = mapSize < mediumMapSize ? 10 : 18; // Whether to add a celtic ritual and a path from the gallic city leading to it let addCelticRitual = randBool(0.9); // One village left and right of the river for (let i = 0; i < 2; ++i) { let civicCenterPosition = new Vector2D( i == 0 ? mapBounds.left + gaulCityBorderDistance : mapBounds.right - gaulCityBorderDistance, mapCenter.y).rotateAround(startAngle, mapCenter); if (addCelticRitual) { // Don't position the meeting place at the center of the map let meetingPlacePosition = new Vector2D( i == 0 ? mapBounds.left + waterWidth : mapBounds.right - waterWidth, mapCenter.y + fractionToTiles(randFloat(0.1, 0.4)) * (randBool() ? 1 : -1)).rotateAround(startAngle, mapCenter); // Radius of the meeting place let mRadius = scaleByMapSize(4, 6); // Create a path connecting the gallic city with a meeting place at the shoreline. // To avoid the path going through the palisade wall, start it at the gate, not at the city center. let pathStart = Vector2D.add(civicCenterPosition, new Vector2D(gaulCityRadius * (i == 0 ? 1 : -1), 0).rotate(startAngle)); createArea( new PathPlacer(pathStart, meetingPlacePosition, 4, 0.4, 4, 0.2, 0.05), [ new LayeredPainter([tShore, tRoad], [1]), new SmoothElevationPainter(ELEVATION_SET, heightPath, 4), new TileClassPainter(clPath) ]); // Create the meeting place near the shoreline at the end of the path createArea( new ClumpPlacer(diskArea(mRadius), 0.6, 0.3, Infinity, meetingPlacePosition), [ new TerrainPainter(tShore), new TileClassPainter(clPath), new TileClassPainter(clRitualPlace) ]); g_Map.placeEntityAnywhere(aCampfire, 0, meetingPlacePosition, randomAngle()); for (let participants of ritualParticipants) { let [positions, angles] = distributePointsOnCircle(participants.count, startAngle, participants.radius * mRadius, meetingPlacePosition); for (let j = 0; j < positions.length; ++j) g_Map.placeEntityPassable(pickRandom(participants.templates), 0, positions[j], angles[j] + participants.angle); } } g_Map.placeEntityPassable(oCivicCenter, 0, civicCenterPosition, startAngle + BUILDING_ORIENTATION + Math.PI * 3/2 * i); // Create the city patch createArea( new ClumpPlacer(diskArea(gaulCityRadius), 0.6, 0.3, Infinity, civicCenterPosition), [ new TerrainPainter(tShore), new TileClassPainter(clGauls) ]); // Place walls and buildings placeCustomFortress(civicCenterPosition, fortressDanubiusVillage, "danubius_village", 0, startAngle + Math.PI); placeCustomFortress(civicCenterPosition, fortressDanubiusSpikes, "danubius_spikes", 0, startAngle + Math.PI); // Place treasure, potentially inside buildings for (let j = 0; j < gallicCCTreasureCount; ++j) g_Map.placeEntityPassable( pickRandom(oTreasures), 0, Vector2D.add(civicCenterPosition, new Vector2D(randFloat(-0.8, 0.8) * gaulCityRadius, 0).rotate(randomAngle())), randomAngle()); } } Engine.SetProgress(10); placePlayerBases({ "PlayerPlacement": playerPlacementRiver(startAngle, fractionToTiles(0.6)), "PlayerTileClass": clPlayer, "BaseResourceClass": clBaseResource, "Walls": false, "CityPatch": { "outerTerrain": tShore, "innerTerrain": tRoad }, "Chicken": { }, "Berries": { "template": oBerryBush }, "Mines": { "types": [ { "template": oMetalLarge }, { "template": oStoneLarge } ], "distance": scaleByMapSize(9, 14) }, "Trees": { "template": oOak, "count": 20, "minDist": 10, "maxDist": 14 }, "Decoratives": { "template": aBush1 } }); Engine.SetProgress(20); paintRiver({ "parallel": true, "start": new Vector2D(mapCenter.x, mapBounds.top).rotateAround(startAngle, mapCenter), "end": new Vector2D(mapCenter.x, mapBounds.bottom).rotateAround(startAngle, mapCenter), "width": waterWidth, "fadeDist": scaleByMapSize(6, 25), "deviation": 0, "heightRiverbed": heightSeaGround, "heightLand": heightLand, "meanderShort": 30, "meanderLong": 0, "waterFunc": (position, height, riverFraction) => { let origPos = position.clone().rotateAround(-startAngle, mapCenter); // Distinguish left and right shoreline if (0 < height && height < 1 && origPos.y > ShorelineDistance && origPos.y < mapSize - ShorelineDistance) clShore[origPos.x < mapCenter.x ? 0 : 1].add(position); }, "landFunc": (position, shoreDist1, shoreDist2) => { if (shoreDist1 > 0) clLand[0].add(position); if (shoreDist2 < 0) clLand[1].add(position); } }); Engine.SetProgress(30); paintTileClassBasedOnHeight(-Infinity, 0.7, Elevation_ExcludeMin_ExcludeMax, clWater); var areasLand = [0, 1].map(i => createArea( new MapBoundsPlacer(), undefined, stayClasses(clLand[i], 0))); var areasWater = [createArea( new MapBoundsPlacer(), undefined, new HeightConstraint(-Infinity, heightLand))]; g_Map.log("Creating shores"); paintTerrainBasedOnHeight(-Infinity, heightShore, 0, tWater); paintTerrainBasedOnHeight(heightShore, heightLand, 0, tShore); Engine.SetProgress(35); createBumps(avoidClasses(clPlayer, 6, clWater, 2, clPath, 1, clGauls, 1), scaleByMapSize(30, 300), 1, 8, 4, 0, 3); Engine.SetProgress(40); if (randBool()) createHills( [tCliff, tCliff, tCliff], avoidClasses(clPlayer, 18, clHill, 20, clWater, 2, clGauls, 5, clPath, 1), clHill, scaleByMapSize(3, 15)); else createMountains( tCliff, avoidClasses(clPlayer, 18, clHill, 20, clWater, 2, clGauls, 5, clPath, 1), clHill, scaleByMapSize(3, 15)); Engine.SetProgress(45); var [forestTrees, stragglerTrees] = getTreeCounts(500, 3000, 0.7); createForests( [tForestFloor, tForestFloor, tForestFloor, pForest1, pForest2], avoidClasses(clPlayer, 16, clForest, 17, clWater, 5, clHill, 2, clGauls, 5, clPath, 1), clForest, forestTrees); Engine.SetProgress(50); g_Map.log("Creating grass patches"); createLayeredPatches( [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8, 21)], [[tGrass, tGrass2], [tGrass2, tGrass3], [tGrass3, tGrass]], [1, 1], avoidClasses(clForest, 0, clPlayer, 10, clWater, 2, clDirt, 2, clHill, 1, clGauls, 5, clPath, 1), scaleByMapSize(15, 45), clDirt); Engine.SetProgress(55); g_Map.log("Creating islands"); var areaIslands = 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, heightIsland, 4), new TileClassPainter(clIsland) ], [avoidClasses(clIsland, 30), stayClasses(clWater, 10)], scaleByMapSize(1, 4) * numPlayers); Engine.SetProgress(60); createBumps(stayClasses(clIsland, 2), scaleByMapSize(50, 400), 1, 8, 4, 0, 3); g_Map.log("Painting seabed"); paintTerrainBasedOnHeight(-20, -3, 3, tSeaDepths); g_Map.log("Creating island metal mines"); createObjectGroupsByAreas( new SimpleGroup([new SimpleObject(oMetalLarge, 1, 1, 0, 4)], true, clMetal), 0, [avoidClasses(clMetal, 50, clRock, 10), stayClasses(clIsland, 5)], scaleByMapSize(3, 10), 20, areaIslands); g_Map.log("Creating island stone mines"); createObjectGroupsByAreas( new SimpleGroup([new SimpleObject(oStoneLarge, 1, 1, 0, 4)], true, clRock), 0, [avoidClasses(clMetal, 10, clRock, 50), stayClasses(clIsland, 5)], scaleByMapSize(3, 10), 20, areaIslands); Engine.SetProgress(65); g_Map.log("Creating island towers"); createObjectGroupsByAreas( new SimpleGroup([new SimpleObject(oTower, 1, 1, 0, 4)], true, clTower), 0, [avoidClasses(clMetal, 4, clRock, 4, clTower, 20), stayClasses(clIsland, 7)], scaleByMapSize(3, 10), 20, areaIslands); g_Map.log("Creating island outposts"); createObjectGroupsByAreas( new SimpleGroup([new SimpleObject(oOutpost, 1, 1, 0, 4)], true, clOutpost), 0, [avoidClasses(clMetal, 4, clRock, 4, clTower, 5, clOutpost, 20), stayClasses(clIsland, 7)], scaleByMapSize(3, 10), 20, areaIslands); g_Map.log("Creating metal mines"); createObjectGroupsByAreas( new SimpleGroup([new SimpleObject(oMetalLarge, 1, 1, 0, 4)], true, clMetal), 0, avoidClasses(clForest, 4, clBaseResource, 20, clMetal, 50, clRock, 20, clWater, 4, clHill, 4, clGauls, 5, clPath, 5), scaleByMapSize(4, 20), 50, areasLand); g_Map.log("Creating stone mines"); createObjectGroupsByAreas( new SimpleGroup([new SimpleObject(oStoneLarge, 1, 1, 0, 4)], true, clRock), 0, avoidClasses(clForest, 4, clBaseResource, 20, clMetal, 20, clRock, 50, clWater, 4, clHill, 4, clGauls, 5, clPath, 5), scaleByMapSize(4, 20), 50, areasLand); g_Map.log("Creating stone ruins"); createObjectGroupsByAreas( new SimpleGroup([new SimpleObject(oStoneRuins, 1, 1, 0, 4)], true, clRock), 0, avoidClasses(clForest, 2, clPlayer, 12, clMetal, 6, clRock, 25, clWater, 4, clHill, 4, clGauls, 5, clPath, 1), scaleByMapSize(2, 10), 20, areasLand); Engine.SetProgress(70); g_Map.log("Creating decoratives"); for (let i = 0; i < 2; ++i) createDecoration( [ [new SimpleObject(aRock1, 1, 1, 0, 1)], [new SimpleObject(aRock2, 1, 1, 0, 1)], [new SimpleObject(aRock3, 1, 1, 0, 1)], [new SimpleObject(aRock4, 1, 1, 0, 1)], [new SimpleObject(aBush1, 1, 3, 0, 2)], [new SimpleObject(aBush2, 1, 2, 0, 1)], [new SimpleObject(aBush3, 1, 3, 0, 2)], [new SimpleObject(aBush4, 1, 2, 0, 1)], [new SimpleObject(aFerns, 2, 5, 2, 4)] ], [ scaleByMapSize(5, 80), scaleByMapSize(5, 80), scaleByMapSize(5, 80), scaleByMapSize(5, 80), scaleByMapSize(5, 80), scaleByMapSize(5, 80), scaleByMapSize(5, 80), scaleByMapSize(5, 80), scaleByMapSize(20, 80) ], i == 0 ? avoidClasses(clWater, 4, clForest, 1, clPlayer, 16, clRock, 4, clMetal, 4, clHill, 4, clGauls, 5, clPath, 1) : [stayClasses(clIsland, 4), avoidClasses(clForest, 1, clRock, 4, clMetal, 4)]); Engine.SetProgress(75); g_Map.log("Creating fish"); createFood( [ [new SimpleObject(oFish, 2, 3, 0, 2)] ], [ 20 * scaleByMapSize(5, 20) ], [avoidClasses(clIsland, 2, clFood, 10, clPath, 1), stayClasses(clWater, 5)], clFood); Engine.SetProgress(80); g_Map.log("Creating huntable animals"); createFood( [ [new SimpleObject(oSheep, 5, 5, 0, 4)], [new SimpleObject(oGoat, 5, 5, 0, 4)], [new SimpleObject(oRabbit, 5, 8, 0, 4)], [new SimpleObject(oDeer, 4, 6, 0, 2)], [new SimpleObject(oHawk, 1, 1, 0, 4)] ], [ scaleByMapSize(5, 20), scaleByMapSize(5, 20), scaleByMapSize(5, 20), scaleByMapSize(5, 20), scaleByMapSize(5, 10) ], avoidClasses(clIsland, 2, clFood, 10, clWater, 5, clPlayer, 16, clHill, 2, clGauls, 5, clPath, 1), clFood); g_Map.log("Creating violent animals"); if (!isNomad()) createFood( [ [new SimpleObject(oWolf, 1, 3, 0, 4)], [new SimpleObject(oBoar, 1, 1, 0, 4)], [new SimpleObject(oBear, 1, 1, 0, 4)] ], [ scaleByMapSize(5, 20), scaleByMapSize(5, 20), scaleByMapSize(5, 20) ], avoidClasses(clIsland, 2, clFood, 10, clWater, 5, clPlayer, 24, clHill, 2, clGauls, 5, clPath, 1), clFood); Engine.SetProgress(85); g_Map.log("Creating fruits"); createFood( [ [new SimpleObject(oApple, 3, 5, 4, 7)], [new SimpleObject(oBerryBush, 4, 6, 0, 4)] ], [ scaleByMapSize(5, 20), scaleByMapSize(5, 20) ], avoidClasses(clWater, 5, clForest, 2, clPlayer, 16, clHill, 4, clFood, 10, clMetal, 4, clRock, 4, clGauls, 5, clPath, 1), clFood); Engine.SetProgress(90); createStragglerTrees( treeTypes, avoidClasses(clForest, 2, clWater, 8, clPlayer, 16, clMetal, 4, clRock, 4, clFood, 1, clHill, 2, clGauls, 5, clPath, 5), clForest, stragglerTrees); createStragglerTrees( treeTypes, [stayClasses(clIsland, 4), avoidClasses(clMetal, 4, clRock, 4, clTower, 4, clOutpost, 4)], clForest, stragglerTrees * 7); Engine.SetProgress(95); g_Map.log("Creating animals on islands"); createFood( [ [new SimpleObject(oSheep, 4, 6, 0, 4)], [new SimpleObject(oGoat, 4, 6, 0, 4)], [new SimpleObject(oRabbit, 5, 8, 0, 4)] ], [ 10 * scaleByMapSize(5, 20), 10 * scaleByMapSize(5, 20), 10 * scaleByMapSize(5, 20) ], [avoidClasses(clRock, 4, clMetal, 4, clFood, 3, clForest, 1, clOutpost, 2, clTower, 2), stayClasses(clIsland, 4)], clFood); Engine.SetProgress(98); g_Map.log("Creating treasures"); createObjectGroupsByAreas( new SimpleGroup( [new SimpleObject(pickRandom(oTreasures), 1, 1, 0, 2)], true, clTreasure ), 0, avoidClasses(clForest, 1, clPlayer, 15, clHill, 1, clWater, 5, clFood, 1, clRock, 4, clMetal, 4, clTreasure, 10, clGauls, 5), randomTreasureCount, 50, areasLand); g_Map.log("Creating gallic decoratives"); createDecoration( [ [new SimpleObject(aBucket, 1, 1, 0, 1)], [new SimpleObject(aBarrel, 1, 1, 0, 1)], [new SimpleObject(aTartan, 3, 3, 4, 4, Math.PI/4, Math.PI/2)], [new SimpleObject(aWheel, 2, 4, 1, 2)], [new SimpleObject(aWell, 1, 1, 0, 2)], [new SimpleObject(aWoodcord, 1, 2, 2, 2, Math.PI/2, Math.PI/2)] ], [ scaleByMapSize(2, 10), scaleByMapSize(2, 10), scaleByMapSize(2, 10), scaleByMapSize(2, 10), scaleByMapSize(3, 4), scaleByMapSize(2, 10) ], avoidClasses(clForest, 1, clPlayer, 10, clBaseResource, 5, clHill, 1, clFood, 1, clWater, 5, clRock, 4, clMetal, 4, clGauls, 5, clPath, 1)); g_Map.log("Creating spawn points for ships"); createObjectGroupsByAreas( new SimpleGroup([new SimpleObject(triggerPointShipSpawn, 1, 1, 0, 0)], true, clShip), 0, [avoidClasses(clShip, 5, clIsland, 4), stayClasses(clWater, 10)], scaleByMapSize(10, 75), 10, areasWater); g_Map.log("Creating patrol points for ships"); createObjectGroupsByAreas( new SimpleGroup([new SimpleObject(triggerPointShipPatrol, 1, 1, 0, 0)], true, clShipPatrol), 0, [avoidClasses(clShipPatrol, 5, clIsland, 3), stayClasses(clWater, 4)], scaleByMapSize(20, 150), 10, areasWater); g_Map.log("Creating ungarrison points for ships"); for (let i = 0; i < 2; ++i) { let areaShore = [createArea( new MapBoundsPlacer(), undefined, stayClasses(clShore[i], 0))]; createObjectGroupsByAreas( new SimpleGroup( [new SimpleObject( i == 0 ? triggerPointShipUnloadLeft : triggerPointShipUnloadRight, 1, 1, 0, 0)], true, clShoreUngarrisonPoint[i]), 0, avoidClasses(clShoreUngarrisonPoint[i], 4), scaleByMapSize(60, 200), 20, areaShore); } g_Map.log("Creating riverdirection triggerpoint"); g_Map.placeEntityAnywhere(triggerPointRiverDirection, 0, Vector2D.add(mapCenter, new Vector2D(0, 1).rotate(startAngle)), randomAngle()); g_Map.log("Creating patrol points for siege engines"); for (let i = 0; i < 2; ++i) // Patrol points for siege engines createObjectGroupsByAreas( new SimpleGroup( [new SimpleObject( i == 0 ? triggerPointLandPatrolLeft : triggerPointLandPatrolRight, 1, 1, 0, 0)], true, clPatrolPointSiegeEngine[i]), 0, avoidClasses(clWater, 5, clForest, 3, clHill, 3, clFood, 1, clRock, 5, clMetal, 5, clPlayer, 10, clGauls, 5, clPatrolPointSiegeEngine[i], 5), scaleByMapSize(20, 150), 10, [areasLand[i]]); if (gallicCC) { g_Map.log("Creating patrol points for soldiers"); for (let i = 0; i < 2; ++i) createObjectGroupsByAreas( new SimpleGroup( [new SimpleObject( i == 0 ? triggerPointCCAttackerPatrolLeft : triggerPointCCAttackerPatrolRight, 1, 1, 0, 0)], true, clPatrolPointSoldier[i]), 0, // Don't avoid the forest, so that as many places as possible on the border are visited avoidClasses( clWater, 5, clHill, 3, clFood, 1, clRock, 4, clMetal, 4, clPlayer, 15, clGauls, 0, clPatrolPointSoldier[i], 5), scaleByMapSize(20, 150), 20, [areasLand[i]]); } g_Map.log("Creating water logs"); createObjectGroupsByAreas( new SimpleGroup([new SimpleObject(aWaterLog, 1, 1, 0, 0, startAngle, startAngle)], true, clWaterLog), 0, [avoidClasses(clShip, 3, clIsland, 4), stayClasses(clWater, 4)], scaleByMapSize(1, 4), 10, areasWater); placePlayersNomad(clPlayer, avoidClasses(clWater, 4, clMetal, 4, clRock, 4, clIsland, 4, clGauls, 20, clRitualPlace, 20, clForest, 1, clBaseResource, 4, clHill, 4, clFood, 2)); if (day) { g_Map.log("Setting day theme"); setSkySet("cumulus"); setSunColor(0.9, 0.8, 0.5); setFogFactor(0.05); setFogThickness(0.25); setWaterColor(0.317, 0.396, 0.294); setWaterTint(0.439, 0.403, 0.262); setPPContrast(0.62); setPPSaturation(0.51); setPPBloom(0.12); } else { g_Map.log("Setting night theme"); setSkySet("dark"); setSunColor(0.4, 0.9, 1.2); setSunElevation(0.13499); setSunRotation(-2.5); setTerrainAmbientColor(0.25, 0.3, 0.45); - setUnitsAmbientColor(0.3, 0.35, 0.5); + setUnitsAmbientColor(0.25, 0.3, 0.45); setFogFactor(0.004); setFogThickness(0.25); setFogColor(0.35, 0.45, 0.5); setWaterColor(0.074, 0.101, 0.090); setWaterTint(0.129, 0.160, 0.137); } setPPEffect("hdr"); setWaterWaviness(2.0); setWaterType("lake"); setWaterMurkiness(0.97); setWaterHeight(21); g_Map.ExportMap(); Index: ps/trunk/binaries/data/mods/public/maps/random/elephantine.js =================================================================== --- ps/trunk/binaries/data/mods/public/maps/random/elephantine.js (revision 24193) +++ ps/trunk/binaries/data/mods/public/maps/random/elephantine.js (revision 24194) @@ -1,603 +1,603 @@ /** * Heightmap image source: * OpenStreetMap, available under Open Database Licence, www.openstreetmap.org/copyright * https://download.geofabrik.de/africa.html * * To reproduce the river image: * You need a gdal version that supports osm, see https://www.gdal.org/drv_osm.html * wget https://download.geofabrik.de/africa/egypt-latest.osm.pbf * lon=32.89; lat=24.09175; width=0.025; * lat1=$(bc <<< ";scale=5;$lat-$width/2"); lon1=$(bc <<< ";scale=5;$lon+$width/2"); lat2=$(bc <<< ";scale=5;$lat+$width/2"); lon2=$(bc <<< ";scale=5;$lon-$width/2") * rm elephantine.geojson; ogr2ogr -f GeoJSON elephantine.geojson -clipdst $lon1 $lat1 $lon2 $lat2 egypt-latest.osm.pbf -sql 'select * from multipolygons where natural="water"' * gdal_rasterize -burn 10 -ts 512 512 elephantine.geojson elephantine.tif * convert elephantine.tif -threshold 50% -negate elephantine.png * * No further changes should be applied to the image to keep it easily interchangeable. */ Engine.LoadLibrary("rmgen"); Engine.LoadLibrary("rmgen-common"); TILE_CENTERED_HEIGHT_MAP = true; const tPrimary = ["savanna_dirt_rocks_a_red", "savanna_dirt_a_red", "savanna_dirt_b_red"]; const tDirt = ["new_savanna_dirt_c", "new_savanna_dirt_d", "savanna_dirt_b_red", "savanna_dirt_plants_cracked"]; const tWater = "desert_sand_wet"; const tRoad = "savanna_tile_a_red"; const tRoadIsland = "savanna_tile_a"; const tRoadWildIsland = "savanna_dirt_rocks_a"; const tGrass = ["savanna_shrubs_a_wetseason", "alpine_grass_b_wild", "medit_shrubs_a", "steppe_grass_green_a"]; const tForestFloorLand = "savanna_forestfloor_b_red"; const tForestFloorIsland = pickRandom(tGrass); const oAcacia = "gaia/tree/acacia"; const oPalms = [ "gaia/tree/cretan_date_palm_tall", "gaia/tree/cretan_date_palm_short", "gaia/tree/palm_tropic", "gaia/tree/date_palm", "gaia/tree/senegal_date_palm", "gaia/tree/medit_fan_palm" ]; const oStoneLarge = "gaia/rock/savanna_large"; const oStoneSmall = "gaia/rock/desert_small"; const oMetalLarge = "gaia/ore/savanna_large"; const oMetalSmall = "gaia/ore/desert_small"; const oTreasure = [ "gaia/treasure/food_barrel", "gaia/treasure/food_bin", "gaia/treasure/wood", "gaia/treasure/metal", "gaia/treasure/stone" ]; const oBerryBush = "gaia/fruit/berry_05"; const oGazelle = "gaia/fauna_gazelle"; const oRhino = "gaia/fauna_rhinoceros_white"; const oWarthog = "gaia/fauna_boar"; const oGiraffe = "gaia/fauna_giraffe"; const oGiraffeInfant = "gaia/fauna_giraffe_infant"; const oElephant = "gaia/fauna_elephant_african_bush"; const oElephantInfant = "gaia/fauna_elephant_african_infant"; const oLion = "gaia/fauna_lion"; const oLioness = "gaia/fauna_lioness"; const oCrocodile = "gaia/fauna_crocodile_nile"; const oFish = "gaia/fish/tilapia"; const oHawk = "birds/buzzard"; // The main temple on elephantine was very similar looking (Greco-Roman-Egyptian): const oWonder = "structures/ptol_wonder"; const oTemples = ["structures/kush_temple_amun", "structures/kush_temple"]; const oPyramid = "structures/kush_pyramid_large"; const oTowers = new Array(2).fill("uncapturable|structures/kush_sentry_tower").concat(["uncapturable|structures/kush_defense_tower"]); const oHeroes = Engine.FindTemplates("units/", true).filter(templateName => templateName.startsWith("units/kush_hero_")); const oUnits = Engine.FindTemplates("units/", false).filter(templateName => templateName.startsWith("units/kush_") && oHeroes.every(heroTemplateName => heroTemplateName != templateName) && Engine.GetTemplate(templateName).Identity.VisibleClasses._string.split(" ").some(type => ["Soldier", "Healer", "Female"].indexOf(type) != -1)); const aRock = actorTemplate("geology/stone_savanna_med"); const aStatues = [ "props/structures/kushites/statue_bird", "props/structures/kushites/statue_lion", "props/structures/kushites/statue_ram" ].map(actorTemplate); const aBushesShoreline = [ ...new Array(4).fill("props/flora/ferns"), "props/flora/bush", "props/flora/bush_medit_la", "props/flora/bush_medit_la_lush", "props/flora/bush_medit_me_lush", "props/flora/bush_medit_sm", "props/flora/bush_medit_sm_lush", "props/flora/bush_tempe_la_lush" ].map(actorTemplate); const aBushesIslands = aBushesShoreline.concat(new Array(3).fill(actorTemplate("props/flora/foliagebush"))); const aBushesDesert = [ "props/flora/bush_dry_a", "props/flora/bush_medit_la_dry", "props/flora/bush_medit_me_dry", "props/flora/bush_medit_sm", "props/flora/bush_medit_sm_dry", "props/flora/bush_tempe_me_dry", "props/flora/grass_soft_dry_large_tall", "props/flora/grass_soft_dry_small_tall" ].map(actorTemplate); const pForestPalmsLand = [ tForestFloorLand, ...oPalms.map(tree => tForestFloorLand + TERRAIN_SEPARATOR + tree), tForestFloorLand]; const pForest2Land = [ tForestFloorLand, tForestFloorLand + TERRAIN_SEPARATOR + oAcacia, tForestFloorLand ]; const pForestPalmsIsland = [ tForestFloorIsland, ...oPalms.map(tree => tForestFloorIsland + TERRAIN_SEPARATOR + tree), tForestFloorIsland]; const pForest2Island = [ tForestFloorIsland, tForestFloorIsland + TERRAIN_SEPARATOR + oAcacia, tForestFloorIsland ]; const heightScale = num => num * g_MapSettings.Size / 320; const heightSeaGround = heightScale(-15); const heightWaterLevel = heightScale(0); const heightShore = heightScale(1); const heightOffsetPath = heightScale(-4); const minHeight = -1; const maxHeight = 2; const g_Map = new RandomMap(0, tPrimary); const mapBounds = g_Map.getBounds(); const mapCenter = g_Map.getCenter(); const clWater = g_Map.createTileClass(); const clIsland = g_Map.createTileClass(); const clCliff = g_Map.createTileClass(); const clPlayer = g_Map.createTileClass(); const clBaseResource = g_Map.createTileClass(); const clForest = g_Map.createTileClass(); const clDirt = g_Map.createTileClass(); const clRock = g_Map.createTileClass(); const clMetal = g_Map.createTileClass(); const clFood = g_Map.createTileClass(); const clTemple = g_Map.createTileClass(); const clTower = g_Map.createTileClass(); const clStatue = g_Map.createTileClass(); const clSoldier = g_Map.createTileClass(); const clTreasure = g_Map.createTileClass(); const clPath = g_Map.createTileClass(); const riverAngle = 0.22 * Math.PI; const riverWidthBorder = fractionToTiles(0.27); const riverWidthCenter = fractionToTiles(0.35); const avoidCollisions = avoidClasses( clPlayer, 15, clWater, 1, clForest, 1, clRock, 4, clMetal, 4, clFood, 6, clPath, 1, clTemple, 11, clCliff, 0, clStatue, 2, clSoldier, 3, clTower, 2, clTreasure, 1); g_Map.LoadHeightmapImage("elephantine.png", minHeight, maxHeight); Engine.SetProgress(3); g_Map.log("Lowering sea ground"); createArea( new MapBoundsPlacer(), [ new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 4), new TileClassPainter(clWater) ], new HeightConstraint(-Infinity, heightWaterLevel)); Engine.SetProgress(6); g_Map.log("Smoothing heightmap"); createArea( new MapBoundsPlacer(), new SmoothingPainter(1, scaleByMapSize(0.1, 0.5), 1)); Engine.SetProgress(10); g_Map.log("Marking islands"); var areaIsland = createArea( new ConvexPolygonPlacer( [ new Vector2D(mapCenter.x - riverWidthBorder / 2, mapBounds.top), new Vector2D(mapCenter.x - riverWidthBorder / 2, mapBounds.bottom), new Vector2D(mapCenter.x - riverWidthCenter / 2, mapCenter.y), new Vector2D(mapCenter.x + riverWidthCenter / 2, mapCenter.y), new Vector2D(mapCenter.x + riverWidthBorder / 2, mapBounds.top), new Vector2D(mapCenter.x + riverWidthBorder / 2, mapBounds.bottom) ].map(v => v.rotateAround(riverAngle, mapCenter)), Infinity), new TileClassPainter(clIsland), avoidClasses(clPlayer, 0, clWater, 0)); Engine.SetProgress(13); g_Map.log("Painting islands"); createArea( new MapBoundsPlacer(), new TerrainPainter(tGrass), stayClasses(clIsland, 0)); Engine.SetProgress(16); g_Map.log("Painting water and shoreline"); createArea( new MapBoundsPlacer(), new TerrainPainter(tWater), new HeightConstraint(-Infinity, heightShore)); Engine.SetProgress(19); placePlayerBases({ "PlayerPlacement": playerPlacementRiver(riverAngle, fractionToTiles(0.62)), "PlayerTileClass": clPlayer, "BaseResourceClass": clBaseResource, "baseResourceConstraint": avoidClasses(clWater, 4), "Walls": "towers", "CityPatch": { "outerTerrain": tRoad, "innerTerrain": tRoad }, "Chicken": { }, "Berries": { "template": oBerryBush }, "Mines": { "types": [ { "template": oMetalLarge }, { "template": oStoneLarge } ] }, "Trees": { "template": oAcacia, "count": 2 }, "Decoratives": { "template": pickRandom(aBushesDesert) } }); Engine.SetProgress(22); g_Map.log("Creating temple"); var groupTemple = createObjectGroupsByAreas( new SimpleGroup([new RandomObject(g_Map.getSize() >= 320 ? [oWonder] : oTemples, 1, 1, 0, 1, riverAngle, riverAngle)], true, clTemple), 0, stayClasses(clIsland, scaleByMapSize(10, 20)), 1, 200, [areaIsland]); Engine.SetProgress(34); g_Map.log("Creating pyramid"); var groupPyramid = createObjectGroupsByAreas( new SimpleGroup([new SimpleObject(oPyramid, 1, 1, 0, 1, riverAngle, riverAngle)], true, clTemple), 0, [stayClasses(clIsland, scaleByMapSize(10, 20)), avoidClasses(clTemple, scaleByMapSize(20, 50)), avoidCollisions], 1, 200, [areaIsland]); Engine.SetProgress(37); g_Map.log("Painting city patches"); var cityCenters = [ groupTemple[0] && groupTemple[0][0] && { "pos": Vector2D.from3D(groupTemple[0][0].position), "radius": 10 }, groupPyramid[0] && groupPyramid[0][0] && { "pos": Vector2D.from3D(groupPyramid[0][0].position), "radius": 6 },].filter(pos => !!pos); var areaCityPatch = cityCenters.map(cityCenter => createArea( new DiskPlacer(cityCenter.radius, cityCenter.pos), new LayeredPainter([tRoadWildIsland, tRoadIsland], [2]), stayClasses(clIsland, 2))); Engine.SetProgress(40); g_Map.log("Painting city path"); if (cityCenters.length == 2) createArea( new PathPlacer(cityCenters[0].pos, cityCenters[1].pos, 4, 0.3, 4, 0.2, 0.05), [ new LayeredPainter([tRoadWildIsland, tRoadIsland], [1]), new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetPath, 4), new TileClassPainter(clPath) ]); Engine.SetProgress(42); createBumps(avoidClasses(clPlayer, 10, clWater, 2, clTemple, 10, clPath, 1), scaleByMapSize(10, 500), 1, 8, 4, 0.2, 3); Engine.SetProgress(43); g_Map.log("Marking cliffs"); createArea( new MapBoundsPlacer(), new TileClassPainter(clCliff), [ avoidClasses(clWater, 2), new SlopeConstraint(2, Infinity) ]); Engine.SetProgress(44); g_Map.log("Creating stone mines"); createMines( [ [new SimpleObject(oStoneSmall, 0, 2, 0, 4, 0, 2 * Math.PI, 1), new SimpleObject(oStoneLarge, 1, 1, 0, 4, 0, 2 * Math.PI, 4)], [new SimpleObject(oStoneSmall, 2, 5, 1, 3, 0, 2 * Math.PI, 1)] ], avoidClasses(clWater, 4, clCliff, 4, clPlayer, 20, clRock, 10, clPath, 1), clRock, scaleByMapSize(6, 24)); Engine.SetProgress(45); g_Map.log("Creating metal mines"); createMines( [ [new SimpleObject(oMetalSmall, 0, 2, 0, 4, 0, 2 * Math.PI, 1), new SimpleObject(oMetalLarge, 1, 1, 0, 4, 0, 2 * Math.PI, 4)], [new SimpleObject(oMetalSmall, 2, 5, 1, 3, 0, 2 * Math.PI, 1)] ], avoidClasses(clWater, 4, clCliff, 4, clPlayer, 20, clMetal, 10, clRock, 5, clPath, 1), clMetal, scaleByMapSize(6, 24)); Engine.SetProgress(46); g_Map.log("Creating kushite towers"); createObjectGroups( new SimpleGroup([new RandomObject(oTowers, 1, 1, 0, 1)], true, clTower), 0, [ stayClasses(clIsland, scaleByMapSize(4, 8)), new NearTileClassConstraint(clTemple, 25), avoidClasses(clTower, 12, clPlayer, 30), avoidCollisions ], scaleByMapSize(4, 12), 200); Engine.SetProgress(49); var [forestTrees, stragglerTrees] = getTreeCounts(400, 3000, 0.7); createForests( [tForestFloorLand, tForestFloorLand, tForestFloorLand, pForestPalmsLand, pForest2Land], [avoidCollisions, avoidClasses(clIsland, 0, clPlayer, 20, clForest, 18, clWater, 2)], clForest, forestTrees / 2); Engine.SetProgress(52); createForests( [tForestFloorIsland, tForestFloorIsland, tForestFloorIsland, pForestPalmsIsland, pForest2Island], [stayClasses(clIsland, 0), avoidClasses(clForest, 15, clWater, 2), avoidCollisions], clForest, forestTrees / 2); Engine.SetProgress(55); g_Map.log("Creating dirt patches"); createPatches( [scaleByMapSize(5, 15)], tDirt, avoidClasses(clWater, 0, clIsland, 0, clForest, 0, clDirt, 5, clPlayer, 12), scaleByMapSize(5, 30), clDirt); Engine.SetProgress(58); g_Map.log("Creating statues"); createObjectGroupsByAreas( new SimpleGroup([new RandomObject(aStatues, 1, 1, 0, 1)], true, clStatue), 0, [ stayClasses(clIsland, scaleByMapSize(8, 24)), new NearTileClassConstraint(clTemple, 10), avoidCollisions ], scaleByMapSize(2, 10), 400, [areaIsland]); Engine.SetProgress(61); g_Map.log("Creating treasure"); createObjectGroupsByAreas( new SimpleGroup([new RandomObject(oTreasure, 1, 2, 0, 1)], true, clTreasure), 0, avoidCollisions, scaleByMapSize(4, 10), 100, areaCityPatch); Engine.SetProgress(62); g_Map.log("Creating hero"); createObjectGroups( new SimpleGroup([new RandomObject(oHeroes, 1, 1, 0, 1)], true, clSoldier), 0, [ stayClasses(clIsland, scaleByMapSize(2, 24)), new NearTileClassConstraint(clTemple, 14), avoidCollisions ], 1, 500); Engine.SetProgress(64); g_Map.log("Creating soldiers"); createObjectGroups( new SimpleGroup([new RandomObject(oUnits, 1, 1, 0, 1)], true, clSoldier), 0, [ new StaticConstraint( [ stayClasses(clIsland, scaleByMapSize(2, 24)), new NearTileClassConstraint(clTemple, 20) ]), avoidCollisions ], scaleByMapSize(12, 60), 200); Engine.SetProgress(67); g_Map.log("Creating berries"); createObjectGroups( new SimpleGroup([new SimpleObject(oBerryBush, 3, 5, 1, 2)], true, clFood), 0, avoidCollisions, scaleByMapSize(4, 12), 250); Engine.SetProgress(70); g_Map.log("Creating rhinos"); createObjectGroups( new SimpleGroup([new SimpleObject(oRhino, 1, 1, 0, 1)], true, clFood), 0, avoidCollisions, scaleByMapSize(2, 10), 50); Engine.SetProgress(73); g_Map.log("Creating warthog"); createObjectGroups( new SimpleGroup([new SimpleObject(oWarthog, 1, 1, 0, 1)], true, clFood), 0, avoidCollisions, scaleByMapSize(2, 10), 50); Engine.SetProgress(77); g_Map.log("Creating gazelles"); createObjectGroups( new SimpleGroup([new SimpleObject(oGazelle, 5, 7, 2, 4)], true, clFood), 0, [avoidClasses(clIsland, 1), avoidCollisions], scaleByMapSize(2, 10), 50); Engine.SetProgress(80); g_Map.log("Creating giraffes"); createObjectGroups( new SimpleGroup([new SimpleObject(oGiraffe, 2, 3, 2, 4), new SimpleObject(oGiraffeInfant, 2, 3, 2, 4)], true, clFood), 0, avoidCollisions, scaleByMapSize(2, 10), 50); Engine.SetProgress(83); if (!isNomad()) { g_Map.log("Creating lions"); createObjectGroups( new SimpleGroup([new SimpleObject(oLion, 1, 2, 2, 4), new SimpleObject(oLioness, 2, 3, 2, 4)], true, clFood), 0, avoidCollisions, scaleByMapSize(2, 10), 50); Engine.SetProgress(87); } g_Map.log("Creating elephants"); createObjectGroups( new SimpleGroup([new SimpleObject(oElephant, 2, 3, 2, 4), new SimpleObject(oElephantInfant, 2, 3, 2, 4)], true, clFood), 0, avoidCollisions, scaleByMapSize(2, 10), 50); Engine.SetProgress(88); g_Map.log("Creating crocodiles"); createObjectGroups( new SimpleGroup([new SimpleObject(oCrocodile, 2, 3, 3, 5)], true, clFood), 0, [ new NearTileClassConstraint(clWater, 3), avoidCollisions ], scaleByMapSize(2, 10), 50); Engine.SetProgress(89); g_Map.log("Creating hawk"); for (let i = 0; i < scaleByMapSize(0, 2); ++i) g_Map.placeEntityAnywhere(oHawk, 0, mapCenter, randomAngle()); Engine.SetProgress(90); g_Map.log("Creating fish"); createObjectGroups( new SimpleGroup([new SimpleObject(oFish, 1, 2, 0, 1)], true, clFood), 0, [stayClasses(clWater, 8), avoidClasses(clFood, 16)], scaleByMapSize(15, 80), 50); Engine.SetProgress(91); createStragglerTrees( [oAcacia], avoidCollisions, clForest, stragglerTrees); Engine.SetProgress(93); placePlayersNomad(clPlayer, [avoidCollisions, avoidClasses(clIsland, 0)]); Engine.SetProgress(95); createDecoration( aBushesDesert.map(bush => [new SimpleObject(bush, 0, 3, 2, 4)]), aBushesDesert.map(bush => scaleByMapSize(20, 150) * randIntInclusive(1, 3)), [avoidClasses(clIsland, 0), avoidCollisions]); Engine.SetProgress(96); createDecoration( aBushesIslands.map(bush => [new SimpleObject(bush, 0, 4, 2, 4)]), aBushesIslands.map(bush => scaleByMapSize(20, 150) * randIntInclusive(1, 3)), [stayClasses(clIsland, 0), avoidCollisions]); Engine.SetProgress(97); createDecoration( [[new SimpleObject(aRock, 0, 4, 2, 4)]], [[scaleByMapSize(80, 500)]], [avoidClasses(clIsland, 0), avoidCollisions]); Engine.SetProgress(98); createDecoration( aBushesShoreline.map(bush => [new SimpleObject(bush, 0, 3, 2, 4)]), aBushesShoreline.map(bush => scaleByMapSize(200, 1000)), [new HeightConstraint(heightWaterLevel, heightShore), avoidCollisions]); Engine.SetProgress(99); g_Environment = { "SkySet": "cloudless", "SunColor": { "r": 1, "g": 0.964706, "b": 0.909804, "a": 0 }, "SunElevation": 0.908117, "SunRotation": -0.558369, "TerrainAmbientColor": { "r": 0.54902, "g": 0.419608, "b": 0.352941, "a": 0 }, - "UnitsAmbientColor": { "r": 0.721569, "g": 0.529412, "b": 0.4, "a": 0 }, + "UnitsAmbientColor": { "r": 0.54902, "g": 0.419608, "b": 0.352941, "a": 0 }, "Fog": { "FogFactor": 0.00195313, "FogThickness": 0, "FogColor": { "r": 0.941176, "g": 0.917647, "b": 0.807843, "a": 0 } }, "Water": { "WaterBody": { "Type": "lake", "Color": { "r": 0.443137, "g": 0.341176, "b": 0.14902, "a": 0 }, "Tint": { "r": 0.705882, "g": 0.67451, "b": 0.454902, "a": 0 }, "Waviness": 8.4668, "Murkiness": 0.92, "WindAngle": 0.625864 } }, "Postproc": { "Brightness": 0.0234375, "Contrast": 1.09961, "Saturation": 0.828125, "Bloom": 0.142969, "PostprocEffect": "hdr" } }; g_Map.ExportMap(); Index: ps/trunk/binaries/data/mods/public/maps/random/india.js =================================================================== --- ps/trunk/binaries/data/mods/public/maps/random/india.js (revision 24193) +++ ps/trunk/binaries/data/mods/public/maps/random/india.js (revision 24194) @@ -1,272 +1,272 @@ Engine.LoadLibrary("rmgen"); Engine.LoadLibrary("rmgen-common"); const tGrass1 = "savanna_grass_a"; const tDirt1 = "savanna_dirt_a"; const tDirt4 = "savanna_dirt_b"; const tCityTiles = "savanna_tile_a_dirt_red"; const tShore = "savanna_riparian_bank"; const tWater = "savanna_riparian_wet"; const oTree = "gaia/tree/palm_tropic"; const oBerryBush = "gaia/fruit/berry_01"; const oRabbit = "gaia/fauna_rabbit"; const oTiger = "gaia/fauna_tiger"; const oCrocodile = "gaia/fauna_crocodile_nile"; const oFish = "gaia/fish/generic"; const oElephant = "gaia/fauna_elephant_asian"; const oElephantInfant = "gaia/fauna_elephant_asian_infant"; const oBoar = "gaia/fauna_boar"; const oStoneSmall = "gaia/rock/savanna_small"; const oMetalLarge = "gaia/ore/savanna_large"; const aBush = "actor|props/flora/bush_medit_sm_dry.xml"; const aRock = "actor|geology/stone_savanna_med.xml"; const heightSeaGround = -3; const heightLand = 1; const heightShore = 3; const heightOffsetBump = 2; var g_Map = new RandomMap(heightLand, tGrass1); var numPlayers = getNumPlayers(); var mapSize = g_Map.getSize(); var mapCenter = g_Map.getCenter(); var clPlayer = g_Map.createTileClass(); var clForest = g_Map.createTileClass(); var clWater = g_Map.createTileClass(); var clRock = g_Map.createTileClass(); var clMetal = g_Map.createTileClass(); var clFood = g_Map.createTileClass(); var clBaseResource = g_Map.createTileClass(); placePlayerBases({ "PlayerPlacement": playerPlacementCircle(fractionToTiles(0.35)), "PlayerTileClass": clPlayer, "BaseResourceClass": clBaseResource, // No city patch "Chicken": { }, "Berries": { "template": oBerryBush }, "Mines": { "types": [ { "template": oMetalLarge }, { "type": "stone_formation", "template": oStoneSmall, "terrain": tDirt1 } ] }, "Trees": { "template": oTree, "count": scaleByMapSize(3, 7), "minDist": 13, "maxDist": 15, "minDistGroup": 4, "maxDistGroup": 6 } // No decoratives }); Engine.SetProgress(20); g_Map.log("Creating bumps"); createAreas( new ClumpPlacer(scaleByMapSize(20, 50), 0.5, 0.08, Infinity), new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetBump, 2), avoidClasses(clPlayer, 13), scaleByMapSize(300, 800) ); g_Map.log("Creating the half dried-up lake"); createArea( new ChainPlacer( 2, Math.floor(scaleByMapSize(2, 16)), Math.floor(scaleByMapSize(35, 200)), Infinity, mapCenter, 0, [Math.floor(scaleByMapSize(15, 40))]), [ new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 4), new TileClassPainter(clWater) ], avoidClasses(clPlayer, 2)); g_Map.log("Creating more shore jaggedness"); createAreas( new ChainPlacer(2, Math.floor(scaleByMapSize(4, 6)), 3, Infinity), [ new SmoothElevationPainter(ELEVATION_SET, heightShore, 4), new TileClassUnPainter(clWater) ], borderClasses(clWater, 4, 7), scaleByMapSize(12, 130) * 2, 150 ); paintTerrainBasedOnHeight(2.4, 3.4, 3, tGrass1); paintTerrainBasedOnHeight(1, 2.4, 0, tShore); paintTerrainBasedOnHeight(-8, 1, 2, tWater); paintTileClassBasedOnHeight(-6, 0, 1, clWater); Engine.SetProgress(55); g_Map.log("Creating stone mines"); for (let i = 0; i < scaleByMapSize(12, 30); ++i) { let position = new Vector2D(randIntInclusive(1, mapSize - 1), randIntInclusive(1, mapSize - 1)); if (avoidClasses(clPlayer, 30, clRock, 25, clWater, 10).allows(position)) { createStoneMineFormation(position, oStoneSmall, tDirt4); clRock.add(position); } } g_Map.log("Creating metal mines"); createObjectGroupsDeprecated( new SimpleGroup([new SimpleObject(oMetalLarge, 1, 1, 0, 4)], true, clMetal), 0, avoidClasses(clPlayer, 20, clMetal, 10, clRock, 8, clWater, 4), scaleByMapSize(2, 12), 100 ); Engine.SetProgress(65); g_Map.log("Creating small decorative rocks"); createObjectGroupsDeprecated( new SimpleGroup( [new SimpleObject(aRock, 1, 3, 0, 3)], true ), 0, avoidClasses(clPlayer, 7, clWater, 1), scaleByMapSize(200, 1200), 1 ); Engine.SetProgress(70); g_Map.log("Creating boar"); createObjectGroupsDeprecated( new SimpleGroup( [new SimpleObject(oBoar, 1, 2, 0, 4)], true, clFood ), 0, avoidClasses(clWater, 1, clPlayer, 20, clFood, 11), scaleByMapSize(4, 12), 50 ); g_Map.log("Creating tigers"); createObjectGroupsDeprecated( new SimpleGroup( [new SimpleObject(oTiger, 2, 2, 0, 4)], true, clFood ), 0, avoidClasses(clWater, 1, clPlayer, 20, clFood, 11), scaleByMapSize(4, 12), 50 ); g_Map.log("Creating crocodiles"); createObjectGroupsDeprecated( new SimpleGroup( [new SimpleObject(oCrocodile, 2, 4, 0, 4)], true, clFood ), 0, stayClasses(clWater, 1), scaleByMapSize(4, 12), 50 ); g_Map.log("Creating elephants"); createObjectGroupsDeprecated( new SimpleGroup( [ new SimpleObject(oElephant, 2, 4, 0, 4), new SimpleObject(oElephantInfant, 1, 2, 0, 4) ], true, clFood ), 0, avoidClasses(clWater, 1, clPlayer, 20, clFood, 11), scaleByMapSize(4, 12), 50 ); g_Map.log("Creating rabbits"); createObjectGroupsDeprecated( new SimpleGroup( [new SimpleObject(oRabbit, 5, 6, 0, 4)], true, clFood ), 0, avoidClasses(clWater, 1, clPlayer, 20, clFood, 11), scaleByMapSize(4, 12), 50 ); createFood( [ [new SimpleObject(oFish, 2, 3, 0, 2)] ], [ 25 * numPlayers ], [avoidClasses(clFood, 20), stayClasses(clWater, 2)], clFood); g_Map.log("Creating berry bush"); createObjectGroupsDeprecated( new SimpleGroup( [new SimpleObject(oBerryBush, 5, 7, 0, 4)], true, clFood ), 0, avoidClasses(clWater, 3, clPlayer, 20, clFood, 12, clRock, 4, clMetal, 4), randIntInclusive(1, 4) * numPlayers + 2, 50 ); Engine.SetProgress(85); g_Map.log("Creating trees"); createObjectGroupsDeprecated( new SimpleGroup( [new SimpleObject(oTree, 1, 7, 0, 3)], true, clForest ), 0, avoidClasses(clForest, 1, clPlayer, 20, clMetal, 4, clRock, 4, clWater, 1), scaleByMapSize(70, 500) ); g_Map.log("Creating large grass tufts"); createObjectGroupsDeprecated( new SimpleGroup( [new SimpleObject(aBush, 2, 4, 0, 1.8, -Math.PI/8, Math.PI/8)] ), 0, avoidClasses(clWater, 3, clPlayer, 2, clForest, 0), scaleByMapSize(100, 1200) ); placePlayersNomad(clPlayer, avoidClasses(clWater, 4, clForest, 1, clMetal, 4, clRock, 4, clFood, 2)); setSunColor(0.87451, 0.847059, 0.647059); setWaterColor(0.741176, 0.592157, 0.27451); setWaterTint(0.741176, 0.592157, 0.27451); setWaterWaviness(2.0); setWaterType("clap"); setWaterMurkiness(0.835938); setUnitsAmbientColor(0.57, 0.58, 0.55); -setTerrainAmbientColor(0.447059, 0.509804, 0.54902); +setTerrainAmbientColor(0.57, 0.58, 0.55); setFogFactor(0.25); setFogThickness(0.15); setFogColor(0.847059, 0.737255, 0.482353); setPPEffect("hdr"); setPPContrast(0.57031); setPPBloom(0.34); g_Map.ExportMap(); Index: ps/trunk/binaries/data/mods/public/maps/random/oasis.js =================================================================== --- ps/trunk/binaries/data/mods/public/maps/random/oasis.js (revision 24193) +++ ps/trunk/binaries/data/mods/public/maps/random/oasis.js (revision 24194) @@ -1,314 +1,314 @@ Engine.LoadLibrary("rmgen"); Engine.LoadLibrary("rmgen-common"); const tSand = ["desert_sand_dunes_100", "desert_dirt_cracks","desert_sand_smooth", "desert_dirt_rough", "desert_dirt_rough_2", "desert_sand_smooth"]; const tDune = ["desert_sand_dunes_50"]; const tForestFloor = "desert_forestfloor_palms"; const tDirt = ["desert_dirt_rough","desert_dirt_rough","desert_dirt_rough", "desert_dirt_rough_2", "desert_dirt_rocks_2"]; const tRoad = "desert_city_tile"; const tRoadWild = "desert_city_tile"; const tShore = "dirta"; const tWater = "desert_sand_wet"; const ePalmShort = "gaia/tree/cretan_date_palm_short"; const ePalmTall = "gaia/tree/cretan_date_palm_tall"; const eBush = "gaia/fruit/grapes"; const eCamel = "gaia/fauna_camel"; const eGazelle = "gaia/fauna_gazelle"; const eLion = "gaia/fauna_lion"; const eLioness = "gaia/fauna_lioness"; const eStoneMine = "gaia/rock/desert_large"; const eMetalMine = "gaia/ore/desert_large"; const aFlower1 = "actor|props/flora/decals_flowers_daisies.xml"; const aWaterFlower = "actor|props/flora/water_lillies.xml"; const aReedsA = "actor|props/flora/reeds_pond_lush_a.xml"; const aReedsB = "actor|props/flora/reeds_pond_lush_b.xml"; const aRock = "actor|geology/stone_desert_med.xml"; const aBushA = "actor|props/flora/bush_desert_dry_a.xml"; const aBushB = "actor|props/flora/bush_desert_dry_a.xml"; const aSand = "actor|particle/blowing_sand.xml"; const pForestMain = [tForestFloor + TERRAIN_SEPARATOR + ePalmShort, tForestFloor + TERRAIN_SEPARATOR + ePalmTall, tForestFloor]; const pOasisForestLight = [tForestFloor + TERRAIN_SEPARATOR + ePalmShort, tForestFloor + TERRAIN_SEPARATOR + ePalmTall, tForestFloor,tForestFloor,tForestFloor ,tForestFloor,tForestFloor,tForestFloor,tForestFloor]; const heightSeaGround = -3; const heightFloraMin = -2.5; const heightFloraReedsMax = -1.9; const heightFloraMax = -1; const heightLand = 1; const heightSand = 3.4; const heightOasisPath = 4; const heightOffsetBump = 4; const heightOffsetDune = 18; var g_Map = new RandomMap(heightLand, tSand); const numPlayers = getNumPlayers(); const mapSize = g_Map.getSize(); const mapCenter = g_Map.getCenter(); var clPlayer = g_Map.createTileClass(); var clHill = g_Map.createTileClass(); var clForest = g_Map.createTileClass(); var clOasis = g_Map.createTileClass(); var clPassage = g_Map.createTileClass(); var clRock = g_Map.createTileClass(); var clMetal = g_Map.createTileClass(); var clFood = g_Map.createTileClass(); var clBaseResource = g_Map.createTileClass(); var waterRadius = scaleByMapSize(7, 50); var shoreDistance = scaleByMapSize(4, 10); var forestDistance = scaleByMapSize(6, 20); var [playerIDs, playerPosition] = playerPlacementCircle(fractionToTiles(0.35)); g_Map.log("Creating small oasis near the players..."); var forestDist = 1.2 * defaultPlayerBaseRadius(); for (let i = 0; i < numPlayers; ++i) { let forestPosition; let forestAngle; do { forestAngle = Math.PI / 3 * randFloat(1, 2); forestPosition = Vector2D.add(playerPosition[i], new Vector2D(forestDist, 0).rotate(-forestAngle)); } while ( !createArea( new ClumpPlacer(70, 1, 0.5, Infinity, forestPosition), [ new LayeredPainter([tForestFloor, pForestMain], [0]), new TileClassPainter(clBaseResource) ], avoidClasses(clBaseResource, 0))); let waterPosition; let flowerPosition; let reedsPosition; do { let waterAngle = forestAngle + randFloat(1, 5) / 3 * Math.PI; waterPosition = Vector2D.add(forestPosition, new Vector2D(6, 0).rotate(-waterAngle)).round(); flowerPosition = Vector2D.add(forestPosition, new Vector2D(3, 0).rotate(-waterAngle)).round(); reedsPosition = Vector2D.add(forestPosition, new Vector2D(5, 0).rotate(-waterAngle)).round(); } while ( !createArea( new ClumpPlacer(diskArea(4.5), 0.9, 0.4, Infinity, waterPosition), [ new LayeredPainter([tShore, tWater], [1]), new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 3) ], avoidClasses(clBaseResource, 0))); createObjectGroup(new SimpleGroup([new SimpleObject(aFlower1, 1, 5, 0, 3)], true, undefined, flowerPosition), 0); createObjectGroup(new SimpleGroup([new SimpleObject(aReedsA, 1, 3, 0, 0)], true, undefined, reedsPosition), 0); } Engine.SetProgress(20); placePlayerBases({ "PlayerPlacement": [playerIDs, playerPosition], "PlayerTileClass": clPlayer, "BaseResourceClass": clBaseResource, "CityPatch": { "outerTerrain": tRoadWild, "innerTerrain": tRoad, "painters": [ new TileClassPainter(clPlayer) ] }, "Chicken": { }, "Berries": { "template": eBush }, "Mines": { "types": [ { "template": eMetalMine }, { "template": eStoneMine }, ], "distance": defaultPlayerBaseRadius(), "maxAngle": Math.PI / 2, "groupElements": shuffleArray([aBushA, aBushB, ePalmShort, ePalmTall]).map(t => new SimpleObject(t, 1, 1, 3, 4)) } // Starting trees were set above // No decoratives }); Engine.SetProgress(30); g_Map.log("Creating central oasis"); createArea( new ClumpPlacer(diskArea(forestDistance + shoreDistance + waterRadius), 0.8, 0.2, Infinity, mapCenter), [ new LayeredPainter([pOasisForestLight, tWater], [forestDistance]), new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, forestDistance + shoreDistance), new TileClassPainter(clOasis) ]); Engine.SetProgress(40); g_Map.log("Creating bumps"); createAreas( new ClumpPlacer(scaleByMapSize(20, 50), 0.3, 0.06, Infinity), new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetBump, 3), avoidClasses(clPlayer, 10, clBaseResource, 6, clOasis, 4), scaleByMapSize(30, 70)); g_Map.log("Creating dirt patches"); createAreas( new ClumpPlacer(80, 0.3, 0.06, Infinity), new TerrainPainter(tDirt), avoidClasses(clPlayer, 10, clBaseResource, 6, clOasis, 4, clForest, 4), scaleByMapSize(15, 50)); g_Map.log("Creating dunes"); createAreas( new ClumpPlacer(120, 0.3, 0.06, Infinity), [ new TerrainPainter(tDune), new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetDune, 30) ], avoidClasses(clPlayer, 10, clBaseResource, 6, clOasis, 4, clForest, 4), scaleByMapSize(15, 50)); Engine.SetProgress(50); if (mapSize > 150 && randBool()) { g_Map.log("Creating path though the oasis"); let pathWidth = scaleByMapSize(7, 18); let points = distributePointsOnCircle(2, randomAngle(), waterRadius + shoreDistance + forestDistance + pathWidth, mapCenter)[0]; createArea( new PathPlacer(points[0], points[1], pathWidth, 0.4, 1, 0.2, 0), [ new TerrainPainter(tSand), new SmoothElevationPainter(ELEVATION_SET, heightOasisPath, 5), new TileClassPainter(clPassage) ]); } g_Map.log("Creating some straggler trees around the passage"); var group = new SimpleGroup([new SimpleObject(ePalmTall, 1,1, 0,0),new SimpleObject(ePalmShort, 1, 2, 1, 2), new SimpleObject(aBushA, 0,2, 1,3)], true, clForest); createObjectGroupsDeprecated(group, 0, stayClasses(clPassage, 3), scaleByMapSize(60, 250), 100); g_Map.log("Creating stone mines"); group = new SimpleGroup([new SimpleObject(eStoneMine, 1,1, 0,0),new SimpleObject(ePalmShort, 1,2, 3,3),new SimpleObject(ePalmTall, 0,1, 3,3) ,new SimpleObject(aBushB, 1,1, 2,2), new SimpleObject(aBushA, 0,2, 1,3)], true, clRock); createObjectGroupsDeprecated(group, 0, avoidClasses(clOasis, 10, clForest, 1, clPlayer, 30, clRock, 10,clBaseResource, 2, clHill, 1), scaleByMapSize(6,25), 100 ); g_Map.log("Creating metal mines"); group = new SimpleGroup([new SimpleObject(eMetalMine, 1,1, 0,0),new SimpleObject(ePalmShort, 1,2, 2,3),new SimpleObject(ePalmTall, 0,1, 2,2) ,new SimpleObject(aBushB, 1,1, 2,2), new SimpleObject(aBushA, 0,2, 1,3)], true, clMetal); createObjectGroupsDeprecated(group, 0, avoidClasses(clOasis, 10, clForest, 1, clPlayer, 30, clMetal, 10,clBaseResource, 2, clRock, 10, clHill, 1), scaleByMapSize(6,25), 100 ); Engine.SetProgress(65); g_Map.log("Creating small decorative rocks"); group = new SimpleGroup( [new SimpleObject(aRock, 2,4, 0,2)], true, undefined ); createObjectGroupsDeprecated(group, 0, avoidClasses(clOasis, 3, clForest, 0, clPlayer, 10, clHill, 1, clFood, 20), 30, scaleByMapSize(10, 50)); Engine.SetProgress(70); g_Map.log("Creating camels"); group = new SimpleGroup( [new SimpleObject(eCamel, 1,2, 0,4)], true, clFood ); createObjectGroupsDeprecated(group, 0, avoidClasses(clOasis, 3, clForest, 0, clPlayer, 10, clHill, 1, clFood, 20), 1 * numPlayers, 50 ); Engine.SetProgress(75); g_Map.log("Creating gazelles"); group = new SimpleGroup( [new SimpleObject(eGazelle, 2,4, 0,2)], true, clFood ); createObjectGroupsDeprecated(group, 0, avoidClasses(clOasis, 3, clForest, 0, clPlayer, 10, clHill, 1, clFood, 20), 1 * numPlayers, 50 ); Engine.SetProgress(85); g_Map.log("Creating oasis animals"); for (let i = 0; i < scaleByMapSize(5, 30); ++i) { let animalPos = Vector2D.add(mapCenter, new Vector2D(forestDistance + shoreDistance + waterRadius, 0).rotate(randomAngle())); createObjectGroup( new RandomGroup( [ new SimpleObject(eLion, 1, 2, 0, 4), new SimpleObject(eLioness, 1, 2, 2, 4), new SimpleObject(eGazelle, 4, 6, 1, 5), new SimpleObject(eCamel, 1, 2, 1, 5) ], true, clFood, animalPos), 0); } Engine.SetProgress(90); g_Map.log("Creating bushes"); var group = new SimpleGroup( [new SimpleObject(aBushB, 1,2, 0,2), new SimpleObject(aBushA, 2,4, 0,2)] ); createObjectGroupsDeprecated(group, 0, avoidClasses(clOasis, 2, clHill, 1, clPlayer, 1, clPassage, 1), scaleByMapSize(10, 40), 20 ); var objectsWaterFlora = [ new SimpleObject(aReedsA, 5, 12, 0, 2), new SimpleObject(aReedsB, 5, 12, 0, 2) ]; g_Map.log("Creating sand blows and beautifications"); for (var sandx = 0; sandx < mapSize; sandx += 4) for (var sandz = 0; sandz < mapSize; sandz += 4) { let position = new Vector2D(sandx, sandz); let height = g_Map.getHeight(position); if (height > heightSand) { if (randBool((height - heightSand) / 1.4)) createObjectGroup(new SimpleGroup([new SimpleObject(aSand, 0, 1, 0, 2)], true, undefined, position), 0); } else if (height > heightFloraMin && height < heightFloraMax) { if (randBool(0.4)) createObjectGroup(new SimpleGroup([new SimpleObject(aWaterFlower, 1, 4, 1, 2)], true, undefined, position), 0); else if (randBool(0.7) && height < heightFloraReedsMax) createObjectGroup(new SimpleGroup(objectsWaterFlora, true, undefined, position), 0); if (clPassage.countMembersInRadius(position, 2)) { if (randBool(0.4)) createObjectGroup(new SimpleGroup([new SimpleObject(aWaterFlower, 1, 4, 1, 2)], true, undefined, position), 0); else if (randBool(0.7) && height < heightFloraReedsMax) createObjectGroup(new SimpleGroup(objectsWaterFlora, true, undefined, position), 0); } } } placePlayersNomad(clPlayer, avoidClasses(clOasis, 4, clForest, 1, clMetal, 4, clRock, 4, clHill, 4, clFood, 2)); setSkySet("sunny"); setSunColor(0.914,0.827,0.639); setSunRotation(Math.PI/3); setSunElevation(0.5); setWaterColor(0, 0.227, 0.843); setWaterTint(0, 0.545, 0.859); setWaterWaviness(1.0); setWaterType("clap"); setWaterMurkiness(0.5); -setTerrainAmbientColor(0.45, 0.5, 0.6); +setTerrainAmbientColor(0.501961, 0.501961, 0.501961); setUnitsAmbientColor(0.501961, 0.501961, 0.501961); g_Map.ExportMap(); Index: ps/trunk/binaries/data/mods/public/maps/random/phoenician_levant.js =================================================================== --- ps/trunk/binaries/data/mods/public/maps/random/phoenician_levant.js (revision 24193) +++ ps/trunk/binaries/data/mods/public/maps/random/phoenician_levant.js (revision 24194) @@ -1,333 +1,333 @@ Engine.LoadLibrary("rmgen"); Engine.LoadLibrary("rmgen-common"); //TILE_CENTERED_HEIGHT_MAP = true; const tCity = "medit_city_pavement"; const tCityPlaza = "medit_city_pavement"; const tHill = ["medit_dirt", "medit_dirt_b", "medit_dirt_c", "medit_rocks_grass", "medit_rocks_grass"]; const tMainDirt = "medit_dirt"; const tCliff = "medit_cliff_aegean"; const tForestFloor = "medit_rocks_shrubs"; const tGrass = "medit_rocks_grass"; const tRocksShrubs = "medit_rocks_shrubs"; const tRocksGrass = "medit_rocks_grass"; const tDirt = "medit_dirt_b"; const tDirtB = "medit_dirt_c"; const tShore = "medit_sand"; const tWater = "medit_sand_wet"; const oGrapeBush = "gaia/fruit/grapes"; const oDeer = "gaia/fauna_deer"; const oFish = "gaia/fish/generic"; const oSheep = "gaia/fauna_sheep"; const oGoat = "gaia/fauna_goat"; const oStoneLarge = "gaia/rock/mediterranean_large"; const oStoneSmall = "gaia/rock/mediterranean_small"; const oMetalLarge = "gaia/ore/mediterranean_large"; const oDatePalm = "gaia/tree/cretan_date_palm_short"; const oSDatePalm = "gaia/tree/cretan_date_palm_tall"; const oCarob = "gaia/tree/carob"; const oFanPalm = "gaia/tree/medit_fan_palm"; const oPoplar = "gaia/tree/poplar_lombardy"; const oCypress = "gaia/tree/cypress"; const aBush1 = "actor|props/flora/bush_medit_sm.xml"; const aBush2 = "actor|props/flora/bush_medit_me.xml"; const aBush3 = "actor|props/flora/bush_medit_la.xml"; const aBush4 = "actor|props/flora/bush_medit_me.xml"; const aDecorativeRock = "actor|geology/stone_granite_med.xml"; const pForest = [tForestFloor + TERRAIN_SEPARATOR + oDatePalm, tForestFloor + TERRAIN_SEPARATOR + oSDatePalm, tForestFloor + TERRAIN_SEPARATOR + oCarob, tForestFloor, tForestFloor]; const heightSeaGround = -3; const heightShore = -1.5; const heightLand = 1; const heightIsland = 6; const heightHill = 15; const heightOffsetBump = 2; var g_Map = new RandomMap(heightLand, tHill); const numPlayers = getNumPlayers(); const mapSize = g_Map.getSize(); const mapCenter = g_Map.getCenter(); const mapBounds = g_Map.getBounds(); var clPlayer = g_Map.createTileClass(); var clForest = g_Map.createTileClass(); var clWater = g_Map.createTileClass(); var clDirt = g_Map.createTileClass(); var clRock = g_Map.createTileClass(); var clMetal = g_Map.createTileClass(); var clFood = g_Map.createTileClass(); var clBaseResource = g_Map.createTileClass(); var clGrass = g_Map.createTileClass(); var clHill = g_Map.createTileClass(); var clIsland = g_Map.createTileClass(); var startAngle = randIntInclusive(0, 3) * Math.PI / 2; placePlayerBases({ "PlayerPlacement": [ sortAllPlayers(), playerPlacementLine(Math.PI / 2, new Vector2D(fractionToTiles(0.76), mapCenter.y), fractionToTiles(0.2)).map(pos => pos.rotateAround(startAngle, mapCenter)) ], "PlayerTileClass": clPlayer, "BaseResourceClass": clBaseResource, "CityPatch": { "outerTerrain": tCityPlaza, "innerTerrain": tCity }, "Chicken": { }, "Berries": { "template": oGrapeBush }, "Mines": { "types": [ { "template": oMetalLarge }, { "template": oStoneLarge } ] }, "Trees": { "template": oCarob, "count": 2 }, "Decoratives": { "template": aBush1 } }); Engine.SetProgress(30); paintRiver({ "parallel": true, "start": new Vector2D(mapBounds.left, mapBounds.top).rotateAround(startAngle, mapCenter), "end": new Vector2D(mapBounds.left, mapBounds.bottom).rotateAround(startAngle, mapCenter), "width": mapSize, "fadeDist": scaleByMapSize(6, 25), "deviation": 0, "heightRiverbed": heightSeaGround, "heightLand": heightLand, "meanderShort": 20, "meanderLong": 0 }); Engine.SetProgress(40); paintTileClassBasedOnHeight(-Infinity, heightLand, Elevation_ExcludeMin_ExcludeMax, clWater); paintTerrainBasedOnHeight(-Infinity, heightShore, Elevation_ExcludeMin_ExcludeMax, tWater); paintTerrainBasedOnHeight(heightShore, heightLand, Elevation_ExcludeMin_ExcludeMax, tShore); g_Map.log("Creating bumps"); createAreas( new ClumpPlacer(scaleByMapSize(20, 50), 0.3, 0.06, Infinity), new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetBump, 2), avoidClasses(clWater, 2, clPlayer, 20), scaleByMapSize(100, 200)); g_Map.log("Creating hills"); 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, heightHill, 2), new TileClassPainter(clHill) ], avoidClasses(clPlayer, 20, clForest, 1, clHill, 15, clWater, 0), scaleByMapSize(1, 4) * numPlayers * 3); g_Map.log("Creating forests"); var [forestTrees, stragglerTrees] = getTreeCounts(500, 2500, 0.5); var num = scaleByMapSize(10,42); createAreas( new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), forestTrees / (num * Math.floor(scaleByMapSize(2, 5))), 0.5), [ new TerrainPainter([tForestFloor, pForest]), new TileClassPainter(clForest) ], avoidClasses(clPlayer, 20, clForest, 10, clWater, 1, clHill, 1, clBaseResource, 3), num, 50); Engine.SetProgress(50); g_Map.log("Creating grass patches"); for (let size of [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8, 21)]) createAreas( new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), size, 0.5), [ new LayeredPainter( [[tGrass, tRocksShrubs], [tRocksShrubs, tRocksGrass], [tRocksGrass, tGrass]], [1, 1]), new TileClassPainter(clDirt) ], avoidClasses(clForest, 0, clGrass, 5, clPlayer, 10, clWater, 4, clDirt, 5, clHill, 1), scaleByMapSize(15, 45)); Engine.SetProgress(55); g_Map.log("Creating dirt patches"); for (let size of [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8, 21)]) createAreas( new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), size, 0.5), [ new LayeredPainter( [[tDirt, tDirtB], [tDirt, tMainDirt], [tDirtB, tMainDirt]], [1, 1]), new TileClassPainter(clDirt) ], avoidClasses(clForest, 0, clDirt, 5, clPlayer, 10, clWater, 4, clGrass, 5, clHill, 1), scaleByMapSize(15, 45)); Engine.SetProgress(60); g_Map.log("Creating cyprus"); createAreas( new ClumpPlacer(diskArea(fractionToTiles(0.08)), 0.2, 0.1, 0.01), [ new LayeredPainter([tShore, tHill], [12]), new SmoothElevationPainter(ELEVATION_SET, heightIsland, 8), new TileClassPainter(clIsland), new TileClassUnPainter(clWater) ], [stayClasses (clWater, 8)], 1, 100); g_Map.log("Creating cyprus mines"); var mines = [ new SimpleGroup([new SimpleObject(oStoneSmall, 0, 2, 0, 4, 0, 2 * Math.PI, 1), new SimpleObject(oStoneLarge, 1, 1, 0, 4, 0, 2 * Math.PI, 4)], true, clRock), new SimpleGroup([new SimpleObject(oMetalLarge, 1, 1, 0, 4)], true, clMetal), new SimpleGroup([new SimpleObject(oStoneSmall, 2, 5, 1, 3)], true, clRock) ]; for (let mine of mines) createObjectGroups( mine, 0, [ stayClasses(clIsland, 9), avoidClasses(clForest, 1, clRock, 8, clMetal, 8) ], scaleByMapSize(4, 16)); g_Map.log("Creating stone mines"); var group = new SimpleGroup([new SimpleObject(oStoneSmall, 0, 2, 0, 4, 0, 2 * Math.PI, 1), new SimpleObject(oStoneLarge, 1, 1, 0, 4, 0, 2 * Math.PI, 4)], true, clRock); createObjectGroupsDeprecated(group, 0, avoidClasses(clForest, 1, clPlayer, 20, clRock, 10, clWater, 3, clHill, 1), scaleByMapSize(4,16), 100 ); g_Map.log("Creating small stone quarries"); group = new SimpleGroup([new SimpleObject(oStoneSmall, 2,5, 1,3)], true, clRock); createObjectGroupsDeprecated(group, 0, avoidClasses(clForest, 1, clPlayer, 20, clRock, 10, clWater, 3, clHill, 1), scaleByMapSize(4,16), 100 ); g_Map.log("Creating metal mines"); group = new SimpleGroup([new SimpleObject(oMetalLarge, 1,1, 0,4)], true, clMetal); createObjectGroupsDeprecated(group, 0, avoidClasses(clForest, 1, clPlayer, 20, clMetal, 10, clRock, 5, clWater, 3, clHill, 1), scaleByMapSize(4,16), 100 ); Engine.SetProgress(65); g_Map.log("Creating small decorative rocks"); group = new SimpleGroup( [new SimpleObject(aDecorativeRock, 1,3, 0,1)], true ); createObjectGroupsDeprecated( group, 0, avoidClasses(clWater, 1, clForest, 0, clPlayer, 0, clHill, 1), scaleByMapSize(16, 262), 50 ); g_Map.log("Creating shrubs"); group = new SimpleGroup( [new SimpleObject(aBush2, 1,2, 0,1), new SimpleObject(aBush1, 1,3, 0,2), new SimpleObject(aBush4, 1,2, 0,1), new SimpleObject(aBush3, 1,3, 0,2)], true ); createObjectGroupsDeprecated( group, 0, avoidClasses(clWater, 3, clPlayer, 0, clHill, 1), scaleByMapSize(40, 360), 50 ); Engine.SetProgress(70); g_Map.log("Creating fish"); group = new SimpleGroup([new SimpleObject(oFish, 1,3, 2,6)], true, clFood); createObjectGroupsDeprecated(group, 0, [avoidClasses(clIsland, 2, clFood, 10), stayClasses(clWater, 5)], 3*scaleByMapSize(5,20), 50 ); g_Map.log("Creating sheeps"); group = new SimpleGroup([new SimpleObject(oSheep, 5,7, 0,4)], true, clFood); createObjectGroupsDeprecated(group, 0, avoidClasses(clForest, 0, clPlayer, 7, clWater, 3, clFood, 10, clHill, 1), scaleByMapSize(5,20), 50 ); g_Map.log("Creating goats"); group = new SimpleGroup([new SimpleObject(oGoat, 2,4, 0,3)], true, clFood); createObjectGroupsDeprecated(group, 0, avoidClasses(clForest, 0, clPlayer, 7, clWater, 3, clFood, 10, clHill, 1), scaleByMapSize(5,20), 50 ); g_Map.log("Creating deers"); group = new SimpleGroup([new SimpleObject(oDeer, 2,4, 0,2)], true, clFood); createObjectGroupsDeprecated(group, 0, avoidClasses(clForest, 0, clPlayer, 7, clWater, 3, clFood, 10, clHill, 1), scaleByMapSize(5,20), 50 ); g_Map.log("Creating grape bushes"); group = new SimpleGroup( [new SimpleObject(oGrapeBush, 5,7, 0,4)], true, clFood ); createObjectGroupsDeprecated(group, 0, avoidClasses(clWater, 3, clForest, 0, clPlayer, 15, clHill, 1, clFood, 7), randIntInclusive(1, 4) * numPlayers + 2, 50 ); Engine.SetProgress(90); var stragglerTreeConfig = [ [1, avoidClasses(clForest, 0, clWater, 4, clPlayer, 8, clMetal, 6, clHill, 1)], [3, [stayClasses(clIsland, 9), avoidClasses(clRock, 4, clMetal, 4)]] ]; for (let [amount, constraint] of stragglerTreeConfig) createStragglerTrees( [oDatePalm, oSDatePalm, oCarob, oFanPalm, oPoplar, oCypress], constraint, clForest, amount * stragglerTrees); setSkySet("sunny"); setSunColor(0.917, 0.828, 0.734); setWaterColor(0.263,0.314,0.631); setWaterTint(0.133, 0.725,0.855); setWaterWaviness(2.0); setWaterType("ocean"); setWaterMurkiness(0.8); -setTerrainAmbientColor(0.57, 0.58, 0.55); +setTerrainAmbientColor(0.447059, 0.509804, 0.54902); setUnitsAmbientColor(0.447059, 0.509804, 0.54902); setSunElevation(0.671884); setSunRotation(-0.582913); setFogFactor(0.2); setFogThickness(0.15); setFogColor(0.8, 0.7, 0.6); setPPEffect("hdr"); setPPContrast(0.53); setPPSaturation(0.47); setPPBloom(0.52); placePlayersNomad(clPlayer, avoidClasses(clWater, 4, clForest, 1, clMetal, 4, clRock, 4, clHill, 4, clFood, 2)); g_Map.ExportMap(); Index: ps/trunk/binaries/data/mods/public/maps/random/polar_sea.js =================================================================== --- ps/trunk/binaries/data/mods/public/maps/random/polar_sea.js (revision 24193) +++ ps/trunk/binaries/data/mods/public/maps/random/polar_sea.js (revision 24194) @@ -1,289 +1,289 @@ Engine.LoadLibrary("rmgen"); Engine.LoadLibrary("rmgen-common"); var tPrimary = ["polar_snow_a"]; var tSecondary = "polar_snow_glacial"; var tHalfSnow = ["ice_01", "ice_dirt"]; var tSnowLimited = ["polar_snow_b", "polar_ice"]; var tDirt = "ice_dirt"; var tRoad = "polar_ice_b"; var tRoadWild = "polar_ice_cracked"; var tShore = "polar_ice_snow"; var tWater = "polar_ice_c"; var oArcticFox = "gaia/fauna_fox_arctic"; var oArcticWolf = "gaia/fauna_wolf_arctic_domestic"; var oMuskox = "gaia/fauna_muskox"; var oWalrus = "gaia/fauna_walrus"; var oWhaleFin = "gaia/fauna_whale_fin"; var oWhaleHumpback = "gaia/fauna_whale_humpback"; var oFish = "gaia/fish/generic"; var oStoneLarge = "gaia/rock/mediterranean_large"; var oStoneSmall = "gaia/rock/alpine_small"; var oMetalLarge = "gaia/ore/badlands_large"; var oWoodTreasure = "gaia/treasure/wood"; var oMarket = "skirmish/structures/default_market"; var aRockLarge = "actor|geology/stone_granite_med.xml"; var aRockMedium = "actor|geology/stone_granite_med.xml"; var aIceberg = "actor|props/special/eyecandy/iceberg.xml"; var heightSeaGround = -4; var heightLand = 2; var heightCliff = 3; var g_Map = new RandomMap(heightLand, tPrimary); const numPlayers = getNumPlayers(); const mapSize = g_Map.getSize(); const mapCenter = g_Map.getCenter(); var clPlayer = g_Map.createTileClass(); var clWater = g_Map.createTileClass(); var clDirt = g_Map.createTileClass(); var clRock = g_Map.createTileClass(); var clMetal = g_Map.createTileClass(); var clHill = g_Map.createTileClass(); var clFood = g_Map.createTileClass(); var clBaseResource = g_Map.createTileClass(); var clArcticWolf = g_Map.createTileClass(); var [playerIDs, playerPosition] = playerPlacementCircle(fractionToTiles(0.35)); var treasures = [{ "template": oWoodTreasure, "count": isNomad() ? 16 : 14 }]; g_Map.log("Creating player markets"); if (!isNomad()) for (let i = 0; i < numPlayers; ++i) { let marketPos = Vector2D.add(playerPosition[i], new Vector2D(12, 0).rotate(randomAngle())).round(); g_Map.placeEntityPassable(oMarket, playerIDs[i], marketPos, BUILDING_ORIENTATION); addCivicCenterAreaToClass(marketPos, clBaseResource); } placePlayerBases({ "PlayerPlacement": [playerIDs, playerPosition], "PlayerTileClass": clPlayer, "BaseResourceClass": clBaseResource, "Walls": "towers", "CityPatch": { "outerTerrain": tRoadWild, "innerTerrain": tRoad }, "Chicken": { "template": oMuskox }, // No berries, no trees, no decoratives "Mines": { "types": [ { "template": oMetalLarge }, { "template": oStoneLarge } ] }, "Treasures": { "types": treasures }, }); Engine.SetProgress(30); g_Map.log("Creating central lake"); createArea( new ChainPlacer( 2, Math.floor(scaleByMapSize(5, 16)), Math.floor(scaleByMapSize(35, 200)), Infinity, mapCenter, 0, [Math.floor(fractionToTiles(0.17))]), [ new LayeredPainter([tShore, tWater], [1]), new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 4), new TileClassPainter(clWater) ], avoidClasses(clPlayer, 20)); Engine.SetProgress(40); g_Map.log("Creating small lakes"); createAreas( new ChainPlacer(1, Math.floor(scaleByMapSize(2, 4)), Math.floor(scaleByMapSize(20, 140)), 0.7), [ new LayeredPainter([tShore, tWater], [1]), new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 5), new TileClassPainter(clWater) ], avoidClasses(clPlayer, 20), scaleByMapSize(10, 16), 1); Engine.SetProgress(50); createBumps(avoidClasses(clWater, 2, clPlayer, 20)); Engine.SetProgress(60); createHills( [tPrimary, tPrimary, tSecondary], avoidClasses(clPlayer, 20, clHill, 35), clHill, scaleByMapSize(20, 240)); Engine.SetProgress(65); g_Map.log("Creating dirt patches"); createLayeredPatches( [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8, 21)], [[tDirt, tHalfSnow], [tHalfSnow, tSnowLimited]], [2], avoidClasses(clWater, 3, clDirt, 5, clPlayer, 12), scaleByMapSize(15, 45), clDirt); g_Map.log("Creating glacier patches"); createPatches( [scaleByMapSize(2, 4), scaleByMapSize(3, 7), scaleByMapSize(5, 15)], tSecondary, avoidClasses(clWater, 3, clDirt, 5, clPlayer, 12), scaleByMapSize(15, 45), clDirt); Engine.SetProgress(70); g_Map.log("Creating stone mines"); createMines( [ [new SimpleObject(oStoneSmall, 0, 2, 0, 4, 0, 2 * Math.PI, 1), new SimpleObject(oStoneLarge, 1, 1, 0, 4, 0, 2 * Math.PI, 4)], [new SimpleObject(oStoneSmall, 2, 5, 1, 3)] ], avoidClasses(clWater, 3, clPlayer, 20, clRock, 18, clHill, 2), clRock); g_Map.log("Creating metal mines"); createMines( [ [new SimpleObject(oMetalLarge, 1, 1, 0, 4)] ], avoidClasses(clWater, 3, clPlayer, 20, clMetal, 18, clRock, 5, clHill, 2), clMetal); Engine.SetProgress(75); createDecoration( [ [ new SimpleObject(aRockMedium, 1, 3, 0, 1) ], [ new SimpleObject(aRockLarge, 1, 2, 0, 1), new SimpleObject(aRockMedium, 1, 3, 0, 2) ] ], [ scaleByMapSize(16, 262), scaleByMapSize(8, 131), ], avoidClasses(clWater, 0, clPlayer, 0)); createDecoration( [ [new SimpleObject(aIceberg, 1, 1, 1, 1)] ], [ scaleByMapSize(8, 131) ], [stayClasses(clWater, 4), avoidClasses(clHill, 2)]); Engine.SetProgress(80); createFood( [ [new SimpleObject(oArcticFox, 1, 2, 0, 3)], [new SimpleObject(isNomad() ? oArcticFox : oArcticWolf, 4, 6, 0, 4)], [new SimpleObject(oWalrus, 2, 3, 0, 2)], [new SimpleObject(oMuskox, 2, 3, 0, 2)] ], [ 3 * numPlayers, 5 * numPlayers, 5 * numPlayers, 12 * numPlayers ], avoidClasses(clPlayer, 35, clFood, 16, clWater, 2, clMetal, 4, clRock, 4, clHill, 2), clFood); createFood( [ [new SimpleObject(oWhaleFin, 1, 2, 0, 2)], [new SimpleObject(oWhaleHumpback, 1, 2, 0, 2)] ], [ scaleByMapSize(1, 6) * 3, scaleByMapSize(1, 6) * 3, ], [avoidClasses(clFood, 20, clHill, 5), stayClasses(clWater, 6)], clFood); createFood( [ [new SimpleObject(oFish, 2, 3, 0, 2)] ], [ 100 ], [avoidClasses(clFood, 12, clHill, 5), stayClasses(clWater, 6)], clFood); Engine.SetProgress(85); // Create trigger points where wolves spawn createObjectGroupsDeprecated( new SimpleGroup([new SimpleObject("trigger/trigger_point_A", 1, 1, 0, 0)], true, clArcticWolf), 0, avoidClasses(clWater, 2, clMetal, 4, clRock, 4, clPlayer, 15, clHill, 2, clArcticWolf, 20), 1000, 100); Engine.SetProgress(95); if (g_MapSettings.Daytime !== undefined ? g_MapSettings.Daytime == "dawn" : randBool(1/3)) { setSkySet("sunset 1"); setSunColor(0.8, 0.7, 0.6); setTerrainAmbientColor(0.7, 0.6, 0.7); - setUnitsAmbientColor(0.6, 0.5, 0.6); + setUnitsAmbientColor(0.7, 0.6, 0.7); setSunElevation(Math.PI * randFloat(1/24, 1/7)); } else { setSkySet(pickRandom(["cumulus", "rain", "mountainous", "overcast", "rain", "stratus"])); setSunElevation(Math.PI * randFloat(1/9, 1/7)); } if (isNomad()) { let constraint = avoidClasses(clWater, 4, clMetal, 4, clRock, 4, clHill, 4, clFood, 2); [playerIDs, playerPosition] = placePlayersNomad(clPlayer, constraint); for (let i = 0; i < numPlayers; ++i) placePlayerBaseTreasures({ "playerID": playerIDs[i], "playerPosition": playerPosition[i], "BaseResourceClass": clBaseResource, "baseResourceConstraint": constraint, "types": treasures }); } setSunRotation(randomAngle()); setWaterColor(0.3, 0.3, 0.4); setWaterTint(0.75, 0.75, 0.75); setWaterMurkiness(0.92); setWaterWaviness(0.5); setWaterType("clap"); setFogThickness(0.76); setFogFactor(0.7); setPPEffect("hdr"); setPPContrast(0.6); setPPSaturation(0.45); setPPBloom(0.4); g_Map.ExportMap(); Index: ps/trunk/binaries/data/mods/public/maps/random/pyrenean_sierra.js =================================================================== --- ps/trunk/binaries/data/mods/public/maps/random/pyrenean_sierra.js (revision 24193) +++ ps/trunk/binaries/data/mods/public/maps/random/pyrenean_sierra.js (revision 24194) @@ -1,463 +1,463 @@ Engine.LoadLibrary("rmgen"); Engine.LoadLibrary("rmgen-common"); TILE_CENTERED_HEIGHT_MAP = true; const tGrassSpecific = ["new_alpine_grass_d","new_alpine_grass_d", "new_alpine_grass_e"]; const tGrass = ["new_alpine_grass_d", "new_alpine_grass_b", "new_alpine_grass_e"]; const tGrassMidRange = ["new_alpine_grass_b", "alpine_grass_a"]; const tGrassHighRange = ["new_alpine_grass_a", "alpine_grass_a", "alpine_grass_rocky"]; const tHighRocks = ["alpine_cliff_b", "alpine_cliff_c","alpine_cliff_c", "alpine_grass_rocky"]; const tSnowedRocks = ["alpine_cliff_b", "alpine_cliff_snow"]; const tTopSnow = ["alpine_snow_rocky","alpine_snow_a"]; const tTopSnowOnly = ["alpine_snow_a"]; const tDirtyGrass = ["new_alpine_grass_d","alpine_grass_d","alpine_grass_c", "alpine_grass_b"]; const tLushGrass = ["new_alpine_grass_a","new_alpine_grass_d"]; const tMidRangeCliffs = ["alpine_cliff_b","alpine_cliff_c"]; const tHighRangeCliffs = ["alpine_mountainside","alpine_cliff_snow" ]; const tSand = ["beach_c", "beach_d"]; const tSandTransition = ["beach_scrub_50_"]; const tWater = ["sand_wet_a","sand_wet_b","sand_wet_b","sand_wet_b"]; const tGrassLandForest = "alpine_forrestfloor"; const tGrassLandForest2 = "alpine_grass_d"; const tForestTransition = ["new_alpine_grass_d", "new_alpine_grass_b","alpine_grass_d"]; const tRoad = "new_alpine_citytile"; const tRoadWild = "new_alpine_citytile"; const oBeech = "gaia/tree/euro_beech"; const oPine = "gaia/tree/aleppo_pine"; const oBerryBush = "gaia/fruit/berry_01"; const oDeer = "gaia/fauna_deer"; const oFish = "gaia/fish/generic"; const oRabbit = "gaia/fauna_rabbit"; const oStoneLarge = "gaia/rock/alpine_large"; const oStoneSmall = "gaia/rock/alpine_small"; const oMetalLarge = "gaia/ore/alpine_large"; const aGrass = "actor|props/flora/grass_soft_small_tall.xml"; const aGrassShort = "actor|props/flora/grass_soft_large.xml"; const aRockLarge = "actor|geology/stone_granite_med.xml"; const aRockMedium = "actor|geology/stone_granite_med.xml"; const aBushMedium = "actor|props/flora/bush_medit_me.xml"; const aBushSmall = "actor|props/flora/bush_medit_sm.xml"; const pForestLand = [tGrassLandForest + TERRAIN_SEPARATOR + oPine,tGrassLandForest + TERRAIN_SEPARATOR + oBeech, tGrassLandForest2 + TERRAIN_SEPARATOR + oPine,tGrassLandForest2 + TERRAIN_SEPARATOR + oBeech, tGrassLandForest,tGrassLandForest2,tGrassLandForest2,tGrassLandForest2]; const pForestLandLight = [tGrassLandForest + TERRAIN_SEPARATOR + oPine,tGrassLandForest + TERRAIN_SEPARATOR + oBeech, tGrassLandForest2 + TERRAIN_SEPARATOR + oPine,tGrassLandForest2 + TERRAIN_SEPARATOR + oBeech, tGrassLandForest,tGrassLandForest2,tForestTransition,tGrassLandForest2, tGrassLandForest,tForestTransition,tGrassLandForest2,tForestTransition, tGrassLandForest2,tGrassLandForest2,tGrassLandForest2,tGrassLandForest2]; const pForestLandVeryLight = [ tGrassLandForest2 + TERRAIN_SEPARATOR + oPine,tGrassLandForest2 + TERRAIN_SEPARATOR + oBeech, tForestTransition,tGrassLandForest2,tForestTransition,tForestTransition,tForestTransition, tGrassLandForest,tForestTransition,tGrassLandForest2,tForestTransition, tGrassLandForest2,tGrassLandForest2,tGrassLandForest2,tGrassLandForest2]; const heightInit = -100; const heightOcean = -22; const heightWaterTerrain = -14; const heightBase = -6; const heightSand = -2; const heightSandTransition = 0; const heightGrass = 6; const heightWaterLevel = 8; const heightPyreneans = 15; const heightGrassMidRange = 18; const heightGrassHighRange = 30; const heightPassage = scaleByMapSize(25, 40); const heightHighRocks = heightPassage + 5; const heightSnowedRocks = heightHighRocks + 10; const heightMountain = heightHighRocks + 20; const heightOffsetHill = 7; const heightOffsetHillRandom = 2; var g_Map = new RandomMap(heightInit, tGrass); const numPlayers = getNumPlayers(); const mapSize = g_Map.getSize(); const mapCenter = g_Map.getCenter(); var clDirt = g_Map.createTileClass(); var clRock = g_Map.createTileClass(); var clMetal = g_Map.createTileClass(); var clFood = g_Map.createTileClass(); var clBaseResource = g_Map.createTileClass(); var clPass = g_Map.createTileClass(); var clPyrenneans = g_Map.createTileClass(); var clPlayer = g_Map.createTileClass(); var clHill = g_Map.createTileClass(); var clForest = g_Map.createTileClass(); var clWater = g_Map.createTileClass(); var startAngle = randomAngle(); var oceanAngle = startAngle + randFloat(-1, 1) * Math.PI / 12; var mountainLength = fractionToTiles(0.68); var mountainWidth = scaleByMapSize(15, 55); var mountainPeaks = 100 * scaleByMapSize(1, 10); var mountainOffset = randFloat(-1, 1) * scaleByMapSize(1, 12); var passageLength = scaleByMapSize(8, 50); var terrainPerHeight = [ { "maxHeight": heightGrass, "steepness": 5, "terrainGround": tGrass, "terrainSteep": tMidRangeCliffs }, { "maxHeight": heightGrassMidRange, "steepness": 8, "terrainGround": tGrassMidRange, "terrainSteep": tMidRangeCliffs }, { "maxHeight": heightGrassHighRange, "steepness": 8, "terrainGround": tGrassHighRange, "terrainSteep": tMidRangeCliffs }, { "maxHeight": heightHighRocks, "steepness": 8, "terrainGround": tHighRocks, "terrainSteep": tHighRangeCliffs }, { "maxHeight": heightSnowedRocks, "steepness": 7, "terrainGround": tSnowedRocks, "terrainSteep": tHighRangeCliffs }, { "maxHeight": Infinity, "steepness": 6, "terrainGround": tTopSnowOnly, "terrainSteep": tTopSnow } ]; g_Map.log("Creating initial sinusoidal noise"); var baseHeights = []; for (var ix = 0; ix < mapSize; ix++) { baseHeights.push([]); for (var iz = 0; iz < mapSize; iz++) { let position = new Vector2D(ix, iz); if (g_Map.inMapBounds(position)) { let height = heightBase + randFloat(-1, 1) + scaleByMapSize(1, 3) * (Math.cos(ix / scaleByMapSize(5, 30)) + Math.sin(iz / scaleByMapSize(5, 30))); g_Map.setHeight(position, height); baseHeights[ix].push(height); } else baseHeights[ix].push(heightInit); } } var playerIDs = sortAllPlayers(); var playerPosition = playerPlacementArcs( playerIDs, mapCenter, fractionToTiles(0.35), oceanAngle, 0.1 * Math.PI, 0.9 * Math.PI); placePlayerBases({ "PlayerPlacement": [playerIDs, playerPosition], "PlayerTileClass": clPlayer, "BaseResourceClass": clBaseResource, "CityPatch": { "outerTerrain": tRoadWild, "innerTerrain": tRoad }, "Chicken": { }, "Berries": { "template": oBerryBush }, "Mines": { "types": [ { "template": oMetalLarge }, { "template": oStoneLarge } ] }, "Trees": { "template": oPine }, "Decoratives": { "template": aGrassShort } }); Engine.SetProgress(30); g_Map.log("Creating the pyreneans"); var mountainVec = new Vector2D(mountainLength, 0).rotate(-startAngle); var mountainStart = Vector2D.sub(mapCenter, Vector2D.div(mountainVec, 2)); var mountainDirection = mountainVec.clone().normalize(); createPyreneans(); paintTileClassBasedOnHeight(heightPyreneans, Infinity, Elevation_ExcludeMin_ExcludeMax, clPyrenneans); Engine.SetProgress(40); /** * Generates the mountain peak noise. * * @param {number} x - between 0 and 1 * @returns {number} between 0 and 1 */ function sigmoid(x, peakPosition) { return 1 / (1 + Math.exp(x)) * // If we're too far from the border, we flatten (0.2 - Math.max(0, Math.abs(0.5 - peakPosition) - 0.3)) * 5; } function createPyreneans() { for (let peak = 0; peak < mountainPeaks; ++peak) { let peakPosition = peak / mountainPeaks; let peakHeight = randFloat(0, 10); for (let distance = 0; distance < mountainWidth; distance += 1/3) { let rest = 2 * (1 - distance / mountainWidth); let sigmoidX = - 1 * (rest - 1.9) + - 4 * (rest - randFloat(0.9, 1.1)) * (rest - randFloat(0.9, 1.1)) * (rest - randFloat(0.9, 1.1)); for (let direction of [-1, 1]) { let pos = Vector2D.sum([ Vector2D.add(mountainStart, Vector2D.mult(mountainDirection, peakPosition * mountainLength)), new Vector2D(mountainOffset, 0).rotate(-peakPosition * Math.PI * 4), new Vector2D(distance, 0).rotate(-startAngle - direction * Math.PI / 2) ]).round(); g_Map.setHeight(pos, baseHeights[pos.x][pos.y] + (heightMountain + peakHeight + randFloat(-9, 9)) * sigmoid(sigmoidX, peakPosition)); } } } } g_Map.log("Creating passages"); var passageLocation = 0.35; var passageVec = mountainDirection.perpendicular().mult(passageLength); for (let passLoc of [passageLocation, 1 - passageLocation]) for (let direction of [1, -1]) { let passageStart = Vector2D.add(mountainStart, Vector2D.mult(mountainVec, passLoc)); let passageEnd = Vector2D.add(passageStart, Vector2D.mult(passageVec, direction)); createPassage({ "start": passageStart, "end": passageEnd, "startHeight": heightPassage, "startWidth": 7, "endWidth": 7, "smoothWidth": 2, "tileClass": clPass }); } Engine.SetProgress(50); g_Map.log("Smoothing the pyreneans"); createArea( new MapBoundsPlacer(), new SmoothingPainter(1, 0.3, 1), new NearTileClassConstraint(clPyrenneans, 1)); g_Map.log("Creating oceans"); for (let ocean of distributePointsOnCircle(2, oceanAngle, fractionToTiles(0.48), mapCenter)[0]) createArea( new ClumpPlacer(diskArea(fractionToTiles(0.18)), 0.9, 0.05, Infinity, ocean), [ new ElevationPainter(heightOcean), new TileClassPainter(clWater) ]); g_Map.log("Smoothing around the water"); createArea( new MapBoundsPlacer(), new SmoothingPainter(5, 0.9, 1), new NearTileClassConstraint(clWater, 5)); Engine.SetProgress(55); g_Map.log("Creating hills"); createAreas( new ClumpPlacer(scaleByMapSize(60, 120), 0.3, 0.06, Infinity), [ new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetHill, 4, heightOffsetHillRandom), new TerrainPainter(tGrassSpecific), new TileClassPainter(clHill) ], avoidClasses(clWater, 5, clPlayer, 20, clBaseResource, 6, clPyrenneans, 2), scaleByMapSize(5, 35)); g_Map.log("Creating forests"); var types = [[tForestTransition, pForestLandVeryLight, pForestLandLight, pForestLand]]; var size = scaleByMapSize(40, 115) * Math.PI; var num = Math.floor(scaleByMapSize(8,40) / types.length); for (let type of types) createAreas( new ClumpPlacer(size, 0.2, 0.1, Infinity), [ new LayeredPainter(type, [scaleByMapSize(1, 2), scaleByMapSize(3, 6), scaleByMapSize(3, 6)]), new TileClassPainter(clForest) ], avoidClasses(clPlayer, 20, clPyrenneans,0, clForest, 7, clWater, 2), num); Engine.SetProgress(60); g_Map.log("Creating lone trees"); var num = scaleByMapSize(80,400); var group = new SimpleGroup([new SimpleObject(oPine, 1,2, 1,3),new SimpleObject(oBeech, 1,2, 1,3)], true, clForest); createObjectGroupsDeprecated(group, 0, avoidClasses(clWater, 3, clForest, 1, clPlayer, 8,clPyrenneans, 1), num, 20 ); g_Map.log("Painting terrain by height and slope"); for (let i = 0; i < terrainPerHeight.length; ++i) for (let steep of [false, true]) createArea( new MapBoundsPlacer(), new TerrainPainter(steep ? terrainPerHeight[i].terrainSteep : terrainPerHeight[i].terrainGround), [ new NearTileClassConstraint(clPyrenneans, 2), new HeightConstraint(terrainPerHeight[i - 1] ? terrainPerHeight[i - 1].maxHeight : -Infinity, terrainPerHeight[i].maxHeight), steep ? new SlopeConstraint(terrainPerHeight[i].steepness, Infinity) : new SlopeConstraint(-Infinity, terrainPerHeight[i].steepness), ]); for (let x = 0; x < mapSize; ++x) for (let z = 0; z < mapSize; ++z) { let position = new Vector2D(x, z); let height = g_Map.getHeight(position); let heightDiff = g_Map.getSlope(position); let terrainShore = getShoreTerrain(position, height, heightDiff); if (terrainShore) createTerrain(terrainShore).place(position); } function getShoreTerrain(position, height, heightDiff) { if (height <= heightWaterTerrain) return tWater; if (height <= heightSand && new NearTileClassConstraint(clWater, 2).allows(position)) return heightDiff < 2.5 ? tSand : tMidRangeCliffs; // Notice the sand transition is also be painted below height -2 if (height <= heightSandTransition && new NearTileClassConstraint(clWater, 3).allows(position)) return heightDiff < 2.5 ? tSandTransition : tMidRangeCliffs; return undefined; } g_Map.log("Creating dirt patches"); for (let size of [scaleByMapSize(3, 20), scaleByMapSize(5, 40), scaleByMapSize(8, 60)]) createAreas( new ClumpPlacer(size, 0.3, 0.06, 0.5), [ new TerrainPainter(tDirtyGrass), new TileClassPainter(clDirt) ], avoidClasses(clWater, 3, clForest, 0, clPyrenneans,5, clHill, 0, clDirt, 5, clPlayer, 6), scaleByMapSize(15, 45)); g_Map.log("Creating grass patches"); for (let size of [scaleByMapSize(2, 32), scaleByMapSize(3, 48), scaleByMapSize(5, 80)]) createAreas( new ClumpPlacer(size, 0.3, 0.06, 0.5), new TerrainPainter(tLushGrass), avoidClasses(clWater, 3, clForest, 0, clPyrenneans,5, clHill, 0, clDirt, 5, clPlayer, 6), scaleByMapSize(15, 45)); Engine.SetProgress(70); // making more in dirt areas so as to appear different g_Map.log("Creating small grass tufts"); var group = new SimpleGroup( [new SimpleObject(aGrassShort, 1,2, 0,1, -Math.PI / 8, Math.PI / 8)] ); createObjectGroupsDeprecated(group, 0, avoidClasses(clWater, 2, clHill, 2, clPlayer, 5, clDirt, 0, clPyrenneans,2), scaleByMapSize(13, 200) ); createObjectGroupsDeprecated(group, 0, stayClasses(clDirt,1), scaleByMapSize(13, 200),10); g_Map.log("Creating large grass tufts"); group = new SimpleGroup( [new SimpleObject(aGrass, 2,4, 0,1.8, -Math.PI / 8, Math.PI / 8), new SimpleObject(aGrassShort, 3,6, 1.2,2.5, -Math.PI / 8, Math.PI / 8)] ); createObjectGroupsDeprecated(group, 0, avoidClasses(clWater, 3, clHill, 2, clPlayer, 5, clDirt, 1, clForest, 0, clPyrenneans,2), scaleByMapSize(13, 200) ); createObjectGroupsDeprecated(group, 0, stayClasses(clDirt,1), scaleByMapSize(13, 200),10); Engine.SetProgress(75); g_Map.log("Creating bushes"); group = new SimpleGroup( [new SimpleObject(aBushMedium, 1,2, 0,2), new SimpleObject(aBushSmall, 2,4, 0,2)] ); createObjectGroupsDeprecated(group, 0, avoidClasses(clWater, 2, clPlayer, 1, clPyrenneans, 1), scaleByMapSize(13, 200), 50 ); Engine.SetProgress(80); g_Map.log("Creating stone mines"); group = new SimpleGroup([new SimpleObject(oStoneSmall, 0, 2, 0, 4, 0, 2 * Math.PI, 1), new SimpleObject(oStoneLarge, 1, 1, 0, 4, 0, 2 * Math.PI, 4)], true, clRock); createObjectGroupsDeprecated(group, 0, avoidClasses(clWater, 3, clForest, 1, clPlayer, 20, clRock, 8, clPyrenneans, 1), scaleByMapSize(4,16), 100 ); g_Map.log("Creating small stone quarries"); group = new SimpleGroup([new SimpleObject(oStoneSmall, 2,5, 1,3)], true, clRock); createObjectGroupsDeprecated(group, 0, avoidClasses(clWater, 3, clForest, 1, clPlayer, 20, clRock, 8, clPyrenneans, 1), scaleByMapSize(4,16), 100 ); g_Map.log("Creating metal mines"); group = new SimpleGroup([new SimpleObject(oMetalLarge, 1,1, 0,4)], true, clMetal); createObjectGroupsDeprecated(group, 0, avoidClasses(clWater, 3, clForest, 1, clPlayer, 20, clMetal, 8, clRock, 5, clPyrenneans, 1), scaleByMapSize(4,16), 100 ); Engine.SetProgress(85); g_Map.log("Creating small decorative rocks"); group = new SimpleGroup( [new SimpleObject(aRockMedium, 1,3, 0,1)], true ); createObjectGroupsDeprecated( group, 0, avoidClasses(clWater, 0, clForest, 0, clPlayer, 0), scaleByMapSize(16, 262), 50 ); g_Map.log("Creating large decorative rocks"); group = new SimpleGroup( [new SimpleObject(aRockLarge, 1,2, 0,1), new SimpleObject(aRockMedium, 1,3, 0,2)], true ); createObjectGroupsDeprecated( group, 0, avoidClasses(clWater, 0, clForest, 0, clPlayer, 0), scaleByMapSize(8, 131), 50 ); Engine.SetProgress(90); g_Map.log("Creating deer"); group = new SimpleGroup( [new SimpleObject(oDeer, 5,7, 0,4)], true, clFood ); createObjectGroupsDeprecated(group, 0, avoidClasses(clWater, 3, clForest, 0, clPlayer, 20, clPyrenneans, 1, clFood, 15), 3 * numPlayers, 50 ); g_Map.log("Creating rabbit"); group = new SimpleGroup( [new SimpleObject(oRabbit, 2,3, 0,2)], true, clFood ); createObjectGroupsDeprecated(group, 0, avoidClasses(clWater, 3, clForest, 0, clPlayer, 20, clPyrenneans, 1, clFood,15), 3 * numPlayers, 50 ); g_Map.log("Creating berry bush"); group = new SimpleGroup( [new SimpleObject(oBerryBush, 5,7, 0,4)],true, clFood ); createObjectGroupsDeprecated(group, 0, avoidClasses(clWater, 3, clForest, 0, clPlayer, 20, clPyrenneans, 1, clFood, 10), randIntInclusive(1, 4) * numPlayers + 2, 50); g_Map.log("Creating fish"); group = new SimpleGroup( [new SimpleObject(oFish, 2,3, 0,2)], true, clFood ); createObjectGroupsDeprecated(group, 0, [avoidClasses(clFood, 15), stayClasses(clWater, 6)], 20 * numPlayers, 60 ); placePlayersNomad(clPlayer, avoidClasses(clWater, 4, clPyrenneans, 4, clForest, 1, clMetal, 4, clRock, 4, clFood, 2)); setSunElevation(Math.PI * randFloat(1/5, 1/3)); setSunRotation(randomAngle()); setSkySet("cumulus"); setSunColor(0.73,0.73,0.65); setTerrainAmbientColor(0.45,0.45,0.50); -setUnitsAmbientColor(0.4,0.4,0.4); +setUnitsAmbientColor(0.45,0.45,0.50); setWaterColor(0.263, 0.353, 0.616); setWaterTint(0.104, 0.172, 0.563); setWaterWaviness(5.0); setWaterType("ocean"); setWaterMurkiness(0.83); setWaterHeight(heightWaterLevel); g_Map.ExportMap(); Index: ps/trunk/binaries/data/mods/public/maps/random/rmbiome/defaultbiome.json =================================================================== --- ps/trunk/binaries/data/mods/public/maps/random/rmbiome/defaultbiome.json (revision 24193) +++ ps/trunk/binaries/data/mods/public/maps/random/rmbiome/defaultbiome.json (revision 24194) @@ -1,68 +1,68 @@ { "Environment": { "TerrainAmbientColor": { "r": 0.447059, "g": 0.509804, "b": 0.54902 }, - "UnitsAmbientColor": { "r": 0.57, "g": 0.58, "b": 0.55 } + "UnitsAmbientColor": { "r": 0.447059, "g": 0.509804, "b": 0.54902 } }, "Terrains": { "mainTerrain": [ "temp_grass_long_b" ], "forestFloor1": "temp_forestfloor_pine", "forestFloor2": "temp_plants_bog", "tier1Terrain": "temp_grass_d", "tier2Terrain": "temp_grass_c", "tier3Terrain": "temp_grass_clovers_2", "tier4Terrain": "temp_grass_plants", "cliff": [ "temp_cliff_a", "temp_cliff_b" ], "hill": [ "temp_dirt_gravel", "temp_dirt_gravel_b" ], "dirt": [ "temp_dirt_gravel", "temp_dirt_gravel_b" ], "road": "temp_road", "roadWild": "temp_road_overgrown", "shoreBlend": "temp_mud_plants", "shore": "sand_grass_25", "water": "medit_sand_wet" }, "Gaia": { "tree1": "gaia/tree/oak", "tree2": "gaia/tree/oak_large", "tree3": "gaia/fruit/apple", "tree4": "gaia/tree/pine", "tree5": "gaia/tree/aleppo_pine", "fruitBush": "gaia/fruit/berry_01", "chicken": "gaia/fauna_chicken", "fish": "gaia/fish/generic", "mainHuntableAnimal": "gaia/fauna_deer", "secondaryHuntableAnimal": "gaia/fauna_sheep", "stoneLarge": "gaia/rock/mediterranean_large", "stoneSmall": "gaia/rock/mediterranean_small", "metalLarge": "gaia/ore/mediterranean_large", "metalSmall": "gaia/ore/mediterranean_small" }, "Decoratives": { "grass": "actor|props/flora/grass_soft_large_tall.xml", "grassShort": "actor|props/flora/grass_soft_large.xml", "reeds": "actor|props/flora/reeds_pond_lush_a.xml", "lillies": "actor|props/flora/pond_lillies_large.xml", "rockLarge": "actor|geology/stone_granite_large.xml", "rockMedium": "actor|geology/stone_granite_med.xml", "bushMedium": "actor|props/flora/bush_medit_me.xml", "bushSmall": "actor|props/flora/bush_medit_sm.xml", "tree": "actor|flora/trees/oak.xml" }, "ResourceCounts": { "trees": { "min": 500, "max": 3000, "forestProbability": 0.7 } } } Index: ps/trunk/binaries/data/mods/public/maps/random/sahel.js =================================================================== --- ps/trunk/binaries/data/mods/public/maps/random/sahel.js (revision 24193) +++ ps/trunk/binaries/data/mods/public/maps/random/sahel.js (revision 24194) @@ -1,242 +1,242 @@ Engine.LoadLibrary("rmgen"); Engine.LoadLibrary("rmgen-common"); const tPrimary = "savanna_grass_a"; const tGrass2 = "savanna_grass_b"; const tGrass3 = "savanna_shrubs_a"; const tDirt1 = "savanna_dirt_rocks_a"; const tDirt2 = "savanna_dirt_rocks_b"; const tDirt3 = "savanna_dirt_rocks_c"; const tDirt4 = "savanna_dirt_b"; const tCityTiles = "savanna_tile_a"; const tShore = "savanna_riparian_bank"; const tWater = "savanna_riparian_wet"; const oBaobab = "gaia/tree/baobab"; const oBerryBush = "gaia/fruit/berry_05"; const oGazelle = "gaia/fauna_gazelle"; const oGiraffe = "gaia/fauna_giraffe"; const oGiraffeInfant = "gaia/fauna_giraffe_infant"; const oElephant = "gaia/fauna_elephant_african_bush"; const oElephantInfant = "gaia/fauna_elephant_african_infant"; const oLion = "gaia/fauna_lion"; const oLioness = "gaia/fauna_lioness"; const oZebra = "gaia/fauna_zebra"; const oStoneSmall = "gaia/rock/savanna_small"; const oMetalLarge = "gaia/ore/savanna_large"; const aBush = "actor|props/flora/bush_medit_sm_dry.xml"; const aRock = "actor|geology/stone_savanna_med.xml"; const heightSeaGround = -5; const heightLand = 1; var g_Map = new RandomMap(heightLand, tPrimary); var numPlayers = getNumPlayers(); var mapSize = g_Map.getSize(); var clPlayer = g_Map.createTileClass(); var clForest = g_Map.createTileClass(); var clWater = g_Map.createTileClass(); var clRock = g_Map.createTileClass(); var clMetal = g_Map.createTileClass(); var clFood = g_Map.createTileClass(); var clBaseResource = g_Map.createTileClass(); placePlayerBases({ "PlayerPlacement": playerPlacementCircle(fractionToTiles(0.35)), "PlayerTileClass": clPlayer, "BaseResourceClass": clBaseResource, "CityPatch": { "outerTerrain": tCityTiles, "innerTerrain": tCityTiles }, "Chicken": { }, "Berries": { "template": oBerryBush }, "Mines": { "types": [ { "template": oMetalLarge }, { "type": "stone_formation", "template": oStoneSmall, "terrain": tDirt4 } ] }, "Trees": { "template": oBaobab, "count": scaleByMapSize(2, 7), "minDistGroup": 2, "maxDistGroup": 7 } // No decoratives }); Engine.SetProgress(20); g_Map.log("Creating big patches"); var patches = [tGrass2, tGrass3]; for (var i = 0; i < patches.length; i++) createAreas( new ChainPlacer(Math.floor(scaleByMapSize(3, 6)), Math.floor(scaleByMapSize(10, 20)), Math.floor(scaleByMapSize(15, 60)), Infinity), new TerrainPainter(patches[i]), avoidClasses(clPlayer, 10), scaleByMapSize(5, 20)); g_Map.log("Creating small patches"); for (let size of [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8, 21)]) for (let patch of [tDirt1, tDirt2, tDirt3]) createAreas( new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), size, Infinity), new TerrainPainter(patch), avoidClasses(clPlayer, 12), scaleByMapSize(4, 15)); g_Map.log("Creating water holes"); createAreas( new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), Math.floor(scaleByMapSize(20, 60)), Infinity), [ new LayeredPainter([tShore, tWater], [1]), new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 7), new TileClassPainter(clWater) ], avoidClasses(clPlayer, 24), scaleByMapSize(1, 3)); Engine.SetProgress(55); g_Map.log("Creating stone mines"); for (var i = 0; i < scaleByMapSize(12,30); ++i) { let position = new Vector2D(randIntExclusive(0, mapSize), randIntExclusive(0, mapSize)); if (avoidClasses(clPlayer, 30, clRock, 25, clWater, 10).allows(position)) { createStoneMineFormation(position, oStoneSmall, tDirt4); clRock.add(position); } } g_Map.log("Creating metal mines"); var group = new SimpleGroup([new SimpleObject(oMetalLarge, 1, 1, 0, 4)], true, clMetal); createObjectGroupsDeprecated(group, 0, avoidClasses(clPlayer, 20, clMetal, 10, clRock, 8, clWater, 4), scaleByMapSize(2,8), 100 ); Engine.SetProgress(65); g_Map.log("Creating small decorative rocks"); group = new SimpleGroup( [new SimpleObject(aRock, 1,3, 0,3)], true ); createObjectGroupsDeprecated( group, 0, avoidClasses(clPlayer, 7, clWater, 1), scaleByMapSize(200, 1200), 1 ); Engine.SetProgress(70); g_Map.log("Creating gazelle"); group = new SimpleGroup( [new SimpleObject(oGazelle, 5,7, 0,4)], true, clFood ); createObjectGroupsDeprecated(group, 0, avoidClasses(clWater, 1, clPlayer, 20, clFood, 11), scaleByMapSize(4,12), 50 ); g_Map.log("Creating zebra"); group = new SimpleGroup( [new SimpleObject(oZebra, 5,7, 0,4)], true, clFood ); createObjectGroupsDeprecated(group, 0, avoidClasses(clWater, 1, clPlayer, 20, clFood, 11), scaleByMapSize(4,12), 50 ); g_Map.log("Creating giraffe"); group = new SimpleGroup( [new SimpleObject(oGiraffe, 2,4, 0,4), new SimpleObject(oGiraffeInfant, 0,2, 0,4)], true, clFood ); createObjectGroupsDeprecated(group, 0, avoidClasses(clWater, 1, clPlayer, 20, clFood, 11), scaleByMapSize(4,12), 50 ); g_Map.log("Creating elephants"); group = new SimpleGroup( [new SimpleObject(oElephant, 2,4, 0,4), new SimpleObject(oElephantInfant, 0,2, 0,4)], true, clFood ); createObjectGroupsDeprecated(group, 0, avoidClasses(clWater, 1, clPlayer, 20, clFood, 11), scaleByMapSize(4,12), 50 ); g_Map.log("Creating lions"); group = new SimpleGroup( [new SimpleObject(oLion, 0,1, 0,4), new SimpleObject(oLioness, 2,3, 0,4)], true, clFood ); createObjectGroupsDeprecated(group, 0, avoidClasses(clWater, 1, clPlayer, 20, clFood, 11), scaleByMapSize(4,12), 50 ); g_Map.log("Creating berry bush"); group = new SimpleGroup( [new SimpleObject(oBerryBush, 5,7, 0,4)], true, clFood ); createObjectGroupsDeprecated(group, 0, avoidClasses(clWater, 3, clPlayer, 20, clFood, 12, clRock, 7, clMetal, 6), randIntInclusive(1, 4) * numPlayers + 2, 50 ); Engine.SetProgress(85); createStragglerTrees( [oBaobab], avoidClasses(clForest, 1, clPlayer, 20, clMetal, 6, clRock, 7, clWater, 1), clForest, scaleByMapSize(70, 500)); g_Map.log("Creating large grass tufts"); group = new SimpleGroup( [new SimpleObject(aBush, 2,4, 0,1.8, -Math.PI / 8, Math.PI / 8)] ); createObjectGroupsDeprecated(group, 0, avoidClasses(clWater, 3, clPlayer, 2, clForest, 0), scaleByMapSize(100, 1200) ); placePlayersNomad(clPlayer, avoidClasses(clWater, 4, clForest, 1, clMetal, 4, clRock, 4, clFood, 2)); setSunColor(0.87451, 0.847059, 0.647059); setWaterColor(0.741176, 0.592157, 0.27451); setWaterTint(0.741176, 0.592157, 0.27451); setWaterWaviness(2.0); setWaterType("clap"); setWaterMurkiness(0.835938); -setUnitsAmbientColor(0.57, 0.58, 0.55); +setUnitsAmbientColor(0.447059, 0.509804, 0.54902); setTerrainAmbientColor(0.447059, 0.509804, 0.54902); setFogFactor(0.25); setFogThickness(0.15); setFogColor(0.847059, 0.737255, 0.482353); setPPEffect("hdr"); setPPContrast(0.57031); setPPBloom(0.34); g_Map.ExportMap();