diff --git a/binaries/data/mods/official/maps/random/latium.js b/binaries/data/mods/official/maps/random/latium.js index 8c58f90137..817e9c8590 100644 --- a/binaries/data/mods/official/maps/random/latium.js +++ b/binaries/data/mods/official/maps/random/latium.js @@ -15,11 +15,13 @@ tBeachCliff = "cliff_medit_beach"; tGrassDry = ["grass_mediterranean_dry_a", "grass_mediterranean_dry_b", "grass_mediterranean_dry_c"]; tGrass = ["grass_mediterranean_green_50", "grass_mediterranean_green_flowers"]; tGrassShrubs = ["grass_mediterranean_green_shrubs", "grass_mediterranean_green_flowers"]; +tGrassRock = ["grass_mediterranean_green_rock"]; tDirt = "dirt_medit_a"; tDirtGrass = "dirt_medit_grass_50"; -tDirtCliff = ["cliff_medit_dirt", "cliff_medit_dirt", "cliff_medit_grass_a"]; -tCliff = ["cliff_medit_face_a", "cliff_medit_foliage_a"]; -tForestFloor = "forestfloor_medit_rock"; +tDirtCliff = "cliff_medit_dirt"; +tGrassCliff = "cliff_medit_grass_a"; +tCliff = ["cliff_medit_face_b", "cliff_medit_face_b", "cliff_medit_foliage_a"]; +tForestFloor = "forestfloor_medit_dirt"; oPalm = "flora_tree_medit_fan_palm"; oLombardyPoplar = "flora_tree_poplar_lombardy"; @@ -36,13 +38,19 @@ oBushLargeDry = "props/flora/bush_medit_la_dry.xml"; oBushLarge = "props/flora/bush_medit_la.xml"; oBushMedDry = "props/flora/bush_medit_me_dry.xml"; oBushMed = "props/flora/bush_medit_me.xml"; +oBushSmall = "props/flora/bush_medit_sm.xml" +oBushSmallDry = "props/flora/bush_medit_sm_dry.xml" oGrass = "props/flora/grass_medit_field.xml"; -oGrassDry = "props/flora/grass_soft_dry_large_tall.xml"; +oGrassDry = "props/flora/grass_soft_dry_small.xml"; +oRockLarge = "geology/stone_granite_greek_large.xml"; +oRockMed = "geology/stone_granite_greek_med.xml"; +oRockSmall = "geology/stone_granite_greek_small.xml"; oWaterLog = "props/flora/water_log.xml"; -tPalmForest = [tForestFloor+"|"+oPalm, tForestFloor, tGrass]; -tPineForest = [tForestFloor+"|"+oPine, tForestFloor, tForestFloor, tForestFloor]; -tMainForest = [tForestFloor+"|"+oCarob, tForestFloor+"|"+oBeech, tForestFloor]; +tPalmForest = [tForestFloor+"|"+oPalm, tGrass]; +tPineForest = [tForestFloor+"|"+oPine, tGrass]; +tMainForest = [tForestFloor+"|"+oCarob, tForestFloor+"|"+oBeech, tGrass, tGrass]; +tPoplarForest = [tForestFloor+"|"+oLombardyPoplar, tGrass]; // Initialize world @@ -56,21 +64,110 @@ clForest = createTileClass(); clMetal = createTileClass(); clStone = createTileClass(); clFood = createTileClass(); +clPlayer = createTileClass(); +clBaseResource = createTileClass(); + +// Place players + +println("Placing players..."); + +playerX = new Array(NUM_PLAYERS+1); +playerY = new Array(NUM_PLAYERS+1); + +numLeftPlayers = Math.floor(NUM_PLAYERS/2); +for(i=0; i0 && h+baseNoise < 1 ) { - baseNoise += Math.min(h, distToWater*30); + baseNoise += Math.min(h, distToWater*50); } h += baseNoise; - // create land noise - if( h > -7 ) + // create cliff noise + if( h > -10 ) { cliffNoise = (1*noise3.eval(x,y) + 0.5*noise4.eval(x,y)) / 1.5; - if(h < -3) { - cliffNoise *= 0.3 * (1 - ((h+3)/-4)); + if(h < 1) { + u = 1 - .3*((h-1)/-10); + cliffNoise *= u; } + cliffNoise += .05 * distToWater / (0.5 - WATER_WIDTH); if(cliffNoise > .6) { - u = 0.7 * (cliffNoise-.6); + u = 0.5 * (cliffNoise-.6); cliffNoise += u * noise5.eval(x,y); cliffNoise /= (1+u); } - cliffNoise += .1 * distToWater / (0.5 - WATER_WIDTH); cliffNoise -= 0.58; + cliffNoise *= pn; if(cliffNoise > 0) { - h += 19 * Math.min(cliffNoise, 0.06) / 0.06; + h += 20 * Math.min(cliffNoise, 0.045) / 0.045; } } @@ -121,16 +223,21 @@ for(ix=0; ix<=SIZE; ix++) { // Paint base terrain +println("Painting terrain..."); + noise6 = new Noise2D(10 * SIZE/128); noise7 = new Noise2D(20 * SIZE/128); -noise8 = new Noise2D(30 * SIZE/128); -noise9 = new Noise2D(50 * SIZE/128); +noise8 = new Noise2D(20 * SIZE/128); +noise9 = new Noise2D(40 * SIZE/128); + +noise10 = new Noise2D(50 * SIZE/128); for(ix=0; ix 3) { t = tCliff; + addToClass(ix, iy, clCliff); } else if(maxH - minH > 2.4) { - t = tDirtCliff; - if(minH < .3) t = tBeachCliff; + if(minH < -1) t = tCliff; + else if(minH < .5) t = tBeachCliff; + else t = [tDirtCliff, tGrassCliff]; + addToClass(ix, iy, clCliff); } // forests if(maxH - minH < 1 && minH > 1) { - forestNoise = (noise6.eval(x,y) + 0.5*noise7.eval(x,y)) / 1.5; + forestNoise = (noise6.eval(x,y) + 0.5*noise7.eval(x,y)) / 1.5 * pn; forestNoise -= 0.6; if(forestNoise > 0) { - if(minH > 20 && t==tGrass && forestNoise > .01) { - t = tPineForest; - } - else if(minH > 4 && minH < 19 && t==tGrass) { - t = tMainForest; + if(minH > 5) { + typeNoise = noise10.eval(x,y); + if(typeNoise < .43 && forestNoise < .05) t = tPoplarForest; + else if(typeNoise < .63) t = tMainForest; + else t = tPineForest; + addToClass(ix, iy, clForest); } else if(minH < 3) { t = tPalmForest; + addToClass(ix, iy, clForest); } } } @@ -197,15 +313,81 @@ for(ix=0; ix 1.2) ? tDirtCliff : tDirt; } - else if(grassNoise > .6) { - t = tGrassShrubs; + else if(grassNoise < .39) { + t = (maxH - minH > 1.2) ? tGrassCliff : tGrassDry; + if(maxH - minH < .5 && randFloat() < .03) { + placeObject(oGrassDry, 0, ix+randFloat(), iy+randFloat(), randFloat()*2*Math.PI); + } + } + else if(grassNoise > .64) { + t = (maxH - minH > 1.2) ? tGrassRock : tGrassShrubs; + } + else { + if(maxH - minH < .5 && randFloat() < .05) { + placeObject(oGrass, 0, ix+randFloat(), iy+randFloat(), randFloat()*2*Math.PI); + } } } placeTerrain(ix, iy, t); } } + +println("Placing object groups..."); + +// create straggler trees +for(t in [oCarob, oBeech, oLombardyPoplar, oPine]) { + group = new SimpleGroup([new SimpleObject(t, 1,3, 0,2)], true, clForest); + createObjectGroups(group, 0, + avoidClasses(clWater, 5, clCliff, 0, clForest, 1), + SIZE*SIZE/8000, 50 + ); +} + +// create bushes +group = new SimpleGroup([ + new SimpleObject(oBushSmall, 0,2, 0,2), + new SimpleObject(oBushSmallDry, 0,2, 0,2), + new SimpleObject(oBushMed, 0,1, 0,2), + new SimpleObject(oBushMedDry, 0,1, 0,2)]); +createObjectGroups(group, 0, + avoidClasses(clWater, 4, clCliff, 2), + SIZE*SIZE/2000, 50 +); + +// create rocks +group = new SimpleGroup([ + new SimpleObject(oRockSmall, 0,3, 0,2), + new SimpleObject(oRockMed, 0,2, 0,2), + new SimpleObject(oRockLarge, 0,1, 0,2)]); +createObjectGroups(group, 0, + avoidClasses(clWater, 0, clCliff, 0), + SIZE*SIZE/2000, 50 +); + +// create stone +group = new SimpleGroup([new SimpleObject(oStone, 2,3, 0,2)], true, clStone); +createObjectGroups(group, 0, + [avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clStone, 15), + new BorderTileClassConstraint(clCliff, 0, 5)], + 3 * NUM_PLAYERS, 100 +); + +// create metal +group = new SimpleGroup([new SimpleObject(oMetal, 2,3, 0,2)], true, clMetal); +createObjectGroups(group, 0, + [avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clMetal, 15, clStone, 5), + new BorderTileClassConstraint(clCliff, 0, 5)], + 3 * NUM_PLAYERS, 100 +); + +// create sheep +group = new SimpleGroup([new SimpleObject(oSheep, 2,4, 0,2)], true, clFood); +createObjectGroups(group, 0, + avoidClasses(clWater, 5, clForest, 1, clCliff, 1, clPlayer, 20, clMetal, 2, clStone, 2, clFood, 8), + 5 * NUM_PLAYERS, 100 +); \ No newline at end of file