Anybody have good general guidelines?


#1

Anybody want to share good guidelines in creating a bot? This is my first time participating. I know c++/python but no game AI experience.
Not looking for specific strategy but just good practices to rapidly develop/test the bots.

  1. You guys use the docker image provided by someone to create your own gym?

  2. If you let your bots battle out against each other, how much of the available halite should they extract to qualify as “good” bots? 80% of Halites in the map?

  3. Any good link for a starting point? Pathfinding? Does your bot have multiple phases? Begin, mid game and ending?


#2
  1. I think in the beginning it is fine to just run your bot against itself manually to check whether you improve performance or not. (Just make sure you test a couple of different seeds)

I still do it like that, mostly. Just before submitting I run a script which plays a variety of different map sizes and games against my previous bot.

  1. I am not tracking this, I check games that my bot plays (either against itself or on the ladder) and see what goes wrong and why I lost and then I improve this part. If my new bot consistently wins against my previous version I submit it. I know you can get really fancy with it but see bottom comment.

  2. Start out with any of the starter kits and build your bot from there. Can you do something that is smarter than random moves? E.g. move towards high halite areas and collect there and properly return halite to the shipyard. Can you avoid collisions etc. solving those problems easily brings you into the top 300 I think.

I went from simple to pretty elaborate and complicated (A* or some dynamic programming and calculating the highest halite/step targets and so on and so forth) back to rather simple, because simple just outperformed


#3

hey thanks for the reply! I think what I need to do is just get started programming. I’ve been really doing a lot of thinking of different strategies but I think it’s useless unless I apply it and see what works!


#4

My two cents:

  1. Absolutely dive into things and start making changes. Submit fast - you get lots of feedback from online games.
  2. You can go a loooong way by being good at mining halite fast and getting your turtles to come back at the right time. Everything else - dropoffs, inspiration, precise spawn timing, combat etc - isn’t worth worrying too much about at first.
  3. Drop naive_navigate quite early. Your bot builds up around your navigation/command system, and it’s pretty restrictive (e.g. no turtle swapping).
  4. Playing your bot against your last bot is good once you get past the point of improvements being obvious.
  5. Watch replays to work out why other people are beating you. There are often some pretty clear things to change.

#5

What does “turtle swapping” mean?


#6

You can swap two ships without destroing them. Ships collisions are triggered only if two ships have same position after turn is ended. You can watch any replay from top100 in x1 speed to see it.


#7

Like teccles said (and he is #1 currently), keep it simple.

I just learned that the hard way this week. I had a super elegant™ pathfinder that was buggy and dumbing it down (v13 to v14) just took me from #240 to #180 or so (on the way to 150ish I suspect).

Further, as I tried all sorts of tricks to work past it, none of those tricks showed any effect because the bad pathfinding confounded everything else. I was on the verge of giving up actually. Then I got desperate. Desperation is harsh but effective medicine. I am now revisiting all of those tricks because I think I can finally measure their effectiveness.


#8

Responding to my own response, my rules of thumb for hitting platinum:

  1. Think a lot about which tiles to mine without overthinking it, be greedy, but KISS™
  2. Fast and efficient pathfinding will get you close to the top of gold, also KISS™
  3. Crash your ships into the dropoffs at the end of the game.
  4. Hyperparameter Optimization beyond that so far is very fertile for me.
  5. I tend to wait for at least 200 games to conclude anything significant.

There’s nothing else to my client so far, no inspiration handling, no additional dropoffs, no dropoff blocking, and no 2 vs 4 player optimization, just good pathfinding, some thoughtful target selection, and some rudimentary total halite HPO…

If I hit Diamond this year, I will be happy…


#9

can you elaborate on crashing off the ships at the drop off.


#10

#11

Still don’t understand it fully after reading the thread. Is the strategy crashing all but one ship and have that one ship gather all the halites and drop it off to the drop off point?


#12

It’s easier to crash all your ships over your shipyard/dropoff than to waste turns trying to avoid collisons.


#13

If you crash them off at drop off/shipyard they will deposit the halites to you automatically?


#14

I dont agree with how people think “pathfinding” is so important. My bot ranked around 300 atm literally just finds the 2 directions that would take a ship closer to its target, eliminates any that would cause a collision, and chooses from the remaining directions. Target selection, and having the right constants of when a ship should go back to dropoff, or move off of the point it is collection from is way more important imo.


#15

Yes, if a collision happens above a dropoff point then all the halite goes into that dropoff. This is why dropoff blocking is a terrible strategy in 2 player games.


#16

If you watch the top 100, when they block, they don’t just block the dropoffs, they block the entires to the dropoffs as well. This is easily countered if you parse it from the map, but it’s very effective otherwise.


#17

I have not seen much improvement over is_full() and about 50 for skipping over tiles for mining, have you seen differently?


#18

My bot around the top 300 doesn’t even check for enemies, which basically counters any type of dropoff blocking strategies, and any drops from collisions will be closer to my dropoff or shipyard, so I will get all the halite from it.


#19

Yes but then you can also plow into yourself if the friendly guy ahead of you runs out of halite, no?