mtgjson / mtgjson

MTGJSON build scripts for Magic: the Gathering
https://mtgjson.com
MIT License
353 stars 63 forks source link

Names field on meld cards is out of order #90

Closed KingSupernova31 closed 5 years ago

KingSupernova31 commented 5 years ago

The "names" array on all multi-part cards is the only way to tell which part is which, and as such its order is important. For meld cards, the order should be: top half, bottom half, melded card. This is the intuitive order, and is the way it was done in v3. Currently however the names arrays on the meld cards are in a seemingly random order, not even consistent among themselves.

ZeldaZach commented 5 years ago

They were manually done before. We might fix that up, but honestly ordering is not really guaranteed in JSON

fenhl commented 5 years ago

Whether or not an array or object in JSON has ordering semantics depends entirely on the specification, which in our case is https://mtgjson.com/v4/docs.html. I've checked the docs for "names" however and you're correct that the field currently specifies no order. That is a severe feature loss compared to version 3, and guaranteed order should be reintroduced. From the v3 docs:

For meld cards, the first name is the card with the meld ability, which has the top half on its back, the second name is the card with the reminder text, and the third name is the melded back face.

We should also document the order for split, flip, and double-faced cards while we're at it.

ZeldaZach commented 5 years ago

I could agree with defining an ordering. I will need a bit of time to get this right, however. At the latest, this will be in 4.1

KingSupernova31 commented 5 years ago

There needs to be some way to tell which part of a multi-part card is which. A guaranteed ordering of "names" is the simplest way to do that, and is consistent with v3.

tooomm commented 5 years ago

@ZeldaZach do you have milestones, projects or tags setup for this purpose? So that things like boosters and this issue are planned for 4.1?

@fenhl So we could say for the array of cards we define that the first element always will be "name" of the card? And don't start it with artist in alphabetical ordering? That would make looking at the file manually way way easier and convenient!

fenhl commented 5 years ago

Yes, that is possible in the JSON format. To support this, we would have to:

ZeldaZach commented 5 years ago

@fenhl That's a bit of work to accomplish, and I'm not sure if I have the time to do such a thing right now... Would be open to a refactor of the project to allow for such a solution