Ticket #2944: gen_wall_builder2015-8-16.patch

File gen_wall_builder2015-8-16.patch, 56.2 KB (added by FeXoR, 9 years ago)
  • binaries/data/mods/public/maps/random/belgian_uplands.js

     
    2121// Heightmap functionality
    2222//////////
    2323
    24 // Some general heightmap settings
    25 const MIN_HEIGHT = - SEA_LEVEL; // 20, should be set in the libs!
    26 const MAX_HEIGHT = 0xFFFF/HEIGHT_UNITS_PER_METRE - SEA_LEVEL; // A bit smaler than 90, should be set in the libs!
    27 
    2824// Add random heightmap generation functionality
    2925function getRandomReliefmap(minHeight, maxHeight)
    3026{
  • binaries/data/mods/public/maps/random/rmgen/library.js

     
    66const PI = Math.PI;
    77const TWO_PI = 2 * Math.PI;
    88const TERRAIN_SEPARATOR = "|";
    9 const SEA_LEVEL = 20.0;
     9const SEA_LEVEL = 160.0;
    1010const CELL_SIZE = 4;
    1111const HEIGHT_UNITS_PER_METRE = 92;
    1212const MIN_MAP_SIZE = 128;
    1313const MAX_MAP_SIZE = 512;
    1414const FALLBACK_CIV = "athen";
     15// Constants needed for heightmap_manipulation.js
     16const MAX_HEIGHT_RANGE = 0xFFFF / HEIGHT_UNITS_PER_METRE // Engine limit, Roughly 700 meters
     17const MIN_HEIGHT = - SEA_LEVEL;
     18const MAX_HEIGHT = MAX_HEIGHT_RANGE - SEA_LEVEL;
     19// Entity template structure keys that might change, for easier mod support
     20const STARTING_ENTITY_KEY = "StartEntities";
     21const START_ENTITY_TEMPLATE_PATH_KEY = "Template"
     22const BUILDER_TEMPLATEPATH_KEYS = ["Builder", "Entities", "_string"];
     23const PRODUCTION_TEMPLATEPATH_KEYS = ["ProductionQueue", "Entities", "_string"];
     24const CIV_PLACEHOLDER_STRING = "{civ}";
    1525
    1626/////////////////////////////////////////////////////////////////////////////////////////////
    1727//  Utility functions
     
    394404    return g_MapSettings.PlayerData.length - 1;
    395405}
    396406
     407// Takes nothing, returns an array of strings representing all available civilizations
     408function getCivList()
     409{
     410    var raw_civData = RMS.GetCivData();
     411    var civList = [];
     412    for (var i = 0; i < raw_civData.length; ++i)
     413        civList.push(JSON.parse(raw_civData[i]).Code);
     414   
     415    return civList;
     416}
     417
     418// Takes nothing, returns an associative array with civ strings as keys containing all unpacked civ data (Templates need to be unpacked with RMS.GetTemplate() if needed)
     419function getFullCivData()
     420{
     421    var rawCivData = RMS.GetCivData();
     422    var unpackedCivData = {};
     423    for (var i = 0; i < rawCivData.length; i++)
     424    {
     425        var singleCivData = JSON.parse(rawCivData[i]);
     426        unpackedCivData[singleCivData.Code] = singleCivData;
     427    }
     428   
     429    return unpackedCivData;
     430}
     431
     432// Takes a player number (0-7, so Gaia excluded). Returns this players civ string
     433// ToDo: If the player number is to high an error will occur (and the fallback won't be reached)!
    397434function getCivCode(player)
    398435{
    399436    if (g_MapSettings.PlayerData[player+1].Civ)
    400437        return g_MapSettings.PlayerData[player+1].Civ;
    401438
    402     warn("undefined civ specified for player " + (player + 1) + ", falling back to '" + FALLBACK_CIV + "'");
     439    warn("Undefined civ specified for player " + (player + 1) + ", falling back to '" + FALLBACK_CIV + "'");
    403440    return FALLBACK_CIV;
    404441}
    405442
     443// Takes an entity path and a key list to get the templates value
     444function getTemplateValue(entPath, key_list)
     445{
     446    var subdata = RMS.GetTemplate(entPath);
     447    for (var i = 0; i < key_list.length; i++)
     448    {
     449        if (key_list[i] in subdata)
     450        {
     451            subdata = subdata[key_list[i]];
     452        }
     453        else
     454        {
     455            return false;
     456        }
     457    }
     458    return subdata;
     459}
     460
     461// Returns a list of all templates paths available to the given civ
     462function getTempatePathList(civ)
     463{
     464    var templatePaths = getFullCivData();
     465    if (civ in templatePaths)
     466    {
     467        templatePaths = templatePaths[civ];
     468    }
     469    else
     470    {
     471        var keys = [];
     472        for (var key in templatePaths)
     473            keys.push(key);
     474        warn("getTempatePathList: Unknown civ: " + civ + " not in " + uneval(keys));
     475        return false;
     476    }
     477    if (STARTING_ENTITY_KEY in templatePaths)
     478    {
     479        templatePaths = templatePaths[STARTING_ENTITY_KEY];
     480    }
     481    else
     482    {
     483        var keys = [];
     484        for (var key in templatePaths)
     485            keys.push(key);
     486        warn("getTempatePathList: Civ has no starting entities as defined in STARTING_ENTITY_KEY (" + STARTING_ENTITY_KEY + "): " + uneval(keys));
     487        return false;
     488    }
     489    for (var i = 0; i < templatePaths.length; i++)
     490    {
     491        if (START_ENTITY_TEMPLATE_PATH_KEY in templatePaths[i])
     492        {
     493            templatePaths[i] = templatePaths[i][START_ENTITY_TEMPLATE_PATH_KEY];
     494        }
     495        else
     496        {
     497            var keys = [];
     498            for (var key in templatePaths[i])
     499                keys.push(key);
     500            warn("getTempatePathList: Starting entity list item has no template as defined in START_ENTITY_TEMPLATE_PATH_KEY (" + START_ENTITY_TEMPLATE_PATH_KEY + "): " + uneval(keys));
     501            return false;
     502        }
     503    }
     504    var foundNew = 1;
     505    while (foundNew > 0)
     506    {
     507        foundNew = 0;
     508        var methods = [BUILDER_TEMPLATEPATH_KEYS, PRODUCTION_TEMPLATEPATH_KEYS];
     509        for (var m = 0; m < methods.length; m++)
     510        {
     511            for (var t = 0; t < templatePaths.length; t++)
     512            {
     513                var pathsToCheck = getTemplateValue(templatePaths[t], methods[m]);
     514                if (typeof(pathsToCheck) === typeof(""))
     515                {
     516                    pathsToCheck = pathsToCheck.split(/\s+/);
     517                    for (var c = 0; c < pathsToCheck.length; c++)
     518                    {
     519                        var actualPath = pathsToCheck[c].replace(CIV_PLACEHOLDER_STRING, civ);
     520                        if (templatePaths.indexOf(actualPath) == -1 && RMS.TemplateExists(actualPath))
     521                        {
     522                            templatePaths.push(actualPath);
     523                            foundNew++;
     524                        }
     525                    }
     526                }
     527            }
     528        }
     529    }
     530    return templatePaths;
     531}
     532
    406533function areAllies(player1, player2)
    407534{
    408535    if ((g_MapSettings.PlayerData[player1+1].Team === undefined) || (g_MapSettings.PlayerData[player2+1].Team === undefined) || (g_MapSettings.PlayerData[player2+1].Team == -1) || (g_MapSettings.PlayerData[player1+1].Team == -1))
  • binaries/data/mods/public/maps/random/rmgen/misc.js

     
    157157    }
    158158}
    159159
    160 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     160//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    161161// placeCivDefaultEntities
    162162//
    163163//  Creates the default starting player entities depending on the players civ
    164164//  fx&fy: position of player base
    165165//  playerid: id of player
    166166//  angle: angle of main base building, optional, default is BUILDING_ANGlE
    167 //  kwargs: Takes some optional keyword arguments to tweek things
    168 //      'iberWall': may be false, 'walls' (default) or 'towers'. Determines the defensive structures Iberians get as civ bonus
     167//  kwargs: Optional. Takes an associative array with keyword arguments to tweak things:
     168//      Known keys: 'iberWall': may be false, 'walls' (default) or 'towers'. Determines the defensive structures Iberians get as civ bonus
    169169//
    170 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     170//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    171171function placeCivDefaultEntities(fx, fz, playerid, angle, kwargs)
    172172{
    173173    // Unpack kwargs
  • binaries/data/mods/public/maps/random/rmgen/wall_builder.js

     
    3737//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    3838//  WallElement class definition
    3939//
    40 //  Concept: If placed unrotated the wall's course is towards positive Y (top) with "outside" right (+X) and "inside" left (-X) like unrotated entities has their drop-points right (in rmgen)
    41 //  The course of the wall will be changed by corners (bending != 0) and so the "inside"/"outside" direction
     40//  Concept: If placed unrotated the wall's build direction is towards positive Y (top) with "outside" right (+X) and "inside" left (-X) like unrotated entities has their drop-points right (in rmgen)
     41//  The build direction of the wall will be changed by corners (bending != 0) and so the "inside"/"outside" direction
    4242//
    43 //  type    Descriptive string, example: "wallLong". NOTE: Not really needed. Mainly for custom wall elements and to get the wall element type in code
    44 //  entity  Optional. Template name string of the entity to be placed, example: "structures/cart_wall_long". Default is undefined (No entity placed)
    45 //  angle   Optional. The angle (float) added to place the entity so "outside" is right when the wall element is placed unrotated. Default is 0
    46 //  width   Optional. How far this wall element lengthens the wall (float), if unrotated the Y space needed. Default is 0
    47 //  indent  Optional. The lateral indentation of the entity, drawn "inside" (positive values) or pushed "outside" (negative values). Default is 0
    48 //  bending Optional. How the course of the wall is changed after this element, positive is bending "in"/left/counter clockwise (like entity placement)
     43//  type    Identification string.
     44//  entPath Optional. Template entity path string of the entity to be placed, example: "structures/cart_wall_long". Default is undefined (No entity placed)
     45//  angle   Optional. Relative angle to the build direction. Default is 0
     46//  width   Optional. How far this wall element lengthens the wall (float), if unrotated the Y space needed. Default is 0
     47//  indent  Optional. The lateral indentation of the entity, drawn "inside" (positive values) or pushed "outside" (negative values). Default is 0
     48//  bending Optional. How the build direction of the wall is changed after this element, positive is bending "in"/left/counter clockwise (like entity placement)
    4949//      NOTE: Bending is not supported by all placement functions (see there)
    5050//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    51 function WallElement(type, entity, angle, width, indent, bending)
     51function WallElement(type, entPath, angle, width, indent, bending)
    5252{
    5353    this.type = type;
    54     // Default wall element type documentation:
    55     // Lengthening straight blocking (mainly left/right symmetric) wall elements (Walls and wall fortifications)
    56         // "wall"          A blocking straight wall element that mainly lengthens the wall, self-explanatory
    57         // "wallShort"     self-explanatory
    58         // "wallLong"      self-explanatory
    59         // "tower"         A blocking straight wall element with damage potential (but for palisades) that slightly lengthens the wall, example: wall tower, palisade tower(No attack)
    60         // "wallFort"      A blocking straight wall element with massive damage potential that lengthens the wall, example: fortress, palisade fort
    61     // Lengthening straight non/custom blocking (mainly left/right symmetric) wall elements (Gates and entries)
    62         // "gate"          A blocking straight wall element with passability determined by owner, example: gate (Functionality not yet implemented)
    63         // "entry"         A non-blocking straight wall element (same width as gate) but without an actual template or just a flag/column/obelisk
    64         // "entryTower"    A non-blocking straight wall element (same width as gate) represented by a single (maybe indented) template, example: defence tower, wall tower, outpost, watchtower
    65         // "entryFort"     A non-blocking straight wall element represented by a single (maybe indented) template, example: fortress, palisade fort
    66     // Bending wall elements (Wall corners)
    67         // "cornerIn"      A wall element bending the wall by PI/2 "inside" (left, +, see above), example: wall tower, palisade curve
    68         // "cornerOut"     A wall element bending the wall by PI/2 "outside" (right, -, see above), example: wall tower, palisade curve
    69         // "cornerHalfIn"  A wall element bending the wall by PI/4 "inside" (left, +, see above), example: wall tower, palisade curve. NOTE: Not yet implemented
    70         // "cornerHalfOut" A wall element bending the wall by PI/4 "outside" (right, -, see above), example: wall tower, palisade curve. NOTE: Not yet implemented
    71     // Zero length straight indented (mainly left/right symmetric) wall elements (Outposts/watchtowers and non-defensive base structures)
    72         // "outpost"       A zero-length wall element without bending far indented so it stands outside the wall, example: outpost, defence tower, watchtower
    73         // "house"         A zero-length wall element without bending far indented so it stands inside the wall that grants population bonus, example: house, hut, longhouse
    74         // "barracks"      A zero-length wall element without bending far indented so it stands inside the wall that grants unit production, example: barracks, tavern, ...
    75     this.entity = entity;
    76     this.angle = (angle !== undefined) ? angle : 0*PI;
     54    this.entPath = entPath;
     55    this.angle = (angle !== undefined) ? angle : 0;
    7756    this.width = (width !== undefined) ? width : 0;
    7857    this.indent = (indent !== undefined) ? indent : 0;
    79     this.bending = (bending !== undefined) ? bending : 0*PI;
     58    this.bending = (bending !== undefined) ? bending : 0;
    8059}
    8160
    8261/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     
    8665//  It's mainly the abstract shape defined in a Fortress instances wall because different styles can be used for it (see wallStyles)
    8766//
    8867//  type                  Descriptive string, example: "tiny". Not really needed (WallTool.wallTypes["type string"] is used). Mainly for custom wall elements
    89 //  wall                  Optional. Array of wall element strings. Can be set afterwards. Default is an epty array.
     68//  wall                  Optional. Array of wall element strings. Can be set afterwards. Default is an empty array.
    9069//      Example: ["entrance", "wall", "cornerIn", "wall", "gate", "wall", "entrance", "wall", "cornerIn", "wall", "gate", "wall", "cornerIn", "wall"]
    9170//  centerToFirstElement  Optional. Object with properties "x" and "y" representing a vector from the visual center to the first wall element. Default is undefined
    9271/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    9372function Fortress(type, wall, centerToFirstElement)
    9473{
    95     this.type = type; // Only usefull to get the type of the actual fortress
     74    this.type = type;
    9675    this.wall = (wall !== undefined) ? wall : [];
    9776    this.centerToFirstElement = undefined;
    9877}
     
    10786////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    10887var wallStyles = {};
    10988
    110 // Generic civ dependent wall style definition. "rome_siege" needs some tweek...
    111 var wallScaleByType = {"athen" : 1.5, "brit" : 1.5, "cart" : 1.8, "gaul" : 1.5, "iber" : 1.5, "mace" : 1.5, "maur": 1.5, "pers" : 1.5, "ptol" : 1.5, "rome" : 1.5, "sele" : 1.5, "spart" : 1.5, "rome_siege" : 1.5};
     89// Get wall element width by template file path and angle
     90function getTemplateWidthByAngle(entPath, angle)
     91{
     92    var template = RMS.GetTemplate(entPath);
     93    var width = getTemplateValue(entPath, ["WallPiece", "Length"]) / CELL_SIZE;
     94   
     95    return width;
     96}
     97
     98// Add new WallElement by it's properties
     99function addNewWallElement(style, type, angle)
     100{
     101    var templatePath = "structures/" + style + "_" + type
     102    wallStyles[style][type] = new WallElement(type, templatePath, angle, getTemplateWidthByAngle(templatePath, angle));
     103}
     104
     105// Find all wall sets by civ to be then put into wallStyles
     106var entitiesByCiv = {};
     107var civList = getCivList();
     108for (var i = 0; i < civList.length; i++)
     109{
     110    var civ = civList[i];
     111    var templatePathList = getTempatePathList(civ);
     112    entitiesByCiv[civ] = templatePathList;
     113}
     114
     115// Generic civ dependent wall style definition. Some, e.g. "rome_siege" needs tweaking...
     116var wallScaleByType = {}; // To be removed TODO
     117var civData = getFullCivData();
     118for (var i = 0; i < civList.length; i++)
     119{
     120    var civ = civList[i];
     121    var wallSets = civData[civ].WallSets;
     122    if (wallSets.hasOwnProperty("Stone"))
     123        wallScaleByType[civ] = wallSets.Stone.Scale;
     124}
     125// Non-civ but civ specific wall styles
     126wallScaleByType.rome_siege = 1.5;
    112127for (var style in wallScaleByType)
    113128{
    114129    var civ = style;
     
    116131        civ = "rome";
    117132    wallStyles[style] = {};
    118133    // Default wall elements
    119     wallStyles[style]["tower"] = new WallElement("tower", "structures/" + style + "_wall_tower", PI, wallScaleByType[style]);
     134    var templatePath = "structures/" + style + "_wall_tower";
     135    var angle = PI;
     136    var width = getTemplateWidthByAngle(templatePath, angle); // DEBUG
     137    log("getTemplateWidthByAngle(" + templatePath + ") =  " + width + ", used to be width = " + wallScaleByType[style]); // DEBUG
     138    // wallStyles[style]["tower"] = new WallElement("tower", templatePath, angle, width);//wallScaleByType[style]);
     139    addNewWallElement(style, "wall_tower", PI);
     140    wallStyles[style]["tower"] = wallStyles[style]["wall_tower"]; // Shortcut
     141   
    120142    wallStyles[style]["endLeft"] = new WallElement("endLeft", "structures/" + style + "_wall_tower", PI, wallScaleByType[style]); // Same as tower. To be compatible with palisades...
    121143    wallStyles[style]["endRight"] = new WallElement("endRight", "structures/" + style + "_wall_tower", PI, wallScaleByType[style]); // Same as tower. To be compatible with palisades...
    122144    wallStyles[style]["cornerIn"] = new WallElement("cornerIn", "structures/" + style + "_wall_tower", 5*PI/4, 0, 0.35*wallScaleByType[style], PI/2); // 2^0.5 / 4 ~= 0.35 ~= 1/3
    123145    wallStyles[style]["cornerOut"] = new WallElement("cornerOut", "structures/" + style + "_wall_tower", 3*PI/4, 0.71*wallScaleByType[style], 0, -PI/2); // // 2^0.5 / 2 ~= 0.71 ~= 2/3
     146   
     147    var templatePath = "structures/" + style + "_wall_short"; // DEBUG
     148    var angle = 0*PI; // DEBUG
     149    var width = getTemplateWidthByAngle(templatePath, angle); // DEBUG
     150    log("getTemplateWidthByAngle(" + templatePath + ") =  " + width + ", used to be width = " + 2*wallScaleByType[style]); // DEBUG
    124151    wallStyles[style]["wallShort"] = new WallElement("wallShort", "structures/" + style + "_wall_short", 0*PI, 2*wallScaleByType[style]);
     152   
     153    var templatePath = "structures/" + style + "_wall_medium"; // DEBUG
     154    var angle = 0*PI; // DEBUG
     155    var width = getTemplateWidthByAngle(templatePath, angle); // DEBUG
     156    log("getTemplateWidthByAngle(" + templatePath + ") =  " + width + ", used to be width = " + 4*wallScaleByType[style]); // DEBUG
    125157    wallStyles[style]["wall"] = new WallElement("wall", "structures/" + style + "_wall_medium", 0*PI, 4*wallScaleByType[style]);
     158   
    126159    wallStyles[style]["wallMedium"] = new WallElement("wall", "structures/" + style + "_wall_medium", 0*PI, 4*wallScaleByType[style]);
     160   
     161    var templatePath = "structures/" + style + "_wall_long"; // DEBUG
     162    var angle = 0*PI; // DEBUG
     163    var width = getTemplateWidthByAngle(templatePath, angle); // DEBUG
     164    log("getTemplateWidthByAngle(" + templatePath + ") =  " + width + ", used to be width = " + 6*wallScaleByType[style]); // DEBUG
    127165    wallStyles[style]["wallLong"] = new WallElement("wallLong", "structures/" + style + "_wall_long", 0*PI, 6*wallScaleByType[style]);
     166   
    128167    // Gate and entrance wall elements
    129168    var gateWidth = 6*wallScaleByType[style];
     169   
     170    var templatePath = "structures/" + style + "_wall_gate"; // DEBUG
     171    var angle = PI; // DEBUG
     172    var width = getTemplateWidthByAngle(templatePath, angle); // DEBUG
     173    log("getTemplateWidthByAngle(" + templatePath + ") =  " + width + ", used to be width = " + 6*wallScaleByType[style]); // DEBUG
    130174    wallStyles[style]["gate"] = new WallElement("gate", "structures/" + style + "_wall_gate", PI, gateWidth);
     175   
    131176    wallStyles[style]["entry"] = new WallElement("entry", undefined, 0*PI, gateWidth);
    132177    wallStyles[style]["entryTower"] = new WallElement("entryTower", "structures/" + civ + "_defense_tower", PI, gateWidth, -4*wallScaleByType[style]);
    133178    wallStyles[style]["entryFort"] = new WallElement("entryFort", "structures/" + civ + "_fortress", 0*PI, 8*wallScaleByType[style], 6*wallScaleByType[style]);
     
    150195    wallStyles[style]["space3"] = new WallElement("space3", undefined, 0*PI, 3*wallScaleByType[style]);
    151196    wallStyles[style]["space4"] = new WallElement("space4", undefined, 0*PI, 4*wallScaleByType[style]);
    152197}
    153 // Add wall fortresses for all generic styles
    154 wallStyles["athen"]["wallFort"] = new WallElement("wallFort", "structures/athen_fortress", 2*PI/2 /* PI/2 */, 5.1 /* 5.6 */, 1.9 /* 1.9 */);
    155 wallStyles["brit"]["wallFort"] = new WallElement("wallFort", "structures/brit_fortress", PI, 2.8);
    156 wallStyles["cart"]["wallFort"] = new WallElement("wallFort", "structures/cart_fortress", PI, 5.1, 1.6);
    157 wallStyles["gaul"]["wallFort"] = new WallElement("wallFort", "structures/gaul_fortress", PI, 4.2, 1.5);
    158 wallStyles["iber"]["wallFort"] = new WallElement("wallFort", "structures/iber_fortress", PI, 5, 0.2);
    159 wallStyles["mace"]["wallFort"] = new WallElement("wallFort", "structures/mace_fortress", 2*PI/2 /* PI/2 */, 5.1 /* 5.6 */, 1.9 /* 1.9 */);
    160 wallStyles["maur"]["wallFort"] = new WallElement("wallFort", "structures/maur_fortress", PI, 5.5);
    161 wallStyles["pers"]["wallFort"] = new WallElement("wallFort", "structures/pers_fortress", PI, 5.6/*5.5*/, 1.9/*1.7*/);
    162 wallStyles["ptol"]["wallFort"] = new WallElement("wallFort", "structures/ptol_fortress", 2*PI/2 /* PI/2 */, 5.1 /* 5.6 */, 1.9 /* 1.9 */);
    163 wallStyles["rome"]["wallFort"] = new WallElement("wallFort", "structures/rome_fortress", PI, 6.3, 2.1);
    164 wallStyles["sele"]["wallFort"] = new WallElement("wallFort", "structures/sele_fortress", 2*PI/2 /* PI/2 */, 5.1 /* 5.6 */, 1.9 /* 1.9 */);
    165 wallStyles["spart"]["wallFort"] = new WallElement("wallFort", "structures/spart_fortress", 2*PI/2 /* PI/2 */, 5.1 /* 5.6 */, 1.9 /* 1.9 */);
    166198// Adjust "rome_siege" style
    167 wallStyles["rome_siege"]["wallFort"] = new WallElement("wallFort", "structures/rome_army_camp", PI, 7.2, 2);
    168 wallStyles["rome_siege"]["entryFort"] = new WallElement("entryFort", "structures/rome_army_camp", PI, 12, 7);
    169199wallStyles["rome_siege"]["house"] = new WallElement("house", "structures/rome_tent", PI, 0, 4);
    170200
    171201// Add special wall styles not well to implement generic (and to show how custom styles can be added)
     
    178208wallStyles["palisades"]["wallLong"] = new WallElement("wall", "other/palisades_rocks_long", 0*PI, 3.5);
    179209wallStyles["palisades"]["wallShort"] = new WallElement("wall", "other/palisades_rocks_short", 0*PI, 1.2);
    180210wallStyles["palisades"]["tower"] = new WallElement("tower", "other/palisades_rocks_tower", -PI/2, 0.7);
    181 wallStyles["palisades"]["wallFort"] = new WallElement("wallFort", "other/palisades_rocks_fort", PI, 1.7);
     211// wallStyles["palisades"]["wallFort"] = new WallElement("wallFort", "other/palisades_rocks_fort", PI, 1.7);
    182212wallStyles["palisades"]["gate"] = new WallElement("gate", "other/palisades_rocks_gate", PI, 3.6);
    183213wallStyles["palisades"]["entry"] = new WallElement("entry", undefined, wallStyles["palisades"]["gate"].angle, wallStyles["palisades"]["gate"].width);
    184214wallStyles["palisades"]["entryTower"] = new WallElement("entryTower", "other/palisades_rocks_watchtower", 0*PI, wallStyles["palisades"]["gate"].width, -3);
     
    208238wallStyles["road"]["tLeft"] = new WallElement("road", "actor|props/special/eyecandy/road_temperate_intersect_T.xml", PI, 4.5, 1.25);
    209239wallStyles["road"]["tRight"] = new WallElement("road", "actor|props/special/eyecandy/road_temperate_intersect_T.xml", 0*PI, 4.5, -1.25);
    210240
    211 // Add special wall element collection "other"
    212 // NOTE: This is not a wall style in the common sense. Use with care!
    213 wallStyles["other"] = {};
    214 wallStyles["other"]["fence"] = new WallElement("fence", "other/fence_long", -PI/2, 3.1);
    215 wallStyles["other"]["fence_medium"] = new WallElement("fence", "other/fence_long", -PI/2, 3.1);
    216 wallStyles["other"]["fence_short"] = new WallElement("fence_short", "other/fence_short", -PI/2, 1.5);
    217 wallStyles["other"]["fence_stone"] = new WallElement("fence_stone", "other/fence_stone", -PI/2, 2.5);
    218 wallStyles["other"]["palisade"] = new WallElement("palisade", "other/palisades_rocks_short", 0, 1.2);
    219 wallStyles["other"]["column"] = new WallElement("column", "other/column_doric", 0, 1);
    220 wallStyles["other"]["obelisk"] = new WallElement("obelisk", "other/obelisk", 0, 2);
    221 wallStyles["other"]["spike"] = new WallElement("spike", "other/palisades_angle_spike", -PI/2, 1);
    222 wallStyles["other"]["bench"] = new WallElement("bench", "other/bench", PI/2, 1.5);
    223 wallStyles["other"]["benchForTable"] = new WallElement("benchForTable", "other/bench", 0, 0.5);
    224 wallStyles["other"]["table"] = new WallElement("table", "other/table_rectangle", 0, 1);
    225 wallStyles["other"]["table_square"] = new WallElement("table_square", "other/table_square", PI/2, 1);
    226 wallStyles["other"]["flag"] = new WallElement("flag", "special/rallypoint", PI, 1);
    227 wallStyles["other"]["standing_stone"] = new WallElement("standing_stone", "gaia/special_ruins_standing_stone", PI, 1);
    228 wallStyles["other"]["settlement"] = new WallElement("settlement", "gaia/special_settlement", PI, 6);
    229 wallStyles["other"]["gap"] = new WallElement("gap", undefined, 0, 2);
    230 wallStyles["other"]["gapSmall"] = new WallElement("gapSmall", undefined, 0, 1);
    231 wallStyles["other"]["gapLarge"] = new WallElement("gapLarge", undefined, 0, 4);
    232 wallStyles["other"]["cornerIn"] = new WallElement("cornerIn", undefined, 0, 0, 0, PI/2);
    233 wallStyles["other"]["cornerOut"] = new WallElement("cornerOut", undefined, 0, 0, 0, -PI/2);
    234241
    235 
    236242////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    237243//  fortressTypes data structure for some default fortress types
    238244//
     
    339345    {
    340346        var element = wallStyles[style][wall[i]];
    341347        if (element === undefined && i == 0)
    342             warn("No valid wall element: " + wall[i]);
     348            warn("No valid wall element: style = " + style + ", wall[" + i + "] = " + wall[i] + ", wallStyles[" + style + "][wall[" + i + "]] = " + wallStyles[style][wall[i]] + ", element = " + element + ", wall = " + wall);
    343349        // Indentation
    344350        var placeX = wallX - element.indent * cos(orientation);
    345351        var placeY = wallY - element.indent * sin(orientation);
    346352        // Add wall elements entity placement arguments to the alignment
    347         alignment.push({"x": placeX, "y": placeY, "entity": element.entity, "angle":orientation + element.angle});
     353        alignment.push({"x": placeX, "y": placeY, "entPath": element.entPath, "angle":orientation + element.angle});
    348354        // Preset vars for the next wall element
    349355        if (i+1 < wall.length)
    350356        {
    351357            orientation += element.bending;
    352358            var nextElement = wallStyles[style][wall[i+1]];
    353359            if (nextElement === undefined)
    354                 warn("No valid wall element: " + wall[i+1]);
     360                warn("No valid wall element: style = " + style + ", wall[" + (i+1) + "] = " + wall[i+1] + ", wallStyles[" + style + "][wall[" + (i+1) + "]] = " + wallStyles[style][wall[i+1]] + ", nextElement = " + uneval(nextElement) + ", wall = " + wall);
    355361            var distance = (element.width + nextElement.width)/2;
    356362            // Corrections for elements with indent AND bending
    357363            var indent = element.indent;
     
    427433//  Places a wall with wall elements attached to another like determined by WallElement properties.
    428434//
    429435//  startX, startY  Where the first wall element should be placed
    430 //  wall            Array of wall element type strings. Example: ["endLeft", "wallLong", "tower", "wallLong", "endRight"]
     436//  wall            Array of wall element types. Example: ["endLeft", "wallLong", "tower", "wallLong", "endRight"]
    431437//  style           Optional. Wall style string. Default is the civ of the given player, "palisades" for gaia
    432438//  playerId        Optional. Number of the player the wall will be placed for. Default is 0 (gaia)
    433439//  orientation     Optional. Angle the first wall element is placed. Default is 0
     
    455461    // Place the wall
    456462    for (var iWall = 0; iWall < wall.length; iWall++)
    457463    {
    458         var entity = AM[iWall].entity;
    459         if (entity !== undefined)
    460             placeObject(AM[iWall].x, AM[iWall].y, entity, playerId, AM[iWall].angle);
     464        var entPath = AM[iWall].entPath;
     465        if (entPath !== undefined)
     466            placeObject(AM[iWall].x, AM[iWall].y, entPath, playerId, AM[iWall].angle);
    461467    }
    462468}
    463469
     
    526532//
    527533//  startX/startY    Coordinate of the approximate beginning of the wall (Not the place of the first wall element)
    528534//  targetX/targetY  Coordinate of the approximate ending of the wall (Not the place of the last wall element)
    529 //  wallPart         Optional. An array of NON-BENDING wall element type strings. Default is ["tower", "wallLong"]
     535//  wallPart         Optional. An array of NON-BENDING wall element types. Default is ["tower", "wallLong"]
    530536//  style            Optional. Wall style string. Default is the civ of the given player, "palisades" for gaia
    531537//  playerId         Optional. Integer number of the player. Default is 0 (gaia)
    532538//  endWithFirst     Optional. A boolean value. If true the 1st wall element in the wallPart array will finalize the wall. Default is true
     
    552558    {
    553559        var bending = wallStyles[style][wallPart[elementIndex]].bending;
    554560        if (bending != 0)
    555             warn("Bending is not supported by placeLinearWall but a bending wall element is used: " + wallPart[elementIndex] + " -> wallStyles[style][wallPart[elementIndex]].entity");
     561            warn("Bending is not supported by placeLinearWall but a bending wall element is used: " + wallPart[elementIndex] + " -> wallStyles[style][wallPart[elementIndex]].entPath");
    556562    }
    557563    // Setup number of wall parts
    558564    var totalLength = getDistance(startX, startY, targetX, targetY);
     
    588594            var placeX = x - wallEle.indent * sin(wallAngle);
    589595            var placeY = y + wallEle.indent * cos(wallAngle);
    590596            // Placement
    591             var entity = wallEle.entity;
    592             if (entity !== undefined)
    593                 placeObject(placeX, placeY, entity, playerId, placeAngle + wallEle.angle);
     597            var entPath = wallEle.entPath;
     598            if (entPath !== undefined)
     599                placeObject(placeX, placeY, entPath, playerId, placeAngle + wallEle.angle);
    594600            x += scaleFactor * wallEle.width/2 * cos(wallAngle);
    595601            y += scaleFactor * wallEle.width/2 * sin(wallAngle);
    596602        }
     
    600606        var wallEle = wallStyles[style][wallPart[0]];
    601607        x += scaleFactor * wallEle.width/2 * cos(wallAngle);
    602608        y += scaleFactor * wallEle.width/2 * sin(wallAngle);
    603         var entity = wallEle.entity;
    604         if (entity !== undefined)
    605             placeObject(x, y, entity, playerId, placeAngle + wallEle.angle);
     609        var entPath = wallEle.entPath;
     610        if (entPath !== undefined)
     611            placeObject(x, y, entPath, playerId, placeAngle + wallEle.angle);
    606612    }
    607613}
    608614
     
    615621//
    616622//  centerX/Y     Coordinates of the circle's center
    617623//  radius        How wide the circle should be (approximate, especially if maxBendOff != 0)
    618 //  wallPart      Optional. An array of NON-BENDING wall element type strings. Default is ["tower", "wallLong"]
     624//  wallPart      Optional. An array of NON-BENDING wall element types. Default is ["tower", "wallLong"]
    619625//  style         Optional. Wall style string. Default is the civ of the given player, "palisades" for gaia
    620626//  playerId      Optional. Integer number of the player. Default is 0 (gaia)
    621627//  orientation   Optional. Where the open part of the (circular) arc should face (if maxAngle is < 2*PI). Default is 0
     
    624630//  maxBendOff    Optional. How irregular the circle should be. 0 means regular circle, PI/2 means very irregular. Default is 0 (regular circle)
    625631//
    626632//  NOTE: Don't use wall elements with bending like corners!
    627 //  TODO: Perhaps add eccentricity and maxBendOff functionality (untill now an unused argument)
     633//  TODO: Perhaps add eccentricity
     634//  TODO: Check if maxBendOff parameter works in all cases
    628635//  TODO: Perhaps add functionality for spirals
    629636/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    630637function placeCircularWall(centerX, centerY, radius, wallPart, style, playerId, orientation, maxAngle, endWithFirst, maxBendOff)
     
    652659   
    653660    // Check arguments
    654661    if (maxBendOff > PI/2 || maxBendOff < 0)
    655         warn("placeCircularWall maxBendOff sould satisfy 0 < maxBendOff < PI/2 (~1.5) but it is: " + maxBendOff);
     662        warn("placeCircularWall maxBendOff should satisfy 0 < maxBendOff < PI/2 (~1.5) but it is: " + maxBendOff);
    656663    for (var elementIndex = 0; elementIndex < wallPart.length; elementIndex++)
    657664    {
    658665        var bending = wallStyles[style][wallPart[elementIndex]].bending;
     
    699706            placeX -= wallEle.indent * cos(placeAngle);
    700707            placeY -= wallEle.indent * sin(placeAngle);
    701708            // Placement
    702             var entity = wallEle.entity;
    703             if (entity !== undefined)
    704                 placeObject(placeX, placeY, entity, playerId, placeAngle + wallEle.angle);
     709            var entPath = wallEle.entPath;
     710            if (entPath !== undefined)
     711                placeObject(placeX, placeY, entPath, playerId, placeAngle + wallEle.angle);
    705712            // Prepare for the next wall element
    706713            actualAngle += addAngle;
    707714            x = centerX + radius*cos(actualAngle);
     
    717724        var placeX = x + (targetX - x)/2;
    718725        var placeY = y + (targetY - y)/2;
    719726        var placeAngle = actualAngle + addAngle/2;
    720         placeObject(placeX, placeY, wallEle.entity, playerId, placeAngle + wallEle.angle);
     727        placeObject(placeX, placeY, wallEle.entPath, playerId, placeAngle + wallEle.angle);
    721728    }
    722729}
    723730
     
    728735//
    729736//  centerX/Y          Coordinates of the polygon's center
    730737//  radius             How wide the circle should be in which the polygon fits
    731 //  wallPart           Optional. An array of NON-BENDING wall element type strings. Default is ["wallLong", "tower"]
     738//  wallPart           Optional. An array of NON-BENDING wall element types. Default is ["wallLong", "tower"]
    732739//  cornerWallElement  Optional. Wall element to be placed at the polygon's corners. Default is "tower"
    733740//  style              Optional. Wall style string. Default is the civ of the given player, "palisades" for gaia
    734741//  playerId           Optional. Integer number of the player. Default is 0 (gaia)
     
    769776    for (var i = 0; i < numCorners; i++)
    770777    {
    771778        var angleToCorner = getAngle(corners[i][0], corners[i][1], centerX, centerY);
    772         placeObject(corners[i][0], corners[i][1], wallStyles[style][cornerWallElement].entity, playerId, angleToCorner);
     779        placeObject(corners[i][0], corners[i][1], wallStyles[style][cornerWallElement].entPath, playerId, angleToCorner);
    773780        if (!(skipFirstWall && i == 0))
    774781        {
    775782            placeLinearWall(
     
    899906    for (var i = 0; i < numCorners; i++)
    900907    {
    901908        var angleToCorner = getAngle(corners[i][0], corners[i][1], centerX, centerY);
    902         placeObject(corners[i][0], corners[i][1], wallStyles[style][cornerWallElement].entity, playerId, angleToCorner);
     909        placeObject(corners[i][0], corners[i][1], wallStyles[style][cornerWallElement].entPath, playerId, angleToCorner);
    903910        if (!(skipFirstWall && i == 0))
    904911        {
    905912            placeLinearWall(
     
    9961003        var wallElement = "wallLong";
    9971004        if ((pointIndex + 1) % gateOccurence == 0)
    9981005            wallElement = "gate";
    999         var entity = wallStyles[style][wallElement].entity;
    1000         if (entity)
     1006        var entPath = wallStyles[style][wallElement].entPath;
     1007        if (entPath)
    10011008        {
    10021009            placeObject(startX + (getDistance(startX, startY, targetX, targetY)/2)*cos(angle), // placeX
    10031010                startY + (getDistance(startX, startY, targetX, targetY)/2)*sin(angle), // placeY
    1004                 entity, playerId, angle - PI/2 + wallStyles[style][wallElement].angle);
     1011                entPath, playerId, angle - PI/2 + wallStyles[style][wallElement].angle);
    10051012        }
    10061013        // Place tower
    10071014        var startX = centerX + bestPointDerivation[(pointIndex + bestPointDerivation.length - 1) % bestPointDerivation.length][0];
    10081015        var startY = centerY + bestPointDerivation[(pointIndex + bestPointDerivation.length - 1) % bestPointDerivation.length][1];
    10091016        var angle = getAngle(startX, startY, targetX, targetY);
    1010         placeObject(centerX + bestPointDerivation[pointIndex][0], centerY + bestPointDerivation[pointIndex][1], wallStyles[style]["tower"].entity, playerId, angle - PI/2 + wallStyles[style]["tower"].angle);
     1017        placeObject(centerX + bestPointDerivation[pointIndex][0], centerY + bestPointDerivation[pointIndex][1], wallStyles[style]["tower"].entPath, playerId, angle - PI/2 + wallStyles[style]["tower"].angle);
    10111018    }
    10121019}
  • binaries/data/mods/public/maps/random/schwarzwald.js

     
    131131// Setup paths
    132132var pathSucsessRadius = baseRadius/2;
    133133var pathAngleOff = PI/2;
    134 var pathWidth = 10; // This is not really the path's thickness in tiles but the number of tiles in the clumbs of the path
     134var pathWidth = 10; // This is not really the path's thickness in tiles but the number of tiles in the clumps of the path
    135135
    136136// Setup additional resources
    137137var resourceRadius = 2*mapRadius/3; // 3*mapRadius/8;
     
    232232//
    233233////////////////
    234234
    235 // Some heightmap constants
    236 const MIN_HEIGHT = - SEA_LEVEL; // -20
    237 const MAX_HEIGHT = 0xFFFF/HEIGHT_UNITS_PER_METRE - SEA_LEVEL; // A bit smaller than 90
    238 
    239235// Get the diferrence between minimum and maxumum height
    240236function getMinAndMaxHeight(reliefmap)
    241237{
  • binaries/data/mods/public/maps/random/wall_demo.js

     
    6262var actualX = distToMapBorder;
    6363var actualY = distToMapBorder;
    6464// Wall styles are chosen by strings so the civ strings got by getCivCode() can be used
    65 // Other styles may be present as well but besides the civ styles only 'palisades' includes all wall element types (yet)
    66 const wallStyleList = ["athen", "brit", "cart", "gaul", "iber", "mace", "maur", "pers", "ptol", "rome", "sele", "spart", "rome_siege", "palisades"];
     65var wallStyleList = getCivList();
     66// Other styles may be available as well...
     67wallStyleList.push("rome_siege");
     68wallStyleList.push("palisades");
     69// Check if all wall styles are present and remove unknown ones
     70for (var i = 0; i < wallStyleList.length; i++)
     71    if (!wallStyles.hasOwnProperty(wallStyleList[i]))
     72        wallStyleList.splice(i, 1);
    6773
    6874
    6975////////////////////////////////////////
    7076// Custom wall placement (element based)
    7177////////////////////////////////////////
    72 var wall = ['endLeft', 'wallLong', 'tower', 'wall', 'outpost', 'wall', 'cornerOut', 'wall', 'cornerIn', 'wall', 'house', 'endRight', 'entryTower', 'endLeft', 'wallShort', 'barracks', 'gate', 'tower', 'wall', 'wallFort', 'wall', 'endRight'];
     78var wall = ['endLeft', 'wallLong', 'tower', 'tower', 'tower', 'wall', 'outpost', 'wall', 'cornerOut', 'wall', 'cornerIn', 'wall', 'house', 'endRight', 'entryTower', 'endLeft', 'wallShort', 'barracks', 'gate', 'tower', 'wall', 'endRight'];
    7379for (var styleIndex = 0; styleIndex < wallStyleList.length; styleIndex++)
    7480{
    7581    var startX = actualX + styleIndex * buildableMapSize/wallStyleList.length; // X coordinate of the first wall element
    7682    var startY = actualY; // Y coordinate of the first wall element
    77     var style = wallStyleList[styleIndex]; // // The wall's style like 'cart', 'iber', 'pers', 'rome', 'romeSiege' or 'palisades'
    78     var orientation = styleIndex * PI/64; // Orientation of the first wall element. 0 means 'outside' or 'front' is right (positive X, like object placement)
     83    var style = wallStyleList[styleIndex]; // The wall's style like 'cart', 'iber', 'pers', 'rome', 'romeSiege' or 'palisades'
     84    var orientation = PI/16 * sin(styleIndex * PI/4); // Orientation of the first wall element. 0 means 'outside' or 'front' is right (positive X, like object placement in Atlas)
    7985    // That means the wall will be build towards top (positive Y) if no corners are used
    8086    var playerId = 0; // Owner of the wall (like in placeObject). 0 is Gaia, 1 is Player 1 (default color blue), ...
    8187    placeWall(startX, startY, wall, style, playerId, orientation); // Actually placing the wall
     
    155161{
    156162    for (var wallIndex = 0; wallIndex < numWallsPerStyle; wallIndex++)
    157163    {
    158         var startX = actualX + (styleIndex * numWallsPerStyle + wallIndex) * distToOtherWalls; // X coordinate the wall will start from
     164        var startX = actualX + (styleIndex * numWallsPerStyle + wallIndex) * buildableMapSize/wallStyleList.length/numWallsPerStyle; // X coordinate the wall will start from
    159165        var startY = actualY; // Y coordinate the wall will start from
    160166        var endX = startX; // X coordinate the wall will end
    161167        var endY = actualY + (wallIndex + 1) * maxWallLength/numWallsPerStyle; // Y coordinate the wall will end
     
    167173        // placeObject(endX, endY, 'other/obelisk', 0, 0*PI); // Place visual marker to see where exsactly the wall ends
    168174    }
    169175}
    170 actualX = distToMapBorder; // Reset actualX
    171 actualY += maxWallLength + distToOtherWalls; // Increase actualY for next wall placement method
    172176
    173177
    174178// Export map data
  • binaries/data/mods/public/maps/random/wall_demo.json

     
    22    "settings" : {
    33        "Name" : "Wall Demo",
    44        "Script" : "wall_demo.js",
    5         "Description" : "A demonstration of wall placement methods/code in random maps. Very large map size is recommended.",
     5        "Description" : "A demonstration of wall placement methods/code in random maps. Giant map size is recommended!",
    66        "BaseTerrain" : ["grass1"],
    77        "BaseHeight" : 0,
    88        "Keywords": ["demo"],
  • binaries/data/mods/public/simulation/data/civs/athen.json

     
    109109            "Special":"Train heroes and research technology pertaining to heroes."
    110110        }
    111111    ],
     112    "WallSets":
     113    {
     114        "Palisades":
     115        {
     116            "Template": "other/wallset_palisade",
     117            "Scale": 0.55
     118        },
     119        "Stone":
     120        {
     121            "Template": "structures/athen_wallset_stone",
     122            "Scale": 1.5
     123        }
     124    },
    112125    "StartEntities":
    113126    [
    114127        {
  • binaries/data/mods/public/simulation/data/civs/brit.json

     
    8787            "Special": ""
    8888        }
    8989    ],
     90    "WallSets":
     91    {
     92        "Palisades":
     93        {
     94            "Template": "other/wallset_palisade",
     95            "Scale": 0.55
     96        },
     97        "Stone":
     98        {
     99            "Template": "structures/athen_wallset_stone",
     100            "Scale": 1.5
     101        }
     102    },
    90103    "StartEntities":
    91104    [
    92105        {
  • binaries/data/mods/public/simulation/data/civs/cart.json

     
    112112            "Special":"Hire Iberian mercenaries."
    113113        }       
    114114    ],
     115    "WallSets":
     116    {
     117        "Palisades":
     118        {
     119            "Template": "other/wallset_palisade",
     120            "Scale": 0.55
     121        },
     122        "Stone":
     123        {
     124            "Template": "structures/athen_wallset_stone",
     125            "Scale": 1.8
     126        }
     127    },
    115128    "StartEntities":
    116129    [
    117130        {
  • binaries/data/mods/public/simulation/data/civs/gaul.json

     
    8787            "Special": ""
    8888        }
    8989    ],
     90    "WallSets":
     91    {
     92        "Palisades":
     93        {
     94            "Template": "other/wallset_palisade",
     95            "Scale": 0.55
     96        },
     97        "Stone":
     98        {
     99            "Template": "structures/athen_wallset_stone",
     100            "Scale": 1.5
     101        }
     102    },
    90103    "StartEntities":
    91104    [
    92105        {
  • binaries/data/mods/public/simulation/data/civs/iber.json

     
    8585            "Special": "Defensive Aura - Gives all Iberian units and buildings within vision range of the monument a 10-15% attack boost. Build Limit: Only 5 may be built per map."
    8686        }
    8787    ],
     88    "WallSets":
     89    {
     90        "Palisades":
     91        {
     92            "Template": "other/wallset_palisade",
     93            "Scale": 0.55
     94        },
     95        "Stone":
     96        {
     97            "Template": "structures/athen_wallset_stone",
     98            "Scale": 1.5
     99        }
     100    },
    88101    "StartEntities":
    89102    [
    90103        {
  • binaries/data/mods/public/simulation/data/civs/mace.json

     
    114114            "Special":"Constructs and upgrades all Macedonian siege engines."
    115115        }
    116116    ],
     117    "WallSets":
     118    {
     119        "Palisades":
     120        {
     121            "Template": "other/wallset_palisade",
     122            "Scale": 0.55
     123        },
     124        "Stone":
     125        {
     126            "Template": "structures/athen_wallset_stone",
     127            "Scale": 1.5
     128        }
     129    },
    117130    "StartEntities":
    118131    [
    119132        {
  • binaries/data/mods/public/simulation/data/civs/maur.json

     
    9494            "Special":"Contentment: +10% Health and +10% resource gathering rates for all citizens and allied citizens within its range. Can be built anywhere except in enemy territory. Max Built: 10."
    9595        }
    9696    ],
     97    "WallSets":
     98    {
     99        "Palisades":
     100        {
     101            "Template": "other/wallset_palisade",
     102            "Scale": 0.55
     103        },
     104        "Stone":
     105        {
     106            "Template": "structures/athen_wallset_stone",
     107            "Scale": 1.5
     108        }
     109    },
    97110    "StartEntities":
    98111    [
    99112        {
  • binaries/data/mods/public/simulation/data/civs/pers.json

     
    104104            "Special": "Train heroes and Persian Immortals. Gives a slow trickle of all resources as 'Satrapy Tribute.'"
    105105        }
    106106    ],
     107    "WallSets":
     108    {
     109        "Palisades":
     110        {
     111            "Template": "other/wallset_palisade",
     112            "Scale": 0.55
     113        },
     114        "Stone":
     115        {
     116            "Template": "structures/athen_wallset_stone",
     117            "Scale": 1.5
     118        }
     119    },
    107120    "StartEntities":
    108121    [
    109122        {
  • binaries/data/mods/public/simulation/data/civs/ptol.json

     
    113113            "Special":"When built along the shoreline, removes shroud of darkness over all the water, revealing all the coast lines on the map. Limit: 1."
    114114        }
    115115    ],
     116    "WallSets":
     117    {
     118        "Palisades":
     119        {
     120            "Template": "other/wallset_palisade",
     121            "Scale": 0.55
     122        },
     123        "Stone":
     124        {
     125            "Template": "structures/athen_wallset_stone",
     126            "Scale": 1.5
     127        }
     128    },
    116129    "StartEntities":
    117130    [
    118131        {
  • binaries/data/mods/public/simulation/data/civs/rome.json

     
    8989            "Special": "Can be built in neutral and enemy territory to strangle enemy towns."
    9090        }
    9191    ],
     92    "WallSets":
     93    {
     94        "Palisades":
     95        {
     96            "Template": "other/wallset_palisade",
     97            "Scale": 0.55
     98        },
     99        "Stone":
     100        {
     101            "Template": "structures/athen_wallset_stone",
     102            "Scale": 1.5
     103        },
     104        "Siege":
     105        {
     106            "Template": "structures/rome_wallset_siege",
     107            "Scale": 1.5
     108        }
     109    },
    92110    "StartEntities":
    93111    [
    94112        {
  • binaries/data/mods/public/simulation/data/civs/sele.json

     
    114114            "Special":"This is the Seleucid expansion building, similar to Civic Centers for other factions. It is weaker and carries a smaller territory influence, but is cheaper and built faster."
    115115        }
    116116    ],
     117    "WallSets":
     118    {
     119        "Palisades":
     120        {
     121            "Template": "other/wallset_palisade",
     122            "Scale": 0.55
     123        },
     124        "Stone":
     125        {
     126            "Template": "structures/athen_wallset_stone",
     127            "Scale": 1.5
     128        }
     129    },
    117130    "StartEntities":
    118131    [
    119132        {
  • binaries/data/mods/public/simulation/data/civs/spart.json

     
    105105            "Special":"Train heroes and Spartiates and research technologies related to them."
    106106        }
    107107    ],
     108    "WallSets":
     109    {
     110        "Palisades":
     111        {
     112            "Template": "other/wallset_palisade",
     113            "Scale": 0.55
     114        },
     115        "Stone":
     116        {
     117            "Template": "structures/athen_wallset_stone",
     118            "Scale": 1.5
     119        }
     120    },
    108121    "StartEntities":
    109122    [
    110123        {
  • binaries/data/mods/public/simulation/templates/structures/athen_wall_tower.xml

     
    1616    <Actor>structures/hellenes/wall_tower.xml</Actor>
    1717  </VisualActor>
    1818  <WallPiece>
    19     <Length>7.5</Length>
     19    <Length>7.0</Length>
    2020  </WallPiece>
    2121</Entity>
     22 No newline at end of file
  • binaries/data/mods/public/simulation/templates/structures/brit_wall_tower.xml

     
    2020    <Actor>structures/celts/wall_tower.xml</Actor>
    2121  </VisualActor>
    2222  <WallPiece>
    23     <Length>9.0</Length>
     23    <Length>7.0</Length>
    2424  </WallPiece>
    2525</Entity>
  • binaries/data/mods/public/simulation/templates/structures/cart_wall_tower.xml

     
    2020    <FoundationActor>structures/fndn_3x3.xml</FoundationActor>
    2121  </VisualActor>
    2222  <WallPiece>
    23     <Length>11.0</Length>
     23    <Length>10.5</Length>
    2424  </WallPiece>
    2525</Entity>
  • binaries/data/mods/public/simulation/templates/structures/gaul_wall_tower.xml

     
    2020    <Actor>structures/celts/wall_tower.xml</Actor>
    2121  </VisualActor>
    2222  <WallPiece>
    23     <Length>9.0</Length>
     23    <Length>7.0</Length>
    2424  </WallPiece>
    2525</Entity>
  • binaries/data/mods/public/simulation/templates/structures/iber_wall_tower.xml

     
    2121    <Actor>structures/iberians/wall_tower.xml</Actor>
    2222  </VisualActor>
    2323  <WallPiece>
    24     <Length>10</Length>
     24    <Length>8.5</Length>
    2525  </WallPiece>
    2626</Entity>
  • binaries/data/mods/public/simulation/templates/structures/mace_wall_tower.xml

     
    1616    <Actor>structures/hellenes/wall_tower.xml</Actor>
    1717  </VisualActor>
    1818  <WallPiece>
    19     <Length>7.5</Length>
     19    <Length>7.0</Length>
    2020  </WallPiece>
    2121</Entity>
     22 No newline at end of file
  • binaries/data/mods/public/simulation/templates/structures/maur_wall_tower.xml

     
    2525    <Actor>structures/mauryans/wall_tower.xml</Actor>
    2626  </VisualActor>
    2727  <WallPiece>
    28     <Length>9.5</Length>
     28    <Length>7.0</Length>
    2929  </WallPiece>
    3030</Entity>
  • binaries/data/mods/public/simulation/templates/structures/pers_wall_tower.xml

     
    1616    <Actor>structures/persians/wall_tower.xml</Actor>
    1717  </VisualActor>
    1818  <WallPiece>
    19     <Length>8.5</Length>
     19    <Length>7.5</Length>
    2020  </WallPiece>
    2121</Entity>
  • binaries/data/mods/public/simulation/templates/structures/ptol_wall_tower.xml

     
    1616    <Actor>structures/ptolemies/wall_tower.xml</Actor>
    1717  </VisualActor>
    1818  <WallPiece>
    19     <Length>10</Length>
     19    <Length>6.5</Length>
    2020  </WallPiece>
    2121</Entity>
     22 No newline at end of file
  • binaries/data/mods/public/simulation/templates/structures/rome_siege_wall_tower.xml

     
    4343    <Actor>structures/romans/siege_wall_tower.xml</Actor>
    4444  </VisualActor>
    4545  <WallPiece>
    46     <Length>6.0</Length>
     46    <Length>5.5</Length>
    4747  </WallPiece>
    4848</Entity>
  • binaries/data/mods/public/simulation/templates/structures/rome_wall_tower.xml

     
    1616    <Actor>structures/romans/wall_tower.xml</Actor>
    1717  </VisualActor>
    1818  <WallPiece>
    19     <Length>9.5</Length>
     19    <Length>8.0</Length>
    2020  </WallPiece>
    2121</Entity>
  • binaries/data/mods/public/simulation/templates/structures/sele_wall_tower.xml

     
    1616    <Actor>structures/hellenes/wall_tower.xml</Actor>
    1717  </VisualActor>
    1818  <WallPiece>
    19     <Length>7.5</Length>
     19    <Length>7.0</Length>
    2020  </WallPiece>
    2121</Entity>
     22 No newline at end of file
  • binaries/data/mods/public/simulation/templates/structures/spart_wall_tower.xml

     
    1616    <Actor>structures/hellenes/wall_tower.xml</Actor>
    1717  </VisualActor>
    1818  <WallPiece>
    19     <Length>7.5</Length>
     19    <Length>7.0</Length>
    2020  </WallPiece>
    2121</Entity>
     22 No newline at end of file