It is currently 09 Sep 2025, 17:42
   
Text Size

[WIP] Split Cards Support

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Re: [WIP] Split Cards Support

Postby Agetian » 22 Feb 2013, 18:01

Awesome, thank you very much for assistance, Max! I'll get on with the coding ASAP.

- Agetian
Agetian
Programmer
 
Posts: 3489
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: [WIP] Split Cards Support

Postby Agetian » 24 Feb 2013, 05:56

kk, "let the games begin" (C). Going to start some coding today and will keep you posted on how that goes. Can't promise I'm going to work fast, but at least I think I have an opportunity to do a little almost every day except some rare busy days. ;)

As far as I understand, the basic framework for processing and displaying split cards is set up by Max (so, the card should potentially load without errors, e.g. the Assault/Battery script above, it should show up in the deck editor correctly and it should be loadable into the game, though it won't do anything, right?)

I plan to begin by making the card playable at a very basic level (so that the user is presented with 2 choices as to which side of the card to play, after which the corresponding card part should go on stack and then resolve) and then step by step take care of the CMC/color issues when the split card is on stack and not on stack, etc.

If there's anything you'd like me to be specifically aware of (as far as the framework implementation or potential future implementation is concerned), please let me know.

P.S. I've reread the Comprehensive Rules rule 708 over again and I want to make sure I'm reading this right... after the spell is cast, if the Split Card stays on the battlefield after the spell resolves, e.g. if it's an Enchantment of some sort, it has two characteristics despite the fact that the spell that was cast was only coming from one side of the card, and thus only one half is "in effect"? (am I correct?)

- Agetian
Agetian
Programmer
 
Posts: 3489
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: [WIP] Split Cards Support

Postby Max mtg » 24 Feb 2013, 06:54

There are no split permanents yet - every card has either both sorcerries or both instants.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: [WIP] Split Cards Support

Postby Rob Cashwalker » 25 Feb 2013, 03:26

Max, what about the Kamigawa flip cards? ie: Bushi Tenderfoot / Kenzo the Hardhearted
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Re: [WIP] Split Cards Support

Postby Max mtg » 25 Feb 2013, 03:41

Rob Cashwalker wrote:Max, what about the Kamigawa flip cards? ie: Bushi Tenderfoot / Kenzo the Hardhearted
These are called 'flip' cards. Split is like asault//battery with two faces drawn downscaled and next to each other
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: [WIP] Split Cards Support

Postby friarsol » 25 Feb 2013, 03:49

Rob Cashwalker wrote:Max, what about the Kamigawa flip cards? ie: Bushi Tenderfoot / Kenzo the Hardhearted
We already have most of the Flip cards. The issues that Flip cards face are closer to what Morph is, and were handled a decent time ago now.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: [WIP] Split Cards Support

Postby Agetian » 26 Feb 2013, 02:27

Ok I'm looking at the code to figure out how to start the modifications, so far I have a few questions:
First of all, as far as I understand, I will need to update CardFactory to be able to create the full card with both parts at the same time. Do I understand correctly that if I do that, the game will recognize the complete set of characteristics during the match and should correctly show the card data in the top right card detail box?
Also, what do you think should the best place to implement the dialog box which will ask the player which side of the card to play? I haven't really touched this part of the game before, so I have a pretty vague idea about what exactly happens when the player clicks on the card during the match. For instance, let's imagine it's the correct phase of the game (Main1/Main2 for Sorceries, etc.) and the player clicks on the card - how is the click processed so that the appropriate action is chosen? I assume that something like this should happen: the player clicks the card -> the game verifies the validity of request (the correct phase, etc.) -> because it's a split card, the player is offered a choice between two card faces -> then the requested card face is pushed onto the stack if all the requirements are met and the mana cost is paid.
And my final question, with the current Split card framework, it's possible to access the individual card face with its set of characteristics - is it also possible to push exactly that card face only onto the stack depending on the player's choice or does this have to be coded separately? If so, can you please hint me at what should be the proper location for that?
Thank you in advance for help!

- Agetian
Agetian
Programmer
 
Posts: 3489
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: [WIP] Split Cards Support

Postby Max mtg » 26 Feb 2013, 04:46

You already have split parts created inside the card, you still have to build the side that is a combination of them.
CardDetailPanel is able to show only one face of card at a time - so you either show some combined cost or patch the class to show both mana costs aside.

Look at cycle, kicker and similiar abilities that add an alternative method to playing a card. They already have such dialog.
While a split card has two parts, the 'combined' characterisitics set may have abilities of both, so as you choose which one to play, the card should be "transformed" into the side chosen as it moves to stack.

Spell is put onto stack before its cost is paid. At the moment the spell reaches stack the part to be played should already be known.

Yes, it's possible. Lurk through the Card class, see how it manages its CardCharacteristics, learn how transform cards from ISD work - that should drive you closer to solution.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: [WIP] Split Cards Support

Postby Agetian » 26 Feb 2013, 16:48

Thanks for the tips and answers, Max, I'm on it!

- Agetian
Agetian
Programmer
 
Posts: 3489
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: [WIP] Split Cards Support

Postby Agetian » 28 Feb 2013, 12:00

Uhh the branch system must really hate me, or I just got to be doing something wrong... I tried merging again today, using the latest TortoiseSVN this time - it started to merge what seemed to be every single card in Forge. That took, like, an hour or more until it got to letter H, at which point it stopped saying "connection was forcibly closed by the server". I tried it one more time after reverting everything (at which point I realized that I lost some minor things I started to experiment with, but that's no big deal) and it stopped again in the mid-letter G. I tried merging the entire history (from 1 to HEAD) and only the latest revisions (e.g. 19000-HEAD) but got the same result. Can someone please tell me what I'm doing wrong? :( I mean, it's really frustrating and, given my current slow progress (due to work), it slows me down to a crawl even further... Sometimes I think I'm just better off working in trunk than going through all the pain at every merge... Thanks in advance for your advice!

- Agetian
Agetian
Programmer
 
Posts: 3489
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: [WIP] Split Cards Support

Postby friarsol » 28 Feb 2013, 13:20

Agetian wrote:Uhh the branch system must really hate me, or I just got to be doing something wrong... I tried merging again today, using the latest TortoiseSVN this time - it started to merge what seemed to be every single card in Forge. That took, like, an hour or more until it got to letter H, at which point it stopped saying "connection was forcibly closed by the server". I tried it one more time after reverting everything (at which point I realized that I lost some minor things I started to experiment with, but that's no big deal) and it stopped again in the mid-letter G. I tried merging the entire history (from 1 to HEAD) and only the latest revisions (e.g. 19000-HEAD) but got the same result. Can someone please tell me what I'm doing wrong? :( I mean, it's really frustrating and, given my current slow progress (due to work), it slows me down to a crawl even further... Sometimes I think I'm just better off working in trunk than going through all the pain at every merge... Thanks in advance for your advice!
You aren't doing anything wrong. I'm not sure why Max decided to have a single checkin for 12k files but it really had issues for a lot of us. It took me 10-15 minutes on both my machines and I had to retry at least once on my laptop. Chris also had a ton of issues with it

You would never need to merge from 1-Head (only from where the branch was created). At this point, it'd probably be easier just creating a brand new branch then trying to salvage that one. I can't even view history of any cards that haven't changed since the mass update since websvn runs out of memory when it tries.

The main reason I suggested you use the branch as it would allow you to checkin things as you progress and people could see that progress and chip in. It's a very strong advantage to have instead of just working locally on your machine. (It would also prevent issues like losing code that only existed locally if you actually checked stuff in)
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: [WIP] Split Cards Support

Postby Max mtg » 28 Feb 2013, 14:04

friarsol wrote:I'm not sure why Max decided to have a single checkin for 12k files but it really had issues for a lot of us.
That was a massive card script update. Tortoise SVN allowed me to commit that many files, and did update the second working copy relativelly fast (5m12s), so I didn't suspect anything wrong about it.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: [WIP] Split Cards Support

Postby Agetian » 28 Feb 2013, 14:23

Ohh I see... can you please tell me how to delete the old branch and make a new one then?

- Agetian
Agetian
Programmer
 
Posts: 3489
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: [WIP] Split Cards Support

Postby friarsol » 28 Feb 2013, 15:03

Max mtg wrote:
friarsol wrote:I'm not sure why Max decided to have a single checkin for 12k files but it really had issues for a lot of us.
That was a massive card script update. Tortoise SVN allowed me to commit that many files, and did update the second working copy relativelly fast (5m12s), so I didn't suspect anything wrong about it.
I understand why all the scripts were updated, but in the past whenever a large bunch of scripts are updated (and it's happened several times for different reasons) whoever was updating them did them in 2-3 letter batches to prevent a major single update.

I do believe the server is also in Germany, so it's not too surprising that any of you guys had less issues with a transfer/update than those of us across the Atlantic.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: [WIP] Split Cards Support

Postby Max mtg » 28 Feb 2013, 17:06

friarsol wrote:I understand why all the scripts were updated, but in the past whenever a large bunch of scripts are updated (and it's happened several times for different reasons) whoever was updating them did them in 2-3 letter batches to prevent a major single update.

I do believe the server is also in Germany, so it's not too surprising that any of you guys had less issues with a transfer/update than those of us across the Atlantic.
Ok, Sol, next time I'll send card scripts directly to you! =) (so that you commit them in a fail-safe mode) (I also hope, we won't have to make such massive changes in the foreseeable future)
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 70 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 70 users online :: 0 registered, 0 hidden and 70 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 70 guests

Login Form