1 Engine.LoadLibrary("rmgen");
3 const tGrass1 = "savanna_grass_a";
4 const tDirt1 = "savanna_dirt_a";
5 const tDirt4 = "savanna_dirt_b";
6 const tCityTiles = "savanna_tile_a_dirt_red";
7 const tShore = "savanna_riparian_bank";
8 const tWater = "savanna_riparian_wet";
10 const oTree = "gaia/flora_tree_palm_tropic";
11 const oBerryBush = "gaia/flora_bush_berry";
12 const oRabbit = "gaia/fauna_rabbit";
13 const oTiger = "gaia/fauna_tiger";
14 const oCrocodile = "gaia/fauna_crocodile";
15 const oFish = "gaia/fauna_fish";
16 const oElephant = "gaia/fauna_elephant_asian";
17 const oElephantInfant = "gaia/fauna_elephant_asian_infant";
18 const oBoar = "gaia/fauna_boar";
19 const oStoneSmall = "gaia/geology_stone_savanna_small";
20 const oMetalLarge = "gaia/geology_metal_savanna_slabs";
22 const aBush = "actor|props/flora/bush_medit_sm_dry.xml";
23 const aRock = "actor|geology/stone_savanna_med.xml";
27 var numPlayers = getNumPlayers();
28 var mapSize = getMapSize();
30 var clPlayer = createTileClass();
31 var clForest = createTileClass();
32 var clWater = createTileClass();
33 var clRock = createTileClass();
34 var clMetal = createTileClass();
35 var clFood = createTileClass();
36 var clBaseResource = createTileClass();
39 "PlayerPlacement": playerPlacementCircle(0.35),
40 "PlayerTileClass": clPlayer,
41 "BaseResourceClass": clBaseResource,
46 "template": oBerryBush
51 "template": oMetalLarge
54 "type": "stone_formation",
55 "template": oStoneSmall,
62 "count": scaleByMapSize(3, 7),
70 Engine.SetProgress(20);
72 log("Creating bumps...");
74 new ClumpPlacer(scaleByMapSize(20, 50), 0.5, 0.08, 1),
75 new SmoothElevationPainter(ELEVATION_MODIFY, 2, 2),
76 avoidClasses(clPlayer, 13),
77 scaleByMapSize(300, 800)
80 log("Creating the half dried-up lake...");
84 Math.floor(scaleByMapSize(2, 16)),
85 Math.floor(scaleByMapSize(35, 200)),
87 Math.round(fractionToTiles(0.5)),
88 Math.round(fractionToTiles(0.5)),
90 [Math.floor(mapSize * 0.008 * Math.pow(scaleByMapSize(1, 66), 1/8))]),
92 new SmoothElevationPainter(ELEVATION_SET, -3, 4),
95 avoidClasses(clPlayer, 20));
97 log("Creating more shore jaggedness...");
99 new ChainPlacer(2, Math.floor(scaleByMapSize(4, 6)), 3, 1),
101 new SmoothElevationPainter(ELEVATION_SET, 3, 4),
102 unPaintClass(clWater)
104 borderClasses(clWater, 4, 7),
105 scaleByMapSize(12, 130) * 2, 150
108 paintTerrainBasedOnHeight(2.4, 3.4, 3, tGrass1);
109 paintTerrainBasedOnHeight(1, 2.4, 0, tShore);
110 paintTerrainBasedOnHeight(-8, 1, 2, tWater);
111 paintTileClassBasedOnHeight(-6, 0, 1, clWater);
112 Engine.SetProgress(55);
114 var playerConstraint = new AvoidTileClassConstraint(clPlayer, 30);
115 var minesConstraint = new AvoidTileClassConstraint(clRock, 25);
116 var waterConstraint = new AvoidTileClassConstraint(clWater, 10);
118 log("Creating stone mines...");
119 for (let i = 0; i < scaleByMapSize(12, 30); ++i)
121 let mX = randIntInclusive(1, mapSize - 1);
122 let mZ = randIntInclusive(1, mapSize - 1);
123 if (playerConstraint.allows(mX, mZ) && minesConstraint.allows(mX, mZ) && waterConstraint.allows(mX, mZ))
125 createStoneMineFormation(mX, mZ, oStoneSmall, tDirt4);
126 addToClass(mX, mZ, clRock);
130 log("Creating metal mines...");
131 createObjectGroupsDeprecated(
132 new SimpleGroup([new SimpleObject(oMetalLarge, 1, 1, 0, 4)], true, clMetal),
134 avoidClasses(clPlayer, 20, clMetal, 10, clRock, 8, clWater, 4),
135 scaleByMapSize(2, 12), 100
137 Engine.SetProgress(65);
139 log("Creating small decorative rocks...");
140 createObjectGroupsDeprecated(
142 [new SimpleObject(aRock, 1, 3, 0, 3)],
146 avoidClasses(clPlayer, 7, clWater, 1),
147 scaleByMapSize(200, 1200), 1
149 Engine.SetProgress(70);
151 log("Creating boar...");
152 createObjectGroupsDeprecated(
154 [new SimpleObject(oBoar, 1, 2, 0, 4)],
158 avoidClasses(clWater, 1, clPlayer, 20, clFood, 11),
159 scaleByMapSize(4, 12), 50
162 log("Creating tigers...");
163 createObjectGroupsDeprecated(
165 [new SimpleObject(oTiger, 2, 2, 0, 4)],
169 avoidClasses(clWater, 1, clPlayer, 20, clFood, 11),
170 scaleByMapSize(4, 12), 50
173 log("Creating crocodiles...");
174 createObjectGroupsDeprecated(
176 [new SimpleObject(oCrocodile, 2, 4, 0, 4)],
179 stayClasses(clWater, 1),
180 scaleByMapSize(4, 12), 50
183 log("Creating elephants...");
184 createObjectGroupsDeprecated(
187 new SimpleObject(oElephant, 2, 4, 0, 4),
188 new SimpleObject(oElephantInfant, 1, 2, 0, 4)
193 avoidClasses(clWater, 1, clPlayer, 20, clFood, 11),
194 scaleByMapSize(4, 12), 50
197 log("Creating rabbits...");
198 createObjectGroupsDeprecated(
200 [new SimpleObject(oRabbit, 5, 6, 0, 4)],
204 avoidClasses(clWater, 1, clPlayer, 20, clFood, 11),
205 scaleByMapSize(4, 12), 50
210 [new SimpleObject(oFish, 2, 3, 0, 2)]
215 [avoidClasses(clFood, 20), stayClasses(clWater, 2)],
218 log("Creating berry bush...");
219 createObjectGroupsDeprecated(
221 [new SimpleObject(oBerryBush, 5, 7, 0, 4)],
225 avoidClasses(clWater, 3, clPlayer, 20, clFood, 12, clRock, 7, clMetal, 2),
226 randIntInclusive(1, 4) * numPlayers + 2, 50
228 Engine.SetProgress(85);
230 log("Creating trees...");
231 createObjectGroupsDeprecated(
233 [new SimpleObject(oTree, 1, 7, 0, 3)],
237 avoidClasses(clForest, 1, clPlayer, 20, clMetal, 1, clRock, 7, clWater, 1),
238 scaleByMapSize(70, 500)
241 log("Creating large grass tufts...");
242 createObjectGroupsDeprecated(
244 [new SimpleObject(aBush, 2, 4, 0, 1.8, -Math.PI/8, Math.PI/8)]
247 avoidClasses(clWater, 3, clPlayer, 2, clForest, 0),
248 scaleByMapSize(100, 1200)
251 placePlayersNomad(clPlayer, avoidClasses(clWater, 4, clForest, 1, clMetal, 4, clRock, 4, clFood, 2));
253 setSunColor(0.87451, 0.847059, 0.647059);
254 setWaterColor(0.741176, 0.592157, 0.27451);
255 setWaterTint(0.741176, 0.592157, 0.27451);
256 setWaterWaviness(2.0);
257 setWaterType("clap");
258 setWaterMurkiness(0.835938);
260 setUnitsAmbientColor(0.57, 0.58, 0.55);
261 setTerrainAmbientColor(0.447059, 0.509804, 0.54902);
264 setFogThickness(0.15);
265 setFogColor(0.847059, 0.737255, 0.482353);
268 setPPContrast(0.57031);