Wow, amazing game, I started playing but have 2 small issues..
I can not figure out returns of each functions? How to do that? Tried logging, but nothing comes out.. is there somewhere documentation about each function?
no matter what I do, my ships go first to the center but never do they try to go to largest or closest planet.
I tried improving my code as per documentation as I wish my ships to go to closest planet first
How can I direct ships to closest planets?
indent preformatted text by 4 spaces
game = hlt.Game("Settler")
game_map = game.update_map()
command_queue = 
planets = game_map.all_planets()
ships = game_map.get_me().all_ships()
for current in range(0, len(ships)):
if ships[current].docking_status != ships[current].DockingStatus.UNDOCKED:
# Skip this ship
largest_planet = max(planet.radius for planet in game_map.all_planets())
entities_by_distance = game_map.nearby_entities_by_distance(ships[current])
nearest_planet = None
for distance in sorted(entities_by_distance):
nearest_planet = next((nearest_entity for nearest_entity in entities_by_distance[distance] if isinstance(nearest_entity, hlt.entity.Planet)), None)
# Skip this planet
# If we can dock, let's (try to) dock. If two ships try to dock at once, neither will be able to.
# We add the command by appending it to the command_queue
navigate_command = ships[current].navigate(ships[current].closest_point_to(nearest_planet), game_map, speed=hlt.constants.MAX_SPEED)