highkite / alphaBot

Farming bot for the game **Alpha Wars** (http://eng.alphawars.com/)
3 stars 5 forks source link

This is no issue, but i did not find the "comment" section :) #3

Closed alexanderthiem closed 3 years ago

alexanderthiem commented 3 years ago

This is so nice, as i found it !After! I made such a thing on my own (for Delta Wars 5), for the exact same reasons....

My algorithm (not using libraries to analyze the image), gets a 4/5 accuracy as well, but automatically clicks for one base of each map... It also: logs you in again if you got logged out tries again if it missclics automatically produces pans if you tell him to

it works by splitting shapes (that are not connected) analyzing shapes by finding edges (geometrically, like the point fearest away from the midpoint must be an egde) and looking how far the points differ from these lines.... that way it successfully finds lonely triangles (not to click) and rectangles (to click), but if they are overlapping it just clicks in the middle of the shape

I dont know why i wrote this, but it was nice to see, that someone else had the same idea

alexanderthiem commented 3 years ago

ohhh now i can write a comment to this "Issue" :)

Th0rOnDoR commented 2 years ago

Hi,

What do you mean by "analyzing shapes by finding edges" without using libraries to analyze the image ? Could it be possible to talk ? Th0rOnDoR.#6925

Best Regards Th0rOnDoR

alexanderthiem commented 2 years ago

Hi Th0r0nDoR,

As far as I remember my code, i took the image of the screen by using a Library and converted it to a 2-Dimensional List. I then sorted this list into 0 and 1 (based on the bnrightness I guess). This List of Pixels was then splitted into shapes by finding connected und unconnected groups of pixels. Then I analyzed each shape similar to this: M=Midpoint of all Pixels being 1 A= The point with the highest distance to M B=The point with the highest distance to the line AM (Using Vectors to generate a formula for the distance) C= The Point with highest distance to the line AB

Then I calculated for every point (being 1) the distance to the lines AB,BC,CA took the minimum of those three values and summed it up: S= Sum(For each point=1, minimum(distanceToAB,distanceToBC,distanceToCA))

If this Sum was smaller than a given constant, the shape was treated as an triangle

^^Thats how I remember it atleast :)

Sure it is possible to talk alexanderThiem