Skip to content

Commit

Permalink
try something
Browse files Browse the repository at this point in the history
  • Loading branch information
LenaTheWolfess committed Mar 6, 2022
1 parent 0bb1b4b commit ccaedb0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions simulation/ai/Kiara/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ KIARA.Config = function(difficulty, behavior)
"Hack": 0.085,
"Pierce": 0.085,
"Crush": 0.055,
"Fire": 0.095,
"Poison": 0.95
"Fire": 1.0,
"Poison": 1.0
};

this.Economy = {
Expand Down
11 changes: 7 additions & 4 deletions simulation/ai/Kiara/queueplanBuilding.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ KIARA.ConstructionPlan.prototype.findGoodPosition = function(gameState)
if (template.buildPlacementType() == "shore")
return this.findDockPosition(gameState);

const civ = gameState.getPlayerCiv();
let HQ = gameState.ai.HQ;
if ((template.hasClass("Storehouse")|| template.hasClass("Farmstead") && this.metadata && this.metadata.base))
{
Expand Down Expand Up @@ -236,6 +237,8 @@ KIARA.ConstructionPlan.prototype.findGoodPosition = function(gameState)
placement.set(j, 45);
}

const fieldRadius = civ == "han" ? 35 : 40;

if (!HQ.requireHouses || !template.hasClass("House"))
{
gameState.getOwnStructures().forEach(function(ent) {
Expand All @@ -247,15 +250,15 @@ KIARA.ConstructionPlan.prototype.findGoodPosition = function(gameState)
if (struct.resourceDropsiteTypes() && struct.resourceDropsiteTypes().indexOf("food") != -1)
{
if (template.hasClass("Field") || template.hasClass("Corral"))
placement.addInfluence(x, z, 80 / cellSize, 50);
placement.addInfluence(x, z, fieldRadius*2 / cellSize, 50);
else // If this is not a field add a negative influence because we want to leave this area for fields
placement.addInfluence(x, z, 80 / cellSize, -20);
placement.addInfluence(x, z, fieldRadius*2 / cellSize, -20);
}
/**/
if (template.hasClass("House") && ent.hasClass("CivilCentre"))
placement.addInfluence(x, z, 40/cellSize, -10); // we want to leave this for fields
placement.addInfluence(x, z, fieldRadius/cellSize, -10); // we want to leave this for fields
if (template.hasClass("House") && ent.hasClass("Field"))
placement.addInfluence(x, z, 40/cellSize, 5);
placement.addInfluence(x, z, fieldRadius/cellSize, 5);
if (template.hasClass("Farmstead") && (!ent.hasClass("Field") && !ent.hasClass("Corral") &&
(!ent.hasClass("StoneWall") || ent.hasClass("Gates"))))
placement.addInfluence(x, z, 100/cellSize, -25); // move farmsteads away to make room (StoneWall test needed for iber)
Expand Down

0 comments on commit ccaedb0

Please sign in to comment.