1 RMS.LoadLibrary("rmgen");
2 RMS.LoadLibrary("rmbiome");
4 TILE_CENTERED_HEIGHT_MAP = true;
8 const tMainTerrain = g_Terrains.mainTerrain;
9 const tForestFloor1 = g_Terrains.forestFloor1;
10 const tForestFloor2 = g_Terrains.forestFloor2;
11 const tCliff = g_Terrains.cliff;
12 const tTier1Terrain = g_Terrains.tier1Terrain;
13 const tTier2Terrain = g_Terrains.tier2Terrain;
14 const tTier3Terrain = g_Terrains.tier3Terrain;
15 const tHill = g_Terrains.hill;
16 const tDirt = g_Terrains.dirt;
17 const tRoad = g_Terrains.road;
18 const tRoadWild = g_Terrains.roadWild;
19 const tTier4Terrain = g_Terrains.tier4Terrain;
20 const tShoreBlend = g_Terrains.shoreBlend;
21 const tShore = g_Terrains.shore;
22 const tWater = g_Terrains.water;
24 const oTree1 = g_Gaia.tree1;
25 const oTree2 = g_Gaia.tree2;
26 const oTree3 = g_Gaia.tree3;
27 const oTree4 = g_Gaia.tree4;
28 const oTree5 = g_Gaia.tree5;
29 const oFruitBush = g_Gaia.fruitBush;
30 const oMainHuntableAnimal = g_Gaia.mainHuntableAnimal;
31 const oFish = g_Gaia.fish;
32 const oSecondaryHuntableAnimal = g_Gaia.secondaryHuntableAnimal;
33 const oStoneLarge = g_Gaia.stoneLarge;
34 const oStoneSmall = g_Gaia.stoneSmall;
35 const oMetalLarge = g_Gaia.metalLarge;
36 const oWood = "gaia/special_treasure_wood";
38 const aGrass = g_Decoratives.grass;
39 const aGrassShort = g_Decoratives.grassShort;
40 const aReeds = g_Decoratives.reeds;
41 const aLillies = g_Decoratives.lillies;
42 const aRockLarge = g_Decoratives.rockLarge;
43 const aRockMedium = g_Decoratives.rockMedium;
44 const aBushMedium = g_Decoratives.bushMedium;
45 const aBushSmall = g_Decoratives.bushSmall;
47 const pForest1 = [tForestFloor2 + TERRAIN_SEPARATOR + oTree1, tForestFloor2 + TERRAIN_SEPARATOR + oTree2, tForestFloor2];
48 const pForest2 = [tForestFloor1 + TERRAIN_SEPARATOR + oTree4, tForestFloor1 + TERRAIN_SEPARATOR + oTree5, tForestFloor1];
52 const numPlayers = getNumPlayers();
53 const mapSize = getMapSize();
54 const mapArea = mapSize*mapSize;
56 var clPlayer = createTileClass();
57 var clHill = createTileClass();
58 var clForest = createTileClass();
59 var clWater = createTileClass();
60 var clDirt = createTileClass();
61 var clRock = createTileClass();
62 var clMetal = createTileClass();
63 var clFood = createTileClass();
64 var clBaseResource = createTileClass();
65 var clSettlement = createTileClass();
66 var clLand = createTileClass();
67 var clShallow = createTileClass();
71 var md = randIntInclusive(2,13);
72 var needsAdditionalWood = false;
73 //*****************************************************************************************************************************
74 if (md == 2) //continent
76 var [playerIDs, playerX, playerZ, playerAngle] = radialPlayerPlacement(0.25);
78 for (var i = 0; i < numPlayers; i++)
80 var fx = fractionToTiles(playerX[i]);
81 var fz = fractionToTiles(playerZ[i]);
85 addCivicCenterAreaToClass(ix, iz, clPlayer);
87 var placer = new ChainPlacer(2, floor(scaleByMapSize(5, 9)), floor(scaleByMapSize(5, 20)), 1, ix, iz, 0, [floor(scaleByMapSize(23, 50))]);
88 var elevationPainter = new SmoothElevationPainter(
89 ELEVATION_SET, // type
93 createArea(placer, [elevationPainter, paintClass(clLand)], null);
96 var fx = fractionToTiles(0.5);
97 var fz = fractionToTiles(0.5);
101 var placer = new ChainPlacer(2, floor(scaleByMapSize(5, 12)), floor(scaleByMapSize(60, 700)), 1, ix, iz, 0, [floor(mapSize * 0.33)]);
102 var terrainPainter = new LayeredPainter(
103 [tWater, tShore, tMainTerrain], // terrains
106 var elevationPainter = new SmoothElevationPainter(
107 ELEVATION_SET, // type
111 createArea(placer, [terrainPainter, elevationPainter, paintClass(clLand)], null);
113 var clPeninsulaSteam = createTileClass();
115 if (randBool(1/3)) // peninsula
117 var angle = randFloat(0, TWO_PI);
119 var fx = fractionToTiles(0.5 + 0.25*cos(angle));
120 var fz = fractionToTiles(0.5 + 0.25*sin(angle));
124 var placer = new ChainPlacer(2, floor(scaleByMapSize(5, 12)), floor(scaleByMapSize(60, 700)), 1, ix, iz, 0, [floor(mapSize * 0.33)]);
125 var terrainPainter = new LayeredPainter(
126 [tWater, tShore, tMainTerrain], // terrains
129 var elevationPainter = new SmoothElevationPainter(
130 ELEVATION_SET, // type
134 createArea(placer, [terrainPainter, elevationPainter, paintClass(clLand)], null);
136 var fx = fractionToTiles(0.5 + 0.35*cos(angle));
137 var fz = fractionToTiles(0.5 + 0.35*sin(angle));
141 var placer = new ClumpPlacer(mapArea * 0.3, 0.9, 0.01, 10, ix, iz);
142 createArea(placer, [paintClass(clPeninsulaSteam)], null);
145 //********************************************************************************************************
146 else if (md == 3) //central sea
148 var playerIDs = primeSortAllPlayers();
149 var playerPos = placePlayersRiver();
152 var playerAngle = [];
154 var mdd1 = randIntInclusive(1,2);
155 if (mdd1 == 1) //vertical
156 for (var i = 0; i < numPlayers; i++)
158 playerZ[i] = playerPos[i];
159 playerX[i] = 0.2 + 0.6*(i%2);
162 for (var i = 0; i < numPlayers; i++)
164 playerZ[i] = 0.2 + 0.6*(i%2);
165 playerX[i] = playerPos[i];
169 "horizontal": mdd1 != 1,
172 "width": randFloat(0.22, 0.3) + scaleByMapSize(1, 4) / 20,
179 "waterFunc": (ix, iz, height) => {
180 placeTerrain(ix, iz, height < -1.5 ? tWater : tShore);
182 addToClass(ix, iz, clWater);
184 "landFunc": (ix, iz, shoreDist1, shoreDist2) => {
185 setHeight(ix, iz, 3.1);
186 addToClass(ix, iz, clLand);
191 if (mdd1 == 1) //vertical
193 var placer = new PathPlacer(1, fractionToTiles(0.5), fractionToTiles(0.99), fractionToTiles(0.5), scaleByMapSize(randIntInclusive(16,24),randIntInclusive(100,140)), 0.5, 3*(scaleByMapSize(1,4)), 0.1, 0.01);
197 var placer = new PathPlacer(fractionToTiles(0.5), 1, fractionToTiles(0.5), fractionToTiles(0.99), scaleByMapSize(randIntInclusive(16,24),randIntInclusive(100,140)), 0.5, 3*(scaleByMapSize(1,4)), 0.1, 0.01);
199 var terrainPainter = new LayeredPainter(
200 [tMainTerrain, tMainTerrain, tMainTerrain], // terrains
203 var elevationPainter = new SmoothElevationPainter(
204 ELEVATION_SET, // type
208 createArea(placer, [terrainPainter, elevationPainter, unPaintClass(clWater)], null);
210 var mdd2 = randIntInclusive(1,7);
213 log("Creating islands...");
214 placer = new ChainPlacer(floor(scaleByMapSize(4, 7)), floor(scaleByMapSize(7, 10)), floor(scaleByMapSize(16, 40)), 0.07);
215 terrainPainter = new LayeredPainter(
216 [tMainTerrain, tMainTerrain], // terrains
219 elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3.1, 4);
222 [terrainPainter, elevationPainter, paintClass(clLand)],
223 avoidClasses(clLand, 3, clPlayer, 3),
224 scaleByMapSize(2, 5)*randIntInclusive(8,14)
229 log("Creating extentions...");
230 placer = new ClumpPlacer(randIntInclusive(scaleByMapSize(13,24),scaleByMapSize(24,45))*randIntInclusive(scaleByMapSize(13,24),scaleByMapSize(24,45)), 0.80, 0.1, 10);
231 terrainPainter = new LayeredPainter(
232 [tMainTerrain, tMainTerrain], // terrains
235 elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3.1, 4);
238 [terrainPainter, elevationPainter, paintClass(clLand)],
240 scaleByMapSize(2, 5)*randIntInclusive(8,14)
244 //********************************************************************************************************
245 else if (md == 4) //central river
248 for (var ix = 0; ix < mapSize; ix++)
250 for (var iz = 0; iz < mapSize; iz++)
252 var x = ix / (mapSize + 1.0);
253 var z = iz / (mapSize + 1.0);
254 setHeight(ix, iz, 3);
258 var playerIDs = primeSortAllPlayers();
259 var playerPos = placePlayersRiver();
263 var playerAngle = [];
265 var mdd1 = randIntInclusive(1,2);
266 if (mdd1 == 1) //horizontal
267 for (var i = 0; i < numPlayers; i++)
269 playerZ[i] = 0.25 + 0.5*(i%2);
270 playerX[i] = playerPos[i];
273 for (var i = 0; i < numPlayers; i++)
275 playerZ[i] = playerPos[i];
276 playerX[i] = 0.25 + 0.5*(i%2);
279 log("Creating the main river");
282 var placer = new PathPlacer(fractionToTiles(0.5), 1, fractionToTiles(0.5) , fractionToTiles(0.99), scaleByMapSize(14,24), 0.5, 3*(scaleByMapSize(1,4)), 0.1, 0.01);
284 var placer = new PathPlacer(1, fractionToTiles(0.5), fractionToTiles(0.99), fractionToTiles(0.5), scaleByMapSize(14,24), 0.5, 3*(scaleByMapSize(1,4)), 0.1, 0.01);
286 var terrainPainter = new LayeredPainter(
287 [tShore, tWater, tWater], // terrains
290 var elevationPainter = new SmoothElevationPainter(
291 ELEVATION_SET, // type
295 createArea(placer, [terrainPainter, elevationPainter], avoidClasses(clPlayer, 4));
298 placer = new ClumpPlacer(floor(PI*scaleByMapSize(10,20)*scaleByMapSize(10,20)/4), 0.95, 0.6, 10, 1, fractionToTiles(0.5));
300 placer = new ClumpPlacer(floor(PI*scaleByMapSize(10,20)*scaleByMapSize(10,20)/4), 0.95, 0.6, 10, fractionToTiles(0.5), 1);
302 var painter = new LayeredPainter([tWater, tWater], [1]);
303 var elevationPainter = new SmoothElevationPainter(ELEVATION_SET, -4, 2);
304 createArea(placer, [painter, elevationPainter], avoidClasses(clPlayer, 8));
307 placer = new ClumpPlacer(floor(PI*scaleByMapSize(10,20)*scaleByMapSize(10,20)/4), 0.95, 0.6, 10, fractionToTiles(0.99), fractionToTiles(0.5));
309 placer = new ClumpPlacer(floor(PI*scaleByMapSize(10,20)*scaleByMapSize(10,20)/4), 0.95, 0.6, 10, fractionToTiles(0.5), fractionToTiles(0.99));
311 var painter = new LayeredPainter([tWater, tWater], [1]);
312 var elevationPainter = new SmoothElevationPainter(ELEVATION_SET, -4, 2);
313 createArea(placer, [painter, elevationPainter], avoidClasses(clPlayer, 8));
315 log("Creating the shallows of the main river");
317 for (var i = 0; i <= randIntInclusive(1, scaleByMapSize(4,8)); i++)
319 var cLocation = randFloat(0.15,0.85);
321 createShallowsPassage(floor(fractionToTiles(cLocation)), floor(fractionToTiles(0.35)), floor(fractionToTiles(cLocation)), floor(fractionToTiles(0.65)), scaleByMapSize(4,8), -2, -2, 2, clShallow, undefined, -4);
323 createShallowsPassage(floor(fractionToTiles(0.35)), floor(fractionToTiles(cLocation)), floor(fractionToTiles(0.65)), floor(fractionToTiles(cLocation)), scaleByMapSize(4,8), -2, -2, 2, clShallow, undefined, -4);
328 for (var i = 0; i < numPlayers; i++)
330 var fx = fractionToTiles(playerX[i]);
331 var fz = fractionToTiles(playerZ[i]);
334 // create the city patch
335 var cityRadius = scaleByMapSize(17,29)/3;
336 placer = new ClumpPlacer(PI*cityRadius*cityRadius, 0.6, 0.3, 10, ix, iz);
337 createArea(placer, paintClass(clPlayer), null);
340 createTributaryRivers(
342 randIntInclusive(8, scaleByMapSize(12, 16)),
343 scaleByMapSize(10, 20),
349 avoidClasses(clPlayer, 3));
352 //********************************************************************************************************
353 else if (md == 5) //rivers and lake
355 var [playerIDs, playerX, playerZ] = radialPlayerPlacement();
357 for (var i = 0; i < numPlayers; i++)
359 var fx = fractionToTiles(playerX[i]);
360 var fz = fractionToTiles(playerZ[i]);
364 addCivicCenterAreaToClass(ix, iz, clPlayer);
367 for (var ix = 0; ix < mapSize; ix++)
369 for (var iz = 0; iz < mapSize; iz++)
371 var x = ix / (mapSize + 1.0);
372 var z = iz / (mapSize + 1.0);
373 setHeight(ix, iz, 3);
376 var mdd1 = randIntInclusive(1,2);
377 if (mdd1 == 1) //lake
379 var fx = fractionToTiles(0.5);
380 var fz = fractionToTiles(0.5);
384 var lSize = sqrt(sqrt(sqrt(scaleByMapSize(1, 6))));
386 var placer = new ChainPlacer(2, floor(scaleByMapSize(5, 16)), floor(scaleByMapSize(35, 200)), 1, ix, iz, 0, [floor(mapSize * 0.17 * lSize)]);
387 var terrainPainter = new LayeredPainter(
388 [tShore, tWater, tWater, tWater], // terrains
391 var elevationPainter = new SmoothElevationPainter(
392 ELEVATION_SET, // type
396 createArea(placer, [terrainPainter, elevationPainter, paintClass(clWater)], null);
398 log("Creating shore jaggedness...");
399 placer = new ChainPlacer(2, floor(scaleByMapSize(4, 6)), 3, 1);
400 terrainPainter = new LayeredPainter(
401 [tCliff, tHill], // terrains
404 elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 4);
407 [terrainPainter, elevationPainter, unPaintClass(clWater)],
408 borderClasses(clWater, 4, 7),
409 scaleByMapSize(12, 130) * 2, 150
413 if (randBool(1/3) &&(mdd1 == 1))//island
415 var placer = new ClumpPlacer(mapArea * 0.006 * lSize, 0.7, 0.1, 10, ix, iz);
416 var terrainPainter = new LayeredPainter(
417 [tShore, tWater, tWater, tWater], // terrains
420 var elevationPainter = new SmoothElevationPainter(
421 ELEVATION_SET, // type
425 createArea(placer, [terrainPainter, elevationPainter, paintClass(clWater)], null);
428 //********************************************************************************************************
429 else if (md == 6) //edge seas
432 for (var ix = 0; ix < mapSize; ix++)
434 for (var iz = 0; iz < mapSize; iz++)
436 var x = ix / (mapSize + 1.0);
437 var z = iz / (mapSize + 1.0);
438 setHeight(ix, iz, 3);
442 var mdd1 = randIntInclusive(1,2);
444 var playerIDs = sortAllPlayers();
451 for (var i = 0; i < numPlayers; i++)
453 playerPos[i] = (i + 1) / (numPlayers + 1);
454 if (mdd1 == 1) //horizontal
456 playerX[i] = playerPos[i];
457 playerZ[i] = 0.4 + 0.2*(i%2);
461 playerX[i] = 0.4 + 0.2*(i%2);
462 playerZ[i] = playerPos[i];
465 var fx = fractionToTiles(playerX[i]);
466 var fz = fractionToTiles(playerZ[i]);
470 addCivicCenterAreaToClass(ix, iz, clPlayer);
473 var mdd2 = randIntInclusive(1,3);
474 var fadedistance = 7;
478 if ((mdd2 == 1)||(mdd2 == 3))
480 var distance = randFloat(0., 0.1);
481 for (var ix = 0; ix < mapSize; ix++)
483 for (var iz = 0; iz < mapSize; iz++)
485 if (iz > (0.69+distance) * mapSize)
487 if (iz < (0.69+distance) * mapSize + fadedistance)
489 setHeight(ix, iz, 3 - 7 * (iz - (0.69+distance) * mapSize) / fadedistance);
490 if (3 - 7 * (iz - (0.69+distance) * mapSize) / fadedistance < 0.5)
491 addToClass(ix, iz, clWater);
495 setHeight(ix, iz, -4);
496 addToClass(ix, iz, clWater);
503 if ((mdd2 == 2)||(mdd2 == 3))
505 var distance = randFloat(0., 0.1);
506 for (var ix = 0; ix < mapSize; ix++)
508 for (var iz = 0; iz < mapSize; iz++)
510 if (iz < (0.31-distance) * mapSize)
512 if (iz > (0.31-distance) * mapSize - fadedistance)
514 setHeight(ix, iz, 3 - 7 * ((0.31-distance) * mapSize - iz) / fadedistance);
515 if (3 - 7 * ((0.31-distance) * mapSize - iz) / fadedistance < 0.5)
516 addToClass(ix, iz, clWater);
520 setHeight(ix, iz, -4);
521 addToClass(ix, iz, clWater);
530 if ((mdd2 == 1)||(mdd2 == 3))
532 var distance = randFloat(0., 0.1);
533 for (var ix = 0; ix < mapSize; ix++)
535 for (var iz = 0; iz < mapSize; iz++)
537 if (ix > (0.69+distance) * mapSize)
539 if (ix < (0.69+distance) * mapSize + fadedistance)
541 setHeight(ix, iz, 3 - 7 * (ix - (0.69+distance) * mapSize) / fadedistance);
542 if (3 - 7 * (ix - (0.69+distance) * mapSize) / fadedistance < 0.5)
543 addToClass(ix, iz, clWater);
547 setHeight(ix, iz, -4);
548 addToClass(ix, iz, clWater);
554 if ((mdd2 == 2)||(mdd2 == 3))
556 var distance = randFloat(0., 0.1);
557 for (var ix = 0; ix < mapSize; ix++)
559 for (var iz = 0; iz < mapSize; iz++)
561 if (ix < (0.31-distance) * mapSize)
563 if (ix > (0.31-distance) * mapSize - fadedistance)
565 setHeight(ix, iz, 3 - 7 * ((0.31-distance) * mapSize - ix) / fadedistance);
566 if (3 - 7 * ((0.31-distance) * mapSize - ix) / fadedistance < 0.5)
567 addToClass(ix, iz, clWater);
571 setHeight(ix, iz, -4);
572 addToClass(ix, iz, clWater);
580 log("Creating shore jaggedness...");
581 placer = new ChainPlacer(2, floor(scaleByMapSize(4, 6)), 3, 1);
582 terrainPainter = new LayeredPainter(
583 [tCliff, tHill], // terrains
586 elevationPainter = new SmoothElevationPainter(ELEVATION_SET, -5, 4);
589 [terrainPainter, elevationPainter, paintClass(clWater)],
590 [avoidClasses(clPlayer, 20), borderClasses(clWater, 6, 4)],
591 scaleByMapSize(7, 130) * 2, 150
594 placer = new ChainPlacer(2, floor(scaleByMapSize(4, 6)), 3, 1);
595 terrainPainter = new LayeredPainter(
596 [tCliff, tHill], // terrains
599 elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 4);
602 [terrainPainter, elevationPainter, unPaintClass(clWater)],
603 borderClasses(clWater, 4, 7),
604 scaleByMapSize(12, 130) * 2, 150
607 var mdd3 = randIntInclusive(1,5);
610 log("Creating islands...");
611 placer = new ChainPlacer(floor(scaleByMapSize(4, 7)), floor(scaleByMapSize(7, 10)), floor(scaleByMapSize(16, 40)), 0.07);
612 terrainPainter = new LayeredPainter(
613 [tMainTerrain, tMainTerrain], // terrains
616 elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3.1, 4);
619 [terrainPainter, elevationPainter, paintClass(clLand)],
620 avoidClasses(clLand, 3, clPlayer, 3),
621 scaleByMapSize(2, 5)*randIntInclusive(8,14)
626 log("Creating extentions...");
627 placer = new ChainPlacer(floor(scaleByMapSize(4, 7)), floor(scaleByMapSize(7, 10)), floor(scaleByMapSize(16, 40)), 0.07);
628 terrainPainter = new LayeredPainter(
629 [tMainTerrain, tMainTerrain], // terrains
632 elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3.1, 4);
635 [terrainPainter, elevationPainter, paintClass(clLand)],
637 scaleByMapSize(2, 5)*randIntInclusive(8,14)
641 //********************************************************************************************************
642 else if (md == 7) //gulf
644 for (var ix = 0; ix < mapSize; ix++)
646 for (var iz = 0; iz < mapSize; iz++)
648 var x = ix / (mapSize + 1.0);
649 var z = iz / (mapSize + 1.0);
650 setHeight(ix, iz, 3);
654 var mdd1 = randFloat(0,4);
656 var playerIDs = sortAllPlayers();
661 var playerAngle = [];
663 var startAngle = -PI/6 + (mdd1-1)*PI/2;
664 for (var i = 0; i < numPlayers; i++)
666 playerAngle[i] = startAngle + Math.PI * 2/3 * (numPlayers == 1 ? 1 : 2 * i / (numPlayers - 1));
667 playerX[i] = 0.5 + 0.35*cos(playerAngle[i]);
668 playerZ[i] = 0.5 + 0.35*sin(playerAngle[i]);
671 for (var i = 0; i < numPlayers; i++)
673 var fx = fractionToTiles(playerX[i]);
674 var fz = fractionToTiles(playerZ[i]);
677 // create the city patch
678 var cityRadius = scaleByMapSize(17,29)/3;
679 placer = new ClumpPlacer(PI*cityRadius*cityRadius, 0.6, 0.3, 10, ix, iz);
680 createArea(placer, paintClass(clPlayer), null);
683 fx = fractionToTiles(0.5);
684 fz = fractionToTiles(0.5);
690 var placer = new ChainPlacer(2, floor(scaleByMapSize(5, 16)), floor(scaleByMapSize(35, 200)), 1, ix, iz, 0, [floor(mapSize * 0.17 * lSize)]);
691 var terrainPainter = new LayeredPainter(
692 [tMainTerrain, tMainTerrain, tMainTerrain, tMainTerrain], // terrains
696 var elevationPainter = new SmoothElevationPainter(
697 ELEVATION_SET, // type
701 createArea(placer, [terrainPainter, elevationPainter, paintClass(clWater)], avoidClasses(clPlayer,floor(scaleByMapSize(15,25))));
703 fx = fractionToTiles(0.5 - 0.2*cos(mdd1*PI/2));
704 fz = fractionToTiles(0.5 - 0.2*sin(mdd1*PI/2));
708 var lSize = sqrt(sqrt(sqrt(scaleByMapSize(1, 6))));
710 var placer = new ChainPlacer(2, floor(scaleByMapSize(5, 16)), floor(scaleByMapSize(35, 120)), 1, ix, iz, 0, [floor(mapSize * 0.18 * lSize)]);
711 var terrainPainter = new LayeredPainter(
712 [tMainTerrain, tMainTerrain, tMainTerrain, tMainTerrain], // terrains
715 var elevationPainter = new SmoothElevationPainter(
716 ELEVATION_SET, // type
720 createArea(placer, [terrainPainter, elevationPainter, paintClass(clWater)], avoidClasses(clPlayer,floor(scaleByMapSize(15,25))));
722 fx = fractionToTiles(0.5 - 0.49*cos(mdd1*PI/2));
723 fz = fractionToTiles(0.5 - 0.49*sin(mdd1*PI/2));
727 var lSize = sqrt(sqrt(sqrt(scaleByMapSize(1, 6))));
729 var placer = new ChainPlacer(2, floor(scaleByMapSize(5, 16)), floor(scaleByMapSize(35, 100)), 1, ix, iz, 0, [floor(mapSize * 0.19 * lSize)]);
730 var terrainPainter = new LayeredPainter(
731 [tMainTerrain, tMainTerrain, tMainTerrain, tMainTerrain], // terrains
734 var elevationPainter = new SmoothElevationPainter(
735 ELEVATION_SET, // type
739 createArea(placer, [terrainPainter, elevationPainter, paintClass(clWater)], avoidClasses(clPlayer,floor(scaleByMapSize(15,25))));
741 //********************************************************************************************************
742 else if (md == 8) //lakes
744 var [playerIDs, playerX, playerZ, playerAngle] = radialPlayerPlacement();
746 for (var ix = 0; ix < mapSize; ix++)
748 for (var iz = 0; iz < mapSize; iz++)
750 var x = ix / (mapSize + 1.0);
751 var z = iz / (mapSize + 1.0);
752 setHeight(ix, iz, 3);
756 for (var i = 0; i < numPlayers; i++)
758 var fx = fractionToTiles(playerX[i]);
759 var fz = fractionToTiles(playerZ[i]);
762 // create the city patch
763 var cityRadius = scaleByMapSize(17,29)/3;
764 placer = new ClumpPlacer(PI*cityRadius*cityRadius, 0.6, 0.3, 10, ix, iz);
765 createArea(placer, paintClass(clPlayer), null);
769 var playerConstraint = new AvoidTileClassConstraint(clPlayer, 20);
770 var waterConstraint = new AvoidTileClassConstraint(clWater, 8);
772 for (var x = 0; x < mapSize; ++x)
773 for (var z = 0; z < mapSize; ++z)
774 if (playerConstraint.allows(x, z) && waterConstraint.allows(x, z))
775 lakeAreas.push([x, z]);
780 log("Creating lakes...");
781 var numLakes = scaleByMapSize(5, 16);
782 for (var i = 0; i < numLakes; ++i)
784 lakeAreaLen = lakeAreas.length;
788 chosenPoint = pickRandom(lakeAreas);
790 placer = new ChainPlacer(1, floor(scaleByMapSize(4, 8)), floor(scaleByMapSize(40, 180)), 0.7, chosenPoint[0], chosenPoint[1]);
791 terrainPainter = new LayeredPainter(
792 [tShore, tWater, tWater], // terrains
795 elevationPainter = new SmoothElevationPainter(ELEVATION_SET, -5, 5);
796 var newLake = createAreas(
798 [terrainPainter, elevationPainter, paintClass(clWater)],
799 avoidClasses(clPlayer, 20, clWater, 8),
803 if (newLake && newLake.length)
806 for (var j = 0; j < lakeAreaLen; ++j)
808 var x = lakeAreas[j][0], z = lakeAreas[j][1];
809 if (playerConstraint.allows(x, z) && waterConstraint.allows(x, z))
810 lakeAreas[n++] = lakeAreas[j];
812 lakeAreas.length = n;
816 //********************************************************************************************************
817 else if (md == 9) //passes
819 var [playerIDs, playerX, playerZ, playerAngle, startAngle] = radialPlayerPlacement();
821 for (var ix = 0; ix < mapSize; ix++)
823 for (var iz = 0; iz < mapSize; iz++)
825 var x = ix / (mapSize + 1.0);
826 var z = iz / (mapSize + 1.0);
827 setHeight(ix, iz, 3);
831 log ("Creating ranges...");
832 for (var m = 0; m < numPlayers; m++)
834 var tang = startAngle + (m+0.5)*TWO_PI/(numPlayers);
835 var placer = new PathPlacer(fractionToTiles(0.5), fractionToTiles(0.5), fractionToTiles(0.5 + 0.49*cos(tang)), fractionToTiles(0.5 + 0.49*sin(tang)), scaleByMapSize(14,24), 0.4, 3*(scaleByMapSize(1,3)), 0.2, 0.05);
836 var terrainPainter = new LayeredPainter(
837 [tShore, tWater, tWater], // terrains
840 var elevationPainter = new SmoothElevationPainter(
841 ELEVATION_SET, // type
845 createArea(placer, [terrainPainter, elevationPainter, paintClass(clWater)], avoidClasses(clPlayer, 5));
846 placer = new ClumpPlacer(floor(PI*scaleByMapSize(10,50)*scaleByMapSize(10,50)/5), 0.95, 0.6, 10, fractionToTiles(0.5 + 0.49*cos(tang)), fractionToTiles(0.5 + 0.49*sin(tang)));
847 var painter = new LayeredPainter([tWater, tWater], [1]);
848 var elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 24, 0);
849 createArea(placer, [painter, elevationPainter], avoidClasses(clPlayer, 5));
851 var placer = new PathPlacer(fractionToTiles(0.5 + 0.3*cos(tang) - 0.1 * cos(tang+PI/2)), fractionToTiles(0.5 + 0.3*sin(tang) - 0.1 * sin(tang+PI/2)), fractionToTiles(0.5 + 0.3*cos(tang) + 0.1 * cos(tang+PI/2)), fractionToTiles(0.5 + 0.3*sin(tang) + 0.1 * sin(tang+PI/2)), scaleByMapSize(14,24), 0.4, 3*(scaleByMapSize(1,3)), 0.2, 0.05);
852 var painter = new LayeredPainter([tCliff, tCliff], [1]);
853 var elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 2);
854 createArea(placer, [painter, elevationPainter], null);
856 var mdd1 = randIntInclusive (1,3);
859 var fx = fractionToTiles(0.5);
860 var fz = fractionToTiles(0.5);
864 var placer = new ClumpPlacer(mapArea * 0.005, 0.7, 0.1, 10, ix, iz);
865 var terrainPainter = new LayeredPainter(
866 [tShore, tWater, tWater, tWater], // terrains
869 var elevationPainter = new SmoothElevationPainter(
870 ELEVATION_SET, // type
874 createArea(placer, [terrainPainter, elevationPainter, paintClass(clWater)], null);
878 var fx = fractionToTiles(0.5);
879 var fz = fractionToTiles(0.5);
883 var lSize = sqrt(sqrt(sqrt(scaleByMapSize(1, 6))));
885 var placer = new ClumpPlacer(mapArea * 0.03 * lSize, 0.7, 0.1, 10, ix, iz);
886 var terrainPainter = new LayeredPainter(
887 [tShore, tWater, tWater, tWater], // terrains
890 var elevationPainter = new SmoothElevationPainter(
891 ELEVATION_SET, // type
895 createArea(placer, [terrainPainter, elevationPainter, paintClass(clWater)], null);
898 //********************************************************************************************************
899 else if (md == 10) //lowlands
901 var [playerIDs, playerX, playerZ, playerAngle, startAngle] = radialPlayerPlacement();
903 for (var ix = 0; ix < mapSize; ix++)
905 for (var iz = 0; iz < mapSize; iz++)
907 var x = ix / (mapSize + 1.0);
908 var z = iz / (mapSize + 1.0);
909 setHeight(ix, iz, 30);
913 var radius = scaleByMapSize(18,32);
916 var hillSize = PI * radius * radius;
919 if ((mapSize / 64 == 2)&&(numPlayers <= 2))
923 else if ((mapSize / 64 == 3)&&(numPlayers <= 3))
927 else if ((mapSize / 64 == 4)&&(numPlayers <= 4))
931 else if ((mapSize / 64 == 5)&&(numPlayers <= 4))
935 else if ((mapSize / 64 == 6)&&(numPlayers <= 5))
939 else if ((mapSize / 64 == 7)&&(numPlayers <= 6))
944 for (var i = 0; i < numPlayers*split; i++)
946 var tang = startAngle + (i)*TWO_PI/(numPlayers*split);
947 var fx = fractionToTiles(0.5 + 0.35*cos(tang));
948 var fz = fractionToTiles(0.5 + 0.35*sin(tang));
952 var placer = new ClumpPlacer(hillSize, 0.65, 0.1, 10, ix, iz);
953 var terrainPainter = new LayeredPainter(
954 [tMainTerrain, tMainTerrain], // terrains
955 [cliffRadius] // widths
957 var elevationPainter = new SmoothElevationPainter(
958 ELEVATION_SET, // type
960 cliffRadius // blend radius
962 createArea(placer, [terrainPainter, elevationPainter, paintClass(clLand)], null);
965 var fx = fractionToTiles(0.5);
966 var fz = fractionToTiles(0.5);
970 var lSize = sqrt(sqrt(sqrt(scaleByMapSize(1, 6))));
972 var placer = new ClumpPlacer(mapArea * 0.091 * lSize, 0.7, 0.1, 10, ix, iz);
973 var terrainPainter = new LayeredPainter(
974 [tMainTerrain, tMainTerrain, tMainTerrain, tMainTerrain], // terrains
977 var elevationPainter = new SmoothElevationPainter(
978 ELEVATION_SET, // type
982 createArea(placer, [terrainPainter, elevationPainter, paintClass(clWater)], null);
984 for (var m = 0; m < numPlayers*split; m++)
986 var tang = startAngle + m*TWO_PI/(numPlayers*split);
987 var placer = new PathPlacer(fractionToTiles(0.5), fractionToTiles(0.5), fractionToTiles(0.5 + 0.35*cos(tang)), fractionToTiles(0.5 + 0.35*sin(tang)), scaleByMapSize(14,24), 0.4, 3*(scaleByMapSize(1,3)), 0.2, 0.05);
988 var terrainPainter = new LayeredPainter(
989 [tMainTerrain, tMainTerrain, tMainTerrain], // terrains
992 var elevationPainter = new SmoothElevationPainter(
993 ELEVATION_SET, // type
997 createArea(placer, [terrainPainter, elevationPainter, paintClass(clWater)], null);
1000 //********************************************************************************************************
1003 var [playerIDs, playerX, playerZ, playerAngle] = radialPlayerPlacement();
1005 for (var ix = 0; ix < mapSize; ix++)
1007 for (var iz = 0; iz < mapSize; iz++)
1009 var x = ix / (mapSize + 1.0);
1010 var z = iz / (mapSize + 1.0);
1011 setHeight(ix, iz, 3);
1017 paintTerrainBasedOnHeight(3.12, 40, 1, tCliff);
1018 paintTerrainBasedOnHeight(3, 3.12, 1, tMainTerrain);
1019 paintTerrainBasedOnHeight(1, 3, 1, tShore);
1020 paintTerrainBasedOnHeight(-8, 1, 2, tWater);
1021 unPaintTileClassBasedOnHeight(0, 3.12, 1, clWater);
1022 unPaintTileClassBasedOnHeight(-6, 0, 1, clLand);
1023 paintTileClassBasedOnHeight(-6, 0, 1, clWater);
1024 paintTileClassBasedOnHeight(0, 3.12, 1, clLand);
1025 paintTileClassBasedOnHeight(3.12, 40, 1, clHill);
1027 for (var i = 0; i < numPlayers; i++)
1029 var id = playerIDs[i];
1030 log("Creating base for player " + id + "...");
1032 var radius = scaleByMapSize(17,29);
1033 var shoreRadius = 4;
1036 var hillSize = PI * radius * radius;
1037 // get the x and z in tiles
1038 var fx = fractionToTiles(playerX[i]);
1039 var fz = fractionToTiles(playerZ[i]);
1043 placeCivDefaultEntities(fx, fz, id);
1044 placeDefaultChicken(fx, fz, clBaseResource);
1046 // create berry bushes
1047 var bbAngle = randFloat(0, TWO_PI);
1049 var bbX = round(fx + bbDist * cos(bbAngle));
1050 var bbZ = round(fz + bbDist * sin(bbAngle));
1051 var group = new SimpleGroup(
1052 [new SimpleObject(oFruitBush, 5,5, 0,3)],
1053 true, clBaseResource, bbX, bbZ
1055 createObjectGroup(group, 0);
1056 if (needsAdditionalWood)
1059 var bbAngle = randFloat(0, TWO_PI);
1061 var bbX = round(fx + bbDist * cos(bbAngle));
1062 var bbZ = round(fz + bbDist * sin(bbAngle));
1063 group = new SimpleGroup(
1064 [new SimpleObject(oWood, 14,14, 0,3)],
1065 true, clBaseResource, bbX, bbZ
1067 createObjectGroup(group, 0);
1070 // create metal mine
1071 var mAngle = bbAngle;
1072 while(abs(mAngle - bbAngle) < PI/3)
1074 mAngle = randFloat(0, TWO_PI);
1077 var mX = round(fx + mDist * cos(mAngle));
1078 var mZ = round(fz + mDist * sin(mAngle));
1079 group = new SimpleGroup(
1080 [new SimpleObject(oMetalLarge, 1,1, 0,0)],
1081 true, clBaseResource, mX, mZ
1083 createObjectGroup(group, 0);
1085 // create stone mines
1086 mAngle += randFloat(PI/8, PI/4);
1087 mX = round(fx + mDist * cos(mAngle));
1088 mZ = round(fz + mDist * sin(mAngle));
1089 group = new SimpleGroup(
1090 [new SimpleObject(oStoneLarge, 1,1, 0,2)],
1091 true, clBaseResource, mX, mZ
1093 createObjectGroup(group, 0);
1094 var hillSize = PI * radius * radius;
1095 // create starting trees
1096 var num = floor(hillSize / 100);
1097 var tAngle = randFloat(-PI/3, 4*PI/3);
1098 var tDist = randFloat(11, 13);
1099 var tX = round(fx + tDist * cos(tAngle));
1100 var tZ = round(fz + tDist * sin(tAngle));
1101 group = new SimpleGroup(
1102 [new SimpleObject(oTree1, num, num, 0,5)],
1103 false, clBaseResource, tX, tZ
1105 createObjectGroup(group, 0, avoidClasses(clBaseResource,2));
1107 placeDefaultDecoratives(fx, fz, aGrassShort, clBaseResource, radius);
1110 for (var i = 0; i < numPlayers; i++)
1112 var fx = fractionToTiles(playerX[i]);
1113 var fz = fractionToTiles(playerZ[i]);
1116 // create the city patch
1117 var cityRadius = radius/3;
1118 placer = new ClumpPlacer(PI*cityRadius*cityRadius, 0.6, 0.3, 10, ix, iz);
1119 var painter = new LayeredPainter([tRoadWild, tRoad], [1]);
1120 createArea(placer, [painter, paintClass(clPlayer)], null);
1123 log("Creating bumps...");
1124 placer = new ClumpPlacer(scaleByMapSize(20, 50), 0.3, 0.06, 1);
1125 painter = new SmoothElevationPainter(ELEVATION_MODIFY, 2, 2);
1129 [avoidClasses(clWater, 2, clPlayer, 10), stayClasses(clLand, 3)],
1130 randIntInclusive(0,scaleByMapSize(200, 400))
1133 log("Creating hills...");
1134 placer = new ChainPlacer(1, floor(scaleByMapSize(4, 6)), floor(scaleByMapSize(16, 40)), 0.5);
1135 terrainPainter = new LayeredPainter(
1136 [tCliff, tHill], // terrains
1139 elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 18, 2);
1142 [terrainPainter, elevationPainter, paintClass(clHill)],
1143 [avoidClasses(clPlayer, 20, clHill, randIntInclusive(6, 18)), stayClasses(clLand, 0)],
1144 randIntInclusive(0, scaleByMapSize(4, 8))*randIntInclusive(1, scaleByMapSize(4, 9))
1147 var multiplier = sqrt(randFloat(0.5,1.2)*randFloat(0.5,1.2));
1148 // calculate desired number of trees for map (based on size)
1149 if (currentBiome() == "savanna")
1151 var MIN_TREES = floor(200*multiplier);
1152 var MAX_TREES = floor(1250*multiplier);
1155 else if (currentBiome() == "tropic")
1157 var MIN_TREES = floor(1000*multiplier);
1158 var MAX_TREES = floor(6000*multiplier);
1159 var P_FOREST = randFloat(0.5, 0.7);
1163 var MIN_TREES = floor(500*multiplier);
1164 var MAX_TREES = floor(3000*multiplier);
1165 var P_FOREST = randFloat(0.5,0.8);
1167 var totalTrees = scaleByMapSize(MIN_TREES, MAX_TREES);
1168 var numForest = totalTrees * P_FOREST;
1169 var numStragglers = totalTrees * (1.0 - P_FOREST);
1171 log("Creating forests...");
1173 [[tForestFloor2, tMainTerrain, pForest1], [tForestFloor2, pForest1]],
1174 [[tForestFloor1, tMainTerrain, pForest2], [tForestFloor1, pForest2]]
1175 ]; // some variation
1177 if (currentBiome() != "savanna")
1179 var size = numForest / (scaleByMapSize(3,6) * numPlayers);
1180 var num = floor(size / types.length);
1181 for (var i = 0; i < types.length; ++i)
1183 placer = new ChainPlacer(1, floor(scaleByMapSize(3, 5)), numForest / num, 0.5);
1184 painter = new LayeredPainter(
1185 types[i], // terrains
1190 [painter, paintClass(clForest)],
1191 [avoidClasses(clPlayer, 20, clForest, randIntInclusive(5, 15), clHill, 0), stayClasses(clLand, 4)],
1197 RMS.SetProgress(50);
1198 log("Creating dirt patches...");
1199 var sizes = [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8, 21)];
1201 if (currentBiome() == "savanna")
1203 for (var i = 0; i < sizes.length; i++)
1205 placer = new ChainPlacer(1, floor(scaleByMapSize(3, 5)), sizes[i], 0.5);
1206 painter = new LayeredPainter(
1207 [[tMainTerrain,tTier1Terrain],[tTier1Terrain,tTier2Terrain], [tTier2Terrain,tTier3Terrain]], // terrains
1212 [painter, paintClass(clDirt)],
1213 [avoidClasses(clForest, 0, clHill, 0, clDirt, 5, clPlayer, 7), stayClasses(clLand, 4)],
1214 numb*scaleByMapSize(15, 45)
1218 log("Creating grass patches...");
1219 var sizes = [scaleByMapSize(2, 4), scaleByMapSize(3, 7), scaleByMapSize(5, 15)];
1220 for (var i = 0; i < sizes.length; i++)
1222 placer = new ChainPlacer(1, floor(scaleByMapSize(3, 5)), sizes[i], 0.5);
1223 painter = new TerrainPainter(tTier4Terrain);
1227 [avoidClasses(clForest, 0, clHill, 0, clDirt, 5, clPlayer, 7), stayClasses(clLand, 4)],
1228 numb*scaleByMapSize(15, 45)
1231 RMS.SetProgress(55);
1233 log("Creating stone mines...");
1234 group = new SimpleGroup([new SimpleObject(oStoneSmall, 0,2, 0,4), new SimpleObject(oStoneLarge, 1,1, 0,4)], true, clRock);
1235 createObjectGroupsDeprecated(group, 0,
1236 [avoidClasses(clForest, 1, clPlayer, 20, clRock, 10, clHill, 1), stayClasses(clLand, 4)],
1237 randIntInclusive(scaleByMapSize(2,9),scaleByMapSize(9,40)), 100
1240 log("Creating small stone quarries...");
1241 group = new SimpleGroup([new SimpleObject(oStoneSmall, 2,5, 1,3)], true, clRock);
1242 createObjectGroupsDeprecated(group, 0,
1243 [avoidClasses(clForest, 1, clPlayer, 20, clRock, 10, clHill, 1), stayClasses(clLand, 4)],
1244 randIntInclusive(scaleByMapSize(2,9),scaleByMapSize(9,40)), 100
1247 log("Creating metal mines...");
1248 group = new SimpleGroup([new SimpleObject(oMetalLarge, 1,1, 0,4)], true, clMetal);
1249 createObjectGroupsDeprecated(group, 0,
1250 [avoidClasses(clForest, 1, clPlayer, 20, clMetal, 10, clRock, 5, clHill, 1), stayClasses(clLand, 4)],
1251 randIntInclusive(scaleByMapSize(2,9),scaleByMapSize(9,40)), 100
1254 RMS.SetProgress(65);
1256 log("Creating small decorative rocks...");
1257 group = new SimpleGroup(
1258 [new SimpleObject(aRockMedium, 1,3, 0,1)],
1261 createObjectGroupsDeprecated(
1263 [avoidClasses(clWater, 0, clForest, 0, clPlayer, 0, clHill, 0), stayClasses(clLand, 4)],
1264 scaleByMapSize(16, 262), 50
1267 log("Creating large decorative rocks...");
1268 group = new SimpleGroup(
1269 [new SimpleObject(aRockLarge, 1,2, 0,1), new SimpleObject(aRockMedium, 1,3, 0,2)],
1272 createObjectGroupsDeprecated(
1274 [avoidClasses(clWater, 0, clForest, 0, clPlayer, 0, clHill, 0), stayClasses(clLand, 4)],
1275 scaleByMapSize(8, 131), 50
1277 RMS.SetProgress(70);
1279 log("Creating deer...");
1280 group = new SimpleGroup(
1281 [new SimpleObject(oMainHuntableAnimal, 5,7, 0,4)],
1284 createObjectGroupsDeprecated(group, 0,
1285 [avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 20), stayClasses(clLand, 4)],
1286 randIntInclusive(numPlayers+3, 5*numPlayers+4), 50
1289 log("Creating berry bush...");
1290 group = new SimpleGroup(
1291 [new SimpleObject(oFruitBush, 5,7, 0,4)],
1294 createObjectGroupsDeprecated(group, 0,
1295 [avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 20), stayClasses(clLand, 4)],
1296 randIntInclusive(1, 4) * numPlayers + 2, 50
1298 RMS.SetProgress(75);
1300 log("Creating sheep...");
1301 group = new SimpleGroup(
1302 [new SimpleObject(oSecondaryHuntableAnimal, 2,3, 0,2)],
1305 createObjectGroupsDeprecated(group, 0,
1306 [avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 20), stayClasses(clLand, 4)],
1307 randIntInclusive(numPlayers+3, 5*numPlayers+4), 50
1310 log("Creating fish...");
1311 group = new SimpleGroup(
1312 [new SimpleObject(oFish, 2,3, 0,2)],
1315 createObjectGroupsDeprecated(group, 0,
1316 avoidClasses(clLand, 5, clForest, 0, clPlayer, 0, clHill, 0, clFood, 20),
1317 randIntInclusive(15, 40) * numPlayers, 60
1319 RMS.SetProgress(85);
1321 log("Creating straggler trees...");
1322 var types = [oTree1, oTree2, oTree4, oTree3]; // some variation
1323 var num = floor(numStragglers / types.length);
1324 for (var i = 0; i < types.length; ++i)
1326 group = new SimpleGroup(
1327 [new SimpleObject(types[i], 1,1, 0,3)],
1330 createObjectGroupsDeprecated(group, 0,
1331 [avoidClasses(clWater, 1, clForest, 7, clHill, 1, clPlayer, 0, clMetal, 6, clRock, 6), stayClasses(clLand, 4)],
1337 if (currentBiome() == "tropic")
1340 log("Creating small grass tufts...");
1341 group = new SimpleGroup(
1342 [new SimpleObject(aGrassShort, 1,2, 0,1, -PI/8,PI/8)]
1344 createObjectGroupsDeprecated(group, 0,
1345 [avoidClasses(clWater, 2, clHill, 2, clPlayer, 2, clDirt, 0), stayClasses(clLand, 4)],
1346 planetm * scaleByMapSize(13, 200)
1348 RMS.SetProgress(90);
1350 log("Creating large grass tufts...");
1351 group = new SimpleGroup(
1352 [new SimpleObject(aGrass, 2,4, 0,1.8, -PI/8,PI/8), new SimpleObject(aGrassShort, 3,6, 1.2,2.5, -PI/8,PI/8)]
1354 createObjectGroupsDeprecated(group, 0,
1355 [avoidClasses(clWater, 3, clHill, 2, clPlayer, 2, clDirt, 1, clForest, 0), stayClasses(clLand, 4)],
1356 planetm * scaleByMapSize(13, 200)
1358 RMS.SetProgress(95);
1360 log("Creating shallow flora...");
1361 group = new SimpleGroup(
1362 [new SimpleObject(aLillies, 1,2, 0,2), new SimpleObject(aReeds, 2,4, 0,2)]
1364 createObjectGroupsDeprecated(group, 0,
1365 stayClasses(clShallow, 1),
1366 60 * scaleByMapSize(13, 200), 80
1369 log("Creating bushes...");
1370 group = new SimpleGroup(
1371 [new SimpleObject(aBushMedium, 1,2, 0,2), new SimpleObject(aBushSmall, 2,4, 0,2)]
1373 createObjectGroupsDeprecated(group, 0,
1374 [avoidClasses(clWater, 1, clHill, 1, clPlayer, 1, clDirt, 1), stayClasses(clLand, 3)],
1375 planetm * scaleByMapSize(13, 200), 50
1378 setSkySet(pickRandom(["cirrus", "cumulus", "sunny", "sunny 1", "mountainous", "stratus"]));
1379 setSunRotation(randFloat(0, TWO_PI));
1380 setSunElevation(randFloat(PI/ 5, PI / 3));