It is currently 19 Apr 2024, 19:25
   
Text Size

Crowdsourcing Project Firemind Duels

Moderators: ubeefx, beholder, melvin, ShawnieBoy, Lodici, CCGHQ Admins

Re: Crowdsourcing Project Firemind Duels

Postby PalladiaMors » 10 Oct 2014, 22:09

You shouldn't be able to change the AI since it is hard-coded. How do you figure Firemind switched to MiniMax?
I saw the name MiniMax in some game logs that were hosted through my worker and thought that meant it was the AI being used in those games. I was so under this delusion that, while studying the logs, I thought I had noticed significant changes in its playstyle :shock:
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: Crowdsourcing Project Firemind Duels

Postby mike » 10 Oct 2014, 22:15

At some point Magarena changed the logging function in a way that lead to all the logs being written to the same file. This means that if you play a game while the worker is running it will write both games to the same log. This would explain the wrong AI showing up in the logs.

I put this on my issue list now.
User avatar
mike
Programmer
 
Posts: 128
Joined: 05 Jul 2013, 17:00
Has thanked: 0 time
Been thanked: 29 times

Re: Crowdsourcing Project Firemind Duels

Postby ShawnieBoy » 10 Oct 2014, 22:43

mike wrote:At some point Magarena changed the logging function in a way that lead to all the logs being written to the same file. This means that if you play a game while the worker is running it will write both games to the same log. This would explain the wrong AI showing up in the logs.

I put this on my issue list now.
I'm fairly sure that the queue-worker doesn't set the names of the AI players in AI vs AI, so the names of the Player and the last AI opponent are used instead.
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Crowdsourcing Project Firemind Duels

Postby mike » 10 Oct 2014, 22:50

You're right, I'll add that too.
User avatar
mike
Programmer
 
Posts: 128
Joined: 05 Jul 2013, 17:00
Has thanked: 0 time
Been thanked: 29 times

Re: Crowdsourcing Project Firemind Duels

Postby ShawnieBoy » 10 Oct 2014, 22:55

While you're there, CardDefinitions.loadCardDefinitions() doesn't need to be launched again, as it's already been run when Magarena is opened. ;)

Runs much smoother now :)
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Crowdsourcing Project Firemind Duels

Postby PalladiaMors » 10 Oct 2014, 23:04

By the way, I don't know if this is relevant, but I'm 100% positive that I didn't play any games while hosting. And I was trying to change the AI through the 'new duel' menu, which also allowed me to change the Player's name. Oh yeah and my average game length was about 21 minutes if I recall it right, lol, as opposed to about 1 minute when Mike hosts. I guess my Intel Core2 Duo E7500 2.93 GHz is a bit outdated now...
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: Crowdsourcing Project Firemind Duels

Postby mike » 10 Oct 2014, 23:14

While you're there, CardDefinitions.loadCardDefinitions() doesn't need to be launched again, as it's already been run when Magarena is opened. 
Unfortunately it's not that simple because I run the worker headless on a server which means Magarena is never initialized there. Looking at the method it is probably not even necessary to load all the cards in the worker, it only needs the load the 2 decks before running a duel. This should save a lot of memory too.

By the way, I don't know if this is relevant, but I'm 100% positive that I didn't play any games while hosting. And I was trying to change the AI through the 'new duel' menu, which also allowed me to change the Player's name.
Not sure what to make of this but thanks for clarifying, I'll try to reproduce it.

Oh yeah and my average game length was about 21 minutes if I recall it right, lol, as opposed to about 1 minute when Mike hosts. I guess my Intel Core2 Duo E7500 2.93 GHz is a bit outdated now...
My 4 workers share 6 cores and 8 gigs of ram between each other (while running on raid10 SSDs). Not surprising that it takes a little longer on desktop clients. It would be interesting to see where the bottleneck is and figure out if that could be optimized. If only I could get firemind.ch into a satisfying state already I'd have the time to work on this...
User avatar
mike
Programmer
 
Posts: 128
Joined: 05 Jul 2013, 17:00
Has thanked: 0 time
Been thanked: 29 times

Re: Crowdsourcing Project Firemind Duels

Postby ShawnieBoy » 10 Oct 2014, 23:18

mike wrote:
While you're there, CardDefinitions.loadCardDefinitions() doesn't need to be launched again, as it's already been run when Magarena is opened. 
Unfortunately it's not that simple because I run the worker headless on a server which means Magarena is never initialized there. Looking at the method it is probably not even necessary to load all the cards in the worker, it only needs the load the 2 decks before running a duel. This should save a lot of memory too.
Ahh I see, but the worker will only be launched from within Magarena for users - Loading all the cards twice would be using up memory - even loading the cards from decks twice would eventually mount up.

Maybe a server-side and client-side version...
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Crowdsourcing Project Firemind Duels

Postby mike » 10 Oct 2014, 23:29

Looking at the code in CardDefinitions#addDefinition it seems to store them in a Map with the card name as a key. This means no card should get initialized twice (no change in memory consumption). It will cause quite a bit of disk reads so it should still be prevented.

I think splitting it into a server and client side version is a rather drastic approach especially considering that they should always be behaving the same to ensure consistency of the results.

I'll try if it's possible to load only the cards that are needed for the firemind worker, if that's somehow not possible I'll make sure the worker checks weather Magarena has already loaded the cards before trying to initialize them.
User avatar
mike
Programmer
 
Posts: 128
Joined: 05 Jul 2013, 17:00
Has thanked: 0 time
Been thanked: 29 times

Re: Crowdsourcing Project Firemind Duels

Postby Lodici » 11 Oct 2014, 14:51

Are you not essentially doing the same thing as the Deck Strength calculator - never used it myself but you might want to take a look at DeckStrengthViewer.CalculateThread().
Attachments
2014-10-11_154327.jpg
User avatar
Lodici
Programmer
 
Posts: 399
Joined: 13 Oct 2013, 09:44
Has thanked: 29 times
Been thanked: 71 times

Re: Crowdsourcing Project Firemind Duels

Postby mike » 12 Oct 2014, 17:01

Are you not essentially doing the same thing as the Deck Strength calculator - never used it myself but you might want to take a look at DeckStrengthViewer.CalculateThread().
It does something similar. I actually started it with the code from DeckStrCal.java which had a lot of the functionality I was looking for.

The Player names are now fixed to Player1 and Player2. The cards are also initialized dynamically (only what is in the deck list from the beginning and required cards on demand with slight changes to the CardDefinitions and TokenCardDefinitions classes). This significantly reduces the memory footprint on the server and disk IO wherever it is run.
I pushed a new version to https://code.google.com/r/projectfiremi ... wdsourcing
User avatar
mike
Programmer
 
Posts: 128
Joined: 05 Jul 2013, 17:00
Has thanked: 0 time
Been thanked: 29 times

Previous

Return to Magarena

Who is online

Users browsing this forum: No registered users and 41 guests


Who is online

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

Login Form