Page 1 of 3

Cast with AI hints

PostPosted: 19 May 2015, 14:42
by PalladiaMors
Creating this topic to discuss and ask for suggestions about cards that could use Cast with AI hints (for example, Diabolic Edict has the hint "cast with AI only if an opponent controls a creature").

Card groups that have received or are receiving the hints:

- Target/Each player sacrifices creature(s).

- Deals X damage to each creature / All creatures get -X/-X until end of turn.

- Destroy or Exile all X. Return all X to owner's hands.

- All creatures (you control) gain +X/+X or/and ability until end of turn.

- Some cards that count the number of certain permanents for their effects, if the effect would be irrelevant the majority of the time if the amount is 0.

- Cards with the Champion ability.

- Permanents that are capable of sacrificing themselves as part of the cost to activate an ability (in progress).

Latest edit: adding new group.

Re: Cast with AI hints

PostPosted: 19 May 2015, 19:53
by PalladiaMors
By the way, is there a way to put everything on a single pull request? Because I've noticed that these things have been occupying the build queue for the entire day, which doesn't look right...

Re: Cast with AI hints

PostPosted: 20 May 2015, 00:49
by melvin
PalladiaMors wrote:By the way, is there a way to put everything on a single pull request? Because I've noticed that these things have been occupying the build queue for the entire day, which doesn't look right...
Doesn't seem possible with github web interface. Perhaps try one of the desktop clients such as https://windows.github.com/

Re: Cast with AI hints

PostPosted: 20 May 2015, 23:57
by PalladiaMors
Just some feedback: I've downloaded the program, successfully downloaded what I think is a "clone" of magarena (or what looks like a 6-months old version of it) and managed to edit some files. I'm currently in the process of figuring out how to commit the changes. Doesn't look completely idiot-proof and I'm definitely an idiot, so it'll probably take some time to figure out how to use the app correctly (will have to wait at least for the weekend, today was a very very busy day...).

Meanwhile I'll avoid spamming the queue since I don't know if that causes problems for you guys.

Re: Cast with AI hints

PostPosted: 21 May 2015, 12:44
by PalladiaMors
Ok I think I managed to do it? See https://github.com/PalladiaMors/magaren ... 3e770a9362

Not completely sure what I did, though...

Edit: Nope, I think I got it right now: https://github.com/magarena/magarena/pull/298

Re: Cast with AI hints

PostPosted: 21 May 2015, 13:56
by melvin
PalladiaMors wrote:I think I got it right now: https://github.com/magarena/magarena/pull/298
Looks good, glad it wasn't too hard to figure out. Do put in a more informative commit message next time.

Your repo is rather dated though, the parent commit is from Nov 2014. Do try to update it to something more recent. There should be a way in the desktop client to do an update or sync with upstream. One simple but tedious way is to wipe it and create a new one.

Re: Cast with AI hints

PostPosted: 21 May 2015, 14:25
by PalladiaMors
It kind of automatically downloaded that version, I don't know why. I was glad it did actually, because I'd have no idea how to do that otherwise. Also I made a new pull request and it ended up repeating the files from the last one, not sure if it's possible to ignore that part of it? That was a mess up on my part, I think I know how to avoid it next time.

I did ask it to sync a few times. Will investigate later.

Edit:

Just for my own reference, another huge card group that can use the casting restriction is discard: "Cast SN with AI only if an opponent has at least one card in his or her hand". I may try to add this condition myself eventually. First I have to figure out how to use the GitHub thing - apparently every time I make a pull request it attempts to upload the entire history of editions I've made, which I haven't managed to stop yet. This really isn't made for amateurs, you're supposed to know what you're doing to use this program. I don't, and it's been frustrating.

Another group to investigate later: all creatures you control gain +X/+X until end of turn. I don't think there's many of those and they usually are late game cards that won't benefit as much but it's worth looking at.

Lots of cards that count the number of something controlled by the player, the opponent or both should have use for a casting hint that checks if there's at least one of the proper type of permanents in the game. A few have been done, most haven't.

Plus a lot of filters were missing for the already explored card groups, and there were some borderline cases (i.e. I left out Blasphemous Act intentionally because it's so extreme & I didn't want to block potential attempts to exploit it by redirecting the damage. Many other cards I felt the AI's play would overall improve with the restriction, but decided not to use it for some specific concern. In the end I think if a change makes the AI's rating go up while playing with a certain card, then it should be done, even if on a specific situation it creates a problem.). The groups listed in the opening post all require a second, more careful look.

Leaving this here because I don't intend to do anymore of these so soon & my memory may require these notes later. Hopefully I'll be able to understand them then!

Re: Cast with AI hints

PostPosted: 13 Jun 2015, 21:55
by PalladiaMors
Hey I'm currently reviewing cards from the groups in the list mentioned in the opening post trying to include more cast with AI hints for the cards I feel the AI's play will improve with them.

So I actually meant the question above: if I add a casting restriction to a card with cycling, will it prevent the AI from cycling the card if the condition isn't met? Or does it only affect the ability to cast it? Lots of cards with cycling could use the restriction for the casting, but I don't want to add it if it will prevent the AI from using the cycling ability. Please clarify if possible! Thanks.

Re: Cast with AI hints

PostPosted: 13 Jun 2015, 22:08
by ShawnieBoy
PalladiaMors wrote:Hey I'm currently reviewing cards from the groups in the list mentioned in the opening post trying to include more cast with AI hints for the cards I feel the AI's play will improve with them.

So I actually meant the question above: if I add a casting restriction to a card with cycling, will it prevent the AI from cycling the card if the condition isn't met? Or does it only affect the ability to cast it? Lots of cards with cycling could use the restriction for the casting, but I don't want to add it if it will prevent the AI from using the cycling ability. Please clarify if possible! Thanks.
The hints on a script file will only apply to casting that spell. All cycling abilities have a 'main' timing (essentially an activated ability), so using 'Cast with AI' won't effect them.

You can think of 'Cast SN with' like an additional 'cost'.

Re: Cast with AI hints

PostPosted: 14 Jun 2015, 01:01
by PalladiaMors
OK so here's what happened: after a sh*tload of work, I tried to push the changes and this time, instead of pushing, I think I managed to update my clone to the current version of Magarena. That's pretty good, except that... in the process, all my changes (>50 files) were erased. I really don't like using this thing too much.

Anyway, that can't be helped now. I'd like to ask if there's a way to do cards like Profane Prayers. I tried "Cast with AI only if a player controls a Cleric", but that crashes. There's several cards that count the number of permanents on the battlefield rather than controlled by a specific player that could use this type of hint. Is it currently possible to write that condition in some form?

Now to do everything all over again! Yay!

Re: Cast with AI hints

PostPosted: 14 Jun 2015, 01:17
by melvin
PalladiaMors wrote:That's pretty good, except that... in the process, all my changes (>50 files) were erased.
I'm sorry to hear that, do send us your changes via email to the mailing list if that is more comfortable for you. Yeah, it is unfortunate that the interface not very user friendly.

The client is unlikely to have actually erased your changes once you have committed them. Most likely it switched you to the latest commit on the main repo, which is a different branch from where you commit your changes.

Try to switch to a different branch. One of them may contain your commit with the changes.

Re: Cast with AI hints

PostPosted: 14 Jun 2015, 01:18
by ShawnieBoy
Eww, not good...

"Cast SN with AI only if there is a Cleric on the battlefield"

Re: Cast with AI hints

PostPosted: 14 Jun 2015, 03:25
by PalladiaMors
Well now it's giving me an error saying I can't synchronize. Apparently that wasn't a problem while my clone was outdated, but now that it's almost up-to-date it has become a problem?! Anyway, the application tells me to synchronize manually. I don't have the slightest what that means, so I'm attaching the files I changed here. Hopefully that's not too much trouble for one of you guys to push for me?

This one has 52 files, mainly from the card groups: buffs to all creatures you control, return all X to owner's hands, and cards that count the number of something on the battlefield. There are still more to come (I found more stuff on the second go). Some things were left out due to certain concerns which could be reviewed later. I'll do more cards tomorrow.

Re: Cast with AI hints

PostPosted: 14 Jun 2015, 03:56
by melvin
Thanks, will merge these changes in.

Issues:
Ætherize first line contains the byte order mark.
- https://en.wikipedia.org/wiki/Byte_order_mark is not supported by Magarena. Manually removed
Break of Day first line contains the byte order mark.
- Manually removed
Wirewood Pride does not load.
- Fix is to remove the extra 'you'
Hush has multiple ability property
- Manually merged them.

Suggestion: Create a deck with the modified cards and test them in the game first. This should catch most of the issues.

Re: Cast with AI hints

PostPosted: 14 Jun 2015, 05:47
by melvin
I did some research on the github website. It does support making multiple changes and then submitting only one pull request. See https://help.github.com/articles/github ... e-browser/

As an example, after editing a file and "Propose file change". Don't click on "submit pull request" if you want to make more changes. Instead check on the branch "patch-78", then select another file and edit it, commit change.

Continue to edit and commit until you have made all the related changes. Then click on "Compare & pull request" to submit a pull request. You should see that pull request includes multiple commits.