Skip to content

Commit

Permalink
Merge pull request #157 from AresSC2/fix/pylon-formation
Browse files Browse the repository at this point in the history
fix: pylon formation
  • Loading branch information
raspersc2 authored Jul 16, 2024
2 parents 4710fb7 + 2b646d0 commit 38a62e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/ares/build_runner/build_order_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,8 @@ def _get_position_and_supply_of_first_supply(self) -> tuple[Point2, float]:
if step.start_at_supply <= 13 or target == self.mediator.get_own_nat
else 9.0
)
if self.ai.time < time:
return self.ai.start_location, 999.9

return (
self.mediator.request_building_placement(
Expand Down
6 changes: 3 additions & 3 deletions src/ares/managers/placement_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def request_building_placement(
)
# prioritize production pylons if they exist
elif structure_type == UnitID.PYLON:
if available := [
if available_opt := [
a
for a in available
if self.placements_dict[building_at_base][building_size][a][
Expand All @@ -508,7 +508,7 @@ def request_building_placement(
]
]:
final_placement = min(
available,
available_opt,
key=lambda k: cy_distance_to_squared(k, building_at_base),
)
elif available := [
Expand Down Expand Up @@ -988,7 +988,7 @@ def _solve_protoss_building_formation(self):
two_by_two_positions = cy_find_building_locations(
kernel=np.ones((2, 2), dtype=np.uint8),
x_stride=2,
y_stride=2,
y_stride=3,
x_bounds=raw_x_bounds,
y_bounds=raw_y_bounds,
creep_grid=creep_grid,
Expand Down

0 comments on commit 38a62e4

Please sign in to comment.