1
\$\begingroup\$

EDIT : at first I gave a lot of context for this question, explaining why I wanted to create a bot. I'm sorry it distracted people from my "actual" question.

My question is pretty simple : how does one create a bot for a game ? (Especially... on a mac, if it's possible -- though I can use a Linux virtual machine if needed).

Is it interfaced with the application, or just "watching" the screen and extracting information from it (as if it was taking pictures and analyzing them to get informations such as your HP, your position, etc.) ? Could I use python to code it, or are there specific languages ?

The forementioned context :

Since I started programming, I've wanted to try to create algorithms that would be able to "play" (or even "beat") video games. Many games require only logical choices, more and more complex as the difficulty grows, which seems perfect for algorithms.

I currently enjoy the game "Pixel Dungeon" a lot (see here), but it's not always nice to you (and you die. A lot.). A few researches on the internet show that a lot can be achieved just by following simple guidelines.

So I figured maybe this would be a good game to try and create bots to play it. In the long term, I would like to let bots play, extract data out of it, and modify my algorithms according to these data. I am really enthusiast about this, but also really novice.

(maybe this belongs more to https://stackoverflow.com/ ?)

\$\endgroup\$
10
  • 1
    \$\begingroup\$ Just to throw this out there: I'm a third year computer science (programming) major in college and I have yet to de anything regarding AI or self-writing code. I may be overthinking an obvious solution but this doesn't seem like a trivial thing. \$\endgroup\$ Commented Oct 19, 2016 at 0:12
  • \$\begingroup\$ Are you talking about creating a general purpose AI that could play any game and eventually get better and better at it? Because Deep Mind just did that back in March and experts unilaterally agree that it was a Moon Shot and that such a feat should not have been achievable for another decade! If that was your dream, consider it crushed. On the other hand, if you just want to program a bot to play your game only, this could be done much more easily. You will feed your boy the data that you want the bot to have access to, and then write an AI that chooses what to do with that data. \$\endgroup\$ Commented Oct 19, 2016 at 0:30
  • 1
    \$\begingroup\$ I'm voting to close this question as off-topic because it is about developing bots for third party games, and not related to game development. \$\endgroup\$ Commented Oct 19, 2016 at 1:50
  • 1
    \$\begingroup\$ Use conditional logic. Give each entity a set "budget" per turn, which they use to "purchase" choices. Test for movement, simulate what happens when you move there. Is their health low? Do they have enough budget remaining to use a potion? Is the players health low? Can they kill him in one hit, or should they use a potion instead? Etc. \$\endgroup\$ Commented Oct 19, 2016 at 12:18
  • 1
    \$\begingroup\$ The easiest thing to do is make use of the scripting provided by the game, if the game actually provides that ability. Another technique is to "hack" the game and see if you can figure out any memory locations that can be monitored and actions taken, sometimes you can "hook" into OS function calls that the game uses also. And yet another technique from one of my favorite sites DataGenetics.com is detailed here: "My computer plays better Bejeweled than I do" - datagenetics.com/blog/march2009/index.html \$\endgroup\$ Commented Oct 19, 2016 at 22:50

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.