Skip to content
Damon Getsman edited this page Dec 30, 2018 · 4 revisions

Welcome to the nightMiner wiki!

This project is a rewrite of the original Halite contest submission I was working on for Halite III. Decided to start that one over from scratch at some point, though, and this (slightly) better organized code is the result. The old bot's code can be found in my d4m0Turtle repository.

NOTE: This wiki is in desperate need of an update!

Current Flow

The current flow design leaves quite a bit to be desired. The conditionals are pretty nasty, so I think what I'm going to do is just go through the existing pieces, modularize them a little bit more (if necessary), and document their functions better. After that, we'll just move on down to the Flow Proposal, below, and re-implement the tangled nest of conditionals that were originally pulling things together (kind of) and find a more sane way to work with things.

I'm thinking at this point that it might be best to start implementing a little bit more history than the current ShipHistory object has available. I may actually try out some sort of a linked list, perhaps, of ShipHistory objects being stored for each ship, unless this proves too computation/memory intensive, in order to provide the ability to determine things such as strange behavior and timeouts a bit better than just utilizing the log file alone.

That reminds me, there really needs to be something written to parse the log file into more sane data tabulation, as well. This would, of course, require standardizing the logging facilities a bit more than is currently done.

Specifics regarding ship mission routines

Initialization and Mining

While the turn < (Max_Scuttle_Time - (len(me.get_ships()) * 2)), the following is executed:

  1. Starting in nightMiner.py, the current ship, when generated, will have no current_assignments entry for its corresponding id. This will cause it to skip the conditional processing for mining/scooting/dropoff and land in the except clause, where the return from the following is added to the command_queue: seek_n_nav.StartUp.get_initial_minimum_distance(ship, me, game_map, turn, ke). NOTE: the ke is vestigial, from when I still needed to look at the exception data.
  2. Within get_initial_minimum_distance(), the ShipHistory is created and stashed appropriately in current_assignments. Primary mission is mining, secondary in_transit. A profitable direction is determined, the ship's new destination is set for Initial_Scoot_Distance's moves in that direction, and the command is returned to move in that direction.
  3. After the try statement, the first conditional will match due to primary_mission being glo.Missions.mining. This will send execution to core_processing.Core.primary_mission_mining().

Ending Blockade

It's pretty important to get this routine written out for posterity as quickly as possible here, as I believe that there will be issues implementing the conditional ending_blockade without reviewing all of the internals properly here. I took too long of a break away from things. :(

TODO: Summarize a code review here for all of ending_blockade's processing.

See Also

Flow Proposal