It is currently 19 Apr 2024, 10:28
   
Text Size

Crowdsourcing Project Firemind Duels

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

Crowdsourcing Project Firemind Duels

Postby mike » 20 Aug 2014, 12:38

I was thinking about ways to increase the number of duels that could be processed on firemind.ch and one idea that seems very promising is to crowd-source the queue worker.

Now I could distribute this as a standalone fork of Magarena but it would be a lot more convenient if it was already shipped as a part of every Magarena release.

So what I'm asking here is: Can I develop and distribute this as part of the main Magarena code?

What I have in mind is a menu item called something like "Run Firemind Queue Worker" that every user could run if they wanted to speed up the queue processing or just help out in general. The first time the user has to enter an access token that is generated for every firemind.ch account that allows me to identify the source of the duel results. In a later step I'd like to add benefits for users who process a lot of duels (and for those who submit card scripts).

An additional benefit of this would be that errors that are encountered are also logged to firemind.ch which will help detect errors that happen only in some edge cases and might not even be reportable by users.

What do you guys think about this idea? Would it make sense to ship it as part of magarena?
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 » 20 Aug 2014, 20:47

To me that sounds like a really cool idea.

Being able to detect errors that might normally be missed would be a great addition, as well as being able to help firemind process more duels. Having it a part of the main code makes perfect sense. I'd give this a thumbs up for more integration :)

I've also been intrigued as to how many users there are of Magarena.
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 Lodici » 20 Aug 2014, 21:33

Interesting. I would suggest creating a Firemind@home screen (just like SETI@home only less Space and stars!) accessible from the settings menu. You can then add whatever is needed to sign up and configure an account. I think someone who signs up to this would not want to manually start it each time but instead have it automatically run in the background on starting Magarena. I also think that it should have no impact on the core gameplay or general responsiveness and probably should only run as a very low priority background task and should not run at all during a duel when the AI has dibs on cpu cycles. Finally, for people to sign up there has to be a clear and compelling reason to do so, so those benefits you mentioned should be elucidated sooner rather than later.
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 » 20 Aug 2014, 22:45

Thanks for your feedback Lodici

I think someone who signs up to this would not want to manually start it each time but instead have it automatically run in the background on starting Magarena. I also think that it should have no impact on the core gameplay or general responsiveness and probably should only run as a very low priority background task and should not run at all during a duel when the AI has dibs on cpu cycles.
I fully agree with this. I imagine the task can be paused for as long as the AI is making decisions and resumed whenever the resources become available again.

Finally, for people to sign up there has to be a clear and compelling reason to do so, so those benefits you mentioned should be elucidated sooner rather than later.
You're right. I simply haven't had the time to fully work out the ideas I'm having about rewarding users. Since I want to be as transparent as possible here is what I had in mind:
* Add badges for certain milestones in number of processed duels to profile page
* Increasing the limit on duels in the "official" queue for that user
* Unlocking computationally heavy features like
** "Find deck which is similar but stronger against archetype X"
** "Get notified if a deck arises which has a higher than X win percentage against deck Y"
** "Calculate match-ups with the use of sideboards"

I'm also looking into running a bot for MTGO for which I could give contributors credits to buy cards with.

I guess the api for the queue worker could also favour duels created by the user running it so the simplest benefit would be that one gets their results faster.
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 Huggybaby » 22 Aug 2014, 13:52

Do it do it do it!

A score and ranking on a leaderboard is sufficient reward.
User avatar
Huggybaby
Administrator
 
Posts: 3205
Joined: 15 Jan 2006, 19:44
Location: Finally out of Atlanta
Has thanked: 696 times
Been thanked: 594 times

Re: Crowdsourcing Project Firemind Duels

Postby mike » 03 Sep 2014, 21:32

I now have a clone of magarena with the changes I described at https://code.google.com/r/projectfiremi ... dsourcing/

If anyone would be so kind as to review the code and tell me what I need to change/add to make it viable for inclusion in Magarena I'd be very grateful.

Here is a quick description of how it works:

It builds on the DeckStrCal code and fetches the data for every duel when popping it from the Project Firemind queue. It then posts the result of every game to Firemind and once the last result is posted Firemind will set the duel to finished. If a duel doesn't complete in time (because the worker that popped it from the queue was shut down prematurely for example) it is reset and simply readded to the queue and someone else can pick it up.

I implemented it in the same way the image downloader works and added it as a settings option just beneath it.

It uses the GeneralConfig interface to store the api key when one is entered.

The thread priority is set to the minimum to ensure it doesn't impact the playing experience (and as far as I could test it one can't tell the difference between the worker running or not).

I added the json jar to build.xml which I need to interface with the firemind api.

Feedback is greatly appreciated.
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 » 04 Sep 2014, 04:58

I had a quick look at the code in your repository and it appears to be pretty much self contained. Since it has to be manually initiated via the new settings menu option I would say merge it into the main repo so that you have the rest of the September development cycle to get people testing it - if you don't feel ready to release at the end of the month you can simply hide the menu option.
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 melvin » 04 Sep 2014, 05:42

mike wrote:I now have a clone of magarena with the changes I described at https://code.google.com/r/projectfiremi ... dsourcing/
Lodici wrote:I had a quick look at the code in your repository and it appears to be pretty much self contained.
Thanks for the quick review and recommendation, Lodici. Thanks to mike for contributing this feature. I've merged the changes into the main repo and adjusted the files to match our conventions (spaces instead of tabs, unix line endings etc), you should update your clone with the merged version.
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: Crowdsourcing Project Firemind Duels

Postby ShawnieBoy » 04 Sep 2014, 15:55

Well, I'm already giving it a test :)

I've not delved too deep into the code, just a query if there would be issues if the user was using a different/dev version of the Magarena client than is currently on Firemind? ie. cards available, card scripting/groovy changes?


edit-I have noticed that searching for cards does take a fair bit longer while it's running, and I have a fairly beefy cpu (Hex-core)

edit - hehe, but not fueled by black mana...
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 » 04 Sep 2014, 21:52

I've not delved too deep into the code, just a query if there would be issues if the user was using a different/dev version of the Magarena client than is currently on Firemind? ie. cards available, card scripting/groovy changes?
Currently I'm storing the magarena version with which a duel was calculated so in theory if I wanted to get rid of bad results I could filter them out by that. The issue with the client not being able to handle the new magarena cards hadn't occurred to me up until now to be honest. After considering it I feel the only way is to add an api call to the client that verifies that it is using the latest version and if that is not the case to inform the user that it can't run on an outdated release.

I will add this asap.

edit-I have noticed that searching for cards does take a fair bit longer while it's running, and I have a fairly beefy cpu (Hex-core)
Thanks for testing it and providing feedback. I will see what I can do to make it less impactful on features like the card search. I'm not really a java/desktop guy though so if someone could point me in the right direction I'd appreciate it ;)
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 mike » 07 Sep 2014, 16:27

I added the described version check and updated the clone.
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 melvin » 08 Sep 2014, 02:05

Thanks, mike. I've merged your update into the main repo.
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: Crowdsourcing Project Firemind Duels

Postby ShawnieBoy » 10 Sep 2014, 15:51

The version check code looks good, but I'm getting a 'Version is outdated' while running 1.54 (Both normally and in Dev Mode)
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 Sep 2014, 16:49

Just tested it and it should run fine in prod mode. It does require a valid authentication token though so if it is incorrect you'll get the "Outdated" message because anything failing while requesting the version leads to a return false in the check method.

While testing it I noticed that the generate access token method redirected to a 404 page (while still generating the token). This is fixed 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 Sep 2014, 17:14

Oops, unable to sign in to firemind with Google, error 400

Was just wanting to check that the worker code hasn't changed, as I'm still getting the outdated message
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Next

Return to Magarena

Who is online

Users browsing this forum: No registered users and 31 guests


Who is online

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

Login Form