A python bot which is tailor made to play Counter Strike 1.6 using Image Processing and Controller Emulation
https://ieeexplore.ieee.org/document/8474885
https://github.com/jaspreetbhamra/Agent-GPY/blob/master/Slideshow/Agent%20GPY%20Slideshow.pdf
- The Bold-White lines are all the lines we get from Hough Lines - Line recognition algorithm
- The red lines show the estimated trace of the Hough Lines we used to read the 3D space
- The green circle indicates the centre of the closest horizontal line we can trace, thus giving us the desired direction of travel
- Install Python3
- Download the source
- Run Counter Strike 1.6, and pick a team
- Run g.py using the following command
$ g.py -t <team>
(team can be either 'ct' or 't')
- Grab screen for the game's viewport
- Use Haar Cascades to recognize teammates vs hostiles (The trained data had been made using a set of 1200 images of targets)
- Use Controller Emulator scripts like PyAutoGUI to flick mouse after identifying targets on the viewport
- Use the library to click
- Check back the viewport data for movement clues
5.1. Use CV2 image processing library to get a greyscale version of the viewport
5.2. Use Gaussian Blur to blur out the high noise tiled regions on the screen
5.3. Run Hough Lines transform to get lines
5.4. Discard vertical lines
5.5. Check for two adequately long lines on opposite halves of the viewport with opposite slope, to recognize them as the edges at the feet of walls
5.6. Apply Forward movement input if you get a positive for the pattern in 5.5
5.7. Check for oppositely sloped lines on the same halves
5.8. Apply Right/Left movement input against the half in which you get a positive for the pattern in 5.7
Try using the same code, train for images of real life objects/robots_from_opp_teams, and make a robot that plays the same objectives as in Counter Strike