dgets / nightMiner

Halite III Bot - rewriting Halite III bot from scratch with better project structure plans
6 stars 1 forks source link

Problem using game_map._get_target_direction() #46

Closed dgets closed 5 years ago

dgets commented 5 years ago

It seems that in at least two of the locations that I've used it, the following expression causes a runtime error accusing me of trying to add an int and NoneType, or a tuple, depending on the context that it's found in: game_map._get_target_direction(ship.position, glo.Variables.current_assignments[ship.id].destination). As a result of it happening immediately in the game, with the placement of this expression coming into play as soon as scoot() is utilized, I've not been able to explore much past the 2nd instance of it through game play, which occurs when returning halite to the base.

dgets commented 5 years ago

As this effects scoot(), it is now hosing the ability to do anything with the bot, as far as testing or working on other problems right now. It's probably time to revert scoot(), along with any other integral routines, to the way that they were before these changes were implemented.

It'd really be great if anybody were to reply to the thread on the Halite forums about this. I don't know what on earth could be going wrong with the _get_target_direction() method, though clearly it must lay in one of the arguments.

dgets commented 5 years ago

Okay, so maybe is just an oversight on my part, with some other bug being related to what's going on here. I've been working on this issue at the point of the first scoot() instance which comes up during the game, when the bot is attempting to gain the minimal distance away from the shipyard.

During this phase, at some point, it appears that current_assignments[ship.id].destination is somehow being set to the nested tuple: (None, (1, 0)). Unfortunately this isn't going to work for us (obviously). Now it's time to trace back and see where the tuple is getting nested like that.

It is important to remember that another similar bug (quite possibly with the same value causing the issue) is occurring somewhere else in the code, as well. Maybe wiping out the first issue of this occurring will help them both, but eyes should be staying open.

dgets commented 5 years ago

With commit 2284071, it is now possible to get the majority of games to play to completion. This isn't to say that this issue isn't going to pop up again, but it seems like it's taken care of for now.