It is currently 16 Apr 2024, 22:33
   
Text Size

first strike fixes.

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

first strike fixes.

Postby jpb2 » 09 Jun 2009, 07:07

Hi all,

I am wondering what fixes have been made to first strike and double strike. I am very interested in any fixes on the AI side, since when this was implemented the AI had no clue about that first strike combat even existed. It is not a nice thought to add something to mtgforge that makes it easier to beat the AI. The AI already has too many disadvantages.
jpb2
 
Posts: 11
Joined: 21 Apr 2009, 16:36
Has thanked: 0 time
Been thanked: 0 time

Re: first strike fixes.

Postby Almost_Clever » 09 Jun 2009, 10:53

The AI doesn't really comprehend first / double strike. It will block a first striker with multiple blockers, not realizing that one or more of the blockers will be destroyed from first strike damage before the blockers are able to assign lethal damage to the attacker.
And while Dennis has fixed most of the bugs with first strike (lifelink, mixing first strike with non-first strike blockers), there still appears to be some weird interactions (with wither, for example) that indicate that the first / double strike damage is not working correctly.
A woman came up to me and said / "I'd like to poison your mind / With wrong ideas that appeal to you / Though I am not unkind."
User avatar
Almost_Clever
Tester
 
Posts: 345
Joined: 15 Jan 2009, 01:46
Has thanked: 0 time
Been thanked: 0 time

Re: first strike fixes.

Postby DennisBergkamp » 09 Jun 2009, 16:38

Yes, exactly. I've fixed quite a few things, but there still appear some bugs involved.
I haven't attempted fixing the bug you reported with wither and first strike yet AC, but it looks like a tricky one to fix :? Assigning unlimited damage should be easy to fix, but the fact that the first strike damage gets applied as wither damage, not sure what's going on there :(

Anyway, it's not entirely true that the AI doesn't comprehend first / double strike... I spent a bit of time on two methods in CombatUtil.java: canDestroyAttacker() and canDestroyBlocker(). This is what the AI uses to decide whether to single block or not (it's different with multiple blockers), and when to attack. It's very messy, but I've added checks for all of the cases (when an attacker or defender has first / double strike, wither, flanking, deathtouch, etc. ...). However, I've noticed that the AI still does some stupid attacks/blocks... but this seems to hold true in any case, whether there's first / double strike involved or not :mrgreen:
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: first strike fixes.

Postby mtgrares » 09 Jun 2009, 18:19

However, I've noticed that the AI still does some stupid attacks/blocks... but this seems to hold true in any case, whether there's first / double strike involved or not
The AI randomly decides to not attack or not block with a given creature in order to make the computer a little bit unpredictable. Unfortunately sometimes it also makes the computer look very stupid. (This also explains why the computer sometime targets null with creature pumping cards like Giant Growth. Giant Growth calls ComputerUtil_Attack2 and sees that the creature will attack but later the computer combat code call ComputerUtil_Attack2 and the creature doesn't attack because it is random.)

The randomness of the computer not attacking and not blocking probably should be weighted like the computer regeneration code. The code is in ComputerUtil_Attack2 and ComputerUtil_Block2. The code is simple because it evaluates each creature separately. For example, if the computer has 3 creatures, the code decides should each creature attack or block based on only that creatures stats and ability (like flying).
mtgrares
DEVELOPER
 
Posts: 1352
Joined: 08 Sep 2008, 22:10
Has thanked: 3 times
Been thanked: 12 times


Return to Forge

Who is online

Users browsing this forum: No registered users and 44 guests


Who is online

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

Login Form