How to determine is one of our ship is inspired or not through default hlt code


#1

Hi all,
is it possible to find if our ship is inspired or not using the default hlt code . if not then is there any easy logic to determine this .


#2

Take a window around the ships position.
def get_window(game_map, source, sz=4):
window = []
for y in range(-sz, sz + 1):
for x in range(-sz, sz + 1):
pos = source + Position(x, y)
window.append(game_map[pos])
return window

Check for 2 enemies. In the window


#3

You can also look into the game engine code for the inspiration - https://github.com/HaliteChallenge/Halite-III/blob/c8a48680a394e45b03d000fa3699755063862988/game_engine/core/HaliteImpl.cpp#L396


#4

You should check all tiles t such that manh_dist(t, ship) <= 4, where manh_dist is the Manhattan distance.
The area you are considering is wider than the actual inspired area.


#5

The window ends up being 81 cells. 9x9 with ship at center. I guess the corners wouldn’t actually be within 4 tiles
Looks like the window should be 41 cells?


#6

Correct, below an image. On the left the right inspiration area


#7

Lol this change alone should give me more time for pathing on my bot.


#8

i guess the num of own ship within the manh dist also matters for determining whether our ship is inspired or not .