Open Xeverous opened 5 years ago
Just to add a note on how strictness filtering is done in other filters:
Usually you have a base version of said filter which acts as "league start" filter into early maps, this will most likely show way to much loot, but that is need in a league start situation as bad items can still be worth something and you need some gear for your char. It also likely contains a detailed leveling section which is only need for your first character in the league(later characters will have mostly twinked leveling gear, which means you don't really pick up any gear on your way to maps.)
Now when you get into mid tier maps your most likely gonna switch to some stricter filters; the way this is done the easiest is: (I will use StupidFatHobbits filters as an example, as i base my filter on his)
This is an example from the "normal" filter
Show BaseType "Vaal Axe" "Coronal Maul" "Exquisite Blade" Rarity = Rare SetFontSize 34 SetBorderColor 128 0 0
This is from the Strict version:
Hide BaseType "Vaal Axe" "Coronal Maul" "Exquisite Blade" Rarity = Rare SetFontSize 34 SetBorderColor 128 0 0
So what you really want is an easy way to toggle the Show/Hide when compiling the filter, this could for example be done by having a tag in front of Show in filter_spirit. Something like this maybe?
BaseType ["Vaal Axe", "Coronal Maul", "Exquisite Blade"]{ SetBackgroundColor color_rare_t3 SetFontSize font_t5 SetBorderColor color_rare_border_t3 @Strict(Hide) Show }
When you then complie in filter_spirit you could do something like this:
filter_spirit_cli.exe -g -version=Strict "location/to/filter_spirit/file.txt" "location/to/filter/filter.filter"
Which then would change all the lines that has the @Strict(x) with was on the line before. So in the example above it would simply change "Show" to "Hide".
You could also have that function add an action if there the line is empty without the @Strict command beeing called. Like this:
BaseType ["Vaal Axe", "Coronal Maul", "Exquisite Blade"]{ SetBackgroundColor color_rare_t3 SetFontSize font_t5 SetBorderColor color_rare_border_t3 @Strict(DisableDropSound True) @Strict(Hide) Show }
Which when compiled with the "-version=Strict" [option] shown above would change the block from "Show" to "Hide" and add the "DisableDropSound" "True" to the block as well.
What do you think about this idea for implementing strictness versioning?
You also want to be able to add the PlayDefaultDropSound = False to any block that is tagged with
I don't like this approach, for these reasons:
Show
, generate with Hide
, do not generate). In a lot of cases you want the 3rd one - the difference is that items not explicitly hidden may be caught by later blocks. For example:
n:n
relation, which support can be realized in 2 ways (example syntax):
Show @Strict(Show) @UberStrict(Hide)
@Strict = { currency, misc, maps, ... } @UberStrict = { ... }
The second strictness approach appeals more to me, because:
I have updated the issue intial comment to better outline what is the goal of the feature. This should help in designing it and give a direction for propositions.
Another idea: each block could be marked with a tag and then one could form multiple variants from tags:
@lab
BaseType "Offering to the Goddess" {
...
normal = { +currency, +shards, +lab, +rares, +crafting, ... }
strict = { +currency, +lab, -rares, ... }
pros:
+
generating with Show
, -
- Hide
, nothing - not generating)cons:
A bit of thinking and I actually prefer your idea of @Strict(Hide) Show
- I see the potential to satisfy all conditions:
Show
, Hide
syntax - a thing that I very like - a user who does not want/need variants can just write the filter as it is now (now forced usage of variant-specific syntax) - untagged blocks will be generated as-is in all variants.We only need an idea of better syntax, something that will allow to write one Show
/Hide
keyword for multiple variants.
Been away for Christmas, but i really like that you came back to this idea. It makes it so there will be minimal effort to convert current filters to work with it.
I think it could work really well i this instance, just need to figure out a good syntax.
Adding label and pinning for awarness. We need more ideas for the variant support, perhaps someone with experience in other languages could help.
We basically need:
Show
, generate with Hide
, do not generate)The current idea of something like @strict(..code...)
can satisfy first 3 points, but gets messy when:
I'm still uncertain on this and GGG just relased a big filters improvement annoucement - https://www.pathofexile.com/forum/view-thread/2771031
However, I have been fiddling with the grammar to also support loading/debugging real filters and started to think about rewriting FS grammar so that it is as close to real filters as possible. I won't remove $
,{}
etc but mostly I want to get rid of the stuff like color = RGB(255, 255, 255)
so that one can actually just write color = 255 255 255
.
The only ambiguity I have found is when someone would write x = 123 123 123 y
or x = "base1" "base2" y
- the parser would not know whether that y
is a variable describing some opacity/base or a part of further y = ...
code. It can be worked around with a rule that requires a line break before any next definition, which I think is fine since most people will probably be used to 1-thing-per-line. So far the only drawback of introducing line breaks into the grammar is that it will no longer be possible to write Class "abc" "def" ... "xyz"
where the names are split across multiple lines. This however could use another workaround - programming languages which have something that is per-line allow to use \
at the end of it to indicate that the line is continued below. This would looks in FS this way:
BaseType "abc" "def" \
"xyz" \
"zzzz" \
"last base type name"
Ok, this took a while, but it is finally done.
ShowHide $value
and ShowDiscard $value
) - 4aaa4a7500b0d8bdf668ca6e1b717fccdbeac3a1Expand $subtree
feature - 440e8b99f1cd4704999363a03e6bddebcd25e952I won't explain it here in detail (just read documentation) but I think it's the best implementation possible that satisfies all of my goals for finely-grained strictness editing. I have even added some reasoning to the documentation.
We need a feature which will allow to generate filters with multiple variants/strictness levels from 1 template.
Current idea: decorate blocks (something akin to Python's decorators) and then specify which blocks should be present in each variant.
Edit: cleaner goals - a list of what is must-have:
Show
, generate withHide
, do not generate). In a lot of cases you want the 3rd one - the difference is that items not explicitly hidden may be caught by later blocks - this means that syntax like@Strict(Show) @UberStrict(Hide)
is not enough, because (example):Show
toHide
. The feature should allow to avoid code duplication.