Card Hunter Utility Program

Discussion in 'Card Hunter General Chat' started by Xayrn, Jun 30, 2015.

  1. Xayrn

    Xayrn Hydra

    For anyone looking to help out, the project is now on GitHub: https://github.com/Xayrn/CardHunterUtils

    Inspired by a suggestion in this thread, this project aims to provide a portable utility program for the game we all know and love. The main feature is intended to be a deck-builder superior to what already exists in the game, with more advanced item sorting and filtering, as well as the ability to import and export decks in the BBCode format already supported by the game.

    Current status: Consists of a deck-builder and a sortable/filterable table listing all equipment in the game, as shown below. Card visuals are currently a work-in-progress.
    progress.png
    The program fetches card and equipment data from live.cardhunter.com the first time you run it. If you delete the two generated .csv files (for example, after an expansion is released) it will automatically update itself with the latest cards and equipment. All downloaded resources are currently stored in a pair of "data" and "assets" folders generated in the same directory as the program. Source code is included in the .jar file.

    Instructions: Rename file CardHunterUtils.zip to CardHunterUtils.jar (forum does not allow .jar file attachments) and run with Java 8 (Java 9+ will not work)
     

    Attached Files:

    Last edited: Sep 15, 2022
    Jon, Jayce, Fifjunior7 and 7 others like this.
  2. Xayrn

    Xayrn Hydra

    More incremental progress!
    progress.png
    It's not uploaded yet due to a lack of tooltips for displaying cards at full resolution, but icons are working properly. Cards are, unfortunately, unreadable within columns. I'd display the thumbnails the game uses for cards in-hand, but unless I've overlooked something, there doesn't seem to be a way to get at those without manually cropping them from game screenshots.
     
    Obernoob, Jayce, RedNebula and 3 others like this.
  3. Flaxative

    Flaxative Party Leader

    You should be able to generate them yourself in your program using the data, yeah?
     
    Jayce and Xayrn like this.
  4. Phaselock

    Phaselock Bugblatter

    ParodyKnaveBob, Jayce and Xayrn like this.
  5. Xayrn

    Xayrn Hydra

    Very interesting! I'll likely use this as an example in a few areas. I may even make the assets compatible between the two programs (download art in one, access it in both, provided the programs are in the same directory).
    I didn't want to do this originally (it's a lot more work), but generating the cards myself instead of using static images does give me a lot more flexibility in how they can be displayed and interacted with. Doing it this way also allows the images to automatically update with the data, since I'll be using the art assets downloaded from the server to generate the cards, so any future game content will automagically show up in the program as it's added without me needing to do anything.

    All that being said, don't expect another update in the next few days now. This is going to take a bit to get right.
     
    Last edited: Jul 4, 2015
    ParodyKnaveBob, Jayce and Sir Veza like this.
  6. Flaxative

    Flaxative Party Leader

    Yah, it's more work, but as you noted it's more futureproof. It also lets you add features like clicking on a Keyword to go to Scarponi's FAQ on that keyword, or, say, you're looking at Talented Healer, clicking the Heal in its text could bring you to a list of items with Heal cards.
     
    ParodyKnaveBob, Jayce and Xayrn like this.
  7. Xayrn

    Xayrn Hydra

    Program now fetches data and art resources from live.cardhunter.com as-needed and stores them in the same structure as Jayce's item browser, so the two programs are now able to share resources when located in the same directory. Also began work on card thumbnail rendering. Changes are reflected in the latest version.
     
  8. Xayrn

    Xayrn Hydra

    Added filters for item rarity, token cost, equipment slot, and expansion set columns today; right-click column headers to use them. Program is slowly creeping towards usefulness!
     
  9. Xayrn

    Xayrn Hydra

    Began work on the deck-builder. It still needs some work before I upload it, but it's shaping up nicely so far!
    progress.png
    I'm letting the race of each character just be determined by what you put in the "Racial Skill" slot because it makes things one step simpler, and not much bothers me more than kitting out a human wizard only to realize he can't afford a decent support skill and might as well be a dwarf.
     
    Last edited: Jul 11, 2015
  10. Robauke

    Robauke Guild Leader

    This conclusion is reached way too often.

    Seeing there is a ton of items even if you go by slot or filter otherwise, how about a function to prepare and later browse your own global "favorite selection" of items?
     
    Xayrn likes this.
  11. Kalin

    Kalin Begat G'zok

    Any limits on tokens used?
     
    Xayrn likes this.
  12. Xayrn

    Xayrn Hydra

    This is a neat idea; I may look into adding something like this later. You should see the 'ton of items' issue become much less of a problem once I get around to implementing the card filter, though. The basic idea is that you can add an unlimited number of card description objects to your search, and only items containing at least a specified number of cards matching each description will be shown. I need to finish the implementation of cards themselves before I can start working on this, however.
    Nope. My current plan is to add a level slider (default 18) to each character and then calculate and display how many tokens of each type you have left based on the slider value and items you have equipped. It won't strictly enforce how many tokens you're using, but if your remaining tokens are negative, that's something you may want to fix before you try to take your build live.
     
  13. Xayrn

    Xayrn Hydra

    Program's data and asset directories now match those used by the game. Run the .jar file from your CardHunter Steam folder ("C:\Program Files (x86)\Steam\SteamApps\common\CardHunter" on Windows) and it'll utilize your Steam game files without needing to download anything. This also has the added benefit of automatically staying up to date with the latest game data as Steam updates it.
     
    ParodyKnaveBob and Sir Veza like this.
  14. MattW

    MattW War Monkey

    Looking for any development volunteers? This looks like it could be fun to work on.
     
    Xayrn likes this.
  15. Xayrn

    Xayrn Hydra

    More progress today! The deck-builder is "functional" now, but it's still not very useful without being able to import and export decks or view the cards on your items. The minimum level for characters is 6 until I get around to supporting level-dependent gear slots in the distant future. Token numbers should turn red when your build uses an illegal amount of tokens. I also fixed the item filters disappearing when you click them, which was seemingly caused by upgrading my JDK.
    I wasn't, but I'd definitely appreciate the help. I've been including the source in the .jar files, but unfortunately what I've written so far wasn't designed with others in mind and it probably looks like a mess. I'll devote some time later today to cleaning up the code a bit and writing templates for some of the 'big' methods that need filling in: Card.getView(), Card.getThumbnail(), Party.import(), Party.export(), etc. I'll probably be busy most of this week, so chances are high I won't get around to fully implementing them myself in the near future. Don't feel obligated to help out after reading all that though; the cleanup is as much for my own sanity as anyone else's.

    If anyone really can't wait and wants to help out immediately, the CSV class is pretty straightforward and I vaguely remember getting lazy while dealing with quoted sections of text and just discarding the quote characters from the final output.
     
    Last edited: Jul 19, 2015
  16. MattW

    MattW War Monkey

    Cool - I have your updated CSV tokenizer, and passing tests (JUnit). Where can I put 'em? :)
     
    ParodyKnaveBob and Xayrn like this.
  17. Xayrn

    Xayrn Hydra

    Last project update from me for at least a few days. Added a name filter to the item table, non-functional import/export menu options, and a couple internal improvements to the Card class (text and flavor text fields now exist; thumbnail views now use thumbnail images).
    That's great! You should be able to attach them right to your post. If you want to keep contributing, here's a list of base features that still need to be implemented:
    1. Card thumbnail views need to be finished and look... better
    2. An item's card thumbnails should be displayed when interacting with the item in the deck-builder
    3. Full size card views need to be added and made accessible through some kind of interaction with the thumbnails
    4. Deck importing and exporting via the clipboard should be supported in the game's F1 console's 'partybbcode' format
    Number 4 may be a bit tricky right now, both because I haven't written nice methods for getting all the needed data yet, and because the game doesn't use the same straightforward item order for priests and warriors as it does for wizards in the BBCode output. Feel free to change whatever code you might need to, and if you have any questions about anything, don't hesitate to ask me either here or in a private forum conversation.
     
    ParodyKnaveBob and Pawndawan like this.
  18. MattW

    MattW War Monkey

    Cool. Here's a zip of the source, minus the assets. Not sure if you are interested in / familiar with using a source control system? Might make sharing changes and tracking to-dos easier.

    I'd love to continue helping - the CSV was a good start to get around the project, and because it looked like you wouldn't be tackling it. Would hate to end up doing something redundant.

    I'm not sure I'm totally familiar with JavaFX / image libraries just yet, so if it's all the same to you the deck importer sounds perfect to me.
     

    Attached Files:

    ParodyKnaveBob, Xayrn and Pawndawan like this.
  19. Xayrn

    Xayrn Hydra

    Familiar with? No. Interested in? Definitely! I managed to get the project up on GitHub and add you as a contributor. That being said, I've never used any type of version control before, so don't be surprised if I come to you with some silly questions about it.
    No worries, this is actually my first JavaFX project, too. Work on whatever you feel comfortable with.
     
    ParodyKnaveBob likes this.
  20. MattW

    MattW War Monkey

    Awesome - Git and Github are great. Also, I accept all forms of silly questions. Happy to provide any guidance I can.

    Probably won't have a chance to hack on this again until tomorrow, but I did start taking a look at how to handle import. Are you familiar with @neoncat 's collection export tool? http://www.stexe.com/util/collection-export.php Was thinking that could be useful (or, at least, serviceable) as an inventory import format, in addition to the party/deck formats.
     
    ParodyKnaveBob and Xayrn like this.

Share This Page