It is currently 04 Nov 2025, 23:44
   
Text Size

[WIP] Split Cards Support

Post MTG Forge Related Programming Questions Here

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

Re: [WIP] Split Cards Support

Postby Sloth » 05 Mar 2013, 13:40

Agetian wrote:I'm not sure if there are other cases like that which are possible and which are currently not accounted for, please revise.
Don't worry about every corner case. I'm sure we will find a lot more incompatibilities, but most of them will be there, because some of the old cards/keywords were scripted/coded sloppily. It's not your task to fix all the mess that has piled up in the code over time.

If the main interactions work - reintegrate the branch.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: [WIP] Split Cards Support

Postby Agetian » 05 Mar 2013, 13:45

Ok I'll do some more testing and will then reintegrate. Is the latter as simple as hit the "Reintegrate the branch" or whatever it says in TortoiseSVN? (I've never done that before and, as such, I'm kinda afraid I'll do the wrong thing :D ).

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

Re: [WIP] Split Cards Support

Postby Sloth » 05 Mar 2013, 14:24

Agetian wrote:Ok I'll do some more testing and will then reintegrate. Is the latter as simple as hit the "Reintegrate the branch" or whatever it says in TortoiseSVN? (I've never done that before and, as such, I'm kinda afraid I'll do the wrong thing :D ).
1. Switch to the trunk
2. "Merge" -> "Reintegrate a branch".
3. Resolve all conflicts.
4. Commit.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: [WIP] Split Cards Support

Postby swordshine » 05 Mar 2013, 14:30

Just go over all the 46 split cards (we could get 52 search results in magiccards.info, but actually Naughty/Nice and Who/What/When/Where/Why are illegal for Forge), It seems these cards are not easy to script right now:

Determined:not sure if keyword CARDNAME can't be countered. works here (Vexing Shusher)
Development:cost "has you draw a card" is not scriptable
Fall:reveals two cards at random
Odds:flip heads/tails (Molten Sentry?)

Edit:If you use CARDNAME in SpellDescription, it would not show the correct side but the name of two sides.

Also I'm not sure where to put urls for card pictures or svars like "SVar:RemAIDeck:True". Would these svars affect both sides or only one side?
swordshine
 
Posts: 682
Joined: 11 Jul 2010, 02:37
Has thanked: 116 times
Been thanked: 87 times

Re: [WIP] Split Cards Support

Postby Agetian » 05 Mar 2013, 14:54

@ Sloth: Uhhh trying to reintegrate right now but for some stupid reason it's going over the 12000 cards again even though both my trunk and my SplitCards are on the head revision, so technically speaking, those files should be the same. Do you know why it's doing that? I'm pretty sure it'll fail eventually because I could never get it to merge 12000 files at once without getting me disconnected around the letter G or H. :(

@ swordshine: Here's an example of a script with a SVar in it:
Code: Select all
Name:Fire
ManaCost:1 R
AlternateMode: Split
Types:Instant
A:SP$ DealDamage | Cost$ 1 R | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player to distribute damage to | NumDmg$ 2 | TargetMin$ 1 | TargetMax$ 2 | DividedAsYouChoose$ 2 | SpellDescription$ Fire deals 2 damage divided as you choose among one or two target creatures and/or players.
SetInfo:APC Uncommon
SetInfo:COM Uncommon
SetInfo:DDJ Uncommon
Oracle:Fire deals 2 damage divided as you choose among one or two target creatures and/or players.

ALTERNATE

Name:Ice
ManaCost:1 U
Types:Instant
A:SP$ Tap | Cost$ 1 U | ValidTgts$ Permanent | TgtPrompt$ Select target permanent | SubAbility$ DBDraw | SpellDescription$ Tap target permanent. Draw a card.
SVar:DBDraw:DB$ Draw | NumCards$ 1
Oracle:Tap target permanent.\nDraw a card.
End
So, basically, each side can have its own SVars that affect only that particular side. It seems that as far as RemAIDeck is concerned, if it's present on at least one side the card will be considered unplayable by the AI, at least that's what the deck editor shows me if I try adding it and it seems logical because in areas other than the stack, the card inherits properties of both sides of the card. I'm not sure about picture URLs, to be honest, maybe someone else will be more competent in answering that one, but I assume it should be similar to RemAIDeck (unless it'd matter when the card is on stack?... I've never understood what the picture URLs are for anyway by the way, I don't think I've ever encountered a case when it'd grab the picture from that URL specified in PictureURL... or maybe I just don't know how it works / what it's for).

I'll see what I can do with the CARDNAME issue, can you give me an example script that would use it so that I can play with it?

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

Re: [WIP] Split Cards Support

Postby friarsol » 05 Mar 2013, 15:02

Agetian wrote:I'll see what I can do with the CARDNAME issue, can you give me an example script that would use it so that I can play with it?

- Agetian
In your example above the SpellDescription for Fire should be "CARDNAME deals 2 damage divided as you choose among one or two target creatures and/or players."
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 myk » 05 Mar 2013, 16:11

Agetian wrote:@ Sloth: Uhhh trying to reintegrate right now but for some stupid reason it's going over the 12000 cards again even though both my trunk and my SplitCards are on the head revision, so technically speaking, those files should be the same. Do you know why it's doing that? I'm pretty sure it'll fail eventually because I could never get it to merge 12000 files at once without getting me disconnected around the letter G or H. :(
If it fails, I can do the reintegration for you. Since you've been merging trunk into your branch, there shouldn't be any conflicts to resolve. It's going over all 12000 cards since they were touched during the branch lifetime. It doesn't matter that there are no differences, unfortunately; it's just how subversion works.
myk
 
Posts: 439
Joined: 17 Jan 2013, 02:39
Location: California
Has thanked: 38 times
Been thanked: 57 times

Re: [WIP] Split Cards Support

Postby Agetian » 05 Mar 2013, 16:24

@ myk: Yeah, it failed alright, sadly, for some reason it does it for several hours on my system and it drops me about 1/3 way through it as if it times out or something... Please feel free to reintegrate for me, I'd be very grateful if you could do that.

@ Everyone: I'm looking into the CARDNAME issue but can't seem to get to the bottom of it. I've found five places in the entire Forge code base where CARDNAME is being replaced with the actual card name "en masse" via a call to replaceAll - four instances in the Card class and one instance in SpellAbility.getStackDescription. I tried tinkering with all five of those but neither of them actually seems to be the one I want, because even if I replace the line that replaces CARDNAME with something along the lines of ...replaceAll("CARDNAME", "RANDOMLINE"), it still shows up as "Fire // Ice" in the game as if it was replaced by the name of the card *already* from somewhere else before it got to the part I'm tinkering with. Can you please help me with this?... (at least give me a hint where I should be looking at). P.S. This is minor enough for now and should be easy enough to fix once I pinpoint the location to rig, I don't think this issue should hinder reintegration with the trunk (we can patch it up in trunk shortly).

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

Re: [WIP] Split Cards Support

Postby friarsol » 05 Mar 2013, 16:45

Agetian wrote:P.S. This is minor enough for now and should be easy enough to fix once I pinpoint the location to rig, I don't think this issue should hinder reintegration with the trunk (we can patch it up in trunk shortly).
Yea this is relatively minor, and can be looked at once the reintegration happens.
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 friarsol » 05 Mar 2013, 16:57

swordshine wrote:Determined:not sure if keyword CARDNAME can't be countered. works here (Vexing Shusher)
Development:cost "has you draw a card" is not scriptable
Fall:reveals two cards at random
Odds:flip heads/tails (Molten Sentry?)
Determined should be the same Static Ability as Banefire just on an Effect.

I was looking at doing heads/tails flips for Mana Clash, but never actually finished.

Can't you use the Reveal effect for Fall? I guess the "Random" portion would need to actually account for how many cards you want to Reveal randomly. Should be pretty easy to add support for that. Once that's added Nebuchadnezzar can be converted from hardcode.
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 myk » 05 Mar 2013, 17:30

reintegrating.... (will be done in a few hours. I'm still in res/cardsfolder/a..). Would you like me to remove the SplitCards branch after it's merged, or I should I reset the merge info so you can continue to use the branch and reintegrate further changes at a later date?
myk
 
Posts: 439
Joined: 17 Jan 2013, 02:39
Location: California
Has thanked: 38 times
Been thanked: 57 times

Re: [WIP] Split Cards Support

Postby Agetian » 05 Mar 2013, 17:53

Umm unless anyone has important considerations and arguments for keeping it, I'd say it can be removed - I mean, the basic structure of split card support is all in, what remains is polishing it and fleshing out the potential issues and incompatibilities in card interaction, I guess it's best to do that in one place (trunk, since the major part of the branch is reintegrated anyway), though it's my first experience of working with a branch, so to be on the safe side, I guess we can reset it and keep it for a few days after the reintegration to see if we need it for something else or not. Other opinions are indeed welcome!

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

Re: [WIP] Split Cards Support

Postby Max mtg » 05 Mar 2013, 18:04

Why don't you reintegrate only 'src' folder? All those 12k cards just won't participate
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 » 05 Mar 2013, 18:07

@ Max: Oh, I wasn't aware it was possible to do that! Thx for the tip! I'll definitely utilize this shortcut the next time I work with branches (which means soon since I plan to start a branch for the AI personalities soon enough). :)

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

Re: [WIP] Split Cards Support

Postby myk » 05 Mar 2013, 18:46

Max mtg wrote:Why don't you reintegrate only 'src' folder? All those 12k cards just won't participate
I didn't do it this way since subtree merges can lead to errors and complexities down the road. I've made that mistake in the past and have no intention of repeating it : ) The svn book explicitly advises against subtree merging. Consistently merging from branch roots keeps things simple, and is usually quite fast -- most merges won't take nearly this long.
myk
 
Posts: 439
Joined: 17 Jan 2013, 02:39
Location: California
Has thanked: 38 times
Been thanked: 57 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 51 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 51 users online :: 0 registered, 0 hidden and 51 guests (based on users active over the past 10 minutes)
Most users ever online was 9298 on 10 Oct 2025, 12:54

Users browsing this forum: No registered users and 51 guests

Login Form