setup for final round - needs improvement#17
Open
annadhm wants to merge 3 commits into
Open
Conversation
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First, I implemented the idea of adjusting the bot’s behaviour based on the map we’re playing on. Unfortunately, determining this via the flag doesn’t work since that information isn’t available in the status. So I implemented the following: After 30 rounds (I also tested with 20 and 40 rounds), the map type is determined based on the observed wall density. If the wall density is over 28%, we play on the Maze map and make more conservative moves. Otherwise, we play on an open map and play more aggressively.
Based on observations from the last round, I have also implemented the following:
Escape mode in case we get stuck after a crash. If we get stuck with a player within three rounds with less than two position switches, we ignore the last N tiles visited and look for a frontier in a different direction.
In cases of low gold, we will take one step at a time towards the pot of gold for eight rounds. Another strategy could make more sense here. No moves at all, or moving towards the centre instead of the pot of gold.
Instead of freezing, we reposition towards the centre.
If we are done with exploring, we move to the centre and then towards the gold again.
I have also implemented jumping, but I haven't tested it yet since you need to enable it in the game setup. However, I think this could be one of the rounds in the tournament. So I think it makes sense to test it.
If you're wondering whether it's possible to jump over walls and other players, the answer is no. Players can't be jumped over. So our idea to sabotage other players with a second bot, could work out :))
I didn't find the time to test my code for edge cases or to check that the logic is useful in all cases, but I wanted to share the code early in case you also start working on the bot.
However, I used the stats add-on to take a look at the overall performance.
I tested in short (200 rounds) and long (1000 rounds) on all maps (plots)
We won in maze (short), caves (long), inverse (both), and random (long). So still room for improvements🦾