Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating JSON Cards #65

Closed
solistice opened this issue Jan 6, 2016 · 8 comments
Closed

Generating JSON Cards #65

solistice opened this issue Jan 6, 2016 · 8 comments
Labels

Comments

@solistice
Copy link

Hi demilich,

First of all, huge props to the work you did already! What I want to ask is not really an issue, but more a question. How did you generate all those cards in json with the correct effects and whatnot? I'm also trying to make a simulator, but this is the part where I'm struggling the most (the game works perfectly, as perfect as possible in software), but I can't seem to create the correct formats without doing this manually. Can you explain this a bit? Have been looking through the code a bit, and can't find a generator

@solistice
Copy link
Author

Btw, I poked you on reddit, if you are interested ;)

@webadict
Copy link
Collaborator

webadict commented Jan 6, 2016

Hey Solistice!

Do you mean a way to make cards, or the code that translates the cards?

@webadict
Copy link
Collaborator

webadict commented Jan 6, 2016

The cards are using a JSON parser, since the cards themselves are in JSON format. You should be able to find something online that'll read JSON for your language fairly easily (A library or something.) JSON is fairly prominent for data storage types, so I'd be more surprised if you didn't find one.

The file you're looking for is called CardParsed.java, though.

@solistice
Copy link
Author

I'm looking for an automatic way to create a json file for all the existing cards in the game, not a way to parse cards (I'm familiar with JSON). I'm looking for a way to generate the cards (to some extend, have some other ideas on how to code the triggers) found in cards//

@webadict
Copy link
Collaborator

webadict commented Jan 6, 2016

There's a collection of text files for every card on HearthPwn or the wiki
or something like that. We don't have anything like that though. You would
have to take the text files and generate it from those. That'd be about the
only way I'd see it happening. It seems like a lot of work, but it might be
doable.
On Jan 6, 2016 11:23 AM, "Bart Cools" notifications@github.com wrote:

I'm looking for an automatic way to create a json file for all the
existing cards in the game, not a way to parse cards (I'm familiar with
JSON). I'm looking for a way to generate the cards (to some extend, have
some other ideas on how to code the triggers) found in cards//


Reply to this email directly or view it on GitHub
#65 (comment).

@demilich1
Copy link
Owner

While it would be certainly possible to generate .json templates for all cards and fill in values like mana cost, rarity, attack/hp for minions, etc I think generating stuff like triggers or spells automatically is next to impossible, because the only information you have is the card text, which does not provide full information.

So just to be very clear: All card .json files in MetaStone were created manually. There is no magic, actually it was a lot of work. Especially when a new expansion is released and there are new mechanics.

@solistice
Copy link
Author

Thank you, this is what I wanted to know! Even more praise to you for putting in the hard work!

On 06 Jan 2016, at 19:37, demilich1 notifications@github.com wrote:

While it would be certainly possible to generate .json templates for all cards and fill in values like mana cost, rarity, attack/hp for minions, etc I think generating stuff like triggers or spells automatically is next to impossible, because the only information you have is the card text, which does not provide full information.

So just to be very clear: All card .json files in MetaStone were created manually. There is no magic, actually it was a lot of work. Especially when a new expansion is released and there are new mechanics.


Reply to this email directly or view it on GitHub.

@demilich1
Copy link
Owner

Closing this as the questions seems to be answered

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants