It is currently 19 Apr 2024, 00:02
   
Text Size

Good Games

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

Good Games

Postby mtgrares » 16 Dec 2010, 21:31

I've had some great games with Magarena. One time the AI killed me with a trampling 25/25 and another time I definitely beat the AI and he had -54 life. The AI doesn't let anything slide. The games feel more like chess versus solitaire Magic with Forge. I've also enjoyed the wide number of cards that I haven't used. And all of the cards are great because you didn't code any weak cards.

I enjoyed playing with and against the same deck because I got to know the details of each deck. Thanks for adding the feature that lets you change a card, it sure beats editing stuff by hand. (I tend to remove artifacts since I see them too often.)
mtgrares
DEVELOPER
 
Posts: 1352
Joined: 08 Sep 2008, 22:10
Has thanked: 3 times
Been thanked: 12 times

Re: Good Games

Postby ubeefx » 16 Dec 2010, 23:25

I spent a lot of time to compose the card pool. I did an effort to get a nice card distribution (colors, types, costs). Cards were added to span a lot of the Magic design space and because they are good for limited play. During development I actually removed and replaced cards too. So I did code more cards than the 450 that are currently in the game.

In version 1.2, there will be support for loading and saving decks. The card pool will increase to 500.
You also will be able to create .dec files in the decks folder and play Magarena constructed decks.
User avatar
ubeefx
DEVELOPER
 
Posts: 748
Joined: 23 Nov 2010, 19:16
Has thanked: 34 times
Been thanked: 249 times

Re: Good Games

Postby mtgrares » 17 Dec 2010, 17:07

That sounds really good. :)
mtgrares
DEVELOPER
 
Posts: 1352
Joined: 08 Sep 2008, 22:10
Has thanked: 3 times
Been thanked: 12 times

Re: Good Games

Postby Boom2010 » 17 Dec 2010, 18:57

ubeefx wrote:In version 1.2, there will be support for loading and saving decks. The card pool will increase to 500.
You also will be able to create .dec files in the decks folder and play Magarena constructed decks.
Any chance that you might be able to include some sort of random selection option for the "versus" in the "new duel" screen. i.e it randomly selects one of the "colour sets" in the current drop down lists?
Boom2010
 
Posts: 83
Joined: 08 Mar 2010, 16:02
Has thanked: 21 times
Been thanked: 0 time

Re: Good Games

Postby ubeefx » 18 Dec 2010, 01:24

Random selection for two and three colors is added to 1.2.
User avatar
ubeefx
DEVELOPER
 
Posts: 748
Joined: 23 Nov 2010, 19:16
Has thanked: 34 times
Been thanked: 249 times

Re: Good Games

Postby Boom2010 » 18 Dec 2010, 10:40

ubeefx wrote:Random selection for two and three colors is added to 1.2.
Thanks :D
Boom2010
 
Posts: 83
Joined: 08 Mar 2010, 16:02
Has thanked: 21 times
Been thanked: 0 time

Re: Good Games

Postby jeffwadsworth » 24 Dec 2010, 16:09

I was showing it off to a few friends at work that use Magic Online. They were skeptical of anything not involving a human player and balked at the idea that an AI could beat them. They are now converts. Not only was the CUBE gametype more to their liking but when the AI pulled its equipment from a creature that had just attacked and placed on its newly cast creature they went nuts. Several times the AI made decisions that looked suspect but turned out to be the most sound. We all love the fast gameplay and highlighted action features.
jeffwadsworth
Super Tester Elite
 
Posts: 1171
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 69 times

Re: Good Games

Postby ubeefx » 24 Dec 2010, 16:54

To make a Magic game against computer work the AI must indeed be good enough.
People would quickly lose interest if all duels are won without any effort.
Another cool aspect is that the AI does not cheat or gets huge benefits, which is a method often used to make AI more challenging.
But the AI is not perfect and by design will not always make the best choice. The same applies however for most human players. :)

Nice to hear your friends like the game too!
I think Magarena is currently quite unique in the Cube like approach.
I want to keep it that way, so that is also a reason why the available card pool is not very large.
The UI improvements of release 1.3 could make gameplay even faster.
User avatar
ubeefx
DEVELOPER
 
Posts: 748
Joined: 23 Nov 2010, 19:16
Has thanked: 34 times
Been thanked: 249 times

Re: Good Games

Postby Huggybaby » 24 Dec 2010, 17:04

No, they DO make gameplay faster. HQ Pics + Instant popup + keyboard shortcuts to advance play + improved stack location = the fastest MTG game on earth. You literally will spend 99% of your time making play choices rather than slogging through play mechanics. It makes the new DotP appear positively glacial.
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: Good Games

Postby puxl » 03 Jan 2011, 02:30

ubeefx wrote:During development I actually removed and replaced cards too. So I did code more cards than the 450 that are currently in the game.
I think it may be worthy of putting more cards in. While the set of 500 cards is quite nice, currently the AI in this program is the only AI actually capable of playing well (sometimes it still does not play as good as skilled human player, but it is quite close).

I think putting all reasonable cards (i.e. not complicated to AI or engine) from, say, 7th edition up could bring much more fun, as you could then use Magarena also to try your constructed decks ....

Then you could have two modes - the "traditional" with 500 chosen cards and "unlimited" with all cards (where AI could either use one of the "limited" decks, or you can give AI some of "unlimited" decks) or perhaps more modes for commonly used formats (Extended, Standard, Block ...), each allowing some subset of all implemented cards both for AI and human.
puxl
 
Posts: 11
Joined: 23 Apr 2010, 18:20
Has thanked: 0 time
Been thanked: 0 time

Re: Good Games

Postby ubeefx » 03 Jan 2011, 20:01

Nice to hear you like the capabilities of the AI.

Consider Magarena as a game to play limited sealed alike games with an unexisting set (also called cube).
You have plenty of non basic lands and do no construct the deck yourself, it is generated, but from a sealed card pool.
This set contains 499 powerful and interesting cards (+ 5 basic lands). So the idea here is that less can be more.

Please do not consider Magarena as an application to test or play with constructed decks.
I recommend using other alternatives like Forge for that purpose.

Forge 12/22/2010 already contains 5700 cards! This is an enormous achievement by the Forge Team. =D>
Do not underestimate the work to add so many cards to the program.

When I add cards, I do not just code them but also create test games to test the cards.
This is time consuming but necessary to create a game that plays well.
And because Magic has so many complex interactions, there can still popup issues for each new card you add.
Magarena is also much more code intensive for adding cards, because it does not have the card script abilities of Forge.
User avatar
ubeefx
DEVELOPER
 
Posts: 748
Joined: 23 Nov 2010, 19:16
Has thanked: 34 times
Been thanked: 249 times

Re: Good Games

Postby puxl » 04 Jan 2011, 02:06

ubeefx wrote:Please do not consider Magarena as an application to test or play with constructed decks.
I recommend using other alternatives like Forge for that purpose.

Forge 12/22/2010 already contains 5700 cards!
Yes, and even with that amount, many are still missing. I tried to put in 5 my decks (that I own in real world cards) and for every deck, there are few cards not yet implemented - although either implementing the missing ones or putting in some similar cards should not be hard :))

Unfortunately, much worse problem is that AI that is present in Forge is not very good. It can play, but it is rather stupid and it is a bit like playing against a not very intelligent child.

So for me, if I want to playtest decks, with current state both Forge and Magarena are unusable. But both are opensource, so I can contribute towards this goal.

Forge can be "fixed" by implementing better AI - something not exactly trivial, as this would probably mean writing AI from scratch (maybe some of the code from MagArena could be reused, but I doubt it would be much of it)

Magarena can be "fixed" by implementing the other cards and I think this way could be simpler - any creatures which have only "regular" abilities like lifelink, trample, etc ... could be imported very easily, perhaps using some automated script to generate the code. Many other cards that are similar enough to the ones already in should be relatively easy too. There could be problems with cards different from those already implemented (like milling cards, cards targeted at specific creature types (gain 1 life for every Elf in play), planewalkers, or some complex "unique" cards with 10 lines of game text on them) and it would get probably much worse for AI once complex combos get in (especially "infinite" combos to get unlimited amount of mana, life, creatures, etc ... for example Kiki-Jiki, Mirror Breaker + Pestermite = Infinite amount of Pestermites)

So, question is, if you are willing to enhance the set (and then you can limit the number of available card depending on play settings, so player can choose to either play with 500 card cube that you have selected or with another cube someone else could make from all the implemented cards, or even with constructed deck without any limits) or not (as I looked at svn log, when you replace one card with another, the old card is not just disabled, it is removed from the code completely).

If yes, I can help and contribute with patches. If not - well, Magarena is opensource, so I think I'll just create a fork, add the cards I want, add some extra features in the GUI (so it does more fit with the purpose I intend to use it for - testing constructed decks) and add some commandline interface (play X with deck A vs deck B, return amount of wins for both decks) so I can use it also as tool for my long-term goal - trying to come up with "deckbuilding AI" that will be given heap of cards (optimally all cards from magic, though there is over 10000 of them - or at least some large subset of usable cards) and it should construct some good deck from them.

Then just put the sources + binaries somewhere, so someone can benefit from my fork (or help me with it :))

Currently the Magarena is the best MTG opensource AI I know of (and it is in Java, which is one of the languages I know pretty well), so even though number of implemented cards is currently relatively limited, it would be probably the best starting point ...
puxl
 
Posts: 11
Joined: 23 Apr 2010, 18:20
Has thanked: 0 time
Been thanked: 0 time

Re: Good Games

Postby ubeefx » 04 Jan 2011, 12:24

Implementing a similar AI in Forge as in Magarena would require lots of changes to the Forge code base.
Adding many more cards to Magarena is certainly possible. Maybe the code needs to be restructured a bit first to facilitate that. I indeed remove cards I replace to keep the code base as small as possible.
Making Magarena rule compliant is however not something I plan to do. There might of course be still some improvements.
I suggest you first try to implement a couple of your decks in a fork and see if it works out.
User avatar
ubeefx
DEVELOPER
 
Posts: 748
Joined: 23 Nov 2010, 19:16
Has thanked: 34 times
Been thanked: 249 times

Re: Good Games

Postby puxl » 04 Jan 2011, 13:34

ubeefx wrote:I suggest you first try to implement a couple of your decks in a fork and see if it works out.
I'll try to put in some of my decks and see how well the AI can play them .... I think it would be probably much easier to implement all the cards I need (maybe about 100 or 200 of them, most of them are not very complicated) than to get some decent AI in Forge.

I'll see how that would work and perhaps this would create some improvements that could be put back into Magarena base code ...

There are a few problems I can think of:

milling - while none of my decks is based on it, some others are. Once I add such cards, AI have to be more aware of number of cards in the library, so AI could concentrate the defenses to the worst millers.
Actually, there is one milling card in the current cube - Sword of Body and Mind. 3 or 4 hits with it (since magarena plays with 40 card decks) and the computer is history ... does the AI consider effect of milling cards currently? The alpha-beta have some depth and unless the computer would hit the "loss by unable to draw" condition, if there is no heuristric score based on number of cards into library, then AI may be vulnerable to such cards. Got to try it out ... or read through the source :)

infinite combos: I mentioned for example Kiki-Jiki, Mirror Breaker + Pestermite. For AI it would be probably better to have 3 pestermites than 2, so AI repeats combo. Then it would be considered better to have 4 than 3 .... another repeat. Probably some cutoff would be needed - in the pestermite case it won't be so hard (once you have enough pestermites so that those unblocked would kill the opponent AI should start attack), but with other "infinite" combos - like those that allow to gain life, or give some other advantage than allowing to directly kill the opponent - it would not be easy to decide when to stop, when the computer have "enough" ... is there any code in the AI to handle any infinite combos?

There could be some safety counter (once AI have done more than X action in a phase, then stop doing anything and enter next phase, where X could be something like 100*(number of cards on table + number of cards in hand)) to prevent some endless loops .... and 100 actions per card would probably be enough to gain decisive advantage in most "infinite" combos.

There still can be problem with some infinite combos not controlled by any player: AEther Flash + Ivory Gargoyle would cause the gargoyle to be killed once it resurrects from the graveyard, but it is instantly killed again once it enters play. I think the ruling specify, that this combo repeats as many times as players chooses (in case there are cards like Essence Warden in play that can take advantage of gargoyle being killed and respawned again and again) and then gagroyle is left dead. Maybe similar safety counter would be needed for these effects to prevent endless loops.

How would current code handle such situations?
puxl
 
Posts: 11
Joined: 23 Apr 2010, 18:20
Has thanked: 0 time
Been thanked: 0 time

Re: Good Games

Postby ubeefx » 04 Jan 2011, 19:29

To answer your questions :

Milling : three cards in cube, Sword of Body and Mind, Nemesis of Reason and Szadek, Lord of Secrets
The AI will notice it will lose at a point due to decking, but it will not do much about it until that time.

Infinite combos : I tried to avoid combos in general and especially infinite ones. AI would probably keep on doing the Kiki Jiki + Pestermite combo. This would need extra checks in code.

Pestermite is a nice example of a card that looks simpler than it is.
Choices : may (yes / no), tap or untap, target permanent (unfiltered, all permanents)
So with 20 permanents in play this gives 20 x 2 (yes) + 1 (no) = 41 total options without any clever filtering.
It does not really matter what tapped state is of permanent at moment of putting the ability on stack, because players can respond.

To help you, some non obvious cards with Magarena engine as reference :
- Sunken Ruins: abilities generating more than one mana, mana filtering, requiring mana pool
- River's Grasp : knowing with what types of mana a cost is paid with (mana costs are handled in a very optimized way)
- Grand Arbiter Augustin IV : reducing or incrementing mana costs (also for example convoke keyword)
- Profane Command : multiple choices and targets, very complex (similar Arc Lightning)
- Bloodghast : triggered abilities of cards, not permanents (same is valid for activated abilities)
- Windreaver : more than two activated abilities
- Ovinize : lose all abilities until end of turn
- Zendikar traps : alternative costs
- any Planeswalker

ubeefx
User avatar
ubeefx
DEVELOPER
 
Posts: 748
Joined: 23 Nov 2010, 19:16
Has thanked: 34 times
Been thanked: 249 times

Next

Return to Magarena

Who is online

Users browsing this forum: No registered users and 30 guests


Who is online

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

Login Form