How to training the normal ai - Robosturm/Commander_Wars GitHub Wiki

Setup

  1. Setup get the training script https://github.com/Robosturm/Commander_Wars/blob/master/ai/training/normalai_training.js
  2. Rename it to init.js and copy it to the exe folder
  3. Change the value "cores = 30, // amount of games started at the same time" in the script to how many cpu's you want to use for the training process
  4. Uncomment or comment the line "menu.createRandomInis(2, "resources/aidata/normal/normal", 16);" depending if you want to continue a training session or start a new one.
  5. Change the values at the start of the script under "// training setup data" to on what environment you want to train the ai. Note the map should be a 2 player pvp map.
  6. Optional enable the debug output for the game in order to track what is going on in the background
  7. Start the game

How it works

  1. The game generates if enabled random ai-ini values for 8 ai's
  2. The game let's each ai fight against each other on both positions of the map and gives a score of 0, 1 or 3 depending on the match result for each match
  3. Once every ai fought against each other the best 2 ai's are kept as survivors.
  4. New 6 ai ini values are generated either random ones or progressed ones based on the match results
  5. Repeat from step 2
  6. Stop at anytime you want and check the console.log for the line "Best selected ai's are: ". You can rename the best file to normal.ini and test it or provide it to the CoW project via an issue if the results are good