[CODE] Match, Gauntlet, & AI Test modes

All code submission.
Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: [CODE] Match, Gauntlet, & AI Test modes

Post by Zethfox »

case DUEL_MENU_CHOOSE_DECK:

if (controlId == MENUITEM_RANDOM_PLAYER) // Random Player Deck Selection
{
if (mParent->players[0] == PLAYER_TYPE_HUMAN)
deckmenu->selectRandomDeck(false);
else
deckmenu->selectRandomDeck(true);
tournament->addDeck(0,deckmenu->getSelectedDeckId(),mParent->players[0]);
game->loadPlayer(0, mParent->players[0], deckmenu->getSelectedDeckId(), premadeDeck);
if (deckmenu) deckmenu->Close();
ConstructOpponentMenu();
setGamePhase(DUEL_STATE_CHOOSE_DECK2_TO_PLAY);
break;
}

add the red.
Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: [CODE] Match, Gauntlet, & AI Test modes

Post by Zethfox »

can i get an update holgern, talks about a release are in the works, this change will be in the next release.
I've already talked to wololo about granting you svn access after this is in the svn and beta tested. just need to know if you are ready.
holgern
Posts: 65
Joined: Sat Feb 02, 2013 4:50 pm

Re: [CODE] Match, Gauntlet, & AI Test modes

Post by holgern »

Ok here is a new update:
* i added ConstructOpponentMenu(); This fixed the random player deck bug
* I found a other source of memory leakage (cnogmenu was not deleted after continuing a tournament)
* The decknames are loaded and displayed now, after continuing a tournament

We can remove the fast mode for the next release. Until then the fast mode has to be expected as buggy. But there is a small change, that the bugs in the code are found and corrected. I will take a look, but the code is very hard to understand, as there are so many classes. The main reason for crashing is here: assert(!ae || !currentWaitingAction); (ActionLayer.cpp line 208).
Attachments

[The extension zip has been deactivated and can no longer be displayed.]

[The extension zip has been deactivated and can no longer be displayed.]

Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: [CODE] Match, Gauntlet, & AI Test modes

Post by Zethfox »

That is most likely a card with a targeted combat trigger. one of the decks you use has. Im going to commit this update to svn and get it started for beta testing.
holgern
Posts: 65
Joined: Sat Feb 02, 2013 4:50 pm

Re: [CODE] Match, Gauntlet, & AI Test modes

Post by holgern »

After some testing with 451 AI - Decks, i think there are some critical bugs regarding ai vs ai games. Using normal speed, the game is also crashing a lot. I think it does not depend on the speed.

Using fast mode a critical game situation apears faster then in normal speed, thats all.
Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: [CODE] Match, Gauntlet, & AI Test modes

Post by Zethfox »

The speed causes race conditions not crashes. 2 totally different kinds of bugs.
Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: [CODE] Match, Gauntlet, & AI Test modes

Post by Zethfox »

Zip the 400 decks and send it to me omegablast2002@gmail.com
Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: [CODE] Match, Gauntlet, & AI Test modes

Post by Zethfox »

im commiting it with fast timer mode for ai vs ai, even though im against that change. with one exception, if the ai's opponent is human the fast mode is set to false so that it doesn't carry over into unwanted modes.

it's in the SVN now, before contenueing any more debugging please revert to base, then reupdate to current. i removed some dead code that was commented out, any changes you make now will create conflicts unless you do a revert of the src and include folders before continuing.
it was just the single line commented out code where im sure you just meant to delete it but forgot.
holgern
Posts: 65
Joined: Sat Feb 02, 2013 4:50 pm

Re: [CODE] Match, Gauntlet, & AI Test modes

Post by holgern »

Thank you for submitting my code to svn!


Here are 4 decks for testing the ai vs ai matches in normal speed.

Deck1 vs deck2 crashes the game in this point of the code if (!tc->alreadyHasTarget(target) && tc->canTarget(target) && potentialTargets.size() < 50) (AIPlayerBaka.cpp line 1530)

Deck3 vs Deck4 generateds a entless loop with:
Should I play Joraga Treespeaker?
shouldPlayPercentage = 90

Should I play Elvish Archdruid?
shouldPlayPercentage = 90

Should I play Gilt-Leaf Archdruid?
shouldPlayPercentage = 60

AI wants to play card.
- Next card to play: Gilt-Leaf Archdruid


AIPlayerBaka: AI attempting to pay a mana cost.
- Target: Gilt-Leaf Archdruid
- Cost: {3}{g}{g}

and so on...

Deck 5 vs Deck 6 crashes the game at the same place in code as above. Sign in Blood is responsible for this.
Attachments

[The extension zip has been deactivated and can no longer be displayed.]

Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: [CODE] Match, Gauntlet, & AI Test modes

Post by Zethfox »

That crash is nothing new as I mentioned earlier. hopefully sign in blood can give us a 100 percent repro.
Locked