Game bot device: 16th place in the final of the Russian AI Cup 2020 (and 5th after)

This article is about participating in the Russian AI Cup Game Artificial Intelligence Writing Championship







A game







Disclaimer until everyone fled



Even though I was 16th in the finals, the article describes the bot that held the 5th place in the overall standings of the sandbox when it stopped.







5th place in the sandbox







16- , , , , , . .









( β€” ), Russian AI Cup. . , , .







,







  • ,
  • , ,
  • , ,
  • , ,
  • - , , :)


, , , .







...









. GreenTea, 4- . , (RTS) . , , , , . , , . .







, . . , , , , .







-, , , , β€” . , , . β€” . , , .







. . . , , , . , 5 , 2 . , , - ( ) .







Fight 2v1







2 2 , , , , .







. , . , RTS , , . , :







, , , . 4 : , , . . , , . , , . 5 .







$1 . , $10, β€” $11 .. , , - .







. , , , , .







, . . , . .









. .







  • 1 4 . , , .


Round 1







  • 2 4 , .


Round 2







  • , 1 1. :


Round 2









:







  1. ( ; ; )


.









, , Java. β€” . - , . , , , , . , β€” 40 . , , , , , , 3 , 40 . , 90% VM , 7-10%. . , , Java Kotlin.







VM, , - . , 1 2 , Commandos- ( C++), . VM, , .







, , . , . , - .







karloid, . PE GraalVM.







, , . exe 5 . GraalVM . , . , 2.5 , , . , , , . , 16 5 10-12 , . , , , , , .







0.



. , . :









, ( ). . , , , , , , .









, xathis Google Ants, , .







β€” (, BFS) . , , . , , , , .







BFS , β€” . , - . , , , , .







. β€” , . , . .







Front line







β€” .









, . , . , , , , .









, GraalVM, , . , . , , , . .. , , .







Passage map







, , , . BFS-. , BFS, , .







() β€” . , , , , .







1.



. . :







  • , . , β€” , $350+ (.. - ), 220- .
  • X , . X = 5 , < 15, X = 10 (.. 2 )
  • ,
  • , , . :







    double scale = Game.duel_mode ? 0.2 : (Game.fog_of_war ? 0.25 : 0.1);
    boolean builders_limit_not_reached = num_builders < Math.max(Game.duel_mode ? 60 : 50, World.food_slots.size() * scale);
          
          





    . , , 5- .









2.



-.









, 20 , 6 , , [35, 35] , - . , [30, 30]. , 10+ , 6. , - , , "" . - , .







BFS, .









. 33. , 11. , . , 1 , . . , , .







, , . , A*-, , , . . , . . , "", , . , , .







, 4- . , , , , , . , , , .







, , .







, , , , .









, . , . . β€” - , - , , . , , .







3.



. , . , , , :







  1. ( ).







    Food slots







  2. . , , , , .







  3. BFS. , -, , .







  4. 1 20 ( ).







  5. , , , , .







  6. , .







  7. , , . <= 20, .









, , , , , , ..







, , ,







Extraction of the most walled up resource







, . , -, , , -, , , , . , .







, . , .







, . . . . , , , . , , .







Runaway of workers from the enemy







. , (- ), , . .







.







  1. .
  2. , , , , . .. β€” , 5 . , .
  3. .
  4. BFS . 7 . , .


, , , , . , , . .. "" 5 . 2- , 5 , , . 7 . , . 7 .







() . . , , . , , . , 5 6 ( 10). . 5 , , , ( 5 ), 1 1 : .







4.



. , . . , , β€” (BFS )







5.



, , 7 , , , .







, () , . β€” - .







. :







  1. 5, 6, 7
  2. , , ..,
  3. 5, . .


, β€” 55. β€” . , :







  • 7 8
  • , , , : , ( , ). , , . .
  • .


, . , , , . , , . , 0.99 1.01 . .







, 16 5 , , . :







  1. 5, 6, 7
  2. , 3. <= 7


: , , . 55. 55 , , . , .







, , . , :







  1. 5, 6, 7
  2. , 5,
  3. , 6 7
  4. 6
  5. 5 4, .
  6. β€” , β€” .


, / . . 4-7 . - , , :) .







, . , - , , , .







Redistribution of shots







"C" β€” "3", , "A" "B" 2 . "A" "B" "3", "C" . "C", , "A" "B" , , .







6.



, . , , . β€” Commandos ( 1 ). :









  1. ( , 5 - , . , )
  2. score : 3 , , 1
  3. score , .
  4. BFS- .
  5. .


, , 8-10 4-5, , .

, , 30%, , , . , , 65% 95% , , , , . 2/3 . - 30%. , .







Round 1 Opening



. , . GreenTea. , 1- ( ), 1 1 . . , . , , , , . . , .







, , , . , , .







, . , .









, , . 30 , id. , , .







, , . .









, .







3 [79, 79] ( ) , 9 . . , . , .







Flanking







, , .









, , " ", . , , , , , . , "", . , , .







, :







  1. . , . - , , 2 . , , . , . , 4040 8080.
  2. . .. , . . , . β€” ! β€” . , .

    . :

    • . , , -, -, , , , - .
    • , ,
    • [0, 0], ,
    • , , , [0, 0]. 6 , ( ). .


Emitters







. β€” . , :







Emitters







β€” .







, . , , 25 . , , , . , , , , BFS 25 .







25 . ____ + ___ * (25 - __)



. "" , , , . , .







, , BFS. , BFS , . , 5 . BFS , .







, , , β€” . . , , . - .







, . , , , . , , .









A* . , , , . , , , . . . , , β€” .







, . :







  • : , , "" . , , , . , , . , , , , .







    Pushing the workers







    "A" "B". , . , . , .







  • : , , , . , , .











3- . , , , , , 2/3 , 500. .. . , , , , , ( ), ( ). , 480:20, .







, , . .







, , python. ( 200) . - :







python search.py run &mdash;p1 test.exe &mdash;p2 prev.exe &mdash;count 200 &mdash;teams 2 &mdash;nthreads 3 &mdash;level Finals &mdash;params "CMD_MAX_DIST_FROM_BASE_TO_COUNTER:50/100|ENEMY_UNIT_ATTRACTION:100/300|FRIENDLY_PUSH_OFF_MULT:2.5/7.5" &mdash;output tests_v42-r3-1

      
      





6 200 3 . CMD_MAX_DIST_FROM_BASE_TO_COUNTER = 50



, β€” CMD_MAX_DIST_FROM_BASE_TO_COUNTER = 100



.. . β€” . , CMD_MAX_DIST_FROM_BASE_TO_COUNTER 75, 50 100.









, . , . :











. . , , .

!








All Articles