It is currently 24 Apr 2024, 23:29
   
Text Size

[greatly improved/closed]AddCard error:No more room in cd

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

[greatly improved/closed]AddCard error:No more room in cd

Postby HarlequinCasts » 27 Sep 2013, 23:10

Describe the Bug:
Only recently (OoAv1) noticed this error whenever I go a little too deep with storm and/or graveyard recursion with Past in Flames

Error screenshot attached. "AddCard error: No more room in cd to add card" followed by 4 or so memory location type errors I did not screen shot. I believe I was either finishing casting the rest of my Dark Rituals with Past in Flames, or I had just cast Infernal Tutor from the graveyard.

You can reproduce the error with the save game, but you'll need to go deep and storm into hellbent Infernal Tutor for Past in Flames etc etc.

Which card did behave improperly ?
Storm? Possibly Past in Flames

Which update are you using?(date,name)Which type(Duel,Gauntlet,Sealed Deck)
OoAv1

What exactly should be the correct behavior/interaction ?
No error

Are any other cards possibly affected by this bug ?
NA
Attachments
manalink storm.png
storm issue.zip
(2.85 KiB) Downloaded 173 times
Last edited by Aswan jaguar on 11 Apr 2014, 14:31, edited 4 times in total.
Reason: greatly improved/closed
User avatar
HarlequinCasts
 
Posts: 922
Joined: 07 May 2013, 14:33
Has thanked: 68 times
Been thanked: 30 times

Re: AddCard error: No more room in cd to add card (Storm?)

Postby thanatos01 » 30 Sep 2013, 21:59

I'm getting that error too, but in a dredge deck, so maybe there is something wrong with the memory that is tracking up information for this kind of combos.
thanatos01
 
Posts: 7
Joined: 04 Oct 2011, 06:29
Has thanked: 1 time
Been thanked: 0 time

Re: AddCard error: No more room in cd to add card (Storm?)

Postby HarlequinCasts » 01 Oct 2013, 00:36

thanatos01 wrote:I'm getting that error too, but in a dredge deck, so maybe there is something wrong with the memory that is tracking up information for this kind of combos.
Yeah I've since seen this exact error in a bunch of situations, including a Small Pox deck that does a lot of land cycling and Life from the Loam ing. It seems like the commonality is just an excess of overly complicated turns with a lot of cards involved.
User avatar
HarlequinCasts
 
Posts: 922
Joined: 07 May 2013, 14:33
Has thanked: 68 times
Been thanked: 30 times

Re: AddCard error: No more room in cd to add card (Storm?)

Postby Korath » 20 Oct 2013, 12:29

It's a 150 card per player limit, including cards in hand, cards on the stack, cards in play, effect cards in play, and effect cards on the stack. A new slot doesn't get used up when a card goes from in-hand to on-stack, or on-stack to in-play; but activating a permanent will use one, and so will all of the orange damage and effect cards that attach to permanents.

Most of the problem is that, even when a card or effect is destroyed, its slot isn't available for reuse immediately. This is generally a good thing; it means we don't have to constantly worry about whether the card we're writing data to has been destroyed and is now being used for an entirely different card. Slots only get recycled at the start of each turn. (A card's marked as no-longer-in-use by setting internal_card_id to -1; the slot's marked as reusable by setting original_internal_card_id to -1. The former happens whenever a card leaves play; the latter only in sub_479840(), which is called only by sub_43A370() "Entering Init Turn". The purpose of sub_437400(), which is only called immediately after sub_479840(), is less clear; it may or may not be related.)

There isn't going to be anything we'll be able to do about a battlefield with 30 Bridge from Below zombies each with four Flame-Kin Zealot effect cards attached. Increasing the limit's a major, major undertaking; not as big as the 2000-card limit, but of the same order of magnitude.

We may be able to cut down on the number of cards created, though.

One extreme way would be to only ever have one "This card gets +x/-y and gains a,b,c abilities and loses d,e,f abilites until end of turn" effect card attached to a given permanent. That'd lose genuinely useful data, though - you'd just see that your zombie token has +4/+4 and haste until end of turn from something, not that it's from four FKZs entering the battlefield.

I strongly suspect a significant chunk is checking whether cards in your graveyard could be activated - every time each needs to be checked, the Rules Engine card creates the card, sends it an EVENT_GRAVEYARD_ABILITY, and obliterates it. Since the Rules Engine stops checking as soon as it finds an activateable card (unless you click Rules Engine for a menu), it's not surprising that we're getting more AddCard errors in OoA - this is the first version where sorceries are illegal to flashback except at sorcery speed.

You can generate AddCard errors pretty much at will by putting a handful of flashback cards in your graveyard, getting enough mana so they all appear on the Rules Engine menu, and then clicking on Rules Engine and cancelling a couple times. Ten copies of Chainer's Edict in my graveyard with {5} {B} {B} available and an otherwise empty battlefield is enough that I can't click Rules Engine and cancel four times, nor get all the way through an AI turn. It's... probably... safe to immediately flag the temporary card as reusable instead of just obliterating it normally, which fixes the AddCard errors from this.

Calling sub_479840() more often - say, at the end of each phase, or whenever the stack becomes empty - may or may not be helpful, and may or may not be practical.

First step should probably be to put some logging into our wrapper for add_card_to_hand() to see what's calling it the most, at least from C.
User avatar
Korath
DEVELOPER
 
Posts: 3707
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1106 times

Re: AddCard error: No more room in cd to add card (Storm?)

Postby Aswan jaguar » 20 Oct 2013, 13:13

increasing the limit's a major, major undertaking; not as big as the 2000-card limit, but of the same order of magnitude.
I am afraid that this solution (the best obviously)is totally up to you and Gargaroz (and to any other coder may pop up-not very likely.The rest of us helped Mok and Gargaroz to break the 2000-limit,(Snacko also was there to contribute with best coding practices) helping to make a new csv and any non coding stuff we were asked but I don't see how we could be of any help with this,unfortunately.

I have seen a lot of those errors "AddCard error: No more room in cd to add card" over the years ,more frequently with new patch.There was 1 case that was very strange as it was on the beginning of the game and AI and me had not played anything but 1 land only or something like that and graveyards were empty,too.If I have something like that again I will try to save or take a screenshot.

EDIT:
this is the first version where sorceries are illegal to flashback except at sorcery speed.
If it comes to cutting down, I don't mind not checking if sorceries are illegal to flashback except at sorcery speed.For human you control to cheat or not as for AI I don't mind if AI will benefit from cheating.
Last edited by Aswan jaguar on 20 Oct 2013, 13:19, edited 1 time in total.
Reason: EDIT
---
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: AddCard error: No more room in cd to add card (Storm?)

Postby RanDomino » 20 Oct 2013, 16:05

Korath wrote:(words)
I love you.
RanDomino
 
Posts: 290
Joined: 21 Mar 2010, 22:26
Has thanked: 20 times
Been thanked: 13 times

Re: AddCard error: No more room in cd to add card (Storm?)

Postby Korath » 28 Oct 2013, 15:02

Graveyard abilities release their slot as of 20cb7bb, so the situation should be improved next patch.
User avatar
Korath
DEVELOPER
 
Posts: 3707
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1106 times

Re: [improved]AddCard error:No more room in cd to add card

Postby BAgate » 25 Nov 2013, 23:15

New patch has been released, so anyone have any new info?
Working on: housekeeping and archived reports
User avatar
BAgate
Tester
 
Posts: 2444
Joined: 06 Mar 2012, 11:09
Has thanked: 117 times
Been thanked: 158 times


Return to Archived Reports

Who is online

Users browsing this forum: No registered users and 49 guests


Who is online

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

Login Form