It is currently 16 Apr 2024, 13:38
   
Text Size

Implementing NEW stuff to Magarena

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

Re: Implementing NEW stuff to Magarena

Postby hong yie » 04 Mar 2014, 10:44

About high priority issue 114,
How about make the Ai less aggressive?
only attack when total power + all positive buff is greater than total opponent's toughness or maybe other pessimistic formula ?
i've seen enough my VIP creatures used to do meaningless kamikaze attacks. these VIP creatures including non aggressive creatures that would increase winning chance when they can be kept alive. Such as creatures with lords abilities, or token factories like Thraben Doomsayer, Imperious Perfect.
what can a 2/2 Thraben Doomsayer, 2/2 Imperious Perfect do good in a combat?
it would be OK, if they're 4/4 or more stronger. The Ai just failed to appreciate the value of these VIP creatures.
Let the Ai feel more fear and act more cautiously, i think. thanx. :)
User avatar
hong yie
Programmer
 
Posts: 216
Joined: 10 Mar 2013, 06:44
Location: Jakarta
Has thanked: 75 times
Been thanked: 9 times

Re: Implementing NEW stuff to Magarena

Postby melvin » 04 Mar 2014, 12:32

The blocking item on this is to be able to replicate the bad attack decision in a controlled setting with specific cards. Without that we can't tell if changes are going to make this worse or make it better. In concrete terms, we need to have a setup which we can run to get the bad attack decision. Such a setup, should specify what are the permanents on the board, what are the cards in hand and library, and current life points of both players.
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: Implementing NEW stuff to Magarena

Postby ShawnieBoy » 04 Mar 2014, 16:11

melvin wrote:Agree, we have grown beyond creature enchantments. Will rename to getEnchantedPermanent. On a separate note, I was thinking we should consolidate enchanted, equipped, paired to just one attachedPermanent.
Thanks for that :)

Using attachedPermanent does makes sense, however while fiddling with Artificer's Hex, there doesn't seem to be a simple way to find out if an equipment is attached to a permanent. You can go the other way, find out if a permanent is being equipped/enchanted. I was first thinking that .isEquipped() would refer to the equipment, but it doesn't.

If there would be a way to also add .isAttached() and/or .isBeingAttached() Boolean. Or a way for a .getAttachedPermanent() to somehow return that there's nothing there in a way that can be used?

(Or I could be missing something simple which can already do the same thing)
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Implementing NEW stuff to Magarena

Postby melvin » 05 Mar 2014, 01:56

Currently to test if an equipment is attached is getEquippedCreature().isValid(), true if attached, false otherwise.

This is rather ugly, will fix as part of converging to attach instead of the more specific equip, enchant, pair. So in the future that will be isAttached (is this permanent attached to another). The other way round (does this permanent have an equipment, enchantment, etc) remain as isEquipped, isEnchanted, isPaired.
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: Implementing NEW stuff to Magarena

Postby hong yie » 05 Mar 2014, 04:12

melvin wrote:The blocking item on this is to be able to replicate the bad attack decision in a controlled setting with specific cards. Without that we can't tell if changes are going to make this worse or make it better. In concrete terms, we need to have a setup which we can run to get the bad attack decision. Such a setup, should specify what are the permanents on the board, what are the cards in hand and library, and current life points of both players.
i have report some bad Ai decision made during play test in firemind.ch
i'm sure that should be helpful.
User avatar
hong yie
Programmer
 
Posts: 216
Joined: 10 Mar 2013, 06:44
Location: Jakarta
Has thanked: 75 times
Been thanked: 9 times

Re: Implementing NEW stuff to Magarena

Postby melvin » 05 Mar 2014, 05:36

hong yie wrote:i have report some bad Ai decision made during play test in firemind.ch
i'm sure that should be helpful.
It does, just that we haven't been able to repeatedly replicate any of them.. so right now more reports isn't that useful. What we need is a way to replicate existing reported bad attack decisions.
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: Implementing NEW stuff to Magarena

Postby ShawnieBoy » 05 Mar 2014, 23:11

Now that I've got my head around making and testing scenarios, I'll see if I can make one - I have a few theories about what causes the suicide attacks, would be good to put them to the test.
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Implementing NEW stuff to Magarena

Postby hong yie » 06 Mar 2014, 01:43

i'm sure firemind.ch keep the play log when the suicide attack occurred and surely there's a pattern that trigger such decision. it would be good if the log contain local variables & memory addresses that come into consideration to make the decision, like in compiler's debugging report. :)
i'll try to review my decks in firemind.ch and report some more suicide decision.
User avatar
hong yie
Programmer
 
Posts: 216
Joined: 10 Mar 2013, 06:44
Location: Jakarta
Has thanked: 75 times
Been thanked: 9 times

Re: Implementing NEW stuff to Magarena

Postby melvin » 06 Mar 2014, 01:55

@ShawnieBoy: That's great! Thanks.

@hong yie: Having more detailed logs is not enough, we need a way to trigger the decision on demand. This way when we make a "fix", we can trigger the decision again and see if the AI makes a better one.
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: Implementing NEW stuff to Magarena

Postby Huggybaby » 06 Mar 2014, 04:29

If you had save states it would be possible to send a game in progress right before the questionable move, wouldn't it?
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: Implementing NEW stuff to Magarena

Postby ShawnieBoy » 06 Mar 2014, 17:21

Sorry to come in a bit off-topic (But yes - save states would probably give an eye on what's going on, undo after strange play then submit) Just had a thought about card submissions - With the amount of parsing and debugging that Magarena can already do for itself, wouldn't it be possible to have a card submissions page from within Magarena? Could also have the Wiki embedded to teach/aid.
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Implementing NEW stuff to Magarena

Postby hong yie » 07 Mar 2014, 01:12

Huggybaby wrote:If you had save states it would be possible to send a game in progress right before the questionable move, wouldn't it?
i do agree with this. save state can jump the game directly to the test spot. only need to save all cards in play, combat attacking, defending, graveyards, hands, spells in stack, mana pool (not available in Magarena), tap/ untap status, current phase. just dump all memory value used by Magarena into a file to be reloaded. that should be a useful tool in this matter. :)
User avatar
hong yie
Programmer
 
Posts: 216
Joined: 10 Mar 2013, 06:44
Location: Jakarta
Has thanked: 75 times
Been thanked: 9 times

Re: Implementing NEW stuff to Magarena

Postby hong yie » 14 Mar 2014, 23:13

here is an example of suicide attack. i have more creatures, greater total toughness than AI's total creature's power and still decide to attack.
Attachments
Ai_suicide.png
User avatar
hong yie
Programmer
 
Posts: 216
Joined: 10 Mar 2013, 06:44
Location: Jakarta
Has thanked: 75 times
Been thanked: 9 times

Re: Implementing NEW stuff to Magarena

Postby ShawnieBoy » 15 Mar 2014, 00:01

hong yie wrote:here is an example of suicide attack. i have more creatures, greater total toughness than AI's total creature's power and still decide to attack.
I wouldn't count that as a suicide attack (as in the ones we're looking out for), as the AI will be dead on your turn anyway. Has no way to defend all those fliers (I'm assuming from the one card in hand), so may as well attack all-out as they can't block the lethal damage.
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Implementing NEW stuff to Magarena

Postby hong yie » 15 Mar 2014, 02:35

I wouldn't count that as a suicide attack (as in the ones we're looking out for), as the AI will be dead on your turn anyway. Has no way to defend all those fliers (I'm assuming from the one card in hand), so may as well attack all-out as they can't block the lethal damage.
i think you're right. i forgot those tokens are flyers. i ever use this move to force the flyers to block my attacker too. :)
User avatar
hong yie
Programmer
 
Posts: 216
Joined: 10 Mar 2013, 06:44
Location: Jakarta
Has thanked: 75 times
Been thanked: 9 times

PreviousNext

Return to Magarena

Who is online

Users browsing this forum: No registered users and 21 guests


Who is online

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

Login Form