diff --git a/core/src/mindustry/ai/BaseBuilderAI.java b/core/src/mindustry/ai/BaseBuilderAI.java index afc2a40be8..b3093b4f17 100644 --- a/core/src/mindustry/ai/BaseBuilderAI.java +++ b/core/src/mindustry/ai/BaseBuilderAI.java @@ -12,10 +12,8 @@ import mindustry.game.*; import mindustry.game.Schematic.*; import mindustry.game.Teams.*; import mindustry.gen.*; -import mindustry.maps.generators.*; import mindustry.type.*; import mindustry.world.*; -import mindustry.world.blocks.defense.*; import mindustry.world.blocks.payloads.*; import mindustry.world.blocks.production.*; import mindustry.world.blocks.storage.*; @@ -35,7 +33,7 @@ public class BaseBuilderAI{ private static int correct = 0, incorrect = 0; private int lastX, lastY, lastW, lastH; - private boolean triedWalls, foundPath; + private boolean foundPath; final TeamData data; final Interval timer = new Interval(4); @@ -46,7 +44,6 @@ public class BaseBuilderAI{ boolean calculating, startedCalculating; int calcCount = 0; int totalCalcs = 0; - Block wallType; public BaseBuilderAI(TeamData data){ this.data = data; @@ -62,10 +59,6 @@ public class BaseBuilderAI{ } } - if(wallType == null){ - wallType = BaseGenerator.getDifficultyWall(1, data.team.rules().buildAiTier / 0.8f); - } - if(data.team.rules().aiCoreSpawn && timer.get(timerSpawn, 60 * 6f) && data.hasCore()){ CoreBlock block = (CoreBlock)data.core().block; int coreUnits = data.countType(block.unitType); @@ -104,8 +97,8 @@ public class BaseBuilderAI{ }else{ var field = pathfinder.getField(data.team, Pathfinder.costGround, Pathfinder.fieldCore); - if(field.weights != null){ - int[] weights = field.weights; + if(field.hasCompleteWeights()){ + int[] weights = field.completeWeights; for(int i = 0; i < pathStep; i++){ int minCost = Integer.MAX_VALUE; int cx = calcTile.x, cy = calcTile.y; @@ -154,12 +147,7 @@ public class BaseBuilderAI{ } //only schedule when there's something to build. - if(foundPath && data.plans.isEmpty() && timer.get(timerStep, Mathf.lerp(placeIntervalMin, placeIntervalMax, data.team.rules().buildAiTier))){ - //TODO walls are silly, no walls - //if(!triedWalls){ - // tryWalls(); - // triedWalls = true; - //} + if((foundPath || (!calculating && !foundPath)) && data.plans.isEmpty() && timer.get(timerStep, Mathf.lerp(placeIntervalMin, placeIntervalMax, data.team.rules().buildAiTier))){ for(int i = 0; i < attempts; i++){ int range = 150; @@ -279,47 +267,6 @@ public class BaseBuilderAI{ lastW = result.width + 2; lastH = result.height + 2; - triedWalls = false; - return true; } - - private void tryWalls(){ - Block wall = wallType; - Building spawnt = state.rules.defaultTeam.core() != null ? state.rules.defaultTeam.core() : data.team.core(); - Tile spawn = spawnt == null ? null : spawnt.tile; - - if(spawn == null) return; - - for(int wx = lastX; wx <= lastX + lastW; wx++){ - outer: - for(int wy = lastY; wy <= lastY + lastH; wy++){ - Tile tile = world.tile(wx, wy); - - if(tile == null || !tile.block().alwaysReplace) continue; - - boolean any = false; - - for(Point2 p : Geometry.d8){ - if(Angles.angleDist(Angles.angle(p.x, p.y), spawn.angleTo(tile)) > 70){ - continue; - } - - Tile o = world.tile(tile.x + p.x, tile.y + p.y); - if(o != null && (o.block() instanceof PayloadBlock || o.block() instanceof PayloadConveyor || o.block() instanceof ShockMine)){ - continue outer; - } - - if(o != null && o.team() == data.team && !(o.block() instanceof Wall)){ - any = true; - } - } - - tmpTiles.clear(); - if(any && Build.validPlace(wall, data.team, tile.x, tile.y, 0) && !tile.getLinkedTilesAs(wall, tmpTiles).contains(t -> path.contains(t.pos()))){ - data.plans.add(new BlockPlan(tile.x, tile.y, (short)0, wall.id, null)); - } - } - } - } } \ No newline at end of file diff --git a/core/src/mindustry/ai/Pathfinder.java b/core/src/mindustry/ai/Pathfinder.java index ff8bb71534..e5f862e14f 100644 --- a/core/src/mindustry/ai/Pathfinder.java +++ b/core/src/mindustry/ai/Pathfinder.java @@ -522,6 +522,10 @@ public class Pathfinder implements Runnable{ this.initialized = true; } + public boolean hasCompleteWeights(){ + return hasComplete && completeWeights != null; + } + public void updateTargetPositions(){ targets.clear(); getPositions(targets); diff --git a/core/src/mindustry/core/Renderer.java b/core/src/mindustry/core/Renderer.java index 1eb37957f2..35c3779b33 100644 --- a/core/src/mindustry/core/Renderer.java +++ b/core/src/mindustry/core/Renderer.java @@ -342,7 +342,7 @@ public class Renderer implements ApplicationListener{ if(bloom != null){ bloom.resize(graphics.getWidth(), graphics.getHeight()); - bloom.setBloomIntesity(settings.getInt("bloomintensity", 6) / 4f + 1f); + bloom.setBloomIntensity(settings.getInt("bloomintensity", 6) / 4f + 1f); bloom.blurPasses = settings.getInt("bloomblur", 1); Draw.draw(Layer.bullet - 0.02f, bloom::capture); Draw.draw(Layer.effect + 0.02f, bloom::render); diff --git a/gradle.properties b/gradle.properties index 9b6008c821..99182f85a4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,4 +25,4 @@ org.gradle.caching=true #used for slow jitpack builds; TODO see if this actually works org.gradle.internal.http.socketTimeout=100000 org.gradle.internal.http.connectionTimeout=100000 -archash=d8cd7a6003 +archash=6433d83dbd