Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
abductedPlatypus opened this issue Apr 18, 2018 · 3 comments
Open
Labels
question Further information is requested

Comments

@abductedPlatypus
Copy link
Member

abductedPlatypus commented Apr 18, 2018

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.

@abductedPlatypus abductedPlatypus added the question Further information is requested label Apr 18, 2018
@inthesky2
Copy link

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
Copy link
Member Author

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
Copy link

IamFlea commented Dec 26, 2018

@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 :)

  • You call BitBlt function to take screenshot.
  • You change the image to greyscale and do thresholding.
  • Then, you can easily locate digits and read them by simple list compare. In my case, I compared 8 or 9 pixels for parsing digits.

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants