Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 32 additions & 41 deletions algos/ManyAttackyBois/algo_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def build_defences(self, game_state):
"""
First lets protect ourselves a little with destructors:
"""
firewall_locations = [[0,13],[1,12],[27,13],[23,12],[24,13],[20,10],[2,11],[25,11],[13,10],[6,10]]
firewall_locations = [[0,13],[1,12],[27,13],[23,12],[24,13],[2,11],[25,11]]
for location in firewall_locations:
if game_state.can_spawn(DESTRUCTOR, location):
game_state.attempt_spawn(DESTRUCTOR, location)
Expand All @@ -99,49 +99,49 @@ def build_defences(self, game_state):
if game_state.can_spawn(ENCRYPTOR, location):
game_state.attempt_spawn(ENCRYPTOR, location)

firewall_locations = [[18,4], [9,4]]
for location in firewall_locations:
if game_state.can_spawn(DESTRUCTOR, location):
game_state.attempt_spawn(DESTRUCTOR, location)


destructor_wall = []

for i in range(4,21):
new_location = [i, 10]
for i in range(3,21):
new_location = [i, 11]
destructor_wall.append(new_location)

for location in destructor_wall:
if game_state.can_spawn(DESTRUCTOR, location):
game_state.attempt_spawn(DESTRUCTOR, location)

encryptor_wall = []
for i in range(20, 6, -3):
new_location = [i,10]
encryptor_wall.append(new_location)
for location in encryptor_wall:
if game_state.can_spawn(ENCRYPTOR, location):
game_state.attempt_spawn(ENCRYPTOR, location)


all_locations = []
for i in range(game_state.ARENA_SIZE):
for j in range(math.floor(game_state.ARENA_SIZE / 2)):
if (game_state.game_map.in_arena_bounds([i, j])):
all_locations.append([i, j])

"""
Then we remove locations already occupied.
"""
possible_locations = self.filter_blocked_locations(all_locations, game_state)

# all_locations = []
# for i in range(game_state.ARENA_SIZE):
# for j in range(math.floor(game_state.ARENA_SIZE / 2)):
# if (game_state.game_map.in_arena_bounds([i, j])):
# all_locations.append([i, j])
#
# """
# Then we remove locations already occupied.
# """
# possible_locations = self.filter_blocked_locations(all_locations, game_state)

def build_that_wall(self, game_state):
filter_locations = []

for i in range(2, 23):
new_location = [i, 11]
new_location = [i, 12]
filter_locations.append(new_location)

for location in filter_locations:
if game_state.can_spawn(FILTER, location):
game_state.attempt_spawn(FILTER, location)

def build_that_scratch_post(self, game_state):
filter_locations = [[6,11],[7,11],[8,11],[19,11],[20,11],[21,11],[11,11],[12,11],[13,11],[14,11],[15,11],[16,11]]
destructor_locations = [[7,10], [20,10],[0,13],[27,13]]
filter_locations = [[6,12],[7,12],[8,12],[19,12],[20,12],[21,12],[11,12],[12,12],[13,12],[14,12],[15,12],[16,12]]
destructor_locations = [[7,11], [20,11],[0,13],[27,13]]

for location in filter_locations:
if game_state.can_spawn(FILTER, location):
Expand All @@ -152,29 +152,20 @@ def build_that_scratch_post(self, game_state):
game_state.attempt_spawn(DESTRUCTOR, location)

def deploy_attackers(self, game_state):
"""
First lets check if we have 10 bits, if we don't we lets wait for
a turn where we do.
"""

if (game_state.turn_number in range(1,3)):
while game_state.get_resource(game_state.BITS) >= 1.0:
game_state.attempt_spawn(PING, [23, 9])
else: return


if (game_state.get_resource(game_state.BITS) < 15):
if (game_state.get_resource(game_state.BITS) < 8):
return
if (game_state.get_resource(game_state.BITS) <= 0):
return
"""
First lets deploy an EMP long range unit to destroy firewalls for us.
"""
while game_state.get_resource(game_state.BITS) >= 3.0:
game_state.attempt_spawn(EMP, [4, 9])
# if game_state.turn_number % 3 == 0:
# while game_state.get_resource(game_state.BITS) >= 3.0:
# if game_state.can_spawn(EMP, [24,10]):
# game_state.attempt_spawn(EMP, [24, 10])

while game_state.get_resource(game_state.BITS) >= 1.0:
game_state.attempt_spawn(SCRAMBLER, [5, 8])
if game_state.can_spawn(PING, [4,9]):
game_state.attempt_spawn(PING, [4,9])
else: break

"""
NOTE: the locations we used above to spawn information units may become
Expand Down
Binary file added dist/ManyAttackyBois.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed dist/ProjectHoneyPotv10.zip
Binary file not shown.
Binary file removed dist/ProjectHoneyPotv11.zip
Binary file not shown.
Binary file removed dist/ProjectHoneyPotv12.zip
Binary file not shown.
Binary file removed dist/ProjectHoneyPotv13.zip
Binary file not shown.
Binary file removed dist/ProjectHoneyPotv7.zip
Binary file not shown.