It is currently 16 Apr 2024, 21:12
   
Text Size

Cast with AI hints

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

Re: Cast with AI hints

Postby PalladiaMors » 14 Jun 2015, 18:19

^ Tried to do it that way but failed on my first attempt. I'll try to figure it out better later, bit short on time right now. Overall I suspect that attaching the files here - after playtesting a bit more thoroughly - might be the easiest solution for me. Anyway, I'll give it another try for sure and thanks for trying to help!

p.s: I confused Akroma's Blessing with Akroma's Vengeance on the attached file above, besides the other issues you mentioned. Submitted it through web interface now.
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: Cast with AI hints

Postby melvin » 15 Jun 2015, 01:49

I noticed on your master branch there are a number of unmerged commits.

Eg:
https://github.com/PalladiaMors/magaren ... 3e770a9362
https://github.com/PalladiaMors/magaren ... cf1b5c1935
https://github.com/PalladiaMors/magaren ... e977c9affc
https://github.com/PalladiaMors/magaren ... 11bfe0ba81

Should any of these be merged?

I'm not sure how you are currently using the website. One way to do it is as follows:
1. open https://github.com/PalladiaMors/magarena/find/master
2. find the file to edit
3. click to open the file, click "edit" icon
3. make changes
4. commit
5. if there are more cards, goto 1 (shortcut press 't')

When you are ready to make a pull request, goto https://github.com/PalladiaMors/magarena and click on "Pull request"
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: Cast with AI hints

Postby PalladiaMors » 15 Jun 2015, 16:04

Those links have only old files that have already been implemented one way or the other, so it would be redundant to merge them. I followed your steps and it worked, but when I create the pull request it wants to update all those old files as well, which is unnecessary because they've already been done. Basically I think I've accidentally made a major mess on my master branch thing. I could probably edit one by one to undo those things, but there's about 100 files there at this point. I'll figure out what to do eventually. Thanks for helping.
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: Cast with AI hints

Postby melvin » 16 Jun 2015, 02:27

No worries about the redundant commits, I'll just skip them when I merge.

I found a way to have an updated copy without recreating the fork!

The first commit should be by editing a file from https://github.com/magarena/magarena

This will create an updated branch on your fork, eg. patch-98. This is the name of the new branch, it will be at the same commit as the main repo.

Subsequently, on https://github.com/PalladiaMors/magarena select that branch from the "branch: master" dropdown box. eg. Choose patch-98

Then make further commits to the "patch-98" branch as necessary. When done, submit pull request for patch-98 branch.
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: Cast with AI hints

Postby PalladiaMors » 14 Nov 2015, 18:00

@ShawnieBoy, I saw you added the casting restriction to several cards. I believe a few more cards could also benefit from it, e.g Goblin Sledder. This had been discussed previously in Issue 116. Probably a lot of goblins with self-sacrificing abilities could benefit from it as well? These abilities are common in a few creature types, maybe Goblins, Thrulls, Thalids, I don't know.

While I believe it's an improvement, this is definitely not an ideal solution. For instance, Arcbound Ravager used to be often paired with Disciple of the Vault, and there's the rare hypothetical situation where the opponent is down to low health and you could want to use the sac Ravager to his own ability trick, even when there are no other artifacts you control. Also, some plays aren't much better than the insta-sac Ravger tech: turn 1 artifact land, turn 2 artifact land, play Ravager and sac both lands to get a 3/3 - really bad on most situations.

The restriction is a slight improvement, but ultimately I think these problems are a result of the fact that the AI doesn't seem to consider card advantage and card disadvantage at all in its line evaluations. This is a massive problem, since this is one of the main strategical aspects of the game. Obviously this isn't quite so simple but as a general rule, if you're spending a card in order to disable one of the opponent's cards, you've made an "average" play; if you spend a card and don't "get" any of the opponent's in return, you've made a bad play; if you spent a card and "got" two or more of the opponent's in return, you've made a good play. The exception is if you can finish the game, because then it doesn't matter how many cards you're down in order to do that since you've already won (relevant for strategies such as Burn). My opinion is that somehow the calculations should take this into account.

Edit: another very commonly played card that could use the restriction is Welding Jar.

Updating OP with "cards that can sacrifice themselves" group.
PalladiaMors
 
Posts: 343
Joined: 12 Jul 2014, 17:40
Has thanked: 36 times
Been thanked: 22 times

Re: Cast with AI hints

Postby ShawnieBoy » 14 Nov 2015, 18:18

It's certainly not the best situation, but it is akin to the "Cast with AI only if" for non-targeted sacrifice/damage with a similar 'no point in doing this' outcome.

These changes will not effect the activation of these abilities for the player, and while effecting corner-cases, will help certain cards to remain on the battlefield instead of being sacrificed immediately to themselves.

I've only changed abilities where the effects are intrinsically linked to the source. Essentially all effects with a Sacrifice as a cost could have this AI restriction if a target is of the same type as the Sacrifice type involved.

It would be preferable for the AI that if a Sacrifice type matches the source, and the 'target' of the effect is SN, then to use 'Sacrifice another <type>'.
Similarly if the Sacrifice is SN, then to use 'target other'. These can't be scripted without restricting these options to the player as well, so would/could be included into the AI options somehow.

edit: More thoughts
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Cast with AI hints

Postby muppet » 15 Mar 2016, 15:39

Using Stoneforge Mystic tap ability with no equipment in hand is a common error and I can't see almost any reason why it would ever be useful.
muppet
Tester
 
Posts: 590
Joined: 03 Aug 2011, 14:37
Has thanked: 33 times
Been thanked: 30 times

Re: Cast with AI hints

Postby ShawnieBoy » 16 Mar 2016, 16:54

muppet wrote:Using Stoneforge Mystic tap ability with no equipment in hand is a common error and I can't see almost any reason why it would ever be useful.
Activating and declining to perform it is a possible action (if something changes since it was on the stack) but trying to activate it when the AI can't is another matter - added AI condition, will have a look at other hand->battlefield activations
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Cast with AI hints

Postby ShawnieBoy » 16 Mar 2016, 17:14

Actually - looking at the code more closely, I would guess that the action is being declined, as the effect uses a 'soft' target. Do you have any examples of this occurring with the 'error' "No legal targets?" in the log? Or is it just a "May (no)"?
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Cast with AI hints

Postby muppet » 17 Mar 2016, 10:07

It isn't a bug. You can always use the ability if you want to even though it just uses 2 mana for no reason. I am just saying I can think of almost no time using 2 mana and tapping a creature for no reason is good so you could add a don't do this.
muppet
Tester
 
Posts: 590
Joined: 03 Aug 2011, 14:37
Has thanked: 33 times
Been thanked: 30 times

Re: Cast with AI hints

Postby ShawnieBoy » 17 Mar 2016, 10:49

muppet wrote:It isn't a bug. You can always use the ability if you want to even though it just uses 2 mana for no reason. I am just saying I can think of almost no time using 2 mana and tapping a creature for no reason is good so you could add a don't do this.
AI hinting won't override may choices - they are only there to ensure that the situation to activate/cast are valid. For Stoneforge Mystic, the important part is that there is an Equipment card in hand. If the AI is trying to activate the ability without an Equipment in hand, then AI hinting would help.
If the AI is declining to play an Equipment, then that's more of an AI engine issue.

As a rule, may choices should remain. Although looking at the ability on it's own you'd think "Why would I choose 'No'", it all depends on other cards and all other possible scenarios.
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Cast with AI hints

Postby muppet » 17 Mar 2016, 12:11

It is activating it without an equipment card in hand sorry if I was confusing the issue.
muppet
Tester
 
Posts: 590
Joined: 03 Aug 2011, 14:37
Has thanked: 33 times
Been thanked: 30 times

Re: Cast with AI hints

Postby muppet » 23 Mar 2016, 16:03

It could do with an if you have a legendary permanent in play un tapped with the same name as the one you are trying to cast don't bother unless they have an effect when they both die e.g. the black dragon. or If it is a planeswalker you might want to activate it twice I guess.
muppet
Tester
 
Posts: 590
Joined: 03 Aug 2011, 14:37
Has thanked: 33 times
Been thanked: 30 times

Re: Cast with AI hints

Postby ShawnieBoy » 30 Mar 2016, 17:20

muppet wrote:It could do with an if you have a legendary permanent in play un tapped with the same name as the one you are trying to cast don't bother unless they have an effect when they both die e.g. the black dragon. or If it is a planeswalker you might want to activate it twice I guess.
That's quite a specific casting restriction :D

Situations like this would be best applied within the AI logic. I normally see these plays as the AI not having, or able to find, a valid play to turn the game around.
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Cast with AI hints

Postby muppet » 31 Mar 2016, 09:22

Ok and another that might be AI not a hint. Quirion Ranger is used at every available opportunity which just results in never being able to play more than one land and the untapping is mostly pointless. It pretty much shd only be used if you have no more land in hand or need to untap a creature for a reason not just because you can. Or saving a land from destruction.

I was just trying to cover all the options by making it so specific.

More general things might cause unintended problems in a really tiny number of cases that probably don't come up much. e.g. simply not casting another legendary permanent of the same name is a 70% better fix than allowing it.
Having a switch that says don't do this unless the returned value is overwhelmingly better than other options for a lot of things might well be good.
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