It is currently 25 Apr 2024, 21:13
   
Text Size

[leave as is]Card targeted from graveyard-not shown in stack

Report wrong Card behavior to get it fixed.
PLEASE ADD SAVEGAMES TO YOUR TOPIC !

Moderators: BAgate, drool66, Aswan jaguar, gmzombie, stassy, CCGHQ Admins

[leave as is]Card targeted from graveyard-not shown in stack

Postby Aswan jaguar » 16 Dec 2016, 15:29

Describe the Bug:
A card targeted or chosen from a graveyard isn't shown in stack but we either see the player whose graveyard we selected a card from or nothing.
Also there is no consistency.
Beckon Apparition shows the player whose card was exiled.
While Headstone shows nothing.
This way when you decide to counter or not an Animate Dead for instance you don't know what AI has chosen.
EDIT:As I remembered and tested to be sure this worked fine at least in Manalink2.0.

Which card did behave improperly?
Cards that target or choose cards from graveyard.

Which update are you using? (date, name)Which type? (duel, gauntlet, sealed deck)
Manalink 2016/08/27: Eldritch Moon v2, duel

What exactly should be the correct behavior/interaction?
A targeted or chosen card from graveyard is displayed in stack window so we get to know which this card is.

Are any other cards possibly affected by this bug?
-
Attachments
2016-12-16_180639.jpg
not in stack.rar
(1.95 KiB) Downloaded 136 times
Last edited by Aswan jaguar on 29 Jul 2019, 13:20, edited 6 times in total.
Reason: confirmed bug by BAgate-leave it as it is by me
---
Trying to squash some bugs and playtesting.
User avatar
Aswan jaguar
Super Tester Elite
 
Posts: 8078
Joined: 13 May 2010, 12:17
Has thanked: 730 times
Been thanked: 458 times

Re: Card targeted from graveyard-target not shown in stack

Postby Korath » 16 Dec 2016, 20:25

The old version didn't actually ever target a card in a graveyard. It at most targeted a player. Either the specific card was chosen at resolution (most cards written by early modders, and most cards with more than one card chosen); the card was chosen at announcement, but also removed from the graveyard then, and then re-created at resolution (most cards written by MicroProse); or the card was chosen at announcement, but only its location in the graveyard stored, so if any other effect changed the order of cards in the graveyard or removed any card that was below it, the spell failed even though the chosen card was still there (most cards written by late modders). It's more important that these cards actually work right than that they appear to work right, so going back to the old versions of them isn't an option. And plenty of cards, such as Beckon Apparition like you mention, still use one of the former methods and so need to be updated.

The current method returns information about the chosen card in either one or two target slots. If the targeting card is known only to ever be able to pick cards in a specific player's graveyard (like Nyx Weaver; and currently like Regrowth, but only because Manalink doesn't have any cards like AEthersnatch and doesn't let you decline to pick new targets with cards like Fork), then it only uses one slot, and stores the card's current position in the target's player field and a unique id generated for each card as it's put into a graveyard (see comments at start of src/functions/deck.c) in the target's card field. If at resolution, the card isn't at its current position anymore, the whole graveyard is searched for the unique id in target.card, but that's a lot slower and in most cases doesn't happen (which is why the current position is stored too).

If a card can target cards in either player's graveyard, another target slot is used to store whose graveyard it is. This is actually redundant - the id in the first target's card field is still enough to find the card - but it's at least as convenient as having the also-redundant position stored in the first target's player field.

Whether the modern cards are using one or two slots to store the targeting data, they deliberately don't make them visible as targets. The display routines, cards that trigger on things being chosen as targets, and things that can only target things being targeted by other things (like Rebuff the Wicked) rely on targeting data only storing players and the indices of cards on the battlefield/in players' hands/on the stack, not other apparently-random data. None of these work right for cards like Beckon Apparition that incorrectly target players, either. If Beckon Apparition does show the player whose graveyard is chosen on the stack - it doesn't in dev, at least not for me - then I bet you anything that, if you try to exile your own creature with it, you can counter it with Dawn Charm or Hindering Light.

Couple things need to be done to get this working right:
  • Update all the cards using one of the old methods. Good luck with that.
  • Make it so you only ever need one targeting slot to represent a card in a graveyard. Not difficult, even while continuing to store the position data - you've got 32 bits to work with in the target.player field, and graveyards can't store more than 500 cards anyway. Nine bits is enough to store 512 different values, use a tenth to store whose graveyard it is, and you've still got 22 left over.
  • Make it so targeting slots representing either players or normal cards in player's hands/the stack/the bf, and targeting slots representing things that aren't (like graveyard targets), can be reliably and easily distinguished. The former always has either 0, 1, 2 or -1 in target.player, so it's enough to make sure that target.player==-1 still always means an invalid target, and otherwise to assign a couple higher bits to indicate a card in a graveyard, a card in exile, etc. In Shandalar, I use the same bits as for picking the zone during targeting, i.e. TARGET_ZONE_GRAVEYARD, TARGET_ZONE_EXILE, TARGET_ZONE_ANTE, etc.
  • Find everything that tries to interpret another card's targets (Rebuff the Wicked, Skulking Ghost, lots and lots of other things) and make sure they recognize the new targeting scheme, or at least don't incorrectly match against it. Again, good luck with that; finding them all in old code is a great deal tougher than planning ahead for something like this before you write them.
  • Change all the display routines to deal with the new targeting scheme correctly. Searching for TARGET_ZONE_GRAVEYARD in src/shandalar/ui.cpp will give you a list of the things that need patching. (Though note that both get_displayed_internal_card_id() and get_displayed_csvid() need to be patched in Manalink; I've got them combined in Shandalar.)
  • And only then can you start incrementing card_instance_t::number_of_targets so that they get displayed in the stack without the game crashing.
User avatar
Korath
DEVELOPER
 
Posts: 3707
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1106 times

Re: [conf]Card targeted from graveyard-target not shown in s

Postby Aswan jaguar » 17 Dec 2016, 06:58

Korath wrote: It's more important that these cards actually work right than that they appear to work right, so going back to the old versions of them isn't an option.
I totally agree with you that the correct functionality is the most important thing and by no means I was suggesting going back to what was happening before.I was just mentioning that the specific show card on stack if chosen or "targeted" (as mentioned on card's text not what actually was going on) was working correctly=showing on stack.
I remembered something was said about this in the past but searching for it in forum (in many different ways)didn't came up with anything.Maybe it was mentioned in a git.log.
---
Trying to squash some bugs and playtesting.
User avatar
Aswan jaguar
Super Tester Elite
 
Posts: 8078
Joined: 13 May 2010, 12:17
Has thanked: 730 times
Been thanked: 458 times


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 61 guests


Who is online

In total there are 61 users online :: 0 registered, 0 hidden and 61 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 61 guests

Login Form