It is currently 18 Jul 2025, 05:35
   
Text Size

PHASING - ALPHA TEST - NEO VER 0.1

Moderator: CCGHQ Admins

PHASING - ALPHA TEST - NEO VER 0.1

Postby NeoAnderson » 11 Oct 2014, 16:16

Phasing is probably one of the worst ability to code, there are too many interactions and with the flexibility of Dotp we really can make few things.
Somedays ago i found that ZONE_CEASED_TO_EXIST is working, and i tried to use it to make an approximation of Phasing ability.
Until now i get a partial working version but surely it still have something need to be fixed.

I release here an alpha version for testing purpose so i can receive also your suggestions and feedback.
Please don't use this version to code other cards it is not finished.


Unfortunately Dotp internal PHASING ability doesn't work at all so we can use it when it is an intrinsic ability, to grant Phasing to another card we need to use a fake Phasing ability (so you need Riiak Characteristics function)
This is a TEST VERSION - so the text PHASING MANAGER onto cards who has Phasing is just for testing purpose it will be removed from final version

I still need help to understand exactly how phasing is supposed to works during certain situation so any comment, feedback or idea will be appreciated.



UPDATE :

I have release a test pack of 19 cards with phasing manager 2.0 you can find the topic here :
MTG - PHASING-CARDS PACK 019/019 CARDS

CHANGE LOG VER 1.0 : | Open
1. NEW FEATURE : Now compatible with clone effect. Previous version had an incompatibility with cloning effect cards, if a cloned card phased-out, it was resetted to source card when it phase-in. Obviously this shouldn't happen.
2. NEW FEATURE : Now it is almost compliant with Flip cards, no modify is needed to Flip cards.
3. FIXED : issue about the "Enter-Battlefield checks" about the cards not belonging to the EffectController under the effect of Auras like Mind Control, Control Magic, Confiscate. Now these cards will not activate any triggers.
4. FIXED : From version 0.2 morph cards were no longer compatible with phasing effect. NOW IT WORKS AGAIN.


Know Bugs :
1. When a card not belonging to EffectController but controlled through an Aura like Confiscate phase in will get Haste to avoid summon sickness.
2. Morph cards, cloned cards, flipped cards, will have a stretched picture after they are phasing out at least one time. ( I still don't understand the reason, it depends from dotp engine ) anyway this is not a gameplay bug, the card will be fully working, it is just a visual bug.
CHANGELOG Ver. 0.2 : | Open
As Expected Phasing is creating more issues we can handle with this Dotp engine.
Because we are using a zone change effect to simulate the phasing effect, we have to fight with control change effects.
This due to a control change when we move the card to ZONE_CEASED_TO_EXIST, the controller is restored to card Owner.
The card cannot be moved to a ZONE not belong to the owner.
To avoid this issue i can apply a control effect to keep the control player when the card returns, but there is no way to know if an effect should still exist or not, so i decided to keep only the continuos control change effect cause by Auras attached to the card.
Doing this way i have only one issue the card when returns is affected by summon sickness, the only way i know to avoid this is to give to it haste.

New features are :
1. Can handle cards who changed controller with Auras like Mind Control, Control Magic, Confiscate ....
2. Any control effect (not through auras) applied before Phasing will end with phasing out, because the target doesn't exist anymore.
3. Auras and Equipments that phase out directly will Phase in attached to the card they were attached if it still exist, otherwise they will Phase in detached.


Know bugs until now :
1. When a card not belonging to EffectController but controlled through an Aura like Confiscate phase in, any trigger ability related to enchantment or auras who enters onto battlefield will trigger from the second phase in!
The first time it normally work and doesn't trigger, but due to a misterious reason after the first time it won't work anymore, so the card normally phase-out, phase-in, keeping counters, auras etc etc, but the auras attached are not invisible to "Enter-Battlefield checks".
2. When a card not belonging to EffectController but controlled through an Aura like Confiscate phase in will get Haste to avoid summon sickness.
CHANGELOG Ver. 0.1 : | Open
This version is compliant with effects like:
1a. Ajani’s Chosen
1b. Angelic Chorus
1c. Cathars’ Crusade
1d. Dual Nature
1e. Dreadbringer Lampads - And all Constellation cards.
1f. Altar of the Brood

2. It keeps track of the number of counters on a phasing card.
3. It brings any attached auras or equipments into phasing zone.
4. It is almost working with morph cards ( just a weird effect after a morph card is phase in, the picture become stretched )
5. It will be almost compliant with Flip cards after i update that set so you will need FLIP CARDS SET REV 1b. (same weird effect like morph cards)
6. It keeps memory of Tapped status of the Phased card.



IMPORTANT!! TO USE THIS VERSION YOU NEED :
Riiak ObjectDC Functions
Riiak Characteristics Functions
Last edited by NeoAnderson on 18 Oct 2014, 14:32, edited 8 times in total.
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: PHASING ALPHA TEST - NEO VER 0.1

Postby thefiremind » 11 Oct 2014, 16:31

NeoAnderson wrote:I still need help to understand exactly how phasing is supposed to works during certain situation so any comment, feedback or idea will be appreciated.
This is the best explanation in my opinion:
http://mtgsalvation.gamepedia.com/Phasing
I think the main problem would be to avoid triggering enters/leaves-the-battlefield triggers when the permanent phases in/out, and making Auras/Equipments "phase indirectly".
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: PHASING ALPHA TEST - NEO VER 0.1

Postby NeoAnderson » 11 Oct 2014, 16:34

thefiremind wrote:
NeoAnderson wrote:I still need help to understand exactly how phasing is supposed to works during certain situation so any comment, feedback or idea will be appreciated.
This is the best explanation in my opinion:
http://mtgsalvation.gamepedia.com/Phasing
I think the main problem would be to avoid triggering enters/leaves-the-battlefield triggers when the permanent phases in/out, and making Auras/Equipments "phase indirectly".
I used that explanation to make this version thx Fire, about the triggering enters/leaves-the-battlefield triggers when the permanent phases in/out, and making Auras/Equipments "phase indirectly" i already made it. My doubts are about continuos effects that should last when the card Phase out, expecially control effects!! You can try my version is full working and i also used to test grant Phasing to normal cards it is simple to do just with few code lines.
SAMPLE CODE TO GRANT PHASING TO A TARGET - THE EFFECT WILL END AFTER FIRST PHASING | Open
Code: Select all
<TARGET tag="CARD_QUERY_CHOOSE_CARD" definition="0" compartment="0" count="1" />
      <TARGET_DEFINITION id="0">
      local filter = ClearFilter()
            local subfilter = filter:AddSubFilter_Or()
                  subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ARTIFACT )
                  subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
                  subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ENCHANTMENT )
                  subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_LAND )
                  subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_PLANESWALKER )
      </TARGET_DEFINITION>
     <CONTINUOUS_ACTION layer="1">
         local card = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
         if card ~= nil then
            EffectDC():Set_CardPtr(100, card)
            EffectDC():Protect_CardPtr(100)
      RSN_Characteristics_Set( card, NEO_PHASING_ABILITY, 1 )
        end
    </CONTINUOUS_ACTION>
             <DURATION>
              local card = EffectDC():Get_CardPtr(100)
              if card ~= nil then
                  if card:GetZone() == ZONE_CEASED_TO_EXIST then
                     return false
                  else
                     return card:GetZone() ~= ZONE_BATTLEFIELD
                  end
              end
              </DURATION>
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: PHASING ALPHA TEST - NEO VER 0.1

Postby thefiremind » 11 Oct 2014, 16:42

NeoAnderson wrote:My doubts are about continuos effects that should last when the card Phase out, expecially control effects!!
My understanding of the rule 702.25d in the link I posted makes me think that control should never change. So if a creature with phasing has been stolen with Mind Control, it should still belong to the player who's controlling Mind Control, even after phasing out and back in.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: PHASING ALPHA TEST - NEO VER 0.1

Postby NeoAnderson » 11 Oct 2014, 16:54

thefiremind wrote:
NeoAnderson wrote:My doubts are about continuos effects that should last when the card Phase out, expecially control effects!!
My understanding of the rule 702.25d in the link I posted makes me think that control should never change. So if a creature with phasing has been stolen with Mind Control, it should still belong to the player who's controlling Mind Control, even after phasing out and back in.
I think so, in fact i would revise the code because right now i am using the card:GetOwner() to phase in.
But this could be simple because it is an Aura and it will phase in back with the card, but what happen with effect like :
Aladdin - Aura Graft - Aura Thief - Beguiler of Wills - Blatant Thievery and many others???

2. If we use the last effect controller, what we do if it isn't in play when the card should phase in?? should it phase in to the card owner untap step under his control??
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: PHASING - ALPHA TEST - NEO VER 0.1

Postby migookman » 11 Oct 2014, 17:36

A big THANK YOU!! for all the hard work you are doing in the community. I'm going to give your alpha version a test drive. :)
User avatar
migookman
 
Posts: 135
Joined: 05 Aug 2014, 06:37
Has thanked: 22 times
Been thanked: 28 times

Re: PHASING - ALPHA TEST - NEO VER 0.1

Postby NeoAnderson » 11 Oct 2014, 21:00

migookman wrote:A big THANK YOU!! for all the hard work you are doing in the community. I'm going to give your alpha version a test drive. :)
You're welcome my friend, please be advised there was a missing file into previous WAD for some reason the game doesn't see the declaration of a constant for this reason it won't work as expected.
Now i added a new constant lol file for declaration and i also tested it it should work.
We are still far to say it is finished but i think i reached a good point. Now i have to resolve the controller issue.
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: PHASING - ALPHA TEST - NEO VER 0.1

Postby migookman » 11 Oct 2014, 22:17

It works great now. It even phases the auras. Can't wait to try the Equipoise/Sands of Time lock. :)
User avatar
migookman
 
Posts: 135
Joined: 05 Aug 2014, 06:37
Has thanked: 22 times
Been thanked: 28 times

Re: PHASING - ALPHA TEST - NEO VER 0.1

Postby NeoAnderson » 11 Oct 2014, 22:24

migookman wrote:It works great now. It even phases the auras. Can't wait to try the Equipoise/Sands of Time lock. :)
Yes it phases the Auras, it keeps the counters, and it also keeps track about Tap status, if a card who don't untap during the untap phase, phase out tapped it comeback tapped, it is also working with morph cards, and it will be compliant with Flip cards but i have to update them to make them phasing compliant.
I still have to fix some problems, expecially about the control change effects, now the phasing is not considering these effects, i have to find a way to handle these effects. Anyway right now is an alpha test, please report me any issue or weird behaviour, so i can try to fix it while i am still developing it.
Tomorrow i will comeback onto phasing code now i need to take a break to clarify my mind! I am Phasing OUT!!! :lol: :mrgreen: :lol:
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: PHASING - ALPHA TEST - NEO VER 0.1

Postby NeoAnderson » 13 Oct 2014, 17:17

As Expected Phasing is creating more issues we can handle with this Dotp engine.
Because we are using a zone change effect to simulate the phasing effect, we have to fight with control change effects.
This due to a control change when we move the card to ZONE_CEASED_TO_EXIST, the controller is restored to card Owner.
The card cannot be moved to a ZONE not belong to the owner.
To avoid this issue i can apply a control effect to keep the control player when the card returns, but there is no way to know if an effect should still exist or not, so i decided to keep only the continuos control change effect cause by Auras attached to the card.
Doing this way i have only one issue the card when returns is affected by summon sickness, the only way i know to avoid this is to give to it haste.


New features are :
1. Can handle cards who changed controller with Auras like Mind Control, Control Magic, Confiscate ....
2. Any control effect (not through auras) applied before Phasing will end with phasing out, because the target doesn't exist anymore.
3. Auras and Equipments that phase out directly will Phase in attached to the card they were attached if it still exist, otherwise they will Phase in detached.


Know bugs until now :
1. When a card not belonging to EffectController but controlled through an Aura like Confiscate phase in, any trigger ability related to enchantment or auras who enters onto battlefield will trigger from the second phase in!
The first time it normally work and doesn't trigger, but due to a misterious reason after the first time it won't work anymore, so the card normally phase-out, phase-in, keeping counters, auras etc etc, but the auras attached are not invisible to "Enter-Battlefield checks".
2. When a card not belonging to EffectController but controlled through an Aura like Confiscate phase in will get Haste to avoid summon sickness.
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: PHASING - ALPHA TEST - NEO VER 0.1

Postby NeoAnderson » 14 Oct 2014, 14:03

Update Version 1.0
Trying to fight with a complex approximation and the limited Dotp functions the PHASING-MANAGER's code is exponentially growing up.
So we can take a look to the the changelog of this new version.

I think to have reached the best i can do with this ability, probably i still can fix some small issue. I need some feedback so we can decide if could be used to code other cards.

CHANGE LOG VER 1.0 :
1. NEW FEATURE : Now compatible with clone effect. Previous version had an incompatibility with cloning effect cards, if a cloned card phased-out, it was resetted to source card when it phase-in. Obviously this shouldn't happen.
2. NEW FEATURE : Now it is almost compliant with Flip cards, no modify is needed to Flip cards.
3. FIXED : issue about the "Enter-Battlefield checks" about the cards not belonging to the EffectController under the effect of Auras like Mind Control, Control Magic, Confiscate. Now these cards will not activate any triggers.
4. FIXED : From version 0.2 morph cards were no longer compatible with phasing effect. NOW IT WORKS AGAIN.


Know Bugs :
1. When a card not belonging to EffectController but controlled through an Aura like Confiscate phase in will get Haste to avoid summon sickness.
2. Morph cards, cloned cards, flipped cards, will have a stretched picture after they are phasing out at least one time. ( I still don't understand the reason, it depends from dotp engine ) anyway this is not a gameplay bug, the card will be fully working, it is just a visual bug.
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: PHASING - ALPHA TEST - NEO VER 0.1

Postby migookman » 14 Oct 2014, 21:06

Great work on Phasing Neo. I've tested out Breezekeeper a bit and everything seems to work fine. I would like to test out some cards that grant phasing and also cards that have global phasing (such as Equipoise). Will you be making a Phasing Pack similar to your work with Convoke, Flip Cards, etc. ?
User avatar
migookman
 
Posts: 135
Joined: 05 Aug 2014, 06:37
Has thanked: 22 times
Been thanked: 28 times

Re: PHASING - ALPHA TEST - NEO VER 0.1

Postby RiiakShiNal » 14 Oct 2014, 22:54

Your implementation will also be incompatible with any ability that applies an effect that lasts longer than the phasing interval. For example Sensei Golden-Tail, use the second ability on a creature that phases out, when it phases back in it should still have Bushido 1 and be a Samurai (regardless of the training counter), but the effect goes away once the creature "phases out".
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: PHASING - ALPHA TEST - NEO VER 0.1

Postby NeoAnderson » 15 Oct 2014, 00:00

RiiakShiNal wrote:Your implementation will also be incompatible with any ability that applies an effect that lasts longer than the phasing interval. For example Sensei Golden-Tail, use the second ability on a creature that phases out, when it phases back in it should still have Bushido 1 and be a Samurai (regardless of the training counter), but the effect goes away once the creature "phases out".
This is the exact doubt i had about these kind of effects, when a card phase out, should be considered as it doesn't exist, so could a continuos effects still affect the card if it generated on a resolution time? If we decide that it should keep these kind of effects i can try to fix it.
Honestly Phasing is not really straight as ability, and i am still little bit confused how to consider these effects.
Anyway due of Dotp limitations when we make an approximation as you know we should accept some difference or some small incompatibilities, I am not sure that fixing this problem we will not have other issues!

I decided to implement Phasing let ending any effects generated on resolution time before the card phase out, this because as my opinion should be the same behaviour have some other official cards like Keiga, the Tide Star.

FOR EXAMPLE : look the official card Keiga, the Tide Star , when it dies you take the control of target creature. The effect should end only when the game end as by rule :
611.2a A continuous effect generated by the resolution of a spell or ability lasts as long as stated by the spell or ability creating it (such as "until end of turn"). If no duration is stated, it lasts until the end of the game. This means if i take control of CREATURE_X and it dies during the match i should still be the controller also into graveyard but it isn't so.

The worst thing to resolve is that we cannot know if an effect is until the game end or linked to a particular effect.
So if we also copy the status of the card before we phase out, and restore it when it phase in, when we restore the copiable values we have to set a duration and we don't know which are the duration conditions. So we could grant it until the game end, until card is nil, but this will create more issue with cards that give effects "as long...".


migookman wrote:Great work on Phasing Neo. I've tested out Breezekeeper a bit and everything seems to work fine. I would like to test out some cards that grant phasing and also cards that have global phasing (such as Equipoise). Will you be making a Phasing Pack similar to your work with Convoke, Flip Cards, etc. ?
I am starting to making something but as you can see there are still some bugs, so i would be sure it will not break any massive interactions with other cards. If we agree that the approximation is acceptable i will release a content pack with Phasing cards.
Anyway i am already coding some other phasing cards:
I have implemented (Phasing-out shield) to protect a card from phasing out this because i coded Ertai’s Familiar
I also tested a phase out ability to force a card to phase out on a resolution action.
I have implemented the 2 functions to check when a card phase in or phase out!

Hope that we will reach a good percentage of rules compliance so i can release other stuff.
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: PHASING - ALPHA TEST - NEO VER 0.1

Postby RiiakShiNal » 15 Oct 2014, 01:31

NeoAnderson wrote:I decided to implement Phasing let ending any effects generated on resolution time before the card phase out, this because as my opinion should be the same behaviour have some other official cards like Keiga, the Tide Star.

FOR EXAMPLE : look the official card Keiga, the Tide Star , when it dies you take the control of target creature. The effect should end only when the game end as by rule :
611.2a A continuous effect generated by the resolution of a spell or ability lasts as long as stated by the spell or ability creating it (such as "until end of turn"). If no duration is stated, it lasts until the end of the game.
This means if i take control of CREATURE_X and it dies during the match i should still be the controller also into graveyard but it isn't so.
This is different in that CREATURE_X died at which point it goes to its owner's graveyard. This is because it has ceased to be a permanent and thus no longer has a controller. Additionally, if CREATURE_X were to be recast it would be treated as a new instance rather than the old one coming back (this is consistent with how all abilities work).
108.4. A card doesn’t have a controller unless that card represents a permanent or spell; in those cases, its controller is determined by the rules for permanents or spells. See rules 110.2 and 111.2.
110.1. A permanent is a card or token on the battlefield. A permanent remains on the battlefield indefinitely. A card or token becomes a permanent as it enters the battlefield and it stops being a permanent as it’s moved to another zone by an effect or rule.
Now some effects should end if they use the "for as long as" terminology:
611.2b Some continuous effects generated by the resolution of a spell or ability have durations worded “for as long as . . . .” If the “for as long as” duration never starts, or it ends before the moment the effect would first be applied, the effect does nothing. It doesn’t start and immediately stop again, and it doesn’t last forever.
Example: Master Thief has the ability “When Master Thief enters the battlefield, gain control of target artifact for as long as you control Master Thief.” If you lose control of Master Thief before the ability resolves, it does nothing, because its duration—as long as you control Master Thief—was over before the effect began.
702.25e Continuous effects that affect a phased-out permanent may expire while that permanent is phased out. If so, they will no longer affect that permanent once it’s phased in. In particular,
effects with “for as long as” durations that track that permanent (see rule 611.2b) end when that permanent phases out because they can no longer see it.
However, effects like Sensei Golden-Tail permanently change a permanent (until it ceases to be a permanent for example death). Though this one is trickier to explain as a phased-out permanent is still a permanent any permanent changes to it remain in effect.
702.25d The phasing event doesn’t actually cause a permanent to change zones or control, even though it’s treated as though it’s not on the battlefield and not under its controller’s control while it’s phased out. Zone-change triggers don’t trigger when a permanent phases in or out. Counters remain on a permanent while it’s phased out. Effects that check a phased-in permanent’s history won’t treat the phasing event as having caused the permanent to leave or enter the battlefield or its controller’s control.
This can also be interpreted as other than how a card is treated phasing-in-and-out has no other effect to a card's status. So cards that trigger on other card's zone changes may also not work in relation to your ability code since you move the card to ZONE_CEASED_TO_EXIST. This obviously won't affect dies triggers as the card isn't going to the graveyard, but it may cause other triggers to erroneously fire.
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Next

Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 1 guest

Main Menu

User Menu

Our Partners


Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (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 1 guest

Login Form