World of Tanks is a free MMo where you are driving the most iconic tanks in the history. Here I propose a project providing an automatic driving assistant powered by a deep CNN which take a look at the minimap and drives the tank towards the placeholder.
The idea is pretty simple:
- Capture gameplay (frames and keys) (capture_frames.py)
- Train an end-to-end CNN to take frames as inputs and returns commands as outputs (TF_pipeline_wot)
- Use the Model to command a tank in real time (Play.py)
While the idea was simple I soon encountered many challenges:
- capture multiple keys at the same time
- converting .txt files in hot-one encoded labels and making the y dataset
- class imbalances (fixed with data augmentation and balancing scripts). These solutions are the best I could came up with but 'unfortunately' they require much gameplay to be collected
problems and how to solve them:
- capture the EXACT minimap square. with some tries can be done but remember to adjust the pipeline process
- the model requires a lot of positive examples (5 - 6 000 pairs) to perform nicely;
- many hyper parameters to be chosen that affect training process and control experience. The learning rate was set at 1e-5 but some in some iterations the model could not learn; while controlling the tank the output
- the actual model deployment it's not smooth since you'll need to play WoT in a windowed mode. This is due some incompatibility with Thread processes. In theory the problem could be solved by NOT using thread at all baut this would require re-writing most of the code with different modules and functions
- it's not a Reinforcement Learning approach which is the best approach for agent-control problems (but the game is complex and it would require much more training) but it's on the to-do list ;)