Original Post — Direct link

Welcome.

Referring to the recent announcement: https://www.pathofexile.com/forum/view-thread/2771031

I believe some things definitely deserve to be clarified.

First of all, the following sentence:

"SocketGroup now supports a number to specify the number of sockets in a link. By default (operator =) the number requires an exact match."

I don't get it, if the implicit operator is an exact match, why not having said (operator ==) instead?

I mean, is it just a typo?

Also, does such condition apply to multiple groups on the same item?

For example, would SocketGroup 4 match an item that has 1 group of 4 linked sockets and 1 group of 2 linked sockets?

Now, about the number+colour combining, and using the stated examples:

SocketGroup 5GGG -> exactly 5 linked | at least 3 green

SocketGroup == 5GGG -> exactly 5 linked | exactly 3 green

SocketGroup >= 5GGG -> at least 5 linked | at least 3 green

Fine, but there's 1 thing that bothers me.

In the first case, is the implicit operator really an exact match for the number, but not for the colours?

External link →
about 4 years ago - /u/RhysGGG - Direct link

is the implicit operator really an exact match for the number, but not for the colours? is it just a typo?

No typo. For Sockets and SocketGroup, the default operator (=) is a little odd, in order to preserve backwards compatibility. So yes, the number is an exact match but the colours are not.

The exact equals (operator ==) will force both number and colours to exactly match, if you want. Or you can use operator >= to make both number and colours accept more.

does such condition apply to multiple groups on the same item?

Yes, operators affect all conditions, if multiple conditions are specified.

would SocketGroup 4 match an item that has 1 group of 4 linked sockets and 1 group of 2 linked sockets?

Yes. SocketGroup matches items that contain a matching link. It doesn't care if there are other non-matching links. If you want to filter for 4 links with no other sockets, use Sockets == 4.

about 4 years ago - /u/RhysGGG - Direct link

Originally posted by Xeverous

/u/RhysGGG, can you clarify this? And /u/_xhul_, FYI:

https://cdn.discordapp.com/attachments/175290321695932416/678285728093831177/unknown.png

  • I got the post on == vs = but:

  • I'm unsure whether the syntax is SocketGroup "GGG" or SocketGroup GGG. There are 2 conflicting examples (in red).

  • I'm also unsure how both Sockets and SocketGroup will behave when there are multiple color groups (with = and == we have 4 different cases)

  • It's also not specified whether the order of letters matters - you never published any EBNF spec or anything similar and the parser container multiple unintuitive/bugged assumptions previously so I'm asking if there is anything regarding syntax that is worth to know

  • It's unclear whether CorruptedMods will work with comparison operators. Also why only 0-2 range? What If I drop the multi-corrupted Sirus gloves?

The syntax for SocketGroup should be unchanged: SocketGroup GGG

Ordering of letters doesn't matter.

As with all rules, if you specify multiple matches if match against any (rather than all). So you could use SocketGroup == RRR GGG BBB to match items with exactly 3 sockets all the same colour. If you didn't use the == operator, it would also match items with extra sockets.

CorruptedMods actually takes any number, but currently nothing in the game drops with more than two corrupted mods. Not even Hands of the High Templar.

I've updated the post to be more accurate, thanks.

about 4 years ago - /u/RhysGGG - Direct link

Originally posted by Dissolator

Please check if those are correct:

SocketGroup == 5RRR

shall fail in any case since it needs 5 links and exactly "RRR" group, which is 3 link, so it doesn't match

Sockets == 5RRR

will work and catch any 5 sockets (may not be linked) with 3x Red sockets in any order, since "RRR" here is not a socket group but just a condition to have number of specific types(colors)... or "==" will require number of sockets to be matched to number of listed socket types?

SocketGroup == 5RRR can match items with exactly 5 linked sockets, if the link has exactly 3 red sockets. This should be more useful than just matching nothing.

Sockets == 5RRR will match items with exactly 5 sockets and exactly 3 red sockets.

about 4 years ago - /u/RhysGGG - Direct link

Originally posted by Dissolator

Thanks! So exact match "==" with "5RRR" will not match if item has 4 red sockets, but match item with 3 red and 2 sockets of any other color?

what if it's SocketGroup == 5RRG - it'll match 2 red 1 green and others are not red and not green? while regular match = will allow at least 2 red and 1 green and others may be red or green too?

How < will work with "4RG" ? It will match 3 or 2 linked items with at least 1 red and 1 green in the link? so "RG" part does regular "=" check, not "less then", otherwise it hard to get what "less than 1 red and 1 green" shall check. So < <= => > operators are only applied to number of links, and socket types are have regular "=" match in all those cases?

So exact match "==" with "5RRR" will not match if item has 4 red sockets, but match item with 3 red and 2 sockets of any other color?

Yes

if it's SocketGroup == 5RRG - it'll match 2 red 1 green and others are not red and not green? while regular match = will allow at least 2 red and 1 green and others may be red or green too?

Yep

How < will work with "4RG"

The < and > operators are a bit weird for sockets. I'm not sure how useful they will be in practice. They will match an item that is "greater" or "less" in some way. So if you specify SocketGroup < 4RG then it will match any item with less than a 4 link, or any item with less than 1 red socket, or any item with less than 1 green socket. Operator > is similar, but only checks the number of sockets if you specified a number.

about 4 years ago - /u/RhysGGG - Direct link

Originally posted by _xhul_

I wasn't expecting that.

Are you implying that "SocketGroup < 4RG" is parsed the same way as "SocketGroup < 4 R G"?

Not parsed the same, but they are effectively equivalent

about 4 years ago - /u/RhysGGG - Direct link

Originally posted by Xeverous

I have another question. The post mentions "By default (operator =) the number requires an exact match." but gives examples using only ==.

So:

  • What is the difference between SocketGroup == 5GGG and SocketGroup = 5GGG?
  • What is the difference between Sockets == 5GGG and Sockets = 5GGG?

SocketGroup == 5GGG requires exactly a 5 link, with exactly 3 green sockets. The other two must not be green.

SocketGroup 5GGG (and SocketGroup = 5GGG) require exactly a 5 link with at least 3 green sockets.

Sockets == 5GGG requires exactly 5 total sockets, with exactly 3 green sockets. The other two must not be green.

Sockets 5GGG (and Sockets = 5GGG) require exactly 5 total sockets with at least 3 green sockets.

about 4 years ago - /u/RhysGGG - Direct link

Originally posted by Xeverous

I have another questions:

  • What is the difference between = and == for AreaLevel condition (the official post mentions both)? So far all such conditions (ItemLevel, DropLevel, Quality, GemLevel etc) only allowed < or > or <= or >= or = but not ==.
  • What is the default opacity value for colors that do not specify it? I noticed it is not fully opaque.

You are allowed to use == for numeric values, but it is exactly the same as =.

The default alpha value is 50 (out of 255). Edit: actually not. See below

about 4 years ago - /u/RhysGGG - Direct link

Originally posted by Xeverous

Thanks, but didn't you mean (255 - 50)? 0 is fully transparent, 255 is fully opaque. Default black-but-a-bit-transparent background for common items looks more like 205 than 50.

Oops, that value is not correct. Was looking at the wrong code.

The default text colour and border colour is (ARGB) 255 200 200 200.

The default background colour is (ARGB) 240 0 0 0.

about 4 years ago - /u/RhysGGG - Direct link

Originally posted by Xeverous

Thanks, do you mind checking 2 more things? /u/_xhul_ mentioned few really weird things in https://github.com/xhul-github/xhul-filter/blob/master/misc.txt - I'm mostly concerned about legacy prophecies that are not accepted and == being reported to not perform an exact string-string match for Class as it is the case for BaseType.

The item class not using == is definitely a bug. I will try to fix for 3.10.0.

Quest items must be filtered with an explicit item class (Class "Quest Items"). This is intended, not a bug.

Disabled Prophecies cannot drop and cannot be filtered. Also intended.

Relational operators work with CorruptedMods. Yes, why wouldn't they? It's just a number, after all. It works the same as all numeric rules (ItemLevel, AreaLevel, etc).

Undocumented item classes and base types, including "...". Please do not rely on these. They are scrapped concepts, WIP data that hasn't yet been removed, or occasionally necessary for non-item purposes for various internal reasons. They may change or be removed, and we assume item filters do not need them. These items cannot drop anyway.

The font size is a bit strange, yes, because the limitations depend on the font itself, which is different depending on your language. I don't know if we can improve this easily.

about 4 years ago - /u/RhysGGG - Direct link

Originally posted by _xhul_

Thanks a lot for those precisions.

I retested another bug i mentioned previously, and since you didn't reply, just in case you missed it: The 3.9.2f recoding of "Sockets" & "SocketGroup" has a flaw, specifically when used with a "0" argument. A few examples to illustrate: "Sockets 0" and "SocketGroup 0" will never match an Iron Ring, despite it has no sockets. Similarly, "Sockets 0" and "SocketGroup 0" will always match an Unset Ring, despite it actually has 1 socket. It's worth noting that that behaviour seems to be restricted to non-weapon & non-armour classes only ("Sockets 0" and "SocketGroup 0" will successfully match Kaom's Roots, for example).

Glad to hear you'll take a look at the interaction between "Class" & "==", that will actually grant us more flexibility in the order in which we declare our blocks, cool.

About legacy prophecies, i was surprised they got that treatment, compared to the many player-drop-only bases that can still be referred to, i guess because the "Prophecy" condition was implemented after those got removed from the pool of seekable ones.

I will fix the "Sockets 0" bug. Thanks!

about 4 years ago - /u/RhysGGG - Direct link

Originally posted by _xhul_

I was partly wrong, the bug isn't actually specific to "0" arguments, more like specific to non-weapon and non-armour classes in their intirety. For example, "Sockets < 6" and "SocketGroup < 6" fail to match an Iron Ring aswell.

While i'm here, could we get some details about that "Added new item filter drop effect colour options." 3.10 patch note?

Yeah, there were a few problems with matching against zero.

We are adding new drop effect colours, matching minimap icon colours, and new minimap icon shapes. The info should be posted up sometime today.

about 4 years ago - /u/RhysGGG - Direct link

Originally posted by Xeverous

Isn't there a sort of distinction between matching against 0 and "null"?

For example, Class "Divination Card" will match any card. But If I add Sockets <= 6 it will stop matching any card because cards are not treated to have 0 sockets, they are treated to have "null" sockets and any comparison requiring any socket number always fails.

Is such behavior intended? Can you list what items have "null" instead of 0? /u/_xhul_ already mentioned some inconsistency for sockets with jewellery items that seems to exhibit such implementation.

We don't have any concept of "null" in the item filter. For sockets specifically, base types that could never have sockets were matching false against all socket filters, even things like Sockets <= 6. I have changed this in 3.10.0 so everything has 0 sockets, and will match as such.

about 4 years ago - /u/RhysGGG - Direct link

Originally posted by briansd9

Hi /u/RhysGGG, thank you for the clarifications, I have another question.

Resonator sockets are currently indicated by "DV" in the JSON returned from the item data API. Will this be changed to "D" to conform with the filter syntax?

Unlikely, for backwards compatibility reason

about 4 years ago - /u/RhysGGG - Direct link

Originally posted by Xeverous

For sockets specifically, base types that could never have sockets were matching false against all socket filters, even things like Sockets <= 6

That's exactly how comparison against null or NaN works - it's always false.

I have changed this in 3.10.0 so everything has 0 sockets, and will match as such.

How about other properties? Eg if I do Class "Divination Card" MapTier >= 1 will it catch cards or not? If not, then it (possibly accidentally) implements "comparison against null/nan" behavior. I'm just interested which conditions have such behavior.

I see what you mean. I just had another look through, and I think socket matching was the only case. Everything else should match as zero, not "null".

But please let me know if you find any other weird behaviour!

over 3 years ago - /u/RhysGGG - Direct link

Originally posted by Xeverous

Hello again, during implementing own filter simulator/debugger I once more reviewed this thread and performed some experiments. Some results were different than I expected.

My goal is to understand exactly how the Sockets and SocketGroup conditions work.


First, I tested all the examples here and whether their wording is correct. Everything is fine here, but I post for clarity:

  • SocketGroup 5GGG - an item with exactly 5 linked sockets AND at least 3x G linked within such group
  • SocketGroup = 5GGG - an item with exactly 5 linked sockets AND at least 3x G linked within such group
  • SocketGroup == 5GGG - an item with exactly 5 linked sockets AND exactly 3x G linked within such group
  • SocketGroup >= 5GGG - an item with at least 5 linked sockets AND at least 3x G linked within such group
  • Sockets 5GGG - an item with exactly 5 sockets AND at least 3x G socket
  • Sockets = 5GGG - an item with exactly 5 sockets AND at least 3x G socket
  • Sockets == 5GGG - an item with exactly 5 sockets AND exactly 3x G socket
  • Sockets >= 5GGG - an item with at least 5 sockets AND at least 3x G socket
5s 5L 3G   5L 2G + 1G     5s 5L 4G     5L 3G + 1G      6L 3G     6L 4G
  +            -             +              +            -         -
  +            -             +              +            -         -
  +            -             -              +            -         -
  +            -             +              +            +         +
  +            -             +              -            -         -
  +            -             +              -            -         -
  +            -             -              -            -         -
  +            +             +              +            +         +

Then I tested less-than comparisons and one result is different than expected (marked with | |)

  • SocketGroup < 4RG - an item with less than a 4-link OR less than 1x R socket OR less than 1x G socket
  • Sockets < 4RG - an item with less than 4 sockets OR less than 1x R socket OR less than 1x G socket
B-B-B   G-G-G-G   R-R-R-R   R-G-B-B   R-G B-B   B-B-B-B R G
  +        +         +         -         +          |+|
  +        +         +         -         -           -

Then I tested more-than comparisons:

  • SocketGroup > 4RG - an item with more than a 4-link OR more than 1x R socket OR more than 1x G socket
  • Sockets > 4RG - an item with more than 4 sockets OR more than 1x R socket OR more than 1x G socket
B-B-B-B-B   R-R   R R   G-G   G G   R-G   R-G-B-B   R-G-B-B B
    +        +    |-|    +    |-|    -       -          -
    +        +     +     +     +     -       -          +

To summarize, the only thing I don't get is how/when SocketGroup counts colors when they are not linked together. Can you correct the wording of these or give me any sort of algorithm how these are implemented?

  • SocketGroup < 4RG - an item with less than a 4-link OR less than 1x R socket OR less than 1x G socket
  • SocketGroup > 4RG - an item with more than a 4-link OR more than 1x R socket OR more than 1x G socket

My intuition is:

  • SocketGroup < 4RG - an item with less than a 4-link OR less than 1x R socket within any linked-sockets-group OR less than 1x G socket within any linked-sockets-group
  • SocketGroup > 4RG - an item with more than a 4-link OR more than 1x R socket within any linked-sockets-group OR more than 1x G socket within any linked-sockets-group

...where I define linked-sockets-group as a group of sockets tied by links (so item R-G-B B B-R has 3 groups: RGB, B, BR).

Thanks for any response and have a good weekend.

Hiyo,

Let me preface by saying I feel like the < and > operators are generally not super useful or intuitive for socket matching, but I implemented them anyway for consistency...

So, first of all, SocketGroup only matches against linked socket groups; Sockets matches all sockets on the item regardless of links.

If you use SocketGroup < 4RG to filter an item with B-B-B-B R G the it will match if any of the three "linked socket groups" match. In this case, all three groups match the rule because they all lack either a red socket, a green socket, or both. To clarify:

  • B-B-B-B is a 4 link, but it has less than 1 Red socket (and less than 1 green socket) so it matches.

  • R matches because it is less than a 4 link, and also has less than 1 green socket, so it matches.

  • G matches because it is less than a 4 link, and also has less than 1 red socket, so it matches.

For the > operator, your intuition looks correct. Though considering it again, I somewhat regret implementing > like that, because it's inconsistent with >= semantically (ie an item can be > but not >= which is weird).

If there are any other non-obvious issues with the filtering, please let me know. You mentioned in the data mining thread that there were some subtle things that could catch people out, but afaik any such problem should either warn or error now. If there's something left to fix, I want to fix it.

Cheers!

over 3 years ago - /u/RhysGGG - Direct link

Originally posted by Xeverous

Thanks for the response. So in short, SocketGroup performs matches per each linked-socket-group (at least 1 group needs to satisfy) and Sockets performs one match against item total sockets and total color counts. This is really good news, because I thought of many possible implementations of representing item sockets and eventually went with an array of link-groups, which now turned out to very closely related to how SocketGroup works.

Let me preface by saying I feel like the < and > operators are generally not super useful or intuitive for socket matching, but I implemented them anyway for consistency...

IMO this condition itself is really complex and rarely used but anything more intuitive would surely require much more complex implementation.

Are the sockes/links conditions on https://www.pathofexile.com/trade working the same way? Haven't analyzed them thoroughly.

For the > operator, your intuition looks correct. Though considering it again, I somewhat regret implementing > like that, because it's inconsistent with >= semantically (ie an item can be > but not >= which is weird).

I agree, it's a bit weird. < and > use "OR"s but <=, >=, == and = use "AND"s. Thus, satisfying <= and >= is harder than < and >.

If there are any other non-obvious issues with the filtering, please let me know. You mentioned in the data mining thread that there were some subtle things that could catch people out, but afaik any such problem should either warn or error now.

  • Is the Stackable Currency for non-stackable things intended?
  • I know that you use some naive-style implementation (that is, string-find-if-else instead of actual recursive grammar parsers) for parsing filters, but I haven't found any risky bugs that would cause bigger problems than allowing funny lines like CustomAlertSound WHERE IS MY HH???"pop.wav".
  • Lasty, I guess there is no way to change it now but - there are multiple Item Class systems in the game. What's there reasoning behind them? Filters have their own Class names and values that do not always agree with what is reported on trade APIs or in game's item metadata.

Are the sockets/links conditions on https://www.pathofexile.com/trade working the same way?

Not sure, they use a separate implementation. But it looks the same as >= (or maybe just ==).

Is the Stackable Currency for non-stackable things intended?

Yes, for legacy reasons we cannot change sealed prophecies or imprinted Beasts to be Currency as opposed to Stackable Currency. I don't think we even have any items that are Currency. Stackable Currency is the default setting for new currency, in case we want to make it stack. But we can't easily change it once set without destroying existing items.

allowing funny lines like CustomAlertSound WHERE IS MY HH???"pop.wav".

I think this should warn now.

there are multiple Item Class systems in the game.

There is one single, consistent item class system used everywhere. But if you are searching for substrings (operator = in filters) like "Stackable Currency" then obviously you won't match "Delve Stackable Socketable Currency". Do you have any examples of differences you can point out?