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

Card data; what format to use? #190

Closed
Phrancis opened this issue Apr 26, 2015 · 7 comments
Closed

Card data; what format to use? #190

Phrancis opened this issue Apr 26, 2015 · 7 comments

Comments

@Phrancis
Copy link
Contributor

There have been multiple options thrown around on how to store/load card data into a game instance. Currently, we're using a custom file format (.cards) file stored in extra resources directory. There's also the options of using a common data format, like JSON or XML. Whichever one we end up using, I think we need to settle on one format.

With some of the game logic being moved to JavaScript, JSON seems like a natural choice. But, is it easy enough for an "outsider" (a modder, etc.) to use? Or is the current format better, from UX perspective? XML is also an option, being a very common data format no doubt JS could handle it well, but what about the core Java server?

@Zomis
Copy link
Member

Zomis commented Apr 26, 2015

Core Java server can handle anything you throw in its way. It is the most flexible of them all.

Personally, I don't think XML is a good choice.

The main 'problem' about the data format is that it somehow needs to be able to define effects in it. The .cards format handles this by calling Java methods with reflection, which is not a very flexible approach. Although that cards format can be enhanced to support such features somehow, I think JSON might be the best option here.

I do not know from an "outsider" perspective though what the best is.

@Phrancis
Copy link
Contributor Author

Referencing Issue #183

@Phrancis
Copy link
Contributor Author

@Zomis Do you think JSON along with JS could be an effective way to define effects? Or do the effects necessarily need to remain in the Java core code?

@Zomis
Copy link
Member

Zomis commented Apr 26, 2015

It should be possible to define effects externally, which is one big reason for why the JS branch exists. JSON and JS could be a solution to define these effects.

To be sure about that though, I think it is a good idea to come up with several example effects, both simple and advanced ones, and show how we would want them to be implemented with whatever format we go with.

@Phrancis
Copy link
Contributor Author

Do you think it would be a good start to try to implement currently existing effects using another format? Or come up with something completely new?

@Zomis
Copy link
Member

Zomis commented Apr 26, 2015

The current existing effects are quite simple. I think we pretty much only are using "At the end of your turn, heal 1 hp". Coming up with new effects and coming up with examples for how we would want those to look in JSON/JS format would be good.

@Phrancis
Copy link
Contributor Author

After discussing at length in chat, we will try to get cards and effects going using JSON. For reference, read from here down: http://chat.stackexchange.com/transcript/message/21374847#21374847

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

No branches or pull requests

2 participants