It is currently 19 Apr 2024, 21:33
   
Text Size

Realistic Appearance Card Rendering

by BetaSteward

Moderators: North, BetaSteward, noxx, jeffwadsworth, JayDi, TheElk801, LevelX, CCGHQ Admins

Realistic Appearance Card Rendering

Postby stravant » 21 Aug 2016, 10:46

I'm interested in picking up implementing full realistic card rendering in XMage. I've already done some work on it, progress sample:
| Open
Capture.PNG
Progress Sample

And it doesn't seem too hard, but there's a lot of issues to address:

* Legality concerns: Are we allowed to render cards very similar magic cards at all in the program in the first place? (as long as we use no exact copies of parts of the cards, such as background textures / frame pieces etc)

* Should it be toggleable: Should it be possible to toggle between using card rendering and using the existing card images solution? And if so, how should that be implemented. (Extract out a base class from CardPanel and have two implementations with some sort of global factory that reads the setting and creates the appropriate one at the usage sites?)

* Card Art - To get card images right now, I'm just using the existing card images and slicing a region out of the middle to use for the card art. This isn't ideal, since I still have to load all of the full images, and for things like Devoid cards, I can't get the full art that way (for rendering the transparent card frame), same thing for future sight cards (no nice square art region to cut out).

* Card Face - Should we just render all of the cards in the same card face (The M15 frame), or do correct rendering of old border cards / future sight frames etc too?

* "Changed" characteristics on cards. On MTGO, characteristics of a card that don't match the "base" characteristics of the card (for example, added abilities, or pumped power) are shown in a different color. This seems to be pretty tricky to implement at present, because it doesn't seem like the CardView has any access to the true underlying card. Is there some easy way to access that info that I'm missing?

* Currently I'm just using getRules() to get the rules for the card. But this requires some hacks like checking if the rule contains any spaces to tell if it's a Keyword ability or not. There's also other cools things I could do with a reference to the actual ability itself. How feasible would it be to give the card rendering actual references to the ability objects (not just textual through the view)?

* Caching strategy: The current ImageCache + "Key" struct approach gets a more tricky if extended to the full card rendering strategy. Basically the entire info about the card needs to be included as a Key, at which point hashing it isn't exactly trivial. It's still probably faster than re-rendering, but it's a bit awkward. Begs the question of if there's some way for the engine to tell the client when it thinks the card has changed rather than the renderer trying to figure it out.

* How to abbreviate things. Can the card's name be abbreviated to "~" when short on space? Not many people would know what it means, but they're probably reading the full card text in the popup anyways in that case and realizing shortly, so maybe it's fine?

* Rendering performance: Full card rendering will be a bit more expensive than the current approach. Is there any performance level that's mandated right now? Like, a number X of cards that should be able to render comfortably at once on the screen? Any suggestions on how I should be keeping track of performance to make sure it's fast enough?

* Fonts: What font to use? Are we allowed to package the Beleren font with the program to use for M15 card frames?
stravant
 
Posts: 5
Joined: 16 Mar 2015, 16:30
Has thanked: 0 time
Been thanked: 0 time

Re: Realistic Appearance Card Rendering

Postby escplan9 » 21 Aug 2016, 17:19

The Developer Talk subforum is a better place for most of these questions: www.slightlymagic.net/forum/viewforum.php?f=116

I'm not knowledgeable enough to answer most of these. With regards to toggleable, yes it should be a toggleable feature for sure. As to how to accomplish that, I'm not sure, I haven't worked with that area of the code before. There is no performance thresholds that I'm aware of, it's just something that can be improved upon. And as long as this feature is toggleable and not default, it will not be a concern at all no matter how bad the performance gets.
escplan9
 
Posts: 257
Joined: 10 Aug 2015, 22:38
Has thanked: 26 times
Been thanked: 40 times


Return to XMage

Who is online

Users browsing this forum: No registered users and 121 guests

cron

Who is online

In total there are 121 users online :: 0 registered, 0 hidden and 121 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 121 guests

Login Form