mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-07-04 05:55:47 -07:00
Added Neareastern Badlands map.
This was SVN commit r2733.
This commit is contained in:
parent
99127e2458
commit
6f90dec78f
6 changed files with 295 additions and 9 deletions
|
|
@ -72,9 +72,9 @@ for(i=0; i<NUM_PLAYERS; i++) {
|
|||
println("Creating base for player " + i + "...");
|
||||
|
||||
// some constants
|
||||
radius = 18;
|
||||
cliffRadius = 3;
|
||||
elevation = 32;
|
||||
radius = 17;
|
||||
cliffRadius = 2;
|
||||
elevation = 30;
|
||||
|
||||
// get the x and y in tiles
|
||||
fx = fractionToTiles(playerX[i]);
|
||||
|
|
@ -195,7 +195,7 @@ createAreas(placer, [terrainPainter, elevationPainter, paintClass(clHill)],
|
|||
|
||||
// create forests
|
||||
println("Creating forests...");
|
||||
placer = new ClumpPlacer(30, 0.2, 0.06, 0);
|
||||
placer = new ClumpPlacer(25, 0.2, 0.05, 0);
|
||||
painter = new LayeredPainter([2], [[tGrass, tForest], tForest]);
|
||||
createAreas(placer, [painter, paintClass(clForest)],
|
||||
avoidClasses(clPlayer, 1, clWater, 3, clForest, 10, clHill, 0),
|
||||
|
|
@ -223,7 +223,7 @@ createObjectGroups(group, 0,
|
|||
3 * NUM_PLAYERS, 100
|
||||
);
|
||||
|
||||
// create decorative rocks
|
||||
// create decorative rocks for hills
|
||||
println("Creating decorative rocks...");
|
||||
group = new SimpleGroup([new SimpleObject(oDecorativeRock, 1,1, 0,0)], true);
|
||||
createObjectGroups(group, 0,
|
||||
|
|
@ -252,7 +252,7 @@ println("Creating straggler trees...");
|
|||
group = new SimpleGroup([new SimpleObject(oTree, 1,1, 0,0)], true);
|
||||
createObjectGroups(group, 0,
|
||||
avoidClasses(clWater, 1, clForest, 0, clHill, 0, clPlayer, 0),
|
||||
SIZE*SIZE/800
|
||||
SIZE*SIZE/700
|
||||
);
|
||||
|
||||
// create grass tufts
|
||||
|
|
|
|||
280
binaries/data/mods/official/maps/random/neareastern_badlands.js
Normal file
280
binaries/data/mods/official/maps/random/neareastern_badlands.js
Normal file
|
|
@ -0,0 +1,280 @@
|
|||
// constants
|
||||
|
||||
const SIZE = 208;
|
||||
const NUM_PLAYERS = 4;
|
||||
|
||||
const tSand = "desert_rough";
|
||||
const tDunes = "desert_wave";
|
||||
const tFineSand = "desert_sahara";
|
||||
const tCliff = "cliff_desert";
|
||||
const tForest = "grass_sand_75|flora/wrld_palm_b.xml";
|
||||
const tGrassSand75 = "grass_sand_75";
|
||||
const tGrassSand50 = "grass_sand_50";
|
||||
const tGrassSand25 = "grass_sand_25_2";
|
||||
const tDirt = "dirt_hard";
|
||||
const tDirtCracks = "dirt_cracks";
|
||||
const tShore = "sand";
|
||||
const tWater = "water_2";
|
||||
const tWaterDeep = "water_3";
|
||||
|
||||
const oTree = "flora/wrld_palm_b.xml";
|
||||
const oBerryBush = "wrld_flora_berrybush";
|
||||
const oBush = "foliage/bush_dry_a.xml";
|
||||
const oSheep = "wrld_fauna_sheep";
|
||||
const oDeer = "wrld_fauna_deer";
|
||||
const oMine = "wrld_rock_light";
|
||||
const oDecorativeRock = "geology/rock_gray1.xml";
|
||||
|
||||
// some utility functions to save typing
|
||||
|
||||
function paintClass(cl) {
|
||||
return new TileClassPainter(cl);
|
||||
}
|
||||
|
||||
function avoidClasses(/*class1, dist1, class2, dist2, etc*/) {
|
||||
var ar = new Array(arguments.length/2);
|
||||
for(var i=0; i<arguments.length/2; i++) {
|
||||
ar[i] = new AvoidTileClassConstraint(arguments[2*i], arguments[2*i+1]);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
// initialize map
|
||||
|
||||
println("Initializing map...");
|
||||
init(SIZE, tSand, 10);
|
||||
|
||||
// create tile classes
|
||||
|
||||
clPlayer = createTileClass();
|
||||
clHill1 = createTileClass();
|
||||
clHill2 = createTileClass();
|
||||
clHill3 = createTileClass();
|
||||
clForest = createTileClass();
|
||||
clWater = createTileClass();
|
||||
clPatch = createTileClass();
|
||||
clRock = createTileClass();
|
||||
clFood = createTileClass();
|
||||
clBaseResource = createTileClass();
|
||||
|
||||
// place players
|
||||
|
||||
playerX = new Array(NUM_PLAYERS);
|
||||
playerY = new Array(NUM_PLAYERS);
|
||||
playerAngle = new Array(NUM_PLAYERS);
|
||||
|
||||
startAngle = randFloat() * 2 * PI;
|
||||
for(i=0; i<NUM_PLAYERS; i++) {
|
||||
playerAngle[i] = startAngle + i*2*PI/NUM_PLAYERS;
|
||||
playerX[i] = 0.5 + 0.39*cos(playerAngle[i]);
|
||||
playerY[i] = 0.5 + 0.39*sin(playerAngle[i]);
|
||||
}
|
||||
|
||||
for(i=0; i<NUM_PLAYERS; i++) {
|
||||
println("Creating base for player " + i + "...");
|
||||
|
||||
// some constants
|
||||
radius = 20;
|
||||
cliffRadius = 2;
|
||||
elevation = 30;
|
||||
|
||||
// get the x and y in tiles
|
||||
fx = fractionToTiles(playerX[i]);
|
||||
fy = fractionToTiles(playerY[i]);
|
||||
ix = round(fx);
|
||||
iy = round(fy);
|
||||
|
||||
// calculate size based on the radius
|
||||
size = PI * radius * radius;
|
||||
|
||||
// create the hill
|
||||
placer = new ClumpPlacer(size, 0.9, 0.5, 0, ix, iy);
|
||||
createArea(placer, paintClass(clPlayer), null);
|
||||
|
||||
// create the central road patch
|
||||
placer = new ClumpPlacer(PI*2*2, 0.6, 0.3, 0.5, ix, iy);
|
||||
painter = new TerrainPainter(tDirt);
|
||||
createArea(placer, painter, null);
|
||||
|
||||
// create the TC and the villies
|
||||
group = new SimpleGroup(
|
||||
[ // elements (type, count, distance)
|
||||
new SimpleObject("hele_cc", 1,1, 0,0),
|
||||
new SimpleObject("hele_isp_b", 3,3, 5,5)
|
||||
],
|
||||
true, null, ix, iy
|
||||
);
|
||||
createObjectGroup(group, i);
|
||||
|
||||
// create berry bushes
|
||||
bbAngle = randFloat()*2*PI;
|
||||
bbDist = 10;
|
||||
bbX = round(fx + bbDist * cos(bbAngle));
|
||||
bbY = round(fy + bbDist * sin(bbAngle));
|
||||
group = new SimpleGroup(
|
||||
[new SimpleObject(oSheep, 5,5, 0,2)],
|
||||
true, clBaseResource, bbX, bbY
|
||||
);
|
||||
createObjectGroup(group, 0);
|
||||
|
||||
// create mines
|
||||
mAngle = bbAngle;
|
||||
while(abs(mAngle - bbAngle) < PI/3) {
|
||||
mAngle = randFloat()*2*PI;
|
||||
}
|
||||
mDist = 12;
|
||||
mX = round(fx + mDist * cos(mAngle));
|
||||
mY = round(fy + mDist * sin(mAngle));
|
||||
group = new SimpleGroup(
|
||||
[new SimpleObject(oMine, 3,3, 0,2)],
|
||||
true, clBaseResource, mX, mY
|
||||
);
|
||||
createObjectGroup(group, 0);
|
||||
|
||||
// create starting straggler trees
|
||||
group = new SimpleGroup(
|
||||
[new SimpleObject(oTree, 2,2, 6,12)],
|
||||
true, null, ix, iy
|
||||
);
|
||||
createObjectGroup(group, 0, avoidClasses(clBaseResource,1));
|
||||
}
|
||||
|
||||
// create patches
|
||||
println("Creating sand patches...");
|
||||
placer = new ClumpPlacer(30, 0.2, 0.1, 0);
|
||||
painter = new LayeredPainter([1], [[tSand, tFineSand], tFineSand]);
|
||||
createAreas(placer, [painter, paintClass(clPatch)],
|
||||
avoidClasses(clPatch, 5),
|
||||
(SIZE*SIZE)/600
|
||||
);
|
||||
|
||||
println("Creating dirt patches...");
|
||||
placer = new ClumpPlacer(10, 0.2, 0.1, 0);
|
||||
painter = new TerrainPainter([tSand, tDirt]);
|
||||
createAreas(placer, [painter, paintClass(clPatch)],
|
||||
avoidClasses(clPatch, 5),
|
||||
(SIZE*SIZE)/600
|
||||
);
|
||||
|
||||
// create the oasis
|
||||
println("Creating water...");
|
||||
placer = new ClumpPlacer(1200, 0.6, 0.1, 0, SIZE/2, SIZE/2);
|
||||
painter = new LayeredPainter([6,1], [[tSand, tForest], tShore, tWaterDeep]);
|
||||
elevationPainter = new SmoothElevationPainter(ELEVATION_MODIFY, -10, 5);
|
||||
createArea(placer, [painter, elevationPainter, paintClass(clForest)], null);
|
||||
|
||||
// create hills
|
||||
println("Creating level 1 hills...");
|
||||
placer = new ClumpPlacer(150, 0.25, 0.1, 0.3);
|
||||
terrainPainter = new LayeredPainter(
|
||||
[1], // widths
|
||||
[tCliff, tSand] // terrains
|
||||
);
|
||||
elevationPainter = new SmoothElevationPainter(ELEVATION_MODIFY, 16, 1);
|
||||
createAreas(placer, [terrainPainter, elevationPainter, paintClass(clHill1)],
|
||||
avoidClasses(clForest, 2, clPlayer, 0, clHill1, 16),
|
||||
(SIZE*SIZE)/3800, 100
|
||||
);
|
||||
|
||||
println("Creating small level 1 hills...");
|
||||
placer = new ClumpPlacer(60, 0.25, 0.1, 0.3);
|
||||
terrainPainter = new LayeredPainter(
|
||||
[1], // widths
|
||||
[tCliff, tSand] // terrains
|
||||
);
|
||||
elevationPainter = new SmoothElevationPainter(ELEVATION_MODIFY, 16, 1);
|
||||
createAreas(placer, [terrainPainter, elevationPainter, paintClass(clHill1)],
|
||||
avoidClasses(clForest, 2, clPlayer, 0, clHill1, 3),
|
||||
(SIZE*SIZE)/2800, 100
|
||||
);
|
||||
|
||||
println("Creating level 2 hills...");
|
||||
placer = new ClumpPlacer(60, 0.2, 0.1, 0.9);
|
||||
terrainPainter = new LayeredPainter(
|
||||
[1], // widths
|
||||
[tCliff, tSand] // terrains
|
||||
);
|
||||
elevationPainter = new SmoothElevationPainter(ELEVATION_MODIFY, 16, 1);
|
||||
createAreas(placer, [terrainPainter, elevationPainter, paintClass(clHill2)],
|
||||
[avoidClasses(clHill2, 1), new StayInTileClassConstraint(clHill1, 0)],
|
||||
(SIZE*SIZE)/2800, 200
|
||||
);
|
||||
|
||||
println("Creating level 3 hills...");
|
||||
placer = new ClumpPlacer(25, 0.2, 0.1, 0.9);
|
||||
terrainPainter = new LayeredPainter(
|
||||
[1], // widths
|
||||
[tCliff, tSand] // terrains
|
||||
);
|
||||
elevationPainter = new SmoothElevationPainter(ELEVATION_MODIFY, 16, 1);
|
||||
createAreas(placer, [terrainPainter, elevationPainter, paintClass(clHill3)],
|
||||
[avoidClasses(clHill3, 1), new StayInTileClassConstraint(clHill2, 0)],
|
||||
(SIZE*SIZE)/9000, 300
|
||||
);
|
||||
|
||||
// create forests
|
||||
println("Creating forests...");
|
||||
placer = new ClumpPlacer(25, 0.15, 0.1, 0.3);
|
||||
painter = new TerrainPainter([tSand, tForest]);
|
||||
createAreas(placer, [painter, paintClass(clForest)],
|
||||
avoidClasses(clWater, 0, clPlayer, 1, clForest, 20, clHill1, 0),
|
||||
(SIZE*SIZE)/4000, 50
|
||||
);
|
||||
|
||||
// create mines
|
||||
println("Creating mines...");
|
||||
group = new SimpleGroup([new SimpleObject(oMine, 4,6, 0,2)], true, clRock);
|
||||
createObjectGroups(group, 0,
|
||||
[avoidClasses(clWater, 2, clForest, 2, clPlayer, 0, clRock, 13),
|
||||
new BorderTileClassConstraint(clHill1, 0, 4)],
|
||||
(SIZE*SIZE)/4000, 100
|
||||
);
|
||||
|
||||
// create decorative rocks for hills
|
||||
println("Creating decorative rocks...");
|
||||
group = new SimpleGroup([new SimpleObject(oDecorativeRock, 1,1, 0,0)], true);
|
||||
createObjectGroups(group, 0,
|
||||
new BorderTileClassConstraint(clHill1, 0, 3),
|
||||
(SIZE*SIZE)/2000, 100
|
||||
);
|
||||
|
||||
// create deer
|
||||
println("Creating deer...");
|
||||
group = new SimpleGroup([new SimpleObject(oDeer, 5,7, 0,4)], true, clFood);
|
||||
createObjectGroups(group, 0,
|
||||
avoidClasses(clWater, 0, clForest, 0, clPlayer, 0, clHill1, 0, clFood, 25),
|
||||
(SIZE*SIZE)/5000, 50
|
||||
);
|
||||
|
||||
// create sheep
|
||||
println("Creating sheep...");
|
||||
group = new SimpleGroup([new SimpleObject(oSheep, 1,3, 0,2)], true, clFood);
|
||||
createObjectGroups(group, 0,
|
||||
avoidClasses(clWater, 0, clForest, 0, clPlayer, 0, clHill1, 0, clFood, 15),
|
||||
(SIZE*SIZE)/5000, 50
|
||||
);
|
||||
|
||||
// create straggler trees
|
||||
println("Creating straggler trees...");
|
||||
group = new SimpleGroup([new SimpleObject(oTree, 1,1, 0,0)], true);
|
||||
createObjectGroups(group, 0,
|
||||
avoidClasses(clWater, 0, clForest, 0, clHill1, 0, clPlayer, 0),
|
||||
SIZE*SIZE/1500
|
||||
);
|
||||
|
||||
|
||||
// create bushes
|
||||
println("Creating bushes...");
|
||||
group = new SimpleGroup([new SimpleObject(oBush, 2,3, 0,2)]);
|
||||
createObjectGroups(group, 0,
|
||||
avoidClasses(clWater, 3, clHill1, 0, clPlayer, 0, clForest, 0),
|
||||
SIZE*SIZE/1000
|
||||
);
|
||||
|
||||
// create bushes
|
||||
println("Creating more decorative rocks...");
|
||||
group = new SimpleGroup([new SimpleObject(oDecorativeRock, 1,2, 0,2)]);
|
||||
createObjectGroups(group, 0,
|
||||
avoidClasses(clWater, 3, clHill1, 0, clPlayer, 0, clForest, 0),
|
||||
SIZE*SIZE/1000
|
||||
);
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:151769431b28533230e634f7f4e1864aeb405fc87b3af868bcf4db2937b8f968
|
||||
oid sha256:3e44d2c0a0dc3a75cb2f6048e8c1a7e881878b7a88a24a06996e9be02cee80d0
|
||||
size 433693
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:deed59de29d3986d88ffdb4f0f3a2262179c6cae9208d4c7089317fdf9fc537b
|
||||
size 388223
|
||||
oid sha256:aff572d0c44c7406977762f16dde373188beed2ece47c3ee0d7c0df04bfe8ff6
|
||||
size 348705
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:aeaa6f18b1c6de1914733afa9c1942fdbbcdfd6a99d0f67d0535886225cf1d61
|
||||
size 433620
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:42b07367ddf0663d6df84021fc1053212905ef52947c3a17394b5bf0bb31775f
|
||||
size 227383
|
||||
Loading…
Reference in a new issue