Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/maps/random/unknown.js
Show First 20 Lines • Show All 143 Lines • ▼ Show 20 Lines | if (mdd1 == 1) //archipelago | ||||
// create islands | // create islands | ||||
log("Creating islands..."); | log("Creating islands..."); | ||||
placer = new ClumpPlacer(floor(hillSize*randFloat(0.8,1.2)), 0.80, 0.1, 10); | placer = new ClumpPlacer(floor(hillSize*randFloat(0.8,1.2)), 0.80, 0.1, 10); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tMainTerrain, tMainTerrain], // terrains | [tMainTerrain, tMainTerrain], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 4); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 4); | ||||
createAreas( | createAreasDeprecated( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, paintClass(clLand)], | [terrainPainter, elevationPainter, paintClass(clLand)], | ||||
null, | null, | ||||
scaleByMapSize(2, 5)*randInt(8,14) | scaleByMapSize(2, 5)*randInt(8,14) | ||||
); | ); | ||||
// create shore jaggedness | // create shore jaggedness | ||||
log("Creating shore jaggedness..."); | log("Creating shore jaggedness..."); | ||||
placer = new ClumpPlacer(scaleByMapSize(15, 80), 0.2, 0.1, 1); | placer = new ClumpPlacer(scaleByMapSize(15, 80), 0.2, 0.1, 1); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tCliff, tHill], // terrains | [tCliff, tHill], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 4); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 4); | ||||
createAreas( | createAreasDeprecated( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, paintClass(clLand)], | [terrainPainter, elevationPainter, paintClass(clLand)], | ||||
borderClasses(clLand, 6, 3), | borderClasses(clLand, 6, 3), | ||||
scaleByMapSize(12, 130) * 2, 150 | scaleByMapSize(12, 130) * 2, 150 | ||||
); | ); | ||||
} | } | ||||
else if (mdd1 == 2) //islands | else if (mdd1 == 2) //islands | ||||
{ | { | ||||
// create islands | // create islands | ||||
log("Creating islands..."); | log("Creating islands..."); | ||||
placer = new ClumpPlacer(floor(hillSize*randFloat(0.6,1.4)), 0.80, 0.1, randFloat(0.0, 0.2)); | placer = new ClumpPlacer(floor(hillSize*randFloat(0.6,1.4)), 0.80, 0.1, randFloat(0.0, 0.2)); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tMainTerrain, tMainTerrain], // terrains | [tMainTerrain, tMainTerrain], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 4); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 4); | ||||
createAreas( | createAreasDeprecated( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, paintClass(clLand)], | [terrainPainter, elevationPainter, paintClass(clLand)], | ||||
avoidClasses(clLand, 3, clPlayer, 3), | avoidClasses(clLand, 3, clPlayer, 3), | ||||
scaleByMapSize(6, 10)*randInt(8,14) | scaleByMapSize(6, 10)*randInt(8,14) | ||||
); | ); | ||||
// create small islands | // create small islands | ||||
log("Creating small islands..."); | log("Creating small islands..."); | ||||
placer = new ClumpPlacer(floor(hillSize*randFloat(0.3,0.7)), 0.80, 0.1, 0.07); | placer = new ClumpPlacer(floor(hillSize*randFloat(0.3,0.7)), 0.80, 0.1, 0.07); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tMainTerrain, tMainTerrain], // terrains | [tMainTerrain, tMainTerrain], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 6); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 6); | ||||
createAreas( | createAreasDeprecated( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, paintClass(clLand)], | [terrainPainter, elevationPainter, paintClass(clLand)], | ||||
avoidClasses(clLand, 3, clPlayer, 3), | avoidClasses(clLand, 3, clPlayer, 3), | ||||
scaleByMapSize(2, 6)*randInt(6,15), 25 | scaleByMapSize(2, 6)*randInt(6,15), 25 | ||||
); | ); | ||||
} | } | ||||
else if (mdd1 == 3) // tight islands | else if (mdd1 == 3) // tight islands | ||||
{ | { | ||||
// create islands | // create islands | ||||
log("Creating islands..."); | log("Creating islands..."); | ||||
placer = new ClumpPlacer(floor(hillSize*randFloat(0.8,1.2)), 0.80, 0.1, 10); | placer = new ClumpPlacer(floor(hillSize*randFloat(0.8,1.2)), 0.80, 0.1, 10); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tMainTerrain, tMainTerrain], // terrains | [tMainTerrain, tMainTerrain], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 4); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 4); | ||||
createAreas( | createAreasDeprecated( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, paintClass(clLand)], | [terrainPainter, elevationPainter, paintClass(clLand)], | ||||
avoidClasses(clLand, randInt(8, 16), clPlayer, 3), | avoidClasses(clLand, randInt(8, 16), clPlayer, 3), | ||||
scaleByMapSize(2, 5)*randInt(8,14) | scaleByMapSize(2, 5)*randInt(8,14) | ||||
); | ); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | else if (md == 2) //continent | ||||
// create shore jaggedness | // create shore jaggedness | ||||
log("Creating shore jaggedness..."); | log("Creating shore jaggedness..."); | ||||
placer = new ClumpPlacer(scaleByMapSize(20, 150), 0.2, 0.1, 1); | placer = new ClumpPlacer(scaleByMapSize(20, 150), 0.2, 0.1, 1); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tCliff, tHill], // terrains | [tCliff, tHill], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, -5, 4); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, -5, 4); | ||||
createAreas( | createAreasDeprecated( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, unPaintClass(clLand)], | [terrainPainter, elevationPainter, unPaintClass(clLand)], | ||||
[avoidClasses(clPlayer, 20, clPeninsulaSteam, 20), borderClasses(clLand, 7, 7)], | [avoidClasses(clPlayer, 20, clPeninsulaSteam, 20), borderClasses(clLand, 7, 7)], | ||||
scaleByMapSize(7, 130) * 2, 150 | scaleByMapSize(7, 130) * 2, 150 | ||||
); | ); | ||||
// create outward shore jaggedness | // create outward shore jaggedness | ||||
log("Creating shore jaggedness..."); | log("Creating shore jaggedness..."); | ||||
placer = new ClumpPlacer(scaleByMapSize(20, 150), 0.2, 0.1, 1); | placer = new ClumpPlacer(scaleByMapSize(20, 150), 0.2, 0.1, 1); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tCliff, tHill], // terrains | [tCliff, tHill], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 4); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 4); | ||||
createAreas( | createAreasDeprecated( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, paintClass(clLand)], | [terrainPainter, elevationPainter, paintClass(clLand)], | ||||
[avoidClasses(clPlayer, 20), borderClasses(clLand, 7, 7)], | [avoidClasses(clPlayer, 20), borderClasses(clLand, 7, 7)], | ||||
scaleByMapSize(7, 130) * 2, 150 | scaleByMapSize(7, 130) * 2, 150 | ||||
); | ); | ||||
} | } | ||||
//******************************************************************************************************** | //******************************************************************************************************** | ||||
else if (md == 3) //central sea | else if (md == 3) //central sea | ||||
▲ Show 20 Lines • Show All 194 Lines • ▼ Show 20 Lines | if (mdd2 == 1) | ||||
// create islands | // create islands | ||||
log("Creating islands..."); | log("Creating islands..."); | ||||
placer = new ClumpPlacer(randInt(scaleByMapSize(8,15),scaleByMapSize(15,23))*randInt(scaleByMapSize(8,15),scaleByMapSize(15,23)), 0.80, 0.1, randFloat(0.0, 0.2)); | placer = new ClumpPlacer(randInt(scaleByMapSize(8,15),scaleByMapSize(15,23))*randInt(scaleByMapSize(8,15),scaleByMapSize(15,23)), 0.80, 0.1, randFloat(0.0, 0.2)); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tMainTerrain, tMainTerrain], // terrains | [tMainTerrain, tMainTerrain], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3.1, 4); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3.1, 4); | ||||
createAreas( | createAreasDeprecated( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, paintClass(clLand)], | [terrainPainter, elevationPainter, paintClass(clLand)], | ||||
avoidClasses(clLand, 3, clPlayer, 3), | avoidClasses(clLand, 3, clPlayer, 3), | ||||
scaleByMapSize(2, 5)*randInt(8,14) | scaleByMapSize(2, 5)*randInt(8,14) | ||||
); | ); | ||||
} | } | ||||
else if (mdd2 == 2) | else if (mdd2 == 2) | ||||
{ | { | ||||
// create extentions | // create extentions | ||||
log("Creating extentions..."); | log("Creating extentions..."); | ||||
placer = new ClumpPlacer(randInt(scaleByMapSize(13,24),scaleByMapSize(24,45))*randInt(scaleByMapSize(13,24),scaleByMapSize(24,45)), 0.80, 0.1, 10); | placer = new ClumpPlacer(randInt(scaleByMapSize(13,24),scaleByMapSize(24,45))*randInt(scaleByMapSize(13,24),scaleByMapSize(24,45)), 0.80, 0.1, 10); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tMainTerrain, tMainTerrain], // terrains | [tMainTerrain, tMainTerrain], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3.1, 4); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3.1, 4); | ||||
createAreas( | createAreasDeprecated( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, paintClass(clLand)], | [terrainPainter, elevationPainter, paintClass(clLand)], | ||||
null, | null, | ||||
scaleByMapSize(2, 5)*randInt(8,14) | scaleByMapSize(2, 5)*randInt(8,14) | ||||
); | ); | ||||
} | } | ||||
} | } | ||||
//******************************************************************************************************** | //******************************************************************************************************** | ||||
▲ Show 20 Lines • Show All 267 Lines • ▼ Show 20 Lines | if (mdd1 == 1) //lake | ||||
// create shore jaggedness | // create shore jaggedness | ||||
log("Creating shore jaggedness..."); | log("Creating shore jaggedness..."); | ||||
placer = new ClumpPlacer(scaleByMapSize(20, 150), 0.2, 0.1, 1); | placer = new ClumpPlacer(scaleByMapSize(20, 150), 0.2, 0.1, 1); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tCliff, tHill], // terrains | [tCliff, tHill], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, -5, 4); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, -5, 4); | ||||
createAreas( | createAreasDeprecated( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, paintClass(clWater)], | [terrainPainter, elevationPainter, paintClass(clWater)], | ||||
[avoidClasses(clPlayer, 20), borderClasses(clWater, 6, 4)], | [avoidClasses(clPlayer, 20), borderClasses(clWater, 6, 4)], | ||||
scaleByMapSize(7, 130) * 2, 150 | scaleByMapSize(7, 130) * 2, 150 | ||||
); | ); | ||||
placer = new ClumpPlacer(scaleByMapSize(15, 80), 0.2, 0.1, 1); | placer = new ClumpPlacer(scaleByMapSize(15, 80), 0.2, 0.1, 1); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tCliff, tHill], // terrains | [tCliff, tHill], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 4); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 4); | ||||
createAreas( | createAreasDeprecated( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, unPaintClass(clWater)], | [terrainPainter, elevationPainter, unPaintClass(clWater)], | ||||
borderClasses(clWater, 4, 7), | borderClasses(clWater, 4, 7), | ||||
scaleByMapSize(12, 130) * 2, 150 | scaleByMapSize(12, 130) * 2, 150 | ||||
); | ); | ||||
} | } | ||||
if (randInt(1,2) == 1) //rivers | if (randInt(1,2) == 1) //rivers | ||||
▲ Show 20 Lines • Show All 249 Lines • ▼ Show 20 Lines | else if (md == 6) //edge seas | ||||
// create shore jaggedness | // create shore jaggedness | ||||
log("Creating shore jaggedness..."); | log("Creating shore jaggedness..."); | ||||
placer = new ClumpPlacer(scaleByMapSize(20, 150), 0.2, 0.1, 1); | placer = new ClumpPlacer(scaleByMapSize(20, 150), 0.2, 0.1, 1); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tCliff, tHill], // terrains | [tCliff, tHill], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, -5, 4); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, -5, 4); | ||||
createAreas( | createAreasDeprecated( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, paintClass(clWater)], | [terrainPainter, elevationPainter, paintClass(clWater)], | ||||
[avoidClasses(clPlayer, 20), borderClasses(clWater, 6, 4)], | [avoidClasses(clPlayer, 20), borderClasses(clWater, 6, 4)], | ||||
scaleByMapSize(7, 130) * 2, 150 | scaleByMapSize(7, 130) * 2, 150 | ||||
); | ); | ||||
placer = new ClumpPlacer(scaleByMapSize(15, 80), 0.2, 0.1, 1); | placer = new ClumpPlacer(scaleByMapSize(15, 80), 0.2, 0.1, 1); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tCliff, tHill], // terrains | [tCliff, tHill], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 4); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 4); | ||||
createAreas( | createAreasDeprecated( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, unPaintClass(clWater)], | [terrainPainter, elevationPainter, unPaintClass(clWater)], | ||||
borderClasses(clWater, 4, 7), | borderClasses(clWater, 4, 7), | ||||
scaleByMapSize(12, 130) * 2, 150 | scaleByMapSize(12, 130) * 2, 150 | ||||
); | ); | ||||
var mdd3 = randInt(1,3); | var mdd3 = randInt(1,3); | ||||
if (mdd3 == 1) | if (mdd3 == 1) | ||||
{ | { | ||||
// create islands | // create islands | ||||
log("Creating islands..."); | log("Creating islands..."); | ||||
placer = new ClumpPlacer(randInt(scaleByMapSize(8,15),scaleByMapSize(15,23))*randInt(scaleByMapSize(8,15),scaleByMapSize(15,23)), 0.80, 0.1, randFloat(0.0, 0.2)); | placer = new ClumpPlacer(randInt(scaleByMapSize(8,15),scaleByMapSize(15,23))*randInt(scaleByMapSize(8,15),scaleByMapSize(15,23)), 0.80, 0.1, randFloat(0.0, 0.2)); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tMainTerrain, tMainTerrain], // terrains | [tMainTerrain, tMainTerrain], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3.1, 4); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3.1, 4); | ||||
createAreas( | createAreasDeprecated( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, paintClass(clLand)], | [terrainPainter, elevationPainter, paintClass(clLand)], | ||||
avoidClasses(clLand, 3, clPlayer, 3), | avoidClasses(clLand, 3, clPlayer, 3), | ||||
scaleByMapSize(2, 5)*randInt(8,14) | scaleByMapSize(2, 5)*randInt(8,14) | ||||
); | ); | ||||
} | } | ||||
else if (mdd3 == 2) | else if (mdd3 == 2) | ||||
{ | { | ||||
// create extentions | // create extentions | ||||
log("Creating extentions..."); | log("Creating extentions..."); | ||||
placer = new ClumpPlacer(randInt(scaleByMapSize(13,24),scaleByMapSize(24,45))*randInt(scaleByMapSize(13,24),scaleByMapSize(24,45)), 0.80, 0.1, 10); | placer = new ClumpPlacer(randInt(scaleByMapSize(13,24),scaleByMapSize(24,45))*randInt(scaleByMapSize(13,24),scaleByMapSize(24,45)), 0.80, 0.1, 10); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tMainTerrain, tMainTerrain], // terrains | [tMainTerrain, tMainTerrain], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3.1, 4); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3.1, 4); | ||||
createAreas( | createAreasDeprecated( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, paintClass(clLand)], | [terrainPainter, elevationPainter, paintClass(clLand)], | ||||
null, | null, | ||||
scaleByMapSize(2, 5)*randInt(8,14) | scaleByMapSize(2, 5)*randInt(8,14) | ||||
); | ); | ||||
} | } | ||||
} | } | ||||
//******************************************************************************************************** | //******************************************************************************************************** | ||||
▲ Show 20 Lines • Show All 157 Lines • ▼ Show 20 Lines | else if (md == 8) //lakes | ||||
placer = new ClumpPlacer(scaleByMapSize(160, 700), 0.2, 0.1, 1); | placer = new ClumpPlacer(scaleByMapSize(160, 700), 0.2, 0.1, 1); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tShore, tWater, tWater], // terrains | [tShore, tWater, tWater], // terrains | ||||
[1, 3] // widths | [1, 3] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, -5, 5); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, -5, 5); | ||||
if (randInt(1,2) == 1) | if (randInt(1,2) == 1) | ||||
{ | { | ||||
createAreas( | createAreasDeprecated( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, paintClass(clWater)], | [terrainPainter, elevationPainter, paintClass(clWater)], | ||||
avoidClasses(clPlayer, 12, clWater, 8), | avoidClasses(clPlayer, 12, clWater, 8), | ||||
scaleByMapSize(5, 16) | scaleByMapSize(5, 16) | ||||
); | ); | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
createAreas( | createAreasDeprecated( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, paintClass(clWater)], | [terrainPainter, elevationPainter, paintClass(clWater)], | ||||
avoidClasses(clPlayer, 12), | avoidClasses(clPlayer, 12), | ||||
scaleByMapSize(5, 16) | scaleByMapSize(5, 16) | ||||
); | ); | ||||
} | } | ||||
} | } | ||||
//******************************************************************************************************** | //******************************************************************************************************** | ||||
▲ Show 20 Lines • Show All 372 Lines • ▼ Show 20 Lines | for (var i = 0; i < numPlayers; i++) | ||||
var painter = new LayeredPainter([tRoadWild, tRoad], [1]); | var painter = new LayeredPainter([tRoadWild, tRoad], [1]); | ||||
createArea(placer, [painter, paintClass(clPlayer)], null); | createArea(placer, [painter, paintClass(clPlayer)], null); | ||||
} | } | ||||
// create bumps | // create bumps | ||||
log("Creating bumps..."); | log("Creating bumps..."); | ||||
placer = new ClumpPlacer(scaleByMapSize(20, 50), 0.3, 0.06, 1); | placer = new ClumpPlacer(scaleByMapSize(20, 50), 0.3, 0.06, 1); | ||||
painter = new SmoothElevationPainter(ELEVATION_MODIFY, 2, 2); | painter = new SmoothElevationPainter(ELEVATION_MODIFY, 2, 2); | ||||
createAreas( | createAreasDeprecated( | ||||
placer, | placer, | ||||
painter, | painter, | ||||
[avoidClasses(clWater, 2, clPlayer, 10), stayClasses(clLand, 3)], | [avoidClasses(clWater, 2, clPlayer, 10), stayClasses(clLand, 3)], | ||||
randInt(0,scaleByMapSize(200, 400)) | randInt(0,scaleByMapSize(200, 400)) | ||||
); | ); | ||||
// create hills | // create hills | ||||
log("Creating hills..."); | log("Creating hills..."); | ||||
placer = new ClumpPlacer(scaleByMapSize(20, 150), 0.2, 0.1, 1); | placer = new ClumpPlacer(scaleByMapSize(20, 150), 0.2, 0.1, 1); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tCliff, tHill], // terrains | [tCliff, tHill], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 18, 2); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 18, 2); | ||||
createAreas( | createAreasDeprecated( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, paintClass(clHill)], | [terrainPainter, elevationPainter, paintClass(clHill)], | ||||
[avoidClasses(clPlayer, 20, clHill, randInt(6, 18)), stayClasses(clLand, 0)], | [avoidClasses(clPlayer, 20, clHill, randInt(6, 18)), stayClasses(clLand, 0)], | ||||
randInt(0, scaleByMapSize(4, 8))*randInt(1, scaleByMapSize(4, 9)) | randInt(0, scaleByMapSize(4, 8))*randInt(1, scaleByMapSize(4, 9)) | ||||
); | ); | ||||
var multiplier = sqrt(randFloat(0.5,1.2)*randFloat(0.5,1.2)); | var multiplier = sqrt(randFloat(0.5,1.2)*randFloat(0.5,1.2)); | ||||
// calculate desired number of trees for map (based on size) | // calculate desired number of trees for map (based on size) | ||||
Show All 34 Lines | |||||
var num = floor(size / types.length); | var num = floor(size / types.length); | ||||
for (var i = 0; i < types.length; ++i) | for (var i = 0; i < types.length; ++i) | ||||
{ | { | ||||
placer = new ClumpPlacer(numForest / num, 0.1, 0.1, 1); | placer = new ClumpPlacer(numForest / num, 0.1, 0.1, 1); | ||||
painter = new LayeredPainter( | painter = new LayeredPainter( | ||||
types[i], // terrains | types[i], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
createAreas( | createAreasDeprecated( | ||||
placer, | placer, | ||||
[painter, paintClass(clForest)], | [painter, paintClass(clForest)], | ||||
[avoidClasses(clPlayer, 20, clForest, randInt(5, 15), clHill, 0), stayClasses(clLand, 4)], | [avoidClasses(clPlayer, 20, clForest, randInt(5, 15), clHill, 0), stayClasses(clLand, 4)], | ||||
num | num | ||||
); | ); | ||||
} | } | ||||
RMS.SetProgress(50); | RMS.SetProgress(50); | ||||
// create dirt patches | // create dirt patches | ||||
log("Creating dirt patches..."); | log("Creating dirt patches..."); | ||||
var sizes = [scaleByMapSize(3, 48), scaleByMapSize(5, 84), scaleByMapSize(8, 128)]; | var sizes = [scaleByMapSize(3, 48), scaleByMapSize(5, 84), scaleByMapSize(8, 128)]; | ||||
var numb = 1; | var numb = 1; | ||||
if (random_terrain == g_BiomeSavanna) | if (random_terrain == g_BiomeSavanna) | ||||
numb = 3; | numb = 3; | ||||
for (var i = 0; i < sizes.length; i++) | for (var i = 0; i < sizes.length; i++) | ||||
{ | { | ||||
placer = new ClumpPlacer(sizes[i], 0.3, 0.06, 0.5); | placer = new ClumpPlacer(sizes[i], 0.3, 0.06, 0.5); | ||||
painter = new LayeredPainter( | painter = new LayeredPainter( | ||||
[[tMainTerrain,tTier1Terrain],[tTier1Terrain,tTier2Terrain], [tTier2Terrain,tTier3Terrain]], // terrains | [[tMainTerrain,tTier1Terrain],[tTier1Terrain,tTier2Terrain], [tTier2Terrain,tTier3Terrain]], // terrains | ||||
[1,1] // widths | [1,1] // widths | ||||
); | ); | ||||
createAreas( | createAreasDeprecated( | ||||
placer, | placer, | ||||
[painter, paintClass(clDirt)], | [painter, paintClass(clDirt)], | ||||
[avoidClasses(clForest, 0, clHill, 0, clDirt, 5, clPlayer, 7), stayClasses(clLand, 4)], | [avoidClasses(clForest, 0, clHill, 0, clDirt, 5, clPlayer, 7), stayClasses(clLand, 4)], | ||||
numb*scaleByMapSize(15, 45) | numb*scaleByMapSize(15, 45) | ||||
); | ); | ||||
} | } | ||||
// create grass patches | // create grass patches | ||||
log("Creating grass patches..."); | log("Creating grass patches..."); | ||||
var sizes = [scaleByMapSize(2, 32), scaleByMapSize(3, 48), scaleByMapSize(5, 80)]; | var sizes = [scaleByMapSize(2, 32), scaleByMapSize(3, 48), scaleByMapSize(5, 80)]; | ||||
for (var i = 0; i < sizes.length; i++) | for (var i = 0; i < sizes.length; i++) | ||||
{ | { | ||||
placer = new ClumpPlacer(sizes[i], 0.3, 0.06, 0.5); | placer = new ClumpPlacer(sizes[i], 0.3, 0.06, 0.5); | ||||
painter = new TerrainPainter(tTier4Terrain); | painter = new TerrainPainter(tTier4Terrain); | ||||
createAreas( | createAreasDeprecated( | ||||
placer, | placer, | ||||
painter, | painter, | ||||
[avoidClasses(clForest, 0, clHill, 0, clDirt, 5, clPlayer, 7), stayClasses(clLand, 4)], | [avoidClasses(clForest, 0, clHill, 0, clDirt, 5, clPlayer, 7), stayClasses(clLand, 4)], | ||||
numb*scaleByMapSize(15, 45) | numb*scaleByMapSize(15, 45) | ||||
); | ); | ||||
} | } | ||||
RMS.SetProgress(55); | RMS.SetProgress(55); | ||||
log("Creating stone mines..."); | log("Creating stone mines..."); | ||||
// create large stone quarries | // create large stone quarries | ||||
group = new SimpleGroup([new SimpleObject(oStoneSmall, 0,2, 0,4), new SimpleObject(oStoneLarge, 1,1, 0,4)], true, clRock); | group = new SimpleGroup([new SimpleObject(oStoneSmall, 0,2, 0,4), new SimpleObject(oStoneLarge, 1,1, 0,4)], true, clRock); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
[avoidClasses(clForest, 1, clPlayer, 20, clRock, 10, clHill, 1), stayClasses(clLand, 4)], | [avoidClasses(clForest, 1, clPlayer, 20, clRock, 10, clHill, 1), stayClasses(clLand, 4)], | ||||
randInt(scaleByMapSize(2,9),scaleByMapSize(9,40)), 100 | randInt(scaleByMapSize(2,9),scaleByMapSize(9,40)), 100 | ||||
); | ); | ||||
// create small stone quarries | // create small stone quarries | ||||
group = new SimpleGroup([new SimpleObject(oStoneSmall, 2,5, 1,3)], true, clRock); | group = new SimpleGroup([new SimpleObject(oStoneSmall, 2,5, 1,3)], true, clRock); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
[avoidClasses(clForest, 1, clPlayer, 20, clRock, 10, clHill, 1), stayClasses(clLand, 4)], | [avoidClasses(clForest, 1, clPlayer, 20, clRock, 10, clHill, 1), stayClasses(clLand, 4)], | ||||
randInt(scaleByMapSize(2,9),scaleByMapSize(9,40)), 100 | randInt(scaleByMapSize(2,9),scaleByMapSize(9,40)), 100 | ||||
); | ); | ||||
log("Creating metal mines..."); | log("Creating metal mines..."); | ||||
// create large metal quarries | // create large metal quarries | ||||
group = new SimpleGroup([new SimpleObject(oMetalLarge, 1,1, 0,4)], true, clMetal); | group = new SimpleGroup([new SimpleObject(oMetalLarge, 1,1, 0,4)], true, clMetal); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
[avoidClasses(clForest, 1, clPlayer, 20, clMetal, 10, clRock, 5, clHill, 1), stayClasses(clLand, 4)], | [avoidClasses(clForest, 1, clPlayer, 20, clMetal, 10, clRock, 5, clHill, 1), stayClasses(clLand, 4)], | ||||
randInt(scaleByMapSize(2,9),scaleByMapSize(9,40)), 100 | randInt(scaleByMapSize(2,9),scaleByMapSize(9,40)), 100 | ||||
); | ); | ||||
RMS.SetProgress(65); | RMS.SetProgress(65); | ||||
// create small decorative rocks | // create small decorative rocks | ||||
log("Creating small decorative rocks..."); | log("Creating small decorative rocks..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(aRockMedium, 1,3, 0,1)], | [new SimpleObject(aRockMedium, 1,3, 0,1)], | ||||
true | true | ||||
); | ); | ||||
createObjectGroups( | createObjectGroupsDeprecated( | ||||
group, 0, | group, 0, | ||||
[avoidClasses(clWater, 0, clForest, 0, clPlayer, 0, clHill, 0), stayClasses(clLand, 4)], | [avoidClasses(clWater, 0, clForest, 0, clPlayer, 0, clHill, 0), stayClasses(clLand, 4)], | ||||
scaleByMapSize(16, 262), 50 | scaleByMapSize(16, 262), 50 | ||||
); | ); | ||||
// create large decorative rocks | // create large decorative rocks | ||||
log("Creating large decorative rocks..."); | log("Creating large decorative rocks..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(aRockLarge, 1,2, 0,1), new SimpleObject(aRockMedium, 1,3, 0,2)], | [new SimpleObject(aRockLarge, 1,2, 0,1), new SimpleObject(aRockMedium, 1,3, 0,2)], | ||||
true | true | ||||
); | ); | ||||
createObjectGroups( | createObjectGroupsDeprecated( | ||||
group, 0, | group, 0, | ||||
[avoidClasses(clWater, 0, clForest, 0, clPlayer, 0, clHill, 0), stayClasses(clLand, 4)], | [avoidClasses(clWater, 0, clForest, 0, clPlayer, 0, clHill, 0), stayClasses(clLand, 4)], | ||||
scaleByMapSize(8, 131), 50 | scaleByMapSize(8, 131), 50 | ||||
); | ); | ||||
RMS.SetProgress(70); | RMS.SetProgress(70); | ||||
// create deer | // create deer | ||||
log("Creating deer..."); | log("Creating deer..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(oMainHuntableAnimal, 5,7, 0,4)], | [new SimpleObject(oMainHuntableAnimal, 5,7, 0,4)], | ||||
true, clFood | true, clFood | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
[avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 20), stayClasses(clLand, 4)], | [avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 20), stayClasses(clLand, 4)], | ||||
randInt(numPlayers+3, 5*numPlayers+4), 50 | randInt(numPlayers+3, 5*numPlayers+4), 50 | ||||
); | ); | ||||
// create berry bush | // create berry bush | ||||
log("Creating berry bush..."); | log("Creating berry bush..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(oFruitBush, 5,7, 0,4)], | [new SimpleObject(oFruitBush, 5,7, 0,4)], | ||||
true, clFood | true, clFood | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
[avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 20), stayClasses(clLand, 4)], | [avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 20), stayClasses(clLand, 4)], | ||||
randInt(1, 4) * numPlayers + 2, 50 | randInt(1, 4) * numPlayers + 2, 50 | ||||
); | ); | ||||
RMS.SetProgress(75); | RMS.SetProgress(75); | ||||
// create sheep | // create sheep | ||||
log("Creating sheep..."); | log("Creating sheep..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(oSecondaryHuntableAnimal, 2,3, 0,2)], | [new SimpleObject(oSecondaryHuntableAnimal, 2,3, 0,2)], | ||||
true, clFood | true, clFood | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
[avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 20), stayClasses(clLand, 4)], | [avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 20), stayClasses(clLand, 4)], | ||||
randInt(numPlayers+3, 5*numPlayers+4), 50 | randInt(numPlayers+3, 5*numPlayers+4), 50 | ||||
); | ); | ||||
// create fish | // create fish | ||||
log("Creating fish..."); | log("Creating fish..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(oFish, 2,3, 0,2)], | [new SimpleObject(oFish, 2,3, 0,2)], | ||||
true, clFood | true, clFood | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
avoidClasses(clLand, 5, clForest, 0, clPlayer, 0, clHill, 0, clFood, 20), | avoidClasses(clLand, 5, clForest, 0, clPlayer, 0, clHill, 0, clFood, 20), | ||||
randInt(15, 40) * numPlayers, 60 | randInt(15, 40) * numPlayers, 60 | ||||
); | ); | ||||
RMS.SetProgress(85); | RMS.SetProgress(85); | ||||
// create straggler trees | // create straggler trees | ||||
log("Creating straggler trees..."); | log("Creating straggler trees..."); | ||||
var types = [oTree1, oTree2, oTree4, oTree3]; // some variation | var types = [oTree1, oTree2, oTree4, oTree3]; // some variation | ||||
var num = floor(numStragglers / types.length); | var num = floor(numStragglers / types.length); | ||||
for (var i = 0; i < types.length; ++i) | for (var i = 0; i < types.length; ++i) | ||||
{ | { | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(types[i], 1,1, 0,3)], | [new SimpleObject(types[i], 1,1, 0,3)], | ||||
true, clForest | true, clForest | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
[avoidClasses(clWater, 1, clForest, 1, clHill, 1, clPlayer, 0, clMetal, 6, clRock, 6), stayClasses(clLand, 4)], | [avoidClasses(clWater, 1, clForest, 1, clHill, 1, clPlayer, 0, clMetal, 6, clRock, 6), stayClasses(clLand, 4)], | ||||
num | num | ||||
); | ); | ||||
} | } | ||||
var planetm = 1; | var planetm = 1; | ||||
if (random_terrain == g_BiomeTropic) | if (random_terrain == g_BiomeTropic) | ||||
planetm = 8; | planetm = 8; | ||||
//create small grass tufts | //create small grass tufts | ||||
log("Creating small grass tufts..."); | log("Creating small grass tufts..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(aGrassShort, 1,2, 0,1, -PI/8,PI/8)] | [new SimpleObject(aGrassShort, 1,2, 0,1, -PI/8,PI/8)] | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
[avoidClasses(clWater, 2, clHill, 2, clPlayer, 2, clDirt, 0), stayClasses(clLand, 4)], | [avoidClasses(clWater, 2, clHill, 2, clPlayer, 2, clDirt, 0), stayClasses(clLand, 4)], | ||||
planetm * scaleByMapSize(13, 200) | planetm * scaleByMapSize(13, 200) | ||||
); | ); | ||||
RMS.SetProgress(90); | RMS.SetProgress(90); | ||||
// create large grass tufts | // create large grass tufts | ||||
log("Creating large grass tufts..."); | log("Creating large grass tufts..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[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)] | [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)] | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
[avoidClasses(clWater, 3, clHill, 2, clPlayer, 2, clDirt, 1, clForest, 0), stayClasses(clLand, 4)], | [avoidClasses(clWater, 3, clHill, 2, clPlayer, 2, clDirt, 1, clForest, 0), stayClasses(clLand, 4)], | ||||
planetm * scaleByMapSize(13, 200) | planetm * scaleByMapSize(13, 200) | ||||
); | ); | ||||
RMS.SetProgress(95); | RMS.SetProgress(95); | ||||
// create shallow flora | // create shallow flora | ||||
log("Creating shallow flora..."); | log("Creating shallow flora..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(aLillies, 1,2, 0,2), new SimpleObject(aReeds, 2,4, 0,2)] | [new SimpleObject(aLillies, 1,2, 0,2), new SimpleObject(aReeds, 2,4, 0,2)] | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
stayClasses(clShallow, 1), | stayClasses(clShallow, 1), | ||||
60 * scaleByMapSize(13, 200), 80 | 60 * scaleByMapSize(13, 200), 80 | ||||
); | ); | ||||
// create bushes | // create bushes | ||||
log("Creating bushes..."); | log("Creating bushes..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(aBushMedium, 1,2, 0,2), new SimpleObject(aBushSmall, 2,4, 0,2)] | [new SimpleObject(aBushMedium, 1,2, 0,2), new SimpleObject(aBushSmall, 2,4, 0,2)] | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
[avoidClasses(clWater, 1, clHill, 1, clPlayer, 1, clDirt, 1), stayClasses(clLand, 3)], | [avoidClasses(clWater, 1, clHill, 1, clPlayer, 1, clDirt, 1), stayClasses(clLand, 3)], | ||||
planetm * scaleByMapSize(13, 200), 50 | planetm * scaleByMapSize(13, 200), 50 | ||||
); | ); | ||||
setSkySet(pickRandom(["cirrus", "cumulus", "sunny", "sunny 1", "mountainous", "stratus"])); | setSkySet(pickRandom(["cirrus", "cumulus", "sunny", "sunny 1", "mountainous", "stratus"])); | ||||
setSunRotation(randFloat(0, TWO_PI)); | setSunRotation(randFloat(0, TWO_PI)); | ||||
setSunElevation(randFloat(PI/ 5, PI / 3)); | setSunElevation(randFloat(PI/ 5, PI / 3)); | ||||
// Export map data | // Export map data | ||||
ExportMap(); | ExportMap(); |
Wildfire Games · Phabricator