It is currently 23 Apr 2024, 10:23
   
Text Size

AI as a Service

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

AI as a Service

Postby mike » 05 Jul 2013, 19:00

Update

The site is now live in beta at http://firemind.ch

Check it out and if you find the time please do provide feedback in this thread. I'm happy to take feature requests.

Some facts on features and limitations:

The site lets you upload decks as text in "3 Birds of Paradise"-format or from the .dec files that are distributed with Magarena. It also lets you download decks for use in Magarena.

For now decks can only be uploaded if they consist solely of cards available in Magarena. If you upload a deck that contains a card that is not yet available you get a link to request this card. If multiple users request the same card it gets up voted which helps us realize for which cards there is high demand.

A few seconds after uploading the deck the legal formats are calculated (a refresh is usually necessary). Duels can only be run for the formats the deck is legal in.

You can run duels against other people's public decks. You may also fork someone else's deck to tweak it. Every hour the top nine games for every format are calculated. The main page shows the top 5 games over all formats and the latest public duels.

Per user there is a limit of 55 games (or eleven 5-game duels) for the queue. More can be added once some of the duels have been processed. This (obviously) is to prevent individual users from clogging the queue.

Every game has the Magarena log attached in a more readable and interactive form. From here you can report mistakes made by the AI to help the software play your deck better.

If you are a contributor you can submit card scripts through the site which results in them being added to a clone of the official Magarena repo from which the devs can pull from.

That's the gist of it. I hope you'll enjoy matching your deck building skills against the top. If you've got any questions or suggestions please post them here.

End of update
--------------------




Hi! I'd like to get this community's opinion on an idea I've had.

Last week the hosting company I work for asked me to build a showcase server-system for our new VPS products. The deal was that I could use a state of the art setup of virtual servers free of charge for basically anything I wanted as long as it showcased the possibilities of a distributed system.

Being a fan of both MtG and AI programming I eventually came up with the idea of an online deck play testing service. It poses challenges in all the major areas of distributed systems and would be a perfect fit for a weekend project.

Looking for a suitable AI I ended up here. Many sources call Magarena the best AI available which makes it my first choice for the AI backend.

Last weekend I built a quick proof of concept implementation by wrapping the AI part of Magarena in a queue worker daemon. Here’s to the Magarena Devs! You maintain a very clean and nice to work with codebase that made coding this part a breeze.

I also threw a database and a web frontend together and have now a working prototype. Which is why I’m writing this. If I’m to follow through with my idea, there is a couple of questions I’d like the community or the Devs respectively to answer.

First and most importantly: Is there anyone interested in such a service? To elaborate a little on what I’m talking about: The Service would consist of a Website on which you could submit your decks. You then could simulate duels between two of those decks to see how they perform against each other. That’s the basics. There is of course potential for a lot of neat features.

Is this something the Magarena Devs would welcome or would even be interested in collaborating on? Some of the feature’s I’m planning to add are requesting missing cards from the deck uploader, reporting mistakes the AI made directly from a styled and more readable game log and submitting cards directly through the web interface and (assuming they pass the automated tests) automatic pull requests to the source repository. This could potentially bring a strong boost in user feedback and eventually in the quality of the AI. I would love to do this with a Magarena powered backend but I fully understand if the Devs wouldn't want their software to be used in such a manner. So I’m asking you: What is your take on this? Awesome idea you’d like to be part of? Interesting concept but you need to see more? Blatant abuse of your work? Or just a hopeless endeavor?

Lastly, if the answers to the two questions above were positive, what would be the core features you’d want this service to have? Here’s a few I've come up with so far. Feel free to criticize and add as you’d like.
  • Archetype Testing - Results against Archetype decks of a specific format
  • Requesting and Voting on Cards
  • Submitting Card Scripts, Automated Testing
  • List of Latest Public Duels
  • Browsing preprocessed Game Logs
  • Tracking of similar (public) Decks and their Duel Statistics

Well, I've already written a lot more than I intended to and I still left out a lot of things. I’m going to save them for questions (if there are any) and am hoping for some constructive feedback.

Oh, and does anybody know If I can use the HQ card scans found in this forum for such a project? I would host them publicly of course so anyone who wanted their client to have a source for the pics could point them to my servers.
Last edited by melvin on 08 Aug 2013, 01:36, edited 2 times in total.
Reason: change link
User avatar
mike
Programmer
 
Posts: 128
Joined: 05 Jul 2013, 17:00
Has thanked: 0 time
Been thanked: 29 times

Re: AI as a Service

Postby melvin » 06 Jul 2013, 01:55

Hi Mike,

Current maintainer of http://magarena.googlecode.com here. First of all, welcome to Magarena and many thanks for the compliments on the code base. Keeping the complexity down and making things intuitive in the code is a big part of this project, I'm glad to hear that it has paid off.

On the custom deck forum, I've mentioned before the wish to do a deck vs deck playoff using the AI. Given the number of custom decks we have this is certainly going to be a huge computational challenge, so this has been on the back burners for some time. Recently as part of AI evaluations, I've started on some AI vs AI benchmarking using my desktop, it works but it is fairly slow, going distributed is definitely the way to go to speed things up massively.

It would also be nice to discover which decks that the AI can play well, perhaps for future use in a challenge mode or something similar. The idea of "crowd sourcing" the finding of AI issues is also very appealing to me, currently we have a hard time replicating some of the issues mentioned as we are unable to replicate the exact game state that lead to the misplay.

Magarena as an M:TG AI research and testing framework has always been a personal goal of mine, and this project is one giant step in that direction. Feel free to let us know what you need to integrate with your system, drop us a note here or on our the mailing list, magarena@googlegroups.com

One caveat that I must bring up is that card support has never been our strong suit, and we deliberately avoid certain cards (e.g. those with multiple targets, such as Fireball) and make changes to the rules (e.g. our modified Planeswalker damage redirection, viewtopic.php?f=82&t=9655) to make the game more AI friendly. This means that deck testing on Magarena's engine may not exactly reflect real world performance. That said, we do prefer to move rules our closer to M:TG's if it does not negatively impact the AI's strength.

One question I have is, will this be an open source project?
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: AI as a Service

Postby Incantus » 06 Jul 2013, 04:41

Hi Mike,

While this sounds like a pretty awesome idea, if I was in your shoes I would probably check with your company's legal department. I doubt they would approve as an official product showcase a system that is certain to infringe on WotC's intellectual property.

Incantus
Incantus
DEVELOPER
 
Posts: 267
Joined: 29 May 2008, 15:53
Has thanked: 0 time
Been thanked: 3 times

Re: AI as a Service

Postby mike » 06 Jul 2013, 08:23

I'm aware of the trade-off between AI quality and card variety. Having a smart AI that provides actually useful results seems more important to me for now. Though I must admit that I do believe that most of the AI limitations can eventually be solved by either throwing more computational power at the problem or by adding more heuristics. Might be a silly idea but have you considered per deck heuristics to make for example "search your library" effects possible? e.g. Rampant Growth should be a no-brainer for most decks.

One question I have is, will this be an open source project?
Yes ... and no. The answer to that is a bit complicated and I haven't completely made up my mind yet.

First of all: All modifications and additions to the Magarena AI will be open sourced (and most likely be hosted on github). That includes the code to make it into a queue worker.

Independent parts of the front end like the log parser will be extracted into RubyGems and released as open source (MIT License). Once I get over some security concerns I might open source all of the front end application (this is the part I haven't made up my mind about).

All the application's dependencies are open source (MySQL, Redis, Ruby) so anyone could replicate the system if they choose so.

While this sounds like a pretty awesome idea, if I was in your shoes I would probably check with your company's legal department. I doubt they would approve as an official product showcase a system that is certain to infringe on WotC's intellectual property.
Thanks for the hint. I'll be sure to do so. Would you mind telling me which parts you think are a certain infringement? I understand that you can't host certain images like the mana symbols but I can't imagine that they'd have any legal claims to deck lists and game results (at least not in my country).
User avatar
mike
Programmer
 
Posts: 128
Joined: 05 Jul 2013, 17:00
Has thanked: 0 time
Been thanked: 29 times

Re: AI as a Service

Postby melvin » 07 Jul 2013, 00:56

mike wrote:Might be a silly idea but have you considered per deck heuristics to make for example "search your library" effects possible? e.g. Rampant Growth should be a no-brainer for most decks.
There was a discussion on the mailing list about tutor type effects, we generally believe that is doable, at least for fairly restricted tutoring. Some changes are required on the UI side to show the list of cards. A contributor was working on this feature, but we've not heard back from him/her yet.

mike wrote:Yes ... and no. The answer to that is a bit complicated and I haven't completely made up my mind yet..
Kudos for open sourcing most of the components, I'm sure it would benefit developers who plan to build similar distributed systems.
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: AI as a Service

Postby Huggybaby » 11 Jul 2013, 18:06

mike wrote:
Oh, and does anybody know If I can use the HQ card scans found in this forum for such a project? I would host them publicly of course so anyone who wanted their client to have a source for the pics could point them to my servers.
Hello Mike,

Feel free to use our scans. The more people that use them the better we like it, because we make them to be used, to enhance the gamer's experience.
Attribution would be nice of course. As an example, "HQ card pics courtesy of the HQ Pics Team at Slightlymagic.net"

Welcome to the forum, and good luck with your project. It certainly sounds exciting!
User avatar
Huggybaby
Administrator
 
Posts: 3207
Joined: 15 Jan 2006, 19:44
Location: Finally out of Atlanta
Has thanked: 701 times
Been thanked: 594 times

Re: AI as a Service

Postby mike » 07 Aug 2013, 21:26

The site is now live. I updated the post with more info.
User avatar
mike
Programmer
 
Posts: 128
Joined: 05 Jul 2013, 17:00
Has thanked: 0 time
Been thanked: 29 times

Re: AI as a Service

Postby Huggybaby » 08 Aug 2013, 02:18

Oh, hell to the yeah. The HQ pics popups are fantastic.

Most site owners abandon those after a while due to bandwidth and response issues. Let us know how it works out for you.
User avatar
Huggybaby
Administrator
 
Posts: 3207
Joined: 15 Jan 2006, 19:44
Location: Finally out of Atlanta
Has thanked: 701 times
Been thanked: 594 times


Return to Magarena

Who is online

Users browsing this forum: No registered users and 12 guests


Who is online

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

Login Form