Jump to content
LordJashin

Best Methods for TPA/Color Finding/TIA

Recommended Posts

I want Freddy/Jani/Wanted/Bixby/etc's input on this.

 

I've been thinking about this a while now, and want to hear what you guys think or like.

 

Definitions:

TPA - Array of Points

TIA - Array of Integer (like arrays of colors)

Color Finding - Using colors/points together to find things

 

So we know that designating a search area is the first thing to do. Such as the main screen in Runescape.

 

Now for search methods. We can sort things various ways, and use different tolerance methods. I want to ask does SCAR support CIELab? And what is CIELab btw, and does SCAR need it? - https://en.wikipedia.org/wiki/Lab_color_space

 

1. We can agree that the better the tolerance method, the better the result, and similarity/tol we can use with color finding. It makes sense that the more accurate the better.

 

Now how does this fit in with arrays.

We can get arrays of color, and then get the points at which the colors where found. So lets say we want to find Red, and with some tolerance some similar colors. So all the red colors are returned in a TIntArray, and TPointArray where they were found. The example: red we want to find is primarily on a red boot.

 

Then we can find the distance between points.

 

Proposed methods:

 

1. Find out which areas have the most points that are right next to other points. e.g. how the red boot has tons of red pixels grouped together. We could make a method that does this for us, effectively grouping concentrated areas where the color Red is (with tolerance ofc if not 0).

So I want the TPA to be sorted so that. Only points the are (X) distance away from other points in the TPA will remain. So if i put a distance of 1. Only points that are 1 away from other points will stay. You get the idea. We can actually do this! With the SplitTPA function. Then we would need to sort the TPA by the points closest to another point (Spiral) (there's a function for this too)... this would be if we were playing Runescape. Then start to filter out TPA's that have the least amount of points. So maybe if we were Woodcutting. We could filter out TPA's that have a lower High index then 20-30 points or something. This sounds like a great idea, if you get confused by what I said, just get the main idea here....

 

Looks sort of like this

 

Any other ideas? What do you guys use in your scripts? I think Jani uses some ATPA functions that sort by size.

Edited by LordJashin
Link to comment
Share on other sites

Which tolerance mode is most accurate? That one? Thanks for clearing this up, didn't know SCAR supported this already. Need to brush up on my tolerance knowledge again.

 

 

EDIT: I would also like to add that. Color finding and what I explained In 3D games is different than if we were doing 2D. Like finding an inventory item vs. a tree in Runescape. Different methods for both can be used. More so for 2D.

Edited by LordJashin
Link to comment
Share on other sites

As an end user and not understanding color space and all them other foreign words I generally find tolerance mode 2 to be more accurate. Or rather better at targeting a specific object/color when there are a lot of similiar colors on the screen. But it is a bit slower than mode 1, and if you have a really unique color I simply use mode 1.

 

I use the ACA tool a lot to find my best color and toggle back and forth between mode 1 and 2 to see what matches.

Link to comment
Share on other sites

I would love you bixby even more than I already do :P

 

If you would explain ACA to me again. im such a nubadub

 

or maybe there is a thread on it ...

 

So what would be better for TPA/multiple color finding? Mode 1 would be the fastest? Then mode 2 best accuracy for speed?

Ello mate, here:

-

[video tutorial by YoHoJo]
Link to comment
Share on other sites

O no but I've seen that one...one too many times before xD. Thanks Jani.

 

Thing is with autocolor aid. It doesn't make the TPA/Color Array for you. But inside the Save file is the colors you picked. So that's useful to know. I like ACA a lot.

Too bad it only uses FindColorSpiral though. The TPA functions are better to use cuz u can eliminate things, and group things and find by groups.

I think it used FindColorsSpiral....which still just stops after it finds ONE of the colors?

 

The grouping is much better to do. Idk about speed though......

Also...when only a very small portion of like ( a tree) for instance is showing on runescape the only option would be to use find color.

Too much at play with 3D.

If using more than just the tree trunk color. Like for instance the color of the tree's leaves. Could add distance with that. Find colors with distance from each other min and max.

 

I tell you what though. If you were to rotate the camera a bunch, that grouping method would work perfectly. I guess the find color method + uptext is enough though.

 

I can see how randomization is harder to do.....you also have to account for if it can't find anything...cuz of color changes (logoff or something).

I also think shape recognition/similarity could play a big role. Like if you have a circular object, but only part of it was showing, be able to tell it looks sort of like a circle? Maybe you could achieve this with TPAEdge?

 

- - - Updated - - -

 

Would there be anything better than this? I think that's the limit of what we can do with these functions.

 

Nice tut on some of this

 

So all we can do really is. Color + Uptext and maybe Distance sorting/largeness stuff. Which can't use minimum really without messing up. Shape comparing would be finicky as well.

 

Is there such a thing as FindTextTPATol? mmmm

 

 

Tell you what....if we set Angle to highest in RS2. Get the shape of something at every angle (Rotation). Then use what we scrape of the screen, make them both relatively the same size (using enlargen/make smaller). Then compare the shapes and find out how similar their outline is. I think that could work very well maybe. It has potential anyway...might be a cool function

 

 

 

What does SCAR's bitmap finding use for its tolerance? Does the SetTolerance thingy change it for that too?

Edited by LordJashin
Link to comment
Share on other sites

Well I've got the tree trunk thing working really well :D:

 

Regular view:

 

L4xe6.png

 

Bird view:

 

mHzxi.png

 

But what about the tops of the trees. I can use color aid on that but only a couple colors probably. Could use those.... any other ideas?

 

Here is the part of the script that handles the TPA and finds the trees then Debugs:

 

[scar]

procedure Findforalongtime;

begin

ColorToleranceSpeed(2);

GetColorspeed2Modifiers(b, c);

SetColorspeed2Modifiers(0.07, 0.07);

FindColorSpiralTolEx(258, 145, TPA, 3299183, 0, 0, 520, 336, 16);

ATPA := SplitTPA(TPA, 1);

ATPAExtractSizeEx(ATPA, 50, 10000);

//SortATPAByMiddleEx(ATPA, Point(250, 150));

{ for i := 0 to high(ATPA) do

for j := 0 to high(ATPA) do

begin

//pt := TPACenter(ATPA);

//MoveMouse(pt.x, pt.y);

//WriteLn('Current TPA in ATPA: ' + IntToStr(i));

end;

WriteLn('Length of TPA : ' + IntToStr(Length(TPA)));

WriteLn('Length of ATPA: ' + IntToStr(Length(ATPA)));}

DebugATPABoundsEx(ATPA, True, True, False, False, True, '');

//wait(5000);

end;

[/scar]

 

Any suggestions? I was thinking about just doing a couple colors off the top of the tree...then if it cant find the tree trunk, just to hover to those and check uptext. And if all else fails...to change the camera angle..

Edited by LordJashin
Link to comment
Share on other sites

Lol at least you still remember your login details, not that it matters. +1 up for wtfing

 

Yes this is on a pserver. Thanks Bixby, do you think its excessive to go this far? What would you prefer/do.

 

Want Jani's input too >< lols :P

 

I think 2D with color finding will prove the best. I might try to recreate SPS eventually with SCAR.

Edited by LordJashin
Link to comment
Share on other sites

In truth I never do the same thing twice. I ask myself "what is going to be easier / more accurate this time" In this case I prob just lower the camera and look for the trunks since you already have that working.

 

My practice is to go as far as I can, but not too far to lose the main focus. I still want what Janilabo things, because he's been making a lot of scripts lately xD.

 

I will go with the tree top merge idea you said. And have a ton of failsafes around all of this.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...