Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/petra/config.js
Show First 20 Lines • Show All 169 Lines • ▼ Show 20 Lines | PETRA.Config = function(difficulty = PETRA.DIFFICULTY_MEDIUM, behavior) | ||||
this.garrisonHealthLevel = { "low": 0.4, "medium": 0.55, "high": 0.7 }; | this.garrisonHealthLevel = { "low": 0.4, "medium": 0.55, "high": 0.7 }; | ||||
this.unusedNoAllyTechs = [ | this.unusedNoAllyTechs = [ | ||||
"Player/sharedLos", | "Player/sharedLos", | ||||
"Market/InternationalBonus", | "Market/InternationalBonus", | ||||
"Player/sharedDropsites" | "Player/sharedDropsites" | ||||
]; | ]; | ||||
Freagarach: I guess we can just give the radii and normalisation factors instead of the "abundant" and… | |||||
Done Inline ActionsYou could also make all those setting per resource so you only edit the resource configs and not the config.js file. Stan: You could also make all those setting per resource so you only edit the resource configs and… | |||||
Done Inline ActionsCould, but is not in line with the rest of the file. Freagarach: Could, but is not in line with the rest of the file. | |||||
Done Inline ActionsAlso, one can just use config_mod.js and overwrite the values there. Freagarach: Also, one can just use config_mod.js and overwrite the values there. | |||||
Done Inline ActionsTrue, but now you have a stronger coupling between AI and resources while it *could* in theory be agnostic :) Stan: True, but now you have a stronger coupling between AI and resources while it *could* in theory… | |||||
Done Inline ActionsHow do you mean stronger coupling? There is less coupling now? Each AI can specify its own way of interpreting the resources provided by the game. Freagarach: How do you mean stronger coupling? There is less coupling now? Each AI can specify its own way… | |||||
this.criticalPopulationFactors = [ | this.criticalPopulationFactors = [ | ||||
0.8, | 0.8, | ||||
0.8, | 0.8, | ||||
0.7, | 0.7, | ||||
0.6, | 0.6, | ||||
0.5, | 0.5, | ||||
0.35 | 0.35 | ||||
]; | ]; | ||||
Show All 10 Lines | PETRA.Config = function(difficulty = PETRA.DIFFICULTY_MEDIUM, behavior) | ||||
this.criticalRootFactors = [ | this.criticalRootFactors = [ | ||||
0.8, | 0.8, | ||||
0.8, | 0.8, | ||||
0.67, | 0.67, | ||||
0.5, | 0.5, | ||||
0.35, | 0.35, | ||||
0.2 | 0.2 | ||||
]; | ]; | ||||
// The following values are used to make maps defined in TerrainAnalysis.js | |||||
// and are used for some building placement (cc, dropsites). | |||||
this.resources = { | |||||
// A lower value means more a abundant resource with smaller amount each. | |||||
// A higher value means a more sparse resource with larger amounts each. | |||||
"normalisationFactor": { | |||||
"metal": 90, | |||||
"stone": 90, | |||||
"wood": 50 | |||||
}, | |||||
"ccInfluenceRadius": { | |||||
"metal": 120, | |||||
"stone": 120, | |||||
"wood": 60 | |||||
}, | |||||
"influenceRadius": { | |||||
"metal": 48, | |||||
"stone": 48, | |||||
"wood": 36 | |||||
} | |||||
}; | |||||
}; | }; | ||||
PETRA.Config.prototype.setConfig = function(gameState) | PETRA.Config.prototype.setConfig = function(gameState) | ||||
{ | { | ||||
if (this.difficulty > PETRA.DIFFICULTY_SANDBOX) | if (this.difficulty > PETRA.DIFFICULTY_SANDBOX) | ||||
{ | { | ||||
// Setup personality traits according to the user choice: | // Setup personality traits according to the user choice: | ||||
// The parameter used to define the personality is basically the aggressivity or (1-defensiveness) | // The parameter used to define the personality is basically the aggressivity or (1-defensiveness) | ||||
▲ Show 20 Lines • Show All 146 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
I guess we can just give the radii and normalisation factors instead of the "abundant" and "sparse" things.