Page 40 of 441

Re: Current Known Bugs list

PostPosted: 31 Mar 2009, 18:24
by Rob Cashwalker
DennisBergkamp wrote:I know about the Lignify not removing abilities bug. I've attempted to fix it in the past, but failed :( Tricky to fix... not sure how to do it correctly.
One way to fix it might be through some nasty hack, where we rename the creature (maybe add a space at the end or something :) ) and then reset the name once it's bounced/destroyed, but that's something I'd like to avoid.
While I would normally agree this sort of hack should be avoided, I'd like to point out just how simple this type of solution is, and simple solutions are usually better.... Yeah it's a hack, and it might have a side effect we're not thinking of at the moment... but definitely don't rule it out yet. Especially with the continued enhancement to the whole state-based-effects handler.

What needs more fixing I think is the fact that creature enchantments / auras (whatever they're called) are currently basically sorceries, they just hit the graveyard after being cast and can't be removed by aiming a Disenchant at them. But again, this is very tricky to implement, because the GUI code would have to be updated to show these enchantments preferably behind the creature (or other permanent). I'm not sure how to do this either, GUI code in java is just so damn confusing #-o
Simple - append a reference to the enchantment in the card text. Or add a "keyword" that can easily be added or removed.

Complex - the Card object has had framework for "attachments" since I first looked at the code early last year.. I assumed rares had some intention of making enchantments and equipment work, but ran into difficulties....

Instead of the much-requested overlaying of the card images, just placing auras next to their "hosts" in the line up would be sufficient. Like
Code: Select all
[C1] [C2] [e1] [C3] [ae1] [e2] [A1] [E1]
C are creature
e is an aura
ae is equipment
A is artifact
E is regular enchantments

Re: Current Known Bugs list

PostPosted: 31 Mar 2009, 19:01
by DennisBergkamp
Dennis Re: the GUI....can you simply add a shadowed layer with the label of the card showing? That way on mouse over you can display the enchantment/aura on the sidebar.

Concerning the lignify bug, I think part of the problem is that you are using the actual cards rather than copies of the cards. If something changes in the copy that doesnt effect the real thing but it does affect what is in play. And when you reset the Copy you can do so from the Original without worrying about it being incorrect. This is what I was talking about before with the difference between cards and permanents.

You play Card X --->Permanent X which is a copy of Card X is created and put into play...(Card X is in limbo because you aren't actually ever using it except to get information from it (it is read only)) Permanent X gets pumped by whatever cards are in play, loses said pumping as apropriate, etc... then you can attach/unattach enchantments and equipments to said permanent because you dont have to worry about wrecking it. When some thing causes Permanent X to leave play the Card X it represents does the leaving instead and Permanent X is just erased. Sort of unhooking it from the system.

A typical permanent might look as follows datawise:

Parent Card: Merfolk Looter
Type: Merfolk
Subtype: (whatever subtype is on the card, I forget lol)
CMC: 2
MC: 1U
BaseP: 1
BaseT: 1
Abilitys: (loot)

With a Glorious Anthem in play it also has the following data:
PermBuff: +1P, +1T.
TotalP: 2
TotalT: 2

With a Lignify:
Attached Card: Lignify
TypeChangedTo: Treefolk
BasePChangedTo: 0
BaseTChangedTo: 4
AbilityChangedTo: null
TotalP: 1
TotalT: 5


(If that makes any sense) I realize that implementing concept to actual code isn't necessarily as easy as composing a post in english but the logic should be similar.
This is kind of the way it works already, except, we don't make a copy of the card. But it wouldn't really matter in this case. Let me try to explain, this is the code of Lignify:

Code: Select all
public void resolve()
        {
          Card c = getTargetCard();
          if(AllZone.GameAction.isCardInPlay(c))
          {
            c.setBaseAttack(0);
            c.setBaseDefense(4);

            c.setType(new ArrayList());
            c.addType("Creature");
            c.addType("Treefolk");

            c.setIntrinsicKeyword(new ArrayList());

            c.clearSpellAbility();
          }
        }//resolve()
Basically it sets the base power to 0, base toughness to 4, then it clears all existing types and set it to "Creature Treefolk" and also removes all (intrinsic) keywords (it will lose flying, lifelink etc. unless it's receiving this from an outside source). Then at the end, it clears all spellAbilities (through the c.clearSpellAbility() line), this means say, Captain Sisay won't be able to fetch legendary creatures anymore, or Merfolk Looter won't be able to gain flying until end of turn anymore. Almost all of these abilities are defined in CardFactory.java.
HOWEVER, the Merfolk Looter "loot" ability, or Winnower Patrol "Kinship" are treated very differently, since they're in essence triggered abilities. These abilities are defined in GameActionUtil.java, and they basically put an ability on the stack (at a specific point in time and under certain conditions) whenever a card with that name is found. So basically, it will put the Kinship ability on the stack for Winnower Patrol during the upkeep of the player that controls one, or it will put the "Loot" ability on the stack for Merfolk Looter whenever it finds a card with that name that just dealt combat damage to the other player.

Bottom-line is, these abilities are very separate from the actual card, the only thing that "connects" them is the actual card name. Therefore, if Lignify would change the name of the card as it hits play, these abilities will not trigger anymore, and this bug would be "fixed". I say "fixed" because this is a hacky solution.
Anyway, I hope this makes sense :)

The GUI is a tricky story, the card layout on the various player zones are managed by some layout manager (I think it's a Grid Layout?), and I know more complicated layouts are possible in java, but I have no idea how. I'll look around for some tutorials that might shed some light on this matter.

Re: Current Known Bugs list

PostPosted: 31 Mar 2009, 19:23
by DennisBergkamp
While I would normally agree this sort of hack should be avoided, I'd like to point out just how simple this type of solution is, and simple solutions are usually better.... Yeah it's a hack, and it might have a side effect we're not thinking of at the moment... but definitely don't rule it out yet. Especially with the continued enhancement to the whole state-based-effects handler.
Actually it will cause problems when the card in question gets bounced back to its owner's hand because a card in hand HAS to be defined in cards.txt (I found this out when messing around with Morph, I attempted to set the name to "Morph" of facedown cards, this gave me a lot of trouble). But, perhaps resetting the card to its original name as it's leaving play would fix this.

Simple - append a reference to the enchantment in the card text. Or add a "keyword" that can easily be added or removed.

Complex - the Card object has had framework for "attachments" since I first looked at the code early last year.. I assumed rares had some intention of making enchantments and equipment work, but ran into difficulties....

Instead of the much-requested overlaying of the card images, just placing auras next to their "hosts" in the line up would be sufficient. Like

Code: Select all
[C1] [C2] [e1] [C3] [ae1] [e2] [A1] [E1]


C are creature
e is an aura
ae is equipment
A is artifact
E is regular enchantments

Actually, yes as you said code for the whole aura business kind of exists already (also in the code that defines the order for all the cards to show up on the permanent zone). Should be pretty easy to get to work... even though I'd much rather have auras BEHIND the enchanted permanent, and land stacking would be great as well to keep scrolling to a minimum :)

But Rob, you're probably right, auras/equipment working like you described would be a tremendous improvement from the current way (enchantments going to the graveyard like they're sorceries). So I'll play around with it and check and see if I can implement this sometime. I'm working on some other new stuff first, I'd like to add some new keywords: Wither seems to work now, I will also attempt something like "Whenever a creature dealt damage by {cardname} this turn is put into a graveyard, put a +1/+1 counter on {cardname}". It'd be cool to add cards like Sengir Vampire, and Spiritmonger would be possible too :)

Re: Current Known Bugs list

PostPosted: 01 Apr 2009, 07:41
by GandoTheBard
DennisBergkamp wrote:
Dennis Re: the GUI....can you simply add a shadowed layer with the label of the card showing? That way on mouse over you can display the enchantment/aura on the sidebar.

Concerning the lignify bug, I think part of the problem is that you are using the actual cards rather than copies of the cards. If something changes in the copy that doesnt effect the real thing but it does affect what is in play. And when you reset the Copy you can do so from the Original without worrying about it being incorrect. This is what I was talking about before with the difference between cards and permanents.

You play Card X --->Permanent X which is a copy of Card X is created and put into play...(Card X is in limbo because you aren't actually ever using it except to get information from it (it is read only)) Permanent X gets pumped by whatever cards are in play, loses said pumping as apropriate, etc... then you can attach/unattach enchantments and equipments to said permanent because you dont have to worry about wrecking it. When some thing causes Permanent X to leave play the Card X it represents does the leaving instead and Permanent X is just erased. Sort of unhooking it from the system.

A typical permanent might look as follows datawise:

Parent Card: Merfolk Looter
Type: Merfolk
Subtype: (whatever subtype is on the card, I forget lol)
CMC: 2
MC: 1U
BaseP: 1
BaseT: 1
Abilitys: (loot)

With a Glorious Anthem in play it also has the following data:
PermBuff: +1P, +1T.
TotalP: 2
TotalT: 2

With a Lignify:
Attached Card: Lignify
TypeChangedTo: Treefolk
BasePChangedTo: 0
BaseTChangedTo: 4
AbilityChangedTo: null
TotalP: 1
TotalT: 5


(If that makes any sense) I realize that implementing concept to actual code isn't necessarily as easy as composing a post in english but the logic should be similar.
This is kind of the way it works already, except, we don't make a copy of the card. But it wouldn't really matter in this case. Let me try to explain, this is the code of Lignify:

Code: Select all
public void resolve()
        {
          Card c = getTargetCard();
          if(AllZone.GameAction.isCardInPlay(c))
          {
            c.setBaseAttack(0);
            c.setBaseDefense(4);

            c.setType(new ArrayList());
            c.addType("Creature");
            c.addType("Treefolk");

            c.setIntrinsicKeyword(new ArrayList());

            c.clearSpellAbility();
          }
        }//resolve()
Basically it sets the base power to 0, base toughness to 4, then it clears all existing types and set it to "Creature Treefolk" and also removes all (intrinsic) keywords (it will lose flying, lifelink etc. unless it's receiving this from an outside source). Then at the end, it clears all spellAbilities (through the c.clearSpellAbility() line), this means say, Captain Sisay won't be able to fetch legendary creatures anymore, or Merfolk Looter won't be able to gain flying until end of turn anymore. Almost all of these abilities are defined in CardFactory.java.
HOWEVER, the Merfolk Looter "loot" ability, or Winnower Patrol "Kinship" are treated very differently, since they're in essence triggered abilities. These abilities are defined in GameActionUtil.java, and they basically put an ability on the stack (at a specific point in time and under certain conditions) whenever a card with that name is found. So basically, it will put the Kinship ability on the stack for Winnower Patrol during the upkeep of the player that controls one, or it will put the "Loot" ability on the stack for Merfolk Looter whenever it finds a card with that name that just dealt combat damage to the other player.

Bottom-line is, these abilities are very separate from the actual card, the only thing that "connects" them is the actual card name. Therefore, if Lignify would change the name of the card as it hits play, these abilities will not trigger anymore, and this bug would be "fixed". I say "fixed" because this is a hacky solution.
Anyway, I hope this makes sense :)

The GUI is a tricky story, the card layout on the various player zones are managed by some layout manager (I think it's a Grid Layout?), and I know more complicated layouts are possible in java, but I have no idea how. I'll look around for some tutorials that might shed some light on this matter.
It doesn't make sense to me that you can not get it working correctly if you are already using the model I suggested. You should be connecting the abilities to Unique Id numbers instead of card names and connected the ID names to cards as needed.

Re: Current Known Bugs list

PostPosted: 02 Apr 2009, 19:28
by Mr.Chaos
I just noticed a cosmetic error on Echoing Truth.
The card image and card text at upper right of playfield use the correct words for the card and when played the card also works as it should.
However, when you click the the card to play it, this message shows in the top left info space: "Select target creature for Echoing Truth".
Like I said, this is just a cosmetic error as the card actually can target any nonland permanent as intended but if you go by the upper left text, you might wrongly assume you can only target creatures.

No screeny as I have used up my quota of attachments but this error is easy enough to reproduce anyway.

Re: Current Known Bugs list

PostPosted: 02 Apr 2009, 21:34
by DennisBergkamp
Gando, I'm not exactly sure how to, the way GameActionUtil is currently written makes this very tricky... But, I will think about this in more depth.

Echoing Truth is an easy fix, I'll just change it to "non-land permanent".
What about planeswalker/first strike/double strike combat ? Have you guys noticed any bugs ?

Re: Current Known Bugs list

PostPosted: 03 Apr 2009, 02:31
by Almost_Clever
In addition to flying creatures being able to illegally block flying / swampwalking creatures as previously reported, I've now seen flying / fear creatures get blocked by non-black / non-artifact flyers.

If you bounce Oblivion Ring / Oubliette / Faceless Butcher to your hand in response to the "remove from game" trigger, the creature / nonland permanent will be returned to play before it leaves play (meaning there appears to be two copies at the same time -- destroying it, if it happened to be legendary). Technically, what should happen is that nothing gets returned to play because the target hadn't been removed yet (never to return).

I just noticed that Oubliette plays correctly now (must target a creature), but the text description still says "target nonland permanent."

Re: Current Known Bugs list

PostPosted: 03 Apr 2009, 03:42
by DennisBergkamp
In addition to flying creatures being able to illegally block flying / swampwalking creatures as previously reported, I've now seen flying / fear creatures get blocked by non-black / non-artifact flyers.
Weird, I thought I fixed the flying / swampwalking creatures blocking... I'll look into the flying / fear issue.

Re: Current Known Bugs list

PostPosted: 03 Apr 2009, 06:45
by DennisBergkamp
If you bounce Oblivion Ring / Oubliette / Faceless Butcher to your hand in response to the "remove from game" trigger, the creature / nonland permanent will be returned to play before it leaves play (meaning there appears to be two copies at the same time -- destroying it, if it happened to be legendary). Technically, what should happen is that nothing gets returned to play because the target hadn't been removed yet (never to return).
So I guess what should happen here is that obviously nothing gets returned, however the targeted creature (or non-land permanent) will get removed and stay removed? Let me know if this is incorrect, but if this is indeed the case I think I can fix it.

By the way, reading the rulings on magiccards.info on Oblivion Ring:

-If there are no nonland permanents in play other than an Obvlivion Ring, and a second one enters play, then a third one enters play, this will cause an infinite loop that ends in a draw.

I've always thought this was a bug I needed to fix with Oblivion Ring, but apparently it's actually rules-correct :lol:
Then again, I would need to write some code that detects this and makes the game end in a draw, and I think the AI is not very smart in this regard either, and will "deliberately" cause an infinite loop with three of them in play, even though there are other targetable permanents.

Re: Current Known Bugs list

PostPosted: 03 Apr 2009, 15:17
by Chris H.
I'm working on some other new stuff first, I'd like to add some new keywords: Wither seems to work now, I will also attempt something like "Whenever a creature dealt damage by {cardname} this turn is put into a graveyard, put a +1/+1 counter on {cardname}". It'd be cool to add cards like Sengir Vampire, and Spiritmonger would be possible too :)
I went through the gatherer database and found a number of creatures with Wither. Many of them require Hybrid mana to bring into play. Are you considering using your current hack-ish type system for a couple of these? I am fairly neutral on this, I could go either way.

In RE to the Sengir Vampire, we already have this card in Forge. Your additional coding would allow us to have yet another card brought up to date with all of it's abilities in effect. :supz:

Re: Current Known Bugs list

PostPosted: 03 Apr 2009, 15:46
by DennisBergkamp
Yes, I noticed Sengir Vampire was in cards.txt already when I was testing it :) I've got it working, and added a few "Vampires" (Garza Zol, Plague Queen and Vampire Bats) through the keyword. I hard-coded Mirri the Cursed and Spiritmonger, I might make those into keywords as well.

I don't think I'll do the hacks for the hybrid cards that have wither though, too messy and too much work, especially since a lot of those have double or triple manacost hybrid symbols.
It would probably be better to just get hybrid working, however impossible it may be in MTGForge :mrgreen:

Re: Current Known Bugs list

PostPosted: 03 Apr 2009, 16:50
by Chris H.
What about planeswalker/first strike/double strike combat ? Have you guys noticed any bugs ?
First Strike and Double Strike appear to be functioning correctly in planeswalker combat. I did not notice anything broken during my limited testing.


The computer had two different Planeswalkers in play and I can only attack the first planeswalker that came into play. I am not being given a chance to select the target of the planeswalker attack. I understand that this is not something new and recent.

Re: Current Known Bugs list

PostPosted: 03 Apr 2009, 16:54
by Chris H.
I hard-coded Mirri the Cursed and Spiritmonger, I might make those into keywords as well.
There is a third one which is quite similar to the two above. Have you considered:

Mephidross Vampire
4BB
Creature - Vampire
3/4
Flying Each creature you control is a Vampire in addition to its other creature types and has "Whenever this creature deals damage to a creature, put a +1/+1 counter on this creature."
Rare

Re: Current Known Bugs list

PostPosted: 03 Apr 2009, 17:01
by DennisBergkamp
The computer had two different Planeswalkers in play and I can only attack the first planeswalker that came into play. I am not being given a chance to select the target of the planeswalker attack. I understand that this is not something new and recent.
Ah yes, I'm still not sure how to make this work correctly.... In terms of UI, I was thinking something similar like the multiple blockers GUI that pops up. This seems pretty tricky to implement though.

Re: Current Known Bugs list

PostPosted: 03 Apr 2009, 18:14
by Mr.Chaos
Well, here is a new one!
Compy attacks with a Fyndhorn Elves whyle I have a Talas Warrior in play.
This is odd since the computer will not attack if it is certain the attacker will be killed by the blocker.
Here is the twist: the Talas Warrior could not be asigned as a blocker! :shock:
Unblockable and not able to block. Weird.
This game just never stops to amaze me. LOL!

Edit: Compy will use Elvish Herder to give all creatures trample, regardless of their size and chance to attack at the beginning of turn and waste a lot of mana this way.
It seems that all abilities that pump a creature by paying mana have this tendency for overdoing it.
Compy has a critter who's defence can be boosted for mana? Use all mana!
Compy can regenerate a critter? It does so, regardless whether or not it attacks or takes/took damage.
Compy can boost the power of a critter? Byebye mana.
And so on and so forth.