This commit is contained in:
Anuken 2024-09-09 13:58:04 -04:00
parent 277e4fa553
commit 7784c8f35e
2 changed files with 6 additions and 48 deletions

View File

@ -445,52 +445,4 @@ public class CommandAI extends AIController{
this.stopAtTarget = stopAtTarget;
}
/*
//TODO ひどい
(does not work)
public static float cohesionScl = 0.3f;
public static float cohesionRad = 3f, separationRad = 1.1f, separationScl = 1f, flockMult = 0.5f;
Vec2 calculateFlock(){
if(local.isEmpty()) return flockVec.setZero();
flockVec.setZero();
separation.setZero();
cohesion.setZero();
massCenter.set(unit);
float rad = unit.hitSize;
float sepDst = rad * separationRad, cohDst = rad * cohesionRad;
//"cohesed" isn't even a word smh
int separated = 0, cohesed = 1;
for(var other : local){
float dst = other.dst(unit);
if(dst < sepDst){
separation.add(Tmp.v1.set(unit).sub(other).scl(1f / sepDst));
separated ++;
}
if(dst < cohDst){
massCenter.add(other);
cohesed ++;
}
}
if(separated > 0){
separation.scl(1f / separated);
flockVec.add(separation.scl(separationScl));
}
if(cohesed > 1){
massCenter.scl(1f / cohesed);
flockVec.add(Tmp.v1.set(massCenter).sub(unit).limit(cohesionScl * unit.type.speed));
//seek mass center?
}
return flockVec;
}*/
}

View File

@ -0,0 +1,6 @@
package mindustry.game;
public class CampaignRules{
public boolean fog;
public boolean sectorInvasions;
}