[CODE] Match, Gauntlet, & AI Test modes

All code submission.
holgern
Posts: 65
Joined: Sat Feb 02, 2013 4:50 pm

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

Post by holgern »

So, great news the best version of the tournament mode is now available :).
We are now in a beta state, i will not add new features from now on. Only bug fixing and polishing of the code, so please help me with testing. The credits has to be changed, i need some feedback for this.

Changelog:
* separate tournaments.dat files for player and demo mode
* double knockout tournament with stage filling. You decide how many stages you want to play. It is possible to add only normal or hard decks.
* knockout tournament has also stage filling.
* Round robin tournament: you can add random decks with hard or normal difficulty
* scoretable: it is clearer now how many opponents are left and how many games left
*ai vs ai matches are now performed after each human-ai deck game. E.g. for round robin (1 is the human 2-5 ai decks). at first 1-2, then 1-3, 2-3, 1-4, 2-4, 3-4,1-5, 2-5,3-5,4-5. The same is true for knockout and double knockout.

I hope you like the changes.
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.]

Atriel
Posts: 257
Joined: Wed Dec 22, 2010 8:17 pm
Location: Spain

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

Post by Atriel »

holgern wrote:So, great news the best version of the tournament mode is now available :).
We are now in a beta state, i will not add new features from now on. Only bug fixing and polishing of the code, so please help me with testing. The credits has to be changed, i need some feedback for this.

Changelog:
* separate tournaments.dat files for player and demo mode
* double knockout tournament with stage filling. You decide how many stages you want to play. It is possible to add only normal or hard decks.
* knockout tournament has also stage filling.
* Round robin tournament: you can add random decks with hard or normal difficulty
* scoretable: it is clearer now how many opponents are left and how many games left
*ai vs ai matches are now performed after each human-ai deck game. E.g. for round robin (1 is the human 2-5 ai decks). at first 1-2, then 1-3, 2-3, 1-4, 2-4, 3-4,1-5, 2-5,3-5,4-5. The same is true for knockout and double knockout.

I hope you like the changes.
Yeah! You're impressive!. :mrgreen:
Atriel
goojamin
Posts: 115
Joined: Wed Jul 28, 2010 2:54 pm

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

Post by goojamin »

So, great news the best version of the tournament mode is now available .
We are now in a beta state, i will not add new features from now on. Only bug fixing and polishing of the code, so please help me with testing. The credits has to be changed, i need some feedback for this.

Changelog:
* separate tournaments.dat files for player and demo mode
* double knockout tournament with stage filling. You decide how many stages you want to play. It is possible to add only normal or hard decks.
* knockout tournament has also stage filling.
* Round robin tournament: you can add random decks with hard or normal difficulty
* scoretable: it is clearer now how many opponents are left and how many games left
*ai vs ai matches are now performed after each human-ai deck game. E.g. for round robin (1 is the human 2-5 ai decks). at first 1-2, then 1-3, 2-3, 1-4, 2-4, 3-4,1-5, 2-5,3-5,4-5. The same is true for knockout and double knockout.

I hope you like the changes.
I've compiled this for PSP and played a best of 3 so far with no issues and this is pretty awesome!! I'm going to have some fun testing the rest of the modes, thanks for doing this!
Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

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

Post by Zethfox »

the next step is to work on fixing these memleaks in this. I'll do my best to try and point them out but currently memleaks prevent us from watching a ai vs ai ko and gaunlet torney from start to finish. after about 20 games the game freezes from the memleaks.

other than that everything is looking great on this.
holgern
Posts: 65
Joined: Sat Feb 02, 2013 4:50 pm

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

Post by holgern »

I found one bug. The game->render() function shoule only be called until the game is finished.

In Line 1007 in gamestatedual.cpp i replaced
if (game) game->Render();
by
if (game && !game->didWin())
game->Render();


I hope this fixes the crashes after a game was finished.
Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

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

Post by Zethfox »

I wasn't witnessing crashes, these are freezes that happen after about 30 matches, they stem from deck manager, as if tournament mode is trying to open deck menu when it's finished a match when in tourney mode we just go right on to next match.
holgern
Posts: 65
Joined: Sat Feb 02, 2013 4:50 pm

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

Post by holgern »

Ok, i see what you mean. I added a state DUEL_STATE_MENU_TO_SCORE, which delete the in game menu propperly when showing the score.

I added also a DUEL_STATE_CHOOSE_DECK1_TO_PLAY, which deletes the deckmenu, when using tournamentmodes like KO in ai vs AI matches.

A new deckMenu is now only created if no tournament is running. After leaving, the deckMenu is properly deleted now.

Now, the menu, deckMenu and the oppentmenu is deleted after each usage.

All modes including 2 player mode should work now.

One idea:
The 2 player mode would be perfect for AI vs AI duels, as both decks could be seen and different AI-programm versions could be tested. But it first i will finish this tournament mode, i promise :).
But if this is finish, such ai vs ai over network could be great. I thing a tournament mode for network would also be nice.
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 »

for right now though lets focus on actual ingame items, network support is not fully implemented yet. while making sure your modes work in there is important. we currently have no eta on a network mode, even though you have seen it and played with it a bit it's not actually complete. for example you can't play on 2 different devices yet, both games have to be on the same device.

im very happy with the way torney mode is panning out for the first draft so far. :)
Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

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

Post by Zethfox »

couple things.
gamestateduel.cpp
line 1744
add
if(game)

found a bug.
select "demo"--->best of 3--->gauntlet-->dont select anything, hit the esc key/cancel button. game stalls.
doing
classic--->single game--->select your deck--->cancel

shows us that the deckmenu was deleted before we were finished with it.
lets instead delete deckmenu inbetween matchs rather then in the new places
holgern
Posts: 65
Joined: Sat Feb 02, 2013 4:50 pm

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

Post by holgern »

You are right. deckmenu is now deleted between matches. I polished the code a little bit. I think the code is almost ready for svn.
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.]

Locked