[Utility] Collection Analysis

Discussion in 'Card Hunter General Chat' started by neoncat, Feb 1, 2014.

  1. Stexe

    Stexe #2 in Spring PvP Season

    Sounds good, I'll try it out tomorrow or so.
     
    ParodyKnaveBob and Sir Veza like this.
  2. Stexe

    Stexe #2 in Spring PvP Season

    Sir Veza likes this.
  3. Sir Veza

    Sir Veza Farming Deity

    Probably more for @PhoenixTheHunter , but Max Usable shows 96% in Collection Analysis, and 94% on the Collection Badge. I've included a screenshot of each, and the data used to produce them.

    analysis.png Badge.png
     

    Attached Files:

    ParodyKnaveBob and Stexe like this.
  4. I was about to say, that this is a very interesting incident, but I found the (first) problem with just checking the screenshots.

    First of, including promo items while a) it is neither Christmas nor Halloween AND b) you excluded undroppables, does exactly nothing. Promo items are the seasonal duplicates but they are undroppable if we are out of season. So, either you have to include undroppables, too, or wait for the season for them to be included. But that isn't the issue here as both tools should exclude them in your setup (and at the time of writing). If you want to include undroppables in Collection Badge, you have to include both undroppables and promo items in Collection Analysis to again have the same item selection. One tool has fewer options, because for Collection Badge you want to have an overall view of your progress and that badge shouldn't be able to change based on time of creation (only based on options that are reflected in the small icons). While for Collection Analysis you have more options (including the filter rules) to extract the items you actually care for.

    The issue is simply treasures (edit: or so I thought at first, this is still true, but probably not the main reason). Both tools have different defaults: Collection Analysis excludes them by default, Collection Badge includes them, so you have to change this on one of the pages to achieve the same selection. Again, both tools have different use cases, hence the different defaults. (For you, the badge says 94% either way.)

    While checking the numbers again with one of my collection dumps, I discovered another (and the actual) problem that would result in these numbers never being the same. See, the Collection Badge checks for every single item if it should be counted (aka whether you haven't excluded it by your selection) and then if you've collected enough copies to be a full set (at least 1 for normal mode, or 3/6/9/12 for max usable mode). Hence if you have just 2 copies of some item, it isn't counted as full in max usable and therefore is counted as 0. That means the Collection Badge tool only counts each item as "1" if it is full. This is a binary decision: full=1, not full=0, regardless of the mode. That is similar to the "can equip a whole team?" mode in the Collection Analysis. So, to have matching numbers you have to compare not "max usable" (for Badge) with "one copy of each item" (for Analysis) or "max usable" (for Badge) with "can equip a whole team?" (for Analysis). At the time I introduced this "max usable" checkbox, no-one objected to this setting being equivalent to "can equip a whole team?" and this was the easier way of implementing this feature, therefore this is how it works now. ;) Unless a majority vote favors the other (more difficult) way.

    TL;DR: There are items where you have collected some copies of but not enough to have a full set. One tool interprets this as x copies, the other as "no full set", hence the difference in numbers.
     
    Sir Veza and ParodyKnaveBob like this.
  5. Now that I finished my earlier post, I am actually wondering whether the Collection Badge treats seasonal/promo items the way I described it. I mean, it should. The badge should not change over time just because one promo set is available every now and then. The small icons should always be unambiguous. But based on a small inspection, the tool might actually ignore the promo-ness of items altogether and these items could switch from undroppable to droppable (and back) once a year (given the devs start and end the respective game events). So, thanks Sir Veza, you might have unknowingly (and indirectly) reported a bug. :cool:

    @Stexe I haven't had the time to check the tools, but I will do so the next days.
     
    Sir Veza and Stexe like this.
  6. Stexe

    Stexe #2 in Spring PvP Season

    Sounds good.

    I have an old version of the tools up at: http://wwww.Stexe.com/CardHunterOld/ for those looking for the previous hosted ones.
     
  7. So, as far as I can tell, the new hosted files work as expected. I haven't tested every single feature, but each tool at least does something that seems legit. I will do some more checks over the next days.

    I already "fixed" the collection badge and did some more housekeeping with my code. Also, I wrote a simple (Linux) script to update the resource files (either manually or periodically with something like cron). Given that I provide three different archives and packaging them isn't automated, I will wait a bit more and see if you all find other issues with the tools that I can address all in one go.
     
    Sir Veza and Stexe like this.
  8. Quick addition: I think (I'm still quite inexperienced in php) I found a way to merge the fully automated and the semi automated version into one. That would make it easier to package them all for a release as it would reduce the number of artifacts to two. Then, there again would be the version completely independent of php and the version dependent on php that - by invoking the resource-file fetching job once - could be turned into a semi automated version. And turning the semi automated version back into the fully automated version would be done by simply deleting the "cached" resource files. How much simpler could it be.

    PS: Anyone around who is familiar with bash programming for Windows or Mac? I would perhaps be able to convert my Linux script into Windows bat format (but I don't want to, honestly, I'm glad to have left Windows behind at that point) but I don't have any experience with Mac console scripting or capabilities to test the result at all. If you can, dm me and I'll send you a preview of my current resource-update-script for Linux. If no-one is willing to convert the script, I will only package the Linux script in there (as most hosters use some Linux distro after all).
     
    Sir Veza and Stexe like this.
  9. Sir Veza

    Sir Veza Farming Deity

    Thanks for a) explaining how the max usable collection badge works, and b) leaving Windows behind.
     
  10. I mean, explaining the tools is my job, but for this one, you're welcome ;) EDIT: You know that two of your four signature badges don't show up?

    Regarding the update jobs for Mac and Windows: I would still like to have someone verify this, but I have a feeling that the situation is better than I initially thought: Mac and Linux have a common basis, so given that my script isn't making use of fancy commands - at least I think so -, this script might actually work in Mac natively. And for Windows, there is WSL - Windows Subsystem for Linux - basically a integrated Linux VM. Now, WSL isn't trivial to use and if someone manages to convert my script into a bat or powershell script, this would make things easier for Windows users, but if nothing else, the script should be executable under WSL no problem.

    PS: Another reason why I'm not releasing another version right now, is that I still hope that the latest announcement means new additions for the tools.
     
  11. Stexe

    Stexe #2 in Spring PvP Season

    If there are easy to fix issues I'd say go for that now and I can upload a new version. The new Card Hunter additions could be quite a bit away and I'd like to have a stable build until then.

    Was the only problem with the collection badge? Any other issues?
     
  12. Okay, I will factor this in, if we discover an issue that actually is an issue. Up to now, the only thing I found is the collection-badge-promo-item-filter-issue that is not really an issue. So, I will wait for now.

    I attached the update script (also for those considering porting it to or testing it on Windows or Mac). This isn't final yet but it would be awesome if you could test this for once. Unzip it and place it in CardHunter/resource (this folder already exists), you might have to make it executable (
    Code:
    sudo chmod +x update-resources.sh
    ) and execute it and see what it does. Expected behavior is some status messages of it downloading four files into a temporary folder, and then this folder should be deleted again and the four resource files that are already present in the resource folder should not have changed (because there are no new Cards/Items/Adventures/Figure-skins). (you can also dm or mail me if there is something unclear so that this thread isn't spammed too much ;) )

    EDIT: new script version with much more readable output (and also improved logic)!
     

    Attached Files:

    Last edited: Apr 6, 2021 at 5:31 PM
    Stexe likes this.
  13. Sir Veza

    Sir Veza Farming Deity

    I'm having a forum problem. When I try to upload a changed file with a different name, and even from a different folder, the old one still displays. Getting pretty disgusted with it at this point.
     
  14. Whatever you did, now I at least see no more broken image links anymore.

    Given that I work on code that I last touched almost two years ago, I again have to get familiar with all the magic that is going on in every corner. And some of it is quite dark magic. And all of this on a new system, with a different operating system and other software (versions). But I think I can say that the hosted files seem fine so far. I found a few things that I will change to different colors. But that is no issue with the hosting, just that I have a different perspective on some of the utils now. When I first loaded all my sources into my new tool chain, I got some warnings that I will fix properly (these warnings shouldn't break the tools, but if you get aware of a potential issue, why not fix it). I will have to test my collection-badge-promo-filter-fix and the merge of sau and dev version (don't want to rush those things and risk them to break). But today I worked on the update script again and a build script that will with one command create both release archives at once. That should make it impossible for me to miss files (which is possible based on two years without release, so I better test my build script, too). For this all to be accomplished, I guess I will need a week or so, hence, try your best to break the tools now, and you might get fixes for those issues immediately with the upcoming release. :cool:
     
    Sir Veza likes this.

Share This Page