It is currently 16 Apr 2024, 20:20
   
Text Size

Card Contributions

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

Re: Card Contributions

Postby ShawnieBoy » 01 Apr 2015, 19:29

PalladiaMors wrote:I've started to work on the Urza's "untap up to X lands" cards (Frantic Search & co.). While I don't know how to code the "up to" part, I've noticed that you can select an already untapped land if you don't want to untap others (the cards don't mention that the lands must be tapped). Also, now that there's no more mana burn, I can't think of a possible reason not to untap either (before maybe you could consider something like Citadel of Pain). I think it's solid to do the cards this way, and these are popular cards that will enable a bunch of decks.
I'd be more inclined to try and match the cards' text. Who knows what situations magic can give you. Bear in mind that they don't even need to be your lands you're untapping.
Mesmeric Orb?
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Card Contributions

Postby PalladiaMors » 01 Apr 2015, 20:21

Just saw your post - yeah Mesmeric Orb is an issue (also remembered Wake Thrasher now). The way I did it does allow picking the opponent's lands, so that part is covered. I'll stop submitting them so melvin can verify if there's a fix since we did find two potential problems.
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: Card Contributions

Postby melvin » 02 Apr 2015, 12:38

I think these cards make for very slow play, especially with the AI at highest settings.

@PalladiaMors: in your playtests, how well does the AI make use of the untap effect?
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: Card Contributions

Postby PalladiaMors » 02 Apr 2015, 13:23

I've tested that they parsed and had no bugs, but I didn't test how the AI performed with them. As usual, you know much better than I do what's worth implementing or not, so feel free to not accept the submissions whenever they are problematic.

Just one thing. Like ShawnieBoy, I'm also definitely more inclined to follow the cards' text. However, I must say that a lot of cards that were done before I was even here have small rule adaptations. A ton of cards that required revealing were implemented before revealing was supported. The planeswalkers with emblems have been implemented without the actual emblems. There are many other cards I could mention with such adaptations. With time, several of these things are being improved - for example, revealing is now possible. I don't think small rule deviations should be an absolute dogma. I think sometimes cards can be acceptable temporarily like that. And it's not like every card I've submitted was like that, I like to think I've done a couple things that were somewhat decent.
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: Card Contributions

Postby ShawnieBoy » 02 Apr 2015, 14:47

PalladiaMors wrote:I've tested that they parsed and had no bugs, but I didn't test how the AI performed with them. As usual, you know much better than I do what's worth implementing or not, so feel free to not accept the submissions whenever they are problematic.

Just one thing. Like ShawnieBoy, I'm also definitely more inclined to follow the cards' text. However, I must say that a lot of cards that were done before I was even here have small rule adaptations. A ton of cards that required revealing were implemented before revealing was supported. The planeswalkers with emblems have been implemented without the actual emblems. There are many other cards I could mention with such adaptations. With time, several of these things are being improved - for example, revealing is now possible. I don't think small rule deviations should be an absolute dogma. I think sometimes cards can be acceptable temporarily like that. And it's not like every card I've submitted was like that, I like to think I've done a couple things that were somewhat decent.
Staying true to a cards text or staying true to a cards flavour is where many have differing opinions. My personal opinion (Not saying it's the right one, or that other opinions are 'wrong') is that I always try and have a card as exact as possible to how the card functions 'in the real world', liking Magarena to a simulation.

However I can still see that having a card that functions for pretty much all situations, and still identifies as that card except in some niche scenarios, can open a window to other cards. The cards you have mentioned which are not functionally identical to real cards fall in this category.

Once a card is sumbitted and added, it can never be removed. It would have too much impact on Firemind and other decks people have created with those cards in. That always makes me err on the side of caution. However, sometimes these 'errors' can be fixed (I remember redoing the {T}, Pay 1 life: Add [mana] to your mana pool - as they were dealing damage instead at the time (The only close option for generating mana)) and open up for other cards as a result.

Some of the iterations of early Flashback and Unearth are 'not by the book' - I have a growing grudge against Varolz, the Scar-Striped and his current work-around.

The final question should always be 'Can the AI use it properly?'

Here's what I do for testing cards:
I always have a bundle of simple 40 card decks, they're never fixed, as whenever I work on new cards I replace some in the deck with relevant colour/colours. I then play a mirror match against the AI, where the aim of the game is to get the AI to cast the new cards (And cast them yourself of course) or get new creatures into combat. As I'm not often actively playing Magarena as a user, this can also allow me to check log messages and if they make sense, choices and also see the UI changes that have no doubt occurred :D
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Card Contributions

Postby melvin » 03 Apr 2015, 01:10

PallidiaMors wrote:With time, several of these things are being improved - for example, revealing is now possible. I don't think small rule deviations should be an absolute dogma.
I'm more on the pragmatic side, if we can explain the deviations with a small "rules change" I think it is reasonable. Personally I think of Magarena as MTG + house rules, closer in spirit to Commander than Standard.

In this case, we can add the rule 'Uptap up to X lands' becomes 'Untap X lands'. In fact, it might be a good idea to remove all instances of 'up to', including 'search for up to'. Need more playtesting to evaluate how well the AI is using 'search for up to'.

ShawnieBoy wrote:The final question should always be 'Can the AI use it properly?'
Couldn't agree more with this and no I don't have any intuition whether a given effect will be used properly or not. The only way to find out is to playtest.

Think of the AI like someone new MTG, knows the rules but is not a good player. Would you include a complicated card in the card pool that only you could play well but not the other player? That would be giving you an unfair advantage and if you won with that advantage it would not be a satisfying victory.

Magarena is a game between two entities, the player and the AI, and for every feature/effect we add, we should consider the impact on both of them equally.
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: Card Contributions

Postby PalladiaMors » 12 Apr 2015, 01:28

I suddenly realized that Split Second looks relatively simple to code (below an attempt at Sudden Shock):

Code: Select all
[
    new MagicSpellCardEvent() {
        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
            for (final MagicPlayer player : game.getAPNAP()) {
                game.doAction(new MagicChangePlayerStateAction(player, MagicPlayerState.CantCastSpells));
                game.doAction(new MagicChangePlayerStateAction(player, MagicPlayerState.CantActivateAbilities));
            }
            return new MagicEvent(
                cardOnStack,
                NEG_TARGET_CREATURE_OR_PLAYER,
                this,
                "SN deals 2 damage to target creature or player\$."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            for (final MagicPlayer player : game.getAPNAP()) {
                game.doAction(new MagicRemovePlayerStateAction(player, MagicPlayerState.CantCastSpells));
                game.doAction(new MagicRemovePlayerStateAction(player, MagicPlayerState.CantActivateAbilities));
            }           
            event.processTarget(game, {
                game.doAction(new MagicDealDamageAction(event.getSource(),it,2));
            });
        }
    }
]
I made up "MagicRemovePlayerStateAction", it doesn't exist. Is there a way already available in the game to do that? Would solve these cards.
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: Card Contributions

Postby melvin » 12 Apr 2015, 03:32

There is an issue if the spell is countered. In that case, it never gets to resolve and the executeEvent never runs to remove the "can't cast spells/activate abilities".

We can do it as an intrinsic ability, by modifying the "canPlay" method of activations to check for spells with "split second" on the stack. I'll look into it.

Update:
Implemented in https://github.com/magarena/magarena/co ... 467eb4a73c

Sample card in
https://github.com/magarena/magarena/co ... 11fa2af938
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: Card Contributions

Postby PalladiaMors » 12 Apr 2015, 20:07

Trying to figure out how to put the new "if you cast it from your hand" condition in groovy form. This one's Breaching Leviathan. There's actually a *lot* of these cards, the number had been totally underestimated in the list. From what I've seen the lion's share are straightforward cards that don't require choices, which seems to be the major AI weakness, so I guess these should be fine?

Code: Select all
[
    new MagicWhenComesIntoPlayTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game, final MagicPermanent permanent, final MagicPayedCost payedCost) {
            return permanent.setFromLocation(MagicLocationType.OwnersHand) ?
                new MagicEvent(
                    permanent,
                    this,
                    "Tap all nonblue creatures. Those creatures don't untap during their controllers' next untap steps."
                ):
                MagicEvent.NONE;
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            NONBLUE_CREATURE.filter(game) each {
                game.doAction(new MagicTapAction(it));
                game.doAction(MagicChangeStateAction.Set(
                    it,
                    MagicPermanentState.DoesNotUntapDuringNext
                ));     
            }
        }
    }
]
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: Card Contributions

Postby melvin » 13 Apr 2015, 02:19

@PalladiaMors Use 'permanent.hasState(MagicPermanentState.CastFromHand)' to check if cast from hand.

From what I've seen the lion's share are straightforward cards that don't require choices, which seems to be the major AI weakness, so I guess these should be fine?
Since these are effects we are already using, it is ok. I'm more concerned about effects which have not been used before, such as the 'untap [amount] lands'.
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: Card Contributions

Postby ShawnieBoy » 14 Apr 2015, 13:48

While doing the refactoring I've stumbled across another bundle of cards that should be do-able:

Bane Alley Broker was the only card using ReclaimFromExileAction.

ReclaimFromExileAction is used to return one card from exile to the card's owners hand.

Gustha's Scepter is very similar

Other exile-related worth a look:

Planeswalker's Mischief
Purgatory (ReclaimFromExileAction variant)
Runic Repetition
Mimic Vat (complex)
Wall of Nets
Sengir Nosferatu (I predict problems)

Either that or a possible removal of ReclaimFromExileAction or expanding it to 'reclaim' to a specific location or to only select from cards exiled by a permanent.

Another -
Ætherplasm using SetBlockerAction similar to Brimaz, King of Oreskos
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Card Contributions

Postby PalladiaMors » 16 Apr 2015, 02:44

I've submitted Balance considering that the difference between choosing permanents to sacrifice and keeping the rest and choosing permanents to keep and sacrificing the rest is purely semantical. It's untargeted, triggers will be identical etc. Please ensure this is correct, but I'm pretty sure it is.

Are coin flips already available in groovy form? Could we please get an example? Lots of cards waiting to be done!

Edit: Oh, Tavern Swindler available. Green light to do the ones I can? I saw some debate about possible issues and was a bit worried.
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: Card Contributions

Postby ShawnieBoy » 16 Apr 2015, 02:59

PalladiaMors wrote:I've submitted Balance considering that the difference between choosing permanents to sacrifice and keeping the rest and choosing permanents to keep and sacrificing the rest is purely semantical. It's untargeted, triggers will be identical etc. Please ensure this is correct, but I'm pretty sure it is.
My only concern is that the text is asking you to choose permanens/cards to keep, but the mechanics are asking you to choose cards to sacrifice/discard. Easy to make a mistake there and sacrifice/discard the wrong thing.
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Card Contributions

Postby PalladiaMors » 16 Apr 2015, 03:22

^ Yeah, that's an issue. It's not the first card with such a problem too (Breakthrough). Some cards could use custom text. I don't know if that could be implemented without too much trouble.

Edit: Actually, it's the picture that would have to be customized. I don't think that's going to be very easy to do!

Edit2: Actually, we *could* do that. See the text from the 4th edition. As far as the Oracle is concerned, that text is outdated, but it won't be confusing. The script has the oracle text that can be used as reference if someone can't understand the 4th Edition pic's text. And it brings huge nostalgic feelings and has a better picture than the current version!
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: Card Contributions

Postby muppet » 16 Apr 2015, 11:34

If you want to know what cards the AI is really bad with I can post them.

I'll start with Standstill and all man lands. Admittedly Standstill is actually hard to play.
muppet
Tester
 
Posts: 590
Joined: 03 Aug 2011, 14:37
Has thanked: 33 times
Been thanked: 30 times

PreviousNext

Return to Magarena

Who is online

Users browsing this forum: No registered users and 22 guests


Who is online

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

Login Form