1 Engine.LoadLibrary("rmgen");
2 Engine.LoadLibrary("rmgen-common");
12 var tPrimary = ["alpine_grass_rocky"];
13 var tForestFloor = "alpine_grass";
14 var tCliff = ["polar_cliff_a", "polar_cliff_b", "polar_cliff_snow"];
15 var tSecondary = "alpine_grass";
16 var tHalfSnow = ["polar_grass_snow", "ice_dirt"];
17 var tSnowLimited = ["polar_snow_rocks", "polar_ice"];
18 var tDirt = "ice_dirt";
19 var tShore = "alpine_shore_rocks";
20 var tWater = "polar_ice_b";
21 var tHill = "polar_ice_cracked";
23 var oBush = "gaia/flora_bush_badlands";
24 var oBush2 = "gaia/flora_bush_temperate";
25 var oBerryBush = "gaia/flora_bush_berry";
26 var oRabbit = "gaia/fauna_rabbit";
27 var oMuskox = "gaia/fauna_muskox";
28 var oDeer = "gaia/fauna_deer";
29 var oWolf = "gaia/fauna_wolf";
30 var oWhaleFin = "gaia/fauna_whale_fin";
31 var oWhaleHumpback = "gaia/fauna_whale_humpback";
32 var oFish = "gaia/fauna_fish";
33 var oStoneLarge = "gaia/geology_stonemine_alpine_quarry";
34 var oStoneSmall = "gaia/geology_stone_alpine_a";
35 var oMetalLarge = "gaia/geology_metal_alpine_slabs";
36 var oWoodTreasure = "gaia/treasure/wood";
38 var aRockLarge = "actor|geology/stone_granite_med.xml";
39 var aRockMedium = "actor|geology/stone_granite_med.xml";
41 const pForest = [tForestFloor + TERRAIN_SEPARATOR + oBush, tForestFloor + TERRAIN_SEPARATOR + oBush2, tForestFloor];
43 var heightSeaGround = -5;
46 var g_Map = new RandomMap(heightLand, tPrimary);
48 const numPlayers = getNumPlayers();
50 var clPlayer = g_Map.createTileClass();
51 var clHill = g_Map.createTileClass();
52 var clForest = g_Map.createTileClass();
53 var clWater = g_Map.createTileClass();
54 var clDirt = g_Map.createTileClass();
55 var clRock = g_Map.createTileClass();
56 var clMetal = g_Map.createTileClass();
57 var clFood = g_Map.createTileClass();
58 var clBaseResource = g_Map.createTileClass();
61 "PlayerPlacement": playerPlacementCircle(fractionToTiles(0.35)),
62 "PlayerTileClass": clPlayer,
63 "BaseResourceClass": clBaseResource,
65 "outerTerrain": tPrimary,
66 "innerTerrain": tSecondary
72 "template": oBerryBush
76 { "template": oMetalLarge },
77 { "template": oStoneLarge }
83 "template": oWoodTreasure,
95 Engine.SetProgress(20);
98 [tPrimary, tCliff, tHill],
105 scaleByMapSize(1, 240));
107 Engine.SetProgress(30);
109 g_Map.log("Creating lakes");
113 Math.floor(scaleByMapSize(4, 8)),
114 Math.floor(scaleByMapSize(40, 180)),
117 new LayeredPainter([tShore, tWater], [1]),
118 new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 5),
119 new TileClassPainter(clWater)
121 avoidClasses(clPlayer, 15),
122 scaleByMapSize(1, 20));
124 Engine.SetProgress(45);
126 createBumps(avoidClasses(clPlayer, 6, clWater, 2), scaleByMapSize(30, 300), 1, 8, 4, 0, 3);
128 paintTerrainBasedOnHeight(4, 15, 0, tCliff);
129 paintTerrainBasedOnHeight(15, 100, 3, tSnowLimited);
131 var [forestTrees, stragglerTrees] = getTreeCounts(500, 3000, 0.7);
133 [tSecondary, tForestFloor, tForestFloor, pForest, pForest],
141 Engine.SetProgress(60);
143 g_Map.log("Creating dirt patches");
144 createLayeredPatches(
145 [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8, 21)],
146 [[tDirt,tHalfSnow], [tHalfSnow,tSnowLimited]],
154 scaleByMapSize(15, 45),
157 g_Map.log("Creating shrubs");
159 [scaleByMapSize(2, 4), scaleByMapSize(3, 7), scaleByMapSize(5, 15)],
167 scaleByMapSize(15, 45),
170 g_Map.log("Creating grass patches");
172 [scaleByMapSize(2, 4), scaleByMapSize(3, 7), scaleByMapSize(5, 15)],
180 scaleByMapSize(15, 45),
182 Engine.SetProgress(65);
184 g_Map.log("Creating stone mines");
187 [new SimpleObject(oStoneSmall, 0, 2, 0, 4, 0, 2 * Math.PI, 1), new SimpleObject(oStoneLarge, 1, 1, 0, 4, 0, 2 * Math.PI, 4)],
188 [new SimpleObject(oStoneSmall, 2, 5, 1, 3)]
198 g_Map.log("Creating metal mines");
201 [new SimpleObject(oMetalLarge, 1, 1, 0, 4)]
211 Engine.SetProgress(70);
216 new SimpleObject(aRockMedium, 1, 3, 0, 1)
219 new SimpleObject(aRockLarge, 1, 2, 0, 1),
220 new SimpleObject(aRockMedium, 1, 3, 0, 1)
224 scaleByMapSize(16, 262),
225 scaleByMapSize(8, 131),
232 Engine.SetProgress(75);
236 [new SimpleObject(oWolf, 3, 5, 0, 3)],
237 [new SimpleObject(oRabbit, 6, 8, 0, 6)],
238 [new SimpleObject(oDeer, 3, 4, 0, 3)],
239 [new SimpleObject(oMuskox, 3, 4, 0, 3)]
255 [new SimpleObject(oWhaleFin, 1, 1, 0, 3)],
256 [new SimpleObject(oWhaleHumpback, 1, 1, 0, 3)]
263 avoidClasses(clFood, 20),
264 stayClasses(clWater, 6)
270 [new SimpleObject(oBerryBush, 5, 7, 0, 4)]
273 randIntInclusive(1, 4) * numPlayers + 2
285 [new SimpleObject(oFish, 2, 3, 0, 2)]
291 avoidClasses(clFood, 20),
292 stayClasses(clWater, 6)
296 Engine.SetProgress(85);
298 createStragglerTrees(
310 placePlayersNomad(clPlayer, avoidClasses(clForest, 1, clWater, 4, clMetal, 4, clRock, 4, clHill, 4, clFood, 2));
312 setSkySet("sunset 1");
313 setSunRotation(randomAngle());
314 setSunColor(0.8, 0.7, 0.6);
315 setTerrainAmbientColor(0.7, 0.6, 0.7);
316 setUnitsAmbientColor(0.6, 0.5, 0.6);
317 setSunElevation(Math.PI * randFloat(1/12, 1/7));
318 setWaterColor(0, 0.047, 0.286);
319 setWaterTint(0.462, 0.756, 0.866);
320 setWaterMurkiness(0.92);
322 setWaterType("clap");