forked from 0ad/0ad
Fixes AI building angles to face bottom right corner of the map.
Cleans up the same concept in random maps. This was SVN commit r10275.
This commit is contained in:
parent
d63e9eaef4
commit
c3075c8e5b
@ -46,6 +46,8 @@ const aBushSmall = "actor|props/flora/bush_medit_sm.xml";
|
||||
const pForestD = [tGrassDForest + TERRAIN_SEPARATOR + oOak, tGrassDForest + TERRAIN_SEPARATOR + oOakLarge, tGrassDForest];
|
||||
const pForestP = [tGrassPForest + TERRAIN_SEPARATOR + oPine, tGrassPForest + TERRAIN_SEPARATOR + oAleppoPine, tGrassPForest];
|
||||
|
||||
const BUILDING_ANGlE = 0.75*PI;
|
||||
|
||||
// initialize map
|
||||
|
||||
log("Initializing map...");
|
||||
@ -137,14 +139,14 @@ for (var i = 0; i < numPlayers; i++)
|
||||
|
||||
// create the TC
|
||||
var group = new SimpleGroup( // elements (type, min/max count, min/max distance, min/max angle)
|
||||
[new SimpleObject(civEntities[0].Template, 1,1, 0,0, 0.75*PI, 0.75*PI)],
|
||||
[new SimpleObject(civEntities[0].Template, 1,1, 0,0, BUILDING_ANGlE, BUILDING_ANGlE)],
|
||||
true, null, ix, iz
|
||||
);
|
||||
createObjectGroup(group, i+1);
|
||||
|
||||
// create starting units
|
||||
var uDist = 8;
|
||||
var uAngle = -0.75*PI + randFloat(-PI/8, PI/8);
|
||||
var uAngle = -BUILDING_ANGlE + randFloat(-PI/8, PI/8);
|
||||
for (var j = 1; j < civEntities.length; ++j)
|
||||
{
|
||||
var count = (civEntities[j].Count !== undefined ? civEntities[j].Count : 1);
|
||||
|
@ -69,6 +69,9 @@ var pPalmForest = [tForestFloor+TERRAIN_SEPARATOR+oPalm, tGrass];
|
||||
var pPineForest = [tForestFloor+TERRAIN_SEPARATOR+oPine, tGrass];
|
||||
var pPoplarForest = [tForestFloor+TERRAIN_SEPARATOR+oLombardyPoplar, tGrass];
|
||||
var pMainForest = [tForestFloor+TERRAIN_SEPARATOR+oCarob, tForestFloor+TERRAIN_SEPARATOR+oBeech, tGrass, tGrass];
|
||||
|
||||
const BUILDING_ANGlE = 0.75*PI;
|
||||
|
||||
// initialize map
|
||||
|
||||
log("Initializing map...");
|
||||
@ -270,19 +273,15 @@ if((numPlayers>=6)||(i==startingPlaces[numPlayers-1][nPlayer])){
|
||||
var civEntities = getStartingEntities(nPlayer);
|
||||
|
||||
// create the TC
|
||||
var angletemple = 1.5*PI-islandAngle[i];
|
||||
angletemple = 0.75*PI;
|
||||
//angletemple = (angletemple<0)?angletemple+2*PI:angletemple;
|
||||
var group = new SimpleGroup( // elements (type, min/max count, min/max distance)
|
||||
[new SimpleObject(civEntities[0].Template, 1,1, 0,0, angletemple, angletemple)],
|
||||
[new SimpleObject(civEntities[0].Template, 1,1, 0,0, BUILDING_ANGlE, BUILDING_ANGlE)],
|
||||
true, null, ix, iz
|
||||
);
|
||||
createObjectGroup(group, nPlayer+1);
|
||||
|
||||
// create starting units
|
||||
var uDist = 8;
|
||||
var uAngle = islandAngle[i] + PI + randFloat(-PI/8, PI/8);
|
||||
|
||||
var uAngle = -BUILDING_ANGlE + randFloat(-PI/8, PI/8);
|
||||
for (var j = 1; j < civEntities.length; ++j)
|
||||
{
|
||||
var count = (civEntities[j].Count !== undefined ? civEntities[j].Count : 1);
|
||||
|
@ -63,6 +63,8 @@ var pPineForest = [tForestFloor+TERRAIN_SEPARATOR+oPine, tGrass];
|
||||
var pPoplarForest = [tForestFloor+TERRAIN_SEPARATOR+oLombardyPoplar, tGrass];
|
||||
var pMainForest = [tForestFloor+TERRAIN_SEPARATOR+oCarob, tForestFloor+TERRAIN_SEPARATOR+oBeech, tGrass, tGrass];
|
||||
|
||||
const BUILDING_ANGlE = 0.75*PI;
|
||||
|
||||
// initialize map
|
||||
|
||||
log("Initializing map...");
|
||||
@ -418,14 +420,14 @@ for (var i = 1; i <= numPlayers; i++)
|
||||
|
||||
// create the TC
|
||||
var group = new SimpleGroup( // elements (type, min/max count, min/max distance, min/max angle)
|
||||
[new SimpleObject(civEntities[0].Template, 1,1, 0,0, 0.75*PI, 0.75*PI)],
|
||||
[new SimpleObject(civEntities[0].Template, 1,1, 0,0, BUILDING_ANGlE, BUILDING_ANGlE)],
|
||||
true, null, ix, iz
|
||||
);
|
||||
createObjectGroup(group, i);
|
||||
|
||||
// create starting units
|
||||
var uDist = 8;
|
||||
var uAngle = -0.75*PI + randFloat(-PI/8, PI/8);
|
||||
var uAngle = -BUILDING_ANGlE + randFloat(-PI/8, PI/8);
|
||||
for (var j = 1; j < civEntities.length; ++j)
|
||||
{
|
||||
var count = (civEntities[j].Count !== undefined ? civEntities[j].Count : 1);
|
||||
|
@ -43,6 +43,8 @@ const aDecorativeRock = "actor|geology/stone_desert_med.xml";
|
||||
var pForest = [tForestFloor + TERRAIN_SEPARATOR + oDatePalm, tForestFloor + TERRAIN_SEPARATOR + oSDatePalm, tForestFloor];
|
||||
var pForestOasis = [tGrass + TERRAIN_SEPARATOR + oDatePalm, tGrass + TERRAIN_SEPARATOR + oSDatePalm, tGrass];
|
||||
|
||||
const BUILDING_ANGlE = 0.75*PI;
|
||||
|
||||
// initialize map
|
||||
|
||||
log("Initializing map...");
|
||||
@ -112,14 +114,14 @@ for (var i = 0; i < numPlayers; i++)
|
||||
|
||||
// create the TC
|
||||
var group = new SimpleGroup( // elements (type, min/max count, min/max distance, min/max angle)
|
||||
[new SimpleObject(civEntities[0].Template, 1,1, 0,0, 0.75*PI, 0.75*PI)],
|
||||
[new SimpleObject(civEntities[0].Template, 1,1, 0,0, BUILDING_ANGlE, BUILDING_ANGlE)],
|
||||
true, null, ix, iz
|
||||
);
|
||||
createObjectGroup(group, i+1);
|
||||
|
||||
// create starting units
|
||||
var uDist = 8;
|
||||
var uAngle = -0.75*PI + randFloat(-PI/8, PI/8);
|
||||
var uAngle = -BUILDING_ANGlE + randFloat(-PI/8, PI/8);
|
||||
for (var j = 1; j < civEntities.length; ++j)
|
||||
{
|
||||
var count = (civEntities[j].Count !== undefined ? civEntities[j].Count : 1);
|
||||
|
@ -1,5 +1,7 @@
|
||||
RMS.LoadLibrary("rmgen");
|
||||
|
||||
const BUILDING_ANGlE = 0.75*PI;
|
||||
|
||||
// initialize map
|
||||
|
||||
log("Initializing map...");
|
||||
@ -49,14 +51,14 @@ for (var i=0; i < numPlayers; i++)
|
||||
|
||||
// create the TC
|
||||
var group = new SimpleGroup( // elements (type, min/max count, min/max distance, min/max angle)
|
||||
[new SimpleObject(civEntities[0].Template, 1,1, 0,0, 0.75*PI, 0.75*PI)],
|
||||
[new SimpleObject(civEntities[0].Template, 1,1, 0,0, BUILDING_ANGlE, BUILDING_ANGlE)],
|
||||
true, null, ix, iz
|
||||
);
|
||||
createObjectGroup(group, i+1);
|
||||
|
||||
// create starting units
|
||||
var uDist = 8;
|
||||
var uAngle = -0.75*PI + randFloat(-PI/8, PI/8);
|
||||
var uAngle = -BUILDING_ANGlE + randFloat(-PI/8, PI/8);
|
||||
for (var j = 1; j < civEntities.length; ++j)
|
||||
{
|
||||
var count = (civEntities[j].Count !== undefined ? civEntities[j].Count : 1);
|
||||
|
@ -208,9 +208,8 @@ var BuildingConstructionPlan = Class({
|
||||
// Engine.DumpImage("tiles1.png", obstructionTiles, map.width, map.height, 32);
|
||||
// Engine.DumpImage("tiles2.png", friendlyTiles, map.width, map.height, 256);
|
||||
|
||||
// Randomise the angle a little, to look less artificial
|
||||
//var angle = Math.PI + (Math.random()*2-1) * Math.PI/24;
|
||||
var angle = Math.PI + (Math.PI / 4);
|
||||
// Fixed angle to match fixed starting cam
|
||||
var angle = 0.75*Math.PI;
|
||||
|
||||
return {
|
||||
"x": x,
|
||||
|
@ -184,8 +184,8 @@ var BuildingConstructionPlan = Class({
|
||||
// Engine.DumpImage("tiles1.png", obstructionTiles, map.width, map.height, 32);
|
||||
// Engine.DumpImage("tiles2.png", friendlyTiles, map.width, map.height, 256);
|
||||
|
||||
// Randomise the angle a little, to look less artificial
|
||||
var angle = Math.PI + (Math.random()*2-1) * Math.PI/24;
|
||||
// Fixed angle to match fixed starting cam
|
||||
var angle = 0.75*Math.PI;
|
||||
|
||||
return {
|
||||
"x": x,
|
||||
|
Loading…
Reference in New Issue
Block a user