SiegeEngineers / Border

A small app for showing BuildOrders on top of a game.
MIT License
6 stars 6 forks source link

Adding Hooks to the game for automatic Build Order advancement #6

Open abductedPlatypus opened 6 years ago

abductedPlatypus commented 6 years ago

I know it is possible to add some sort of automatic advancement. (i.e. when there are 3 villagers are on wood highlight the Boar lure task.)

This does require hooking into the game. For single player I guess this would be okay, but I don't think it would be easy to disable it for multiplayer where this becomes more problematic and could (should?) lead to bans.

Question remains if this is a good idea.

inthesky2 commented 5 years ago

Hello, I really like the fact that it's possible to customize the build orders. Can you please add a pixel search to detect the civilization/population of the player to keep track of the build order and have it go to the next step by population count? All that would be required is an initial pixel search to get the civilization, then a pixel search waiting for the next population increase.

The steps would than go like this: Population 7 (1 step) --> pixel search for population 8 --> Population 8 (new step) --> pixel search for population 9 --> Population 9 (new step). This way you wouldn't have to hook to the game, you would just have to pixel search the aoc window. While the program is amazing, it's very inconvenient to use in real time because you have to constantly change the steps while also playing the game. Even for online play, I don't think any good player will ever use something like this, people would only use this as beginners until they memorize their builds. Wouldn't really call this cheating. People can already have a notepad with all the build steps on a second monitor (as I do).

abductedPlatypus commented 5 years ago

Hey thanks for you input. This isn't a small feature unfortunately, it requires 4 parts:

  1. A hook into the game (OCR/pixels or straight memory reading)
  2. Add the requirement info to the build order model, and each update build order (can be combined to the (unpublished) icon system)
  3. Add this functionality to the (unpublished) automated advancer that compares the build order to the info from the hook.
  4. Enable/disable options for this feature.
IamFlea commented 5 years ago

@inthesky2 I have done some pixel searching in my previous project (old version.), image is available here. Executable files are no longer on the server.

Anyway, I wouldn't recommend it. Firstly, reading pixels is slow. Secondly, it can get buggy so the taken screenshot is black (blank). Thirdly, people utilize mods, and changing font may lead to errors. Fourthly, it parsed only resources, so you need to code your own script. :)

Nevertheless, the principle of image processing is really easy to code. Some hard stuff such as Neural Networks is NOT required :)

I parsed also civilization there. I noticed that each civilization has specific bottom frame design. So I just took bottom left pixels, it was a tiny square. I guess it was 16px x 16px and I compared the value of this list to saved value :) Stupid, simple, but it worked...