Ticket #4377: rename_ai_influence_group_v1.patch

File rename_ai_influence_group_v1.patch, 4.3 KB (added by elexis, 7 years ago)
  • binaries/data/mods/public/simulation/ai/common-api/shared.js

    m.SharedScript.prototype.init = function  
    182182    this.accessibility.init(state, this.terrainAnalyzer);
    183183
    184184    // Setup resources
    185185    this.resourceInfo = state.resources;
    186186    m.Resources.prototype.types = state.resources.codes;
    187     // Resource types: 0 = not used for resource maps
    188     //                 1 = abundant resource with small amount each
    189     //                 2 = spare resource, but huge amount each
     187    // Resource types: ignore = not used for resource maps
     188    //                 abundant = abundant resource with small amount each
     189    //                 spare = spare resource, but huge amount each
    190190    // The following maps are defined in TerrainAnalysis.js and are used for some building placement (cc, dropsites)
    191191    // They are updated by checking for create and destroy events for all resources
    192     this.normalizationFactor = { "1": 50, "2": 90 };
    193     this.influenceRadius = { "1": 36, "2": 48 };
    194     this.ccInfluenceRadius = { "1": 60, "2": 120 };
     192    this.normalizationFactor = { "abundant": 50, "spare": 90 };
     193    this.influenceRadius = { "abundant": 36, "spare": 48 };
     194    this.ccInfluenceRadius = { "abundant": 60, "spare": 120 };
    195195    this.resourceMaps = {};   // Contains maps showing the density of resources
    196196    this.ccResourceMaps = {}; // Contains maps showing the density of resources, optimized for CC placement.
    197197    this.createResourceMaps();
    198198
    199199    this.gameState = {};
  • binaries/data/mods/public/simulation/components/GuiInterface.js

    GuiInterface.prototype.GetSimulationStat  
    158158        "codes": Resources.GetCodes(),
    159159        "names": Resources.GetNames(),
    160160        "aiInfluenceGroups": {}
    161161    };
    162162    for (let res of ret.resources.codes)
    163         ret.resources.aiInfluenceGroups[res] = Resources.GetResource(res).aiAnalysisInfluenceGroup || 0;
     163        ret.resources.aiInfluenceGroups[res] = Resources.GetResource(res).aiAnalysisInfluenceGroup;
    164164
    165165    // Add basic statistics to each player
    166166    for (let i = 0; i < numPlayers; ++i)
    167167    {
    168168        let playerEnt = cmpPlayerManager.GetPlayerByID(i);
  • binaries/data/mods/public/simulation/data/resources/food.json

     
    77        "fruit": "Fruit",
    88        "grain": "Grain",
    99        "meat": "Meat"
    1010    },
    1111    "truePrice": 100,
    12     "aiAnalysisInfluenceGroup": 0
     12    "aiAnalysisInfluenceGroup": "ignore"
    1313}
  • binaries/data/mods/public/simulation/data/resources/metal.json

     
    44    "order": 4,
    55    "subtypes": {
    66        "ore": "Ore"
    77    },
    88    "truePrice": 100,
    9     "aiAnalysisInfluenceGroup": 2
     9    "aiAnalysisInfluenceGroup": "spare"
    1010}
  • binaries/data/mods/public/simulation/data/resources/stone.json

     
    55    "subtypes": {
    66        "rock": "Rock",
    77        "ruins": "Ruins"
    88    },
    99    "truePrice": 100,
    10     "aiAnalysisInfluenceGroup": 2
     10    "aiAnalysisInfluenceGroup": "spare"
    1111}
  • binaries/data/mods/public/simulation/data/resources/wood.json

     
    55    "subtypes": {
    66        "tree": "Tree",
    77        "ruins": "Ruins"
    88    },
    99    "truePrice": 100,
    10     "aiAnalysisInfluenceGroup": 1
     10    "aiAnalysisInfluenceGroup": "abundant"
    1111}