Answers.Body: <p>Bot development is more about 'hacking' than AI in a way that in the very first place you need to read and (over) write game data which you are not supposed to (and thereby potentially violating the Terms and Conditions - so be aware of that). The AI part is fairly simple for most hack/bot applications that I can think of. </p>
  
  <p><strong>Read data</strong></p>
  
  <p>To read game data you can for example:</p>
  
  <ul>
  <li>use an assembly code debugger like Ollydbg to locate relevant data in the memory, e.g. amount of gold</li>
  <li>Observe graphical objects being rendered, e.g. a unit being drawn</li>
  <li>Intercept network packages containing all kinds of game information, e.g. a unit appearing on your screen</li>
  </ul>
  
  <p><strong>Write data</strong></p>
  
  <p>In a similar way there are multiple ways to write data:</p>
  
  <ul>
  <li>overwrite game data in memory</li>
  <li>Use the Windows API SendInput() function to emulate keyboard inputs</li>
  <li>Use the Windows API SendMessage() function to send messages to the game</li>
  <li>Manipulate network traffic</li>
  </ul>
  
  <p>These lists are not comprehensive but to give you an idea of how it is being done. </p>
  
  <p>AI-wise an A* algorithm for example can be deployed to do path finding. </p>
  
  <p>If you are interested in the topic I suggest to read 'Game Hacking' by Nick Cano. The book provides a good introduction. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-11T08:56:51.083Z
Answers.LastActivityDate: 2019-11-11T08:56:51.083Z
Answers.UserDisplayName: Jonathan
Body: <p>I was curious about how people make AI to play games. Does anyone know of the AI used to play these games? What allows the AI to see/click the screen in real-time? Even just direction on what libraries for such tasks would be helpful. I can't imagine game developers make an API for creating bots in their games like browsers use with selenium.</p>
  
Tags: <computer-vision><game-ai><chat-bots>
Title: What technology do people use to create bots for games like LOL or Runescape?
UserDisplayName: Michael Hearn
ThreadText: # What technology do people use to create bots for games like LOL or Runescape?
  
  (Asked by: username_0 on 2019-11-11)
  
  I was curious about how people make AI to play games. Does anyone know of the AI used to play these games? What allows the AI to see/click the screen in real-time? Even just direction on what libraries for such tasks would be helpful. I can't imagine game developers make an API for creating bots in their games like browsers use with selenium.
  
  **Tags:** computer-vision, game-ai, chat-bots
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-11-11. Score: 3
  
  Bot development is more about 'hacking' than AI in a way that in the very first place you need to read and (over) write game data which you are not supposed to (and thereby potentially violating the Terms and Conditions - so be aware of that). The AI part is fairly simple for most hack/bot applications that I can think of.
  
  **Read data**
  
  To read game data you can for example:
  
  * use an assembly code debugger like Ollydbg to locate relevant data in the memory, e.g. amount of gold
  * Observe graphical objects being rendered, e.g. a unit being drawn
  * Intercept network packages containing all kinds of game information, e.g. a unit appearing on your screen
  
  **Write data**
  
  In a similar way there are multiple ways to write data:
  
  * overwrite game data in memory
  * Use the Windows API SendInput() function to emulate keyboard inputs
  * Use the Windows API SendMessage() function to send messages to the game
  * Manipulate network traffic
  
  These lists are not comprehensive but to give you an idea of how it is being done.
  
  AI-wise an A\* algorithm for example can be deployed to do path finding.
  
  If you are interested in the topic I suggest to read 'Game Hacking' by Nick Cano. The book provides a good introduction.
  
  
  ---
  
  