Crowdsourcing Project Firemind Duels
by ubeefx
Moderators: ubeefx, beholder, melvin, ShawnieBoy, Lodici, CCGHQ Admins
Re: Crowdsourcing Project Firemind Duels
by PalladiaMors » 10 Oct 2014, 22:09
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 playstyleYou shouldn't be able to change the AI since it is hard-coded. How do you figure Firemind switched to MiniMax?
- PalladiaMors
- Posts: 343
- Joined: 12 Jul 2014, 17:40
- Has thanked: 36 times
- Been thanked: 22 times
Re: Crowdsourcing Project Firemind Duels
by 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.
I put this on my issue list now.
Re: Crowdsourcing Project Firemind Duels
by ShawnieBoy » 10 Oct 2014, 22:43
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.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.
-
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
by mike » 10 Oct 2014, 22:50
You're right, I'll add that too.
Re: Crowdsourcing Project Firemind Duels
by 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
Runs much smoother now
-
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
by 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
by mike » 10 Oct 2014, 23:14
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.While you're there, CardDefinitions.loadCardDefinitions() doesn't need to be launched again, as it's already been run when Magarena is opened. 
Not sure what to make of this but thanks for clarifying, I'll try to reproduce it.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.
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...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...
Re: Crowdsourcing Project Firemind Duels
by ShawnieBoy » 10 Oct 2014, 23:18
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.mike wrote: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.While you're there, CardDefinitions.loadCardDefinitions() doesn't need to be launched again, as it's already been run when Magarena is opened. 
Maybe a server-side and client-side version...
-
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
by 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.
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.
Re: Crowdsourcing Project Firemind Duels
by 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().
Re: Crowdsourcing Project Firemind Duels
by mike » 12 Oct 2014, 17:01
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.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().
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
41 posts
• Page 3 of 3 • 1, 2, 3
Who is online
Users browsing this forum: No registered users and 52 guests