From 672dfc8538478668d3982e54e409036b1f95e9ad Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 20 Feb 2022 14:29:21 -0500 Subject: [PATCH] Disabled flow fields for RTS / Removed pathfind command --- core/assets-raw/sprites/units/locus.png | Bin 0 -> 426 bytes core/src/mindustry/ai/Pathfinder.java | 11 +++++++---- core/src/mindustry/ai/types/LogicAI.java | 18 ------------------ core/src/mindustry/game/Team.java | 5 +++++ core/src/mindustry/logic/LExecutor.java | 3 --- core/src/mindustry/logic/LUnitControl.java | 1 - .../maps/planet/ErekirPlanetGenerator.java | 2 +- 7 files changed, 13 insertions(+), 27 deletions(-) create mode 100644 core/assets-raw/sprites/units/locus.png diff --git a/core/assets-raw/sprites/units/locus.png b/core/assets-raw/sprites/units/locus.png new file mode 100644 index 0000000000000000000000000000000000000000..453eeddadf1b720ee77537b23f7d147523bbf863 GIT binary patch literal 426 zcmeAS@N?(olHy`uVBq!ia0y~yU`POA4mJh`hDS5XEf^RW7>k44ofy`glX=O&z?kCc z;uumf=j~lbze5fT4i{fF_PRgdIL7_D%cVDP=FCqA_ibO^`jbc3mwg*A0|@+hFZW9Q z!%Vud!A{y%*oYabPFO(=Aq~=q zCa}{ukFosNUAVcM{VFcKu}ai_s=g*d^S!dhwm0tTeP-NYe-qjz1&VoQJdpUnZ^1iv z%DgtY+7IW`lp+>wIg!z_kX`c6`(Bp t.floor().isLiquid)){ + preloadPath(getField(state.rules.waveTeam, costNaval, fieldCore)); + } - //preload water on naval maps - if(spawner.getSpawns().contains(t -> t.floor().isLiquid)){ - preloadPath(getField(state.rules.waveTeam, costNaval, fieldCore)); } start(); diff --git a/core/src/mindustry/ai/types/LogicAI.java b/core/src/mindustry/ai/types/LogicAI.java index c74a6edbf4..1bc1710eb7 100644 --- a/core/src/mindustry/ai/types/LogicAI.java +++ b/core/src/mindustry/ai/types/LogicAI.java @@ -3,13 +3,9 @@ package mindustry.ai.types; import arc.math.*; import arc.struct.*; import arc.util.*; -import mindustry.ai.*; import mindustry.entities.units.*; import mindustry.gen.*; import mindustry.logic.*; -import mindustry.world.*; - -import static mindustry.Vars.*; public class LogicAI extends AIController{ /** Minimum delay between item transfers. */ @@ -68,20 +64,6 @@ public class LogicAI extends AIController{ case approach -> { moveTo(Tmp.v1.set(moveX, moveY), moveRad - 7f, 7); } - case pathfind -> { - Building core = unit.closestEnemyCore(); - - if((core == null || !unit.within(core, unit.range() * 0.5f))){ - boolean move = true; - - if(state.rules.waves && unit.team == state.rules.defaultTeam){ - Tile spawner = getClosestSpawner(); - if(spawner != null && unit.within(spawner, state.rules.dropZoneRadius + 120f)) move = false; - } - - if(move) pathfind(Pathfinder.fieldCore); - } - } case stop -> { unit.clearBuilding(); } diff --git a/core/src/mindustry/game/Team.java b/core/src/mindustry/game/Team.java index e39a6cdf24..a3a45485b1 100644 --- a/core/src/mindustry/game/Team.java +++ b/core/src/mindustry/game/Team.java @@ -110,6 +110,11 @@ public class Team implements Comparable{ return (state.rules.waves || state.rules.attackMode) && this == state.rules.waveTeam; } + /** @return whether this team needs a flow field for "dumb" wave pathfinding. */ + public boolean needsFlowField(){ + return isAI() && !rules().rtsAi; + } + public boolean isEnemy(Team other){ return this != other; } diff --git a/core/src/mindustry/logic/LExecutor.java b/core/src/mindustry/logic/LExecutor.java index 9a8f3242d4..8ea1a7c4fe 100644 --- a/core/src/mindustry/logic/LExecutor.java +++ b/core/src/mindustry/logic/LExecutor.java @@ -392,9 +392,6 @@ public class LExecutor{ case within -> { exec.setnum(p4, unit.within(x1, y1, d1) ? 1 : 0); } - case pathfind -> { - ai.control = type; - } case target -> { ai.posTarget.set(x1, y1); ai.aimControl = type; diff --git a/core/src/mindustry/logic/LUnitControl.java b/core/src/mindustry/logic/LUnitControl.java index 26dee47d48..fd7606e104 100644 --- a/core/src/mindustry/logic/LUnitControl.java +++ b/core/src/mindustry/logic/LUnitControl.java @@ -6,7 +6,6 @@ public enum LUnitControl{ move("x", "y"), approach("x", "y", "radius"), boost("enable"), - pathfind, target("x", "y", "shoot"), targetp("unit", "shoot"), itemDrop("to", "amount"), diff --git a/core/src/mindustry/maps/planet/ErekirPlanetGenerator.java b/core/src/mindustry/maps/planet/ErekirPlanetGenerator.java index 768626e6d7..90c96ebcc0 100644 --- a/core/src/mindustry/maps/planet/ErekirPlanetGenerator.java +++ b/core/src/mindustry/maps/planet/ErekirPlanetGenerator.java @@ -449,7 +449,7 @@ public class ErekirPlanetGenerator extends PlanetGenerator{ Schematics.placeLaunchLoadout(spawnX, spawnY); //all sectors are wave sectors - state.rules.waves = true; + state.rules.waves = false; state.rules.showSpawns = true; } }