Yielding to a nostalgic impulse, he decided to play around in one of the fan mods for Diablo II , and after a couple of hours was exhausted by the monotony of what was happening. And then an idea appeared in my head: why not write a bot that instead of me will go through a game that bothers you in just two hours. How can this be done in principle?
Vague answers to questions from DreamChild
First of all, I do it just for fun , to train my programmer's skills, and this is a kind of pen test in writing artificial intelligence, so do not discourage me.
Firstly , everything in Diablo are sprites that are packed in mpq, and not one unpacker was created by craftsmen, so these sprites can be extracted and taught to the AI ​​to recognize them already (we know what to look for). Text information is even simpler: we need to recognize a specific font (well, two fonts) of a specific size. However, it is not even necessary to recognize opponents: if, when you hover the mouse over an area, an inscription appears at the top of the screen, then this is the enemy that needs to be attacked. As a result, the bot should only distinguish between fonts and everything that flies in its direction (AI, dmayu, it is better to do sharpened for ranged combat).
Secondly , for each character there is a “build” - a certain leveling pattern. For simplicity, you can take one character and create for it a template according to which the AI ​​will scatter points of characteristics and skills.
Thirdly , a person selects a better gear only because he is too lazy to run to the merchants. AI can act on the algorithm filled in inventory, compared with his, went to the city, sold, bought a new portal scroll, returned to the location.
Fourthly , the tasks in such games are primitive, there are not so many of them, therefore the conditions for obtaining and executing them can all be manually entered. As for the map: most of the players deal only with those, which completely comb the locations in search of experience and better quality gear.
Fifth , to find out which bow is better is not so difficult: the one that has more damage (compare the stats of the character on the window). And for the other effects there is a hint: the stronger the subject, the more expensive it is. The only catch is with various resistances, but here you can force the AI ​​to consider what it takes more damage from and in accordance with this to strive to increase this or that resistance. But it is better to write an AI, which does not receive any damage at all, or reduces them to a minimum.
Sixth , what are the benefits of the SDK ? There is one in Torchlight and Titan Quest , but what benefits does it give?