Answers.Body: <p><strong>Automation of Game-play</strong></p>
  
  <p>Aimbots are indeed designed to provide assistance to the human game player when the complexity of game play escapes full cybernetic autonomy at the current state of technology.  There are five basic components in any game player, DNA based or digital.</p>
  
  <ul>
  <li>Acquisition of the current state of the game</li>
  <li>Control over execution of move options</li>
  <li>Intercommunication with other players</li>
  <li>Models related to the game</li>
  <li>Execution engine for applying these</li>
  </ul>
  
  <p>The models are as follows for a CS:GO aimbot.</p>
  
  <ul>
  <li>Model of game players</li>
  <li>Model of the opposing team</li>
  <li>Model of the game player being assisted</li>
  <li>Model of that player's team</li>
  <li>Model of the opposing team</li>
  <li>Model of the game state</li>
  <li>Model of legal game moves that transition state</li>
  <li>Model of objectives (winning or maintaining a top score)</li>
  <li>Models of game-play strategy involving the first three items in the previous list </li>
  </ul>
  
  <p>Learning all of these is not in the scope of current deep learning strategies but not outside the scope of AI if the following problem analysis and system approaches are taken.</p>
  
  <ul>
  <li>Assumptions are made similar to those of Morgenstern and von Neumann in the later chapters of their <em>Game Theory</em> to mathematically treat the decisioning of game players in a minimalistic way.</li>
  <li>DSP, GPU, network realization hardware, cluster computing, or some other artificial network hardware acceleration is available</li>
  <li>Models programmed in Prolog, DRools, or some other production system and then leveraged by the execution engine in conjunction with other components such as deep learning networks, convolution processing, Markov trees, fuzzy logic, and the application of oversight functions or heuristics as needed</li>
  </ul>
  
  <p>The two services, (a) the provision of suggestions and (b) the automation of minor tasks, may indeed represent the low hanging fruit from a software engineering perspective, but the problem analysis and system approach above may provide more.</p>
  
  <p><strong>Objectives in CS:GO</strong></p>
  
  <p>The CS:GO (Counter-Strike Global Offensive) game seems to have been written from a Westphalian geopolitical point of view.  This is the typical western perspective, somewhat oblivious to the mindset of the true nature of asymmetric warfare<sup>1</sup>.  This answer will focus on the creation of an aimbot for the existing models of game-play rather than a realistic simulation of geopolitical balance in this decade.</p>
  
  <p>We have the objective types listed in online resources that provide a game overview, again, narrowed in authenticity by the prevailing western view of asymmetric war<sup>1</sup>.</p>
  
  <ul>
  <li>Terminating players of the opposing team</li>
  <li>Planting a bomb toward that end (terrorists only)</li>
  <li>Defend hostages (terrorists only)</li>
  <li>Prevention of bomb casualties (counter-terrorists only)</li>
  <li>Rescue of hostages (counter-terrorists only)</li>
  </ul>
  
  <p><strong>Ballistic Control</strong></p>
  
  <p>The targetting of the body or head of an opponent is within the scope of what image recognition can do in conjunction with a movement model.  In military applications, aeronautic devices must be propelled against air friction and the propulsion requires a largely exothermic reaction like combustion.  Thus all targets have a heat signature, which can be recognized in an infrared video stream in such a way as to plot an intercept course for the ballistic weapon.</p>
  
  <p>The targetting formulation for CS:GO is not as complex and aiming and firing may be fully automated with much less software machinery.  A LSTM with sufficient speed can be trained to recognize a head in subsequent frames and terminate opponents even if moving.  A simple web search for LSTM will provide a plethora of resources to the novice intending to learn about image recognition.</p>
  
  <p><strong>One Ambiguity</strong></p>
  
  <p>Whether the second objective can be met is dependent on what is meant by the term, "Viewing angles," in the context of image recognition.  Can the player see from perspectives other than the location of their eyes?  If so, this answer can be adjusted if given a clear picture of what is meant.</p>
  
  <p><strong>Training and Re-entrant Learning</strong></p>
  
  <p>Training of an artificial neural net to target a head is unnecessary unless the 3D rendering of the game objects and players is distorted by a wide angle virtual lens and trajectories and movements are curved.  As mentioned LSTM can be used to locate a head in multiple frames and extrapolate an opposing players trajectory.</p>
  
  <p>Where deep learning may be most effective is in the training of how to interact with the player to best assist.  Also, if there are other non-targeting techniques that are more discrete, those who play CS:GO well could record their interactions and those recordings can be processed in preparation for use as training data.</p>
  
  <p>Certainly a re-entrant learning strategy such as reinforcement is useful for game-play especially if the make up of teams changes and players exhibit different behaviors, executing differing strategies over different networks with different latencies and through-puts, and communicating with the game clients through different peripheral devices.</p>
  
  <p>[DeepMind Lab Test Bed for Reinforcement Technology](<a href="https://github.com/deepmind/lab" rel="nofollow noreferrer">https://github.com/deepmind/lab</a>}</p>
  
  <p><strong>More than Suggestions</strong></p>
  
  <p>With proper architecture, more than suggestive strategies can be provided to the player.  Statistical dashboards, identification of a bomb before or after planting, and identification of hostages should be among the aimbot services provided, which might suggest a new name, such as obot for objective bot or asbot for assistive bot.</p>
  
  <p>It is not certain that the aimbot interface need be integrated with dashboards or bomb or hostage identifiers.  Sometimes independent bots provide a more flexible arrangement for a user.  Individual bots can always use the same underlying image recognition components and models.</p>
  
  <p><strong>Entry Points into Developing Such a System</strong></p>
  
  <p>Read some of the work on the above concepts and download what code you can find that demonstrates it in Python or Java, install what is necessary, and develop some proficiency with the components discussed above as well as the associated theory.  Don't shy away from the math, since success will require some proficiency with feedback signalling and concepts like gradient descent and back-propagation.</p>
  
  <p><a href="https://scholar.google.com/scholar?hl=en&amp;as_sdt=0%2C10&amp;q=reinforcement+games&amp;btnG=" rel="nofollow noreferrer">Reinforcement in Games</a></p>
  
  <p><a href="https://scholar.google.com/scholar?hl=en&amp;as_sdt=0%2C10&amp;q=lstm+locating+head&amp;btnG=" rel="nofollow noreferrer">LSTM Head Locating</a></p>
  
  <p><a href="https://arxiv.org/pdf/1312.5602.pdf" rel="nofollow noreferrer">Playing Atari with Deep Reinforcement Learning, Mnih et al., 2013</a></p>
  
  <p><strong>Phased Approach</strong></p>
  
  <p>The following phased research and development approach is suggested.</p>
  
  <ul>
  <li>Learn the theory</li>
  <li>Practice the theory in code</li>
  <li>Develop the image recognition front end</li>
  <li>Develop the library to control a virtual player</li>
  <li>Develop at least one of the above models</li>
  <li>Create the simplest bot to use it</li>
  <li>Expand automation from there</li>
  </ul>
  
  <hr>
  
  <p><strong>Footnotes</strong></p>
  
  <p>[1] In asymmetric power struggles, there are always at least two factions within each side because didactic legitimacy seeks division.  Unity is not practically possible.  Each real team usually has a more religious and more secular faction, each of which has economic, philosophic, and historical justifications for their position and agenda.  Also, terrorists don't seek the public detonation of bombs or retention of hostages as objective but rather as means, with the total elimination of all not fully adhered to their view of legitimacy as the sole endgame objective.  Suicide or high risk bombing is considered by most of those that employ it as the poor man's nukes, so without nuclear strike capability for the counter-terrorists and their allies, the terrorism lacks the important dimension of last resort.  The last resort aspect of nuclear strike is missing from the counter-terrorist side too.  CS:GO may sell better by glossing over these particular characteristics of asymmetric warfare and such was left out deliberately.  There may be some benefit to adding these features in from an educational and anti-propaganda point of view.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-22T18:32:05.573Z
Answers.Text: Roughly, 80% of this answer is useless to answer the actual question.
Answers.UserDisplayName: nbro
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-13T04:48:51.533Z
Answers.LastActivityDate: 2018-09-13T06:45:20.927Z
Answers.LastEditDate: 2018-09-13T06:45:20.927Z
Answers.UserDisplayName: Douglas Daseeco
Answers.Body: <p>Thare are many ways to approache this. One approach to start would be to try to describe the problem using a formalism closer to reinforcement learning. </p>
  
  <ul>
  <li>Output:</li>
  </ul>
  
  <p>Aiming in any shooter type game, as I recall, involves moving the mouse. So the output of your aimbot has two dimentions. Depending on the required accuracy, you can consider these two dimentions continous, with a limited range, or if you consider each pixel as a integer, you might be able to discretize your action space. (I assume mouse XY coordinates should be input to the game, not increments)</p>
  
  <ul>
  <li>Input:</li>
  </ul>
  
  <p>You  definetly need screen information. You can take the whole screen as input to a CNN, similarly to DeepQLearning for Atari.</p>
  
  <ul>
  <li>Reward function</li>
  </ul>
  
  <p>This might be tricky since your rewards need to be as dense as possible, however, the only feedback you get from the game is that someone was shot. 
  It might be ebough but this will definetly increase your training time. </p>
  
  <ul>
  <li>Training data / Environemnt:</li>
  </ul>
  
  <p>Your environment for training is the game itseld. Using a <a href="https://ronan.collobert.com/pub/matos/2009_curriculum_icml.pdf" rel="nofollow noreferrer">curriculum learning</a> approach would probably make the training process more efficient. </p>
  
  <p>You can also try an <a href="https://arxiv.org/abs/1801.06503" rel="nofollow noreferrer">imitation learning</a> approach, since I assume you are happy to provide expert training examples (in this case probably headshots in the game environment). </p>
  
  <p>You can read more about how to apply reinforcement learning for games <a href="https://github.com/Unity-Technologies/ml-agents" rel="nofollow noreferrer">here</a>. The Unity ML-Agents Library also includes sample tracking problems and their solutions. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-07T07:00:51.687Z
Answers.LastActivityDate: 2018-09-07T07:00:51.687Z
Answers.UserDisplayName: 50k4
Body: <p>How can I create an artificially intelligent aimbot for a game like <a href="https://en.wikipedia.org/wiki/Counter-Strike:_Global_Offensive" rel="nofollow noreferrer">Counter-Strike Global Offensive (CS:GO)</a>?</p>
  
  <p>I have an initial solution (or approach) in mind. We can train an image recognition model that will recognize the head of the enemy (in the visible area of the player, so excluding the invisible area behind the player, to avoid being easily detected by VAC) and move the cursor to the position of the enemy's head and fire.</p>
  
  <p>It would be much more preferable to train the recognition model in real-time than using demos. Most of the available demos you might have might be 32 tick, but while playing the game, it works at 64 tick.</p>
  
  <p>It is a very fresh idea in my mind, so I didn't actually think a lot about it. Ignoring facts like detection by VAC for a few moments.</p>
  
  <p>Is there any research work on the topic? What are the common machine learning approaches to tackle such a problem?</p>
  
  <p>Later on, this idea can be expanded to a completely autonomous bot that can play the game by itself, but that is a bit too much initially.</p>
  
Tags: <machine-learning><game-ai><applications><reference-request>
Title: How can I create an artificially intelligent aimbot for a game like CS:GO?
UserDisplayName: Mrunal Sonawane
ThreadText: # How can I create an artificially intelligent aimbot for a game like CS:GO?
  
  (Asked by: username_0 on 2018-08-30)
  
  How can I create an artificially intelligent aimbot for a game like [Counter-Strike Global Offensive (CS:GO)](https://en.wikipedia.org/wiki/Counter-Strike:_Global_Offensive)?
  
  I have an initial solution (or approach) in mind. We can train an image recognition model that will recognize the head of the enemy (in the visible area of the player, so excluding the invisible area behind the player, to avoid being easily detected by VAC) and move the cursor to the position of the enemy's head and fire.
  
  It would be much more preferable to train the recognition model in real-time than using demos. Most of the available demos you might have might be 32 tick, but while playing the game, it works at 64 tick.
  
  It is a very fresh idea in my mind, so I didn't actually think a lot about it. Ignoring facts like detection by VAC for a few moments.
  
  Is there any research work on the topic? What are the common machine learning approaches to tackle such a problem?
  
  Later on, this idea can be expanded to a completely autonomous bot that can play the game by itself, but that is a bit too much initially.
  
  **Tags:** machine-learning, game-ai, applications, reference-request
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-09-13. Score: -1 | Accepted answer
  
  **Automation of Game-play**
  
  Aimbots are indeed designed to provide assistance to the human game player when the complexity of game play escapes full cybernetic autonomy at the current state of technology. There are five basic components in any game player, DNA based or digital.
  
  * Acquisition of the current state of the game
  * Control over execution of move options
  * Intercommunication with other players
  * Models related to the game
  * Execution engine for applying these
  
  The models are as follows for a CS:GO aimbot.
  
  * Model of game players
  * Model of the opposing team
  * Model of the game player being assisted
  * Model of that player's team
  * Model of the opposing team
  * Model of the game state
  * Model of legal game moves that transition state
  * Model of objectives (winning or maintaining a top score)
  * Models of game-play strategy involving the first three items in the previous list
  
  Learning all of these is not in the scope of current deep learning strategies but not outside the scope of AI if the following problem analysis and system approaches are taken.
  
  * Assumptions are made similar to those of Morgenstern and von Neumann in the later chapters of their *Game Theory* to mathematically treat the decisioning of game players in a minimalistic way.
  * DSP, GPU, network realization hardware, cluster computing, or some other artificial network hardware acceleration is available
  * Models programmed in Prolog, DRools, or some other production system and then leveraged by the execution engine in conjunction with other components such as deep learning networks, convolution processing, Markov trees, fuzzy logic, and the application of oversight functions or heuristics as needed
  
  The two services, (a) the provision of suggestions and (b) the automation of minor tasks, may indeed represent the low hanging fruit from a software engineering perspective, but the problem analysis and system approach above may provide more.
  
  **Objectives in CS:GO**
  
  The CS:GO (Counter-Strike Global Offensive) game seems to have been written from a Westphalian geopolitical point of view. This is the typical western perspective, somewhat oblivious to the mindset of the true nature of asymmetric warfare1. This answer will focus on the creation of an aimbot for the existing models of game-play rather than a realistic simulation of geopolitical balance in this decade.
  
  We have the objective types listed in online resources that provide a game overview, again, narrowed in authenticity by the prevailing western view of asymmetric war1.
  
  * Terminating players of the opposing team
  * Planting a bomb toward that end (terrorists only)
  * Defend hostages (terrorists only)
  * Prevention of bomb casualties (counter-terrorists only)
  * Rescue of hostages (counter-terrorists only)
  
  **Ballistic Control**
  
  The targetting of the body or head of an opponent is within the scope of what image recognition can do in conjunction with a movement model. In military applications, aeronautic devices must be propelled against air friction and the propulsion requires a largely exothermic reaction like combustion. Thus all targets have a heat signature, which can be recognized in an infrared video stream in such a way as to plot an intercept course for the ballistic weapon.
  
  The targetting formulation for CS:GO is not as complex and aiming and firing may be fully automated with much less software machinery. A LSTM with sufficient speed can be trained to recognize a head in subsequent frames and terminate opponents even if moving. A simple web search for LSTM will provide a plethora of resources to the novice intending to learn about image recognition.
  
  **One Ambiguity**
  
  Whether the second objective can be met is dependent on what is meant by the term, "Viewing angles," in the context of image recognition. Can the player see from perspectives other than the location of their eyes? If so, this answer can be adjusted if given a clear picture of what is meant.
  
  **Training and Re-entrant Learning**
  
  Training of an artificial neural net to target a head is unnecessary unless the 3D rendering of the game objects and players is distorted by a wide angle virtual lens and trajectories and movements are curved. As mentioned LSTM can be used to locate a head in multiple frames and extrapolate an opposing players trajectory.
  
  Where deep learning may be most effective is in the training of how to interact with the player to best assist. Also, if there are other non-targeting techniques that are more discrete, those who play CS:GO well could record their interactions and those recordings can be processed in preparation for use as training data.
  
  Certainly a re-entrant learning strategy such as reinforcement is useful for game-play especially if the make up of teams changes and players exhibit different behaviors, executing differing strategies over different networks with different latencies and through-puts, and communicating with the game clients through different peripheral devices.
  
  [DeepMind Lab Test Bed for Reinforcement Technology](<https://github.com/deepmind/lab>}
  
  **More than Suggestions**
  
  With proper architecture, more than suggestive strategies can be provided to the player. Statistical dashboards, identification of a bomb before or after planting, and identification of hostages should be among the aimbot services provided, which might suggest a new name, such as obot for objective bot or asbot for assistive bot.
  
  It is not certain that the aimbot interface need be integrated with dashboards or bomb or hostage identifiers. Sometimes independent bots provide a more flexible arrangement for a user. Individual bots can always use the same underlying image recognition components and models.
  
  **Entry Points into Developing Such a System**
  
  Read some of the work on the above concepts and download what code you can find that demonstrates it in Python or Java, install what is necessary, and develop some proficiency with the components discussed above as well as the associated theory. Don't shy away from the math, since success will require some proficiency with feedback signalling and concepts like gradient descent and back-propagation.
  
  [Reinforcement in Games](https://scholar.google.com/scholar?hl=en&as_sdt=0%2C10&q=reinforcement+games&btnG=)
  
  [LSTM Head Locating](https://scholar.google.com/scholar?hl=en&as_sdt=0%2C10&q=lstm+locating+head&btnG=)
  
  [Playing Atari with Deep Reinforcement Learning, Mnih et al., 2013](https://arxiv.org/pdf/1312.5602.pdf)
  
  **Phased Approach**
  
  The following phased research and development approach is suggested.
  
  * Learn the theory
  * Practice the theory in code
  * Develop the image recognition front end
  * Develop the library to control a virtual player
  * Develop at least one of the above models
  * Create the simplest bot to use it
  * Expand automation from there
  
  ---
  
  **Footnotes**
  
  [1] In asymmetric power struggles, there are always at least two factions within each side because didactic legitimacy seeks division. Unity is not practically possible. Each real team usually has a more religious and more secular faction, each of which has economic, philosophic, and historical justifications for their position and agenda. Also, terrorists don't seek the public detonation of bombs or retention of hostages as objective but rather as means, with the total elimination of all not fully adhered to their view of legitimacy as the sole endgame objective. Suicide or high risk bombing is considered by most of those that employ it as the poor man's nukes, so without nuclear strike capability for the counter-terrorists and their allies, the terrorism lacks the important dimension of last resort. The last resort aspect of nuclear strike is missing from the counter-terrorist side too. CS:GO may sell better by glossing over these particular characteristics of asymmetric warfare and such was left out deliberately. There may be some benefit to adding these features in from an educational and anti-propaganda point of view.
  
  > **Comments:**
  > **username_2**: Roughly, 80% of this answer is useless to answer the actual question.  
  
  ---
  
  ### Answer by username_3 on 2018-09-07. Score: 0
  
  Thare are many ways to approache this. One approach to start would be to try to describe the problem using a formalism closer to reinforcement learning.
  
  * Output:
  
  Aiming in any shooter type game, as I recall, involves moving the mouse. So the output of your aimbot has two dimentions. Depending on the required accuracy, you can consider these two dimentions continous, with a limited range, or if you consider each pixel as a integer, you might be able to discretize your action space. (I assume mouse XY coordinates should be input to the game, not increments)
  
  * Input:
  
  You definetly need screen information. You can take the whole screen as input to a CNN, similarly to DeepQLearning for Atari.
  
  * Reward function
  
  This might be tricky since your rewards need to be as dense as possible, however, the only feedback you get from the game is that someone was shot.
  It might be ebough but this will definetly increase your training time.
  
  * Training data / Environemnt:
  
  Your environment for training is the game itseld. Using a [curriculum learning](https://ronan.collobert.com/pub/matos/2009_curriculum_icml.pdf) approach would probably make the training process more efficient.
  
  You can also try an [imitation learning](https://arxiv.org/abs/1801.06503) approach, since I assume you are happy to provide expert training examples (in this case probably headshots in the game environment).
  
  You can read more about how to apply reinforcement learning for games [here](https://github.com/Unity-Technologies/ml-agents). The Unity ML-Agents Library also includes sample tracking problems and their solutions.
  
  
  ---
  
  