acpennington / GoatController

The next great ygo sim
1 stars 2 forks source link

Support for alternative card art #232

Closed scheibo closed 2 years ago

scheibo commented 3 years ago

Many cards have alternative card art, either from their OCG release or due to reprints. This card art has already been committed, but with the suffix <n>.jpg as opposed to just .jpg (eg. Dark Magician.1.jpg). Supporting alternative card art adds a bunch of complexity to the UI with 0 gameplay significance and thus is necessarily low priority, but for feature parity with DB and because user's tend to appreciate this sort of customizability (eg. to let them make their online decks reflect their actual IRL cards) it is worth implementing. There has already been a request for different color sheep tokens which is effectively the same problem (these just become SheepToken.jpg, SheepToken.1.jpg, SheepToken.2.jpg, SheepToken.3.jpg).

There are several questions which influence how the implementation would look.

These both result in very different implementations and UIs. If card art preference is just "I just want to change what I see", the preferences can simply be saved as a map in settings which maps from card name -> alternative art number. I'd argue that this is suboptimal - in much the same way people would be disappointed if their sleeve choices were purely local I believe people would want their opponents to be able to see the card art they prefer. We then have several options for representing this in the deck data type. If we don't allow mix-and-matching card art, simply adding a local map of name -> card art for each deck is sufficient (ie. alongside wins, losses, maindeck, sidedeck, etc you would have maybe an art field as well with name -> card art number overrides). However, I think supporting mixing-and-matching of card arts within a deck to allow for maximal expression is desirable, in which case more dramatic changes to the deck type would need to be made.

One option is to change the types for the main and side deck from name -> number to name -> number OR <some other more complex type like an array or object which reflects which card arts are chosen> (I imagine some fusion deck monsters have different card arts but trying to support alternative art there might be too challenging). I don't think this is optimal because it doesn't really lend itself to easy implementation anywhere else. A less intrusive approach would be to add a sentinel value to card names - eg. "Dark Magician|1" and have everything just drop the sentinel/trailing info when dealing with the card but when determining which image to display the correct art can then be parsed out of the name (in this case "Dark Magician.1.jpg"). The Mystic Tomato example above would be represented as:

{
  ...
  maindeck: {
    "Mystic Tomato": 1,
    "Mystic Tomato|1": 2,
    ...
  }
}

Incidentally, this isn't too dissimilar from how Pokémon Showdown handles "cosmetic formes", Pokémon forms such as Furfou's which have 0 competitive relevance.


The following areas would need to be changed:

scheibo commented 3 years ago

The remaining work from #234 that is required to finish this is:

scheibo commented 3 years ago

Of the remaining card date to be added (#282), the following cards have alternative art:

acpennington commented 2 years ago

Is there anything before that needs to be done here? Or can this ticket be closed?

acpennington commented 2 years ago

It seems like everything here has be done, so I'm closing.