My bot to the
- Make sure python version = 3.6.7 is installed
- Download python started kit here
- Put the scipts of this repo under the same folder of the starter kit
- Modify run_game.sh (inside starter kit) as below and run it
# Play with different parameters, setting RANDOM_SEED so it is reproducible
a="python3 5_.py --RANDOM_SEED 1"
b="python3 5_.py --RANDOM_SEED 1 --MIN_HALITE_TO_STAY 30"
c="python3 5_.py --RANDOM_SEED 1 --MIN_HALITE_TO_STAY 40"
d="python3 5_.py --RANDOM_SEED 1 --MIN_HALITE_TO_STAY 50"
./halite --replay-directory replays/ -vvv "$a" "$b" "$c" "$d"
Explore mechanism (implemented from 4_.py)
- Updated make dropoff logic, will move deeper into halite dense region to make dropoff
- Updated spawn ship logic, more conversative in 4p game
- Will collide into enemy in 2p game
- Added make dropoff logic (details in below sections)
- Updated default value of MAX_SHIP_ON_MAP=200, MAX_SPAWN_SHIP_TURN=0.9
- Ship will explore using gaussian filtered map
- Ship will not move to cell which has enemy ship nearby while exploring
- Ships with low halite do not return to shipyard at the end of game
- Set ship status to exploit when few places >= MIN_HALITE_TO_STAY within farthest place it can go
- Decide spawn ship or not based on expected return (i.e. if not much halite left to explore), this gives better results in a small map or 4v4 game
- Implemented new exploring function (new_exploring, exploring_next_turns, get_optimize_naive_move, new_expected_value, distance_map_from_position)
- New exploring mechanism (details under below sections)
- Returning ship will use get_optimize_naive_move to find path with lower cost
- Avoided blocking ship at shipyard, and will try to move around enemy ship during return
- Stop spawning ship if cells that can be collected (>= MIN_HALITE_TO_STAY) is <= ship number
- Updated default value of MAX_SHIP_ON_MAP=40, HALITE_DISCOUNT_RATIO=1.5, MAX_EXPECTED_HALITE_ROUND=8
- Revamp safe_move_check, leverage mark_unsafe method of hlt
- Exploring will try to move farther away from shipyard (measured by manhattan distance)
- Improve returning (will try to move around if block by enemy's ship)
- New function: exec_instruction, set_instruction, naive_navigate_wo_mark_unsafe, gen_random_direction_list
- Refactor code
- Ships will move based on "Expected Halite" (discounted by round).
- Ships will return to shipyard near end of the game
||Based on starter code provided on halite website
Apply logic below to ships 1 by 1
For distance d range from 0 to MAX_EXPECTED_HALITE_ROUND away from the ship:
- Found the cell (distance = d and not occupied) with max halite
- Calculate expected cost if move to that cell
- Calculate expected gain if stay in that cell and collect halite, minus the cost above
- Order the possible cells to move by expected gain (descending order)
For all possible cells from above:
Dropoff mechanism (implemented from 6_.py)
- If there exists a naive move to that cell, do it, if not, try next possible cell
Collision mechanism (implemented from 7_.py)