Shandalar - Program Bugs
AI untaps Old Man of the Sea and then retargets same creature (reviewed)
Not sure it's the AI or individual cards but, there were several bugs which happened in a match vs Saltem Tor:
- Old Man of The Sea was repeatedly used on a creature with summoning sickness, even though other targets were available. (Yes, I checked the power component). This resulted in the creature in question not losing summoning sickness. The AI would always untap the Old Man on his turn, and steal the exact same creature again, effectively achieving nothing. It didn't seem to prioritize creatures with evasion (it stole Teremko Griffin and Dire Wolves on multiple occasion), but it did prioritize creatures with summoning sickness.
- Then it used the Old Man on itself.
- Then it used BOTH it's Prodigal Sorcerers on themselves.
There have also been a big number of targeting issues in general, the AI will often cast buffs on enemy creatures (Holy Strenght and Such)
- Old Man of The Sea was repeatedly used on a creature with summoning sickness, even though other targets were available. (Yes, I checked the power component). This resulted in the creature in question not losing summoning sickness. The AI would always untap the Old Man on his turn, and steal the exact same creature again, effectively achieving nothing. It didn't seem to prioritize creatures with evasion (it stole Teremko Griffin and Dire Wolves on multiple occasion), but it did prioritize creatures with summoning sickness.
- Then it used the Old Man on itself.
- Then it used BOTH it's Prodigal Sorcerers on themselves.
There have also been a big number of targeting issues in general, the AI will often cast buffs on enemy creatures (Holy Strenght and Such)
Last edited by Korath on 01 Oct 2015, 20:37, edited 1 time in total.
Reason: retitle from "Multiple Saltem Tor Deck Bugs"
Reason: retitle from "Multiple Saltem Tor Deck Bugs"
Comments
Posted by Korath » 21 Oct 2015, 01:42
commit 6f2029cca23e8dd5c491c2bfe5f3bfdc53e73370
Author: Korath <dgk@Dirge.none>
Date: Tue Oct 20 21:41:04 2015 -0400
[TH] FIX #757: T-to-control, optional-untap cards use AI assessment to untap
Rather than just untapping if the opponent controls a creature with a higher
power than the currently-controlled creature (as in the MicroProse version and
previous Shandalar ones) or never untapping if currently controlling anything
(as in Manalink), go through an abbreviated AI assessment similar to, but even
further abbreviated from, what's done in the damage prevention step.
Algorithm:
1. Backup the current game state (via backup_data_for_ai_frontend_0())
2. Untap all controller's cards except the optionally-untapping one
3. Check state-based effects (via recalculate_all_cards_in_play())
4. Run the AI evaluation function to get a baseline rating; add 12 to it to
give a slight bias towards not untapping.
5. For each valid target,
a. Restore the game state
b. Untap all controller's cards (including the optional one)
c. Check state-based effects
d. Tap the optional card
e. Reap dying creatures (via regenerate_or_graveyard_triggers())
f. Check state-based effects again
g. Gain control of the target
h. Run the AI evaluation function
i. Stop if the result is greater than the baseline rating.
This is abbreviated compared to the damage-prevention AI assessment in that it
only runs once for each target, and so might not get the best result in the
presence of auxiliary triggers (e.g., Merieke Ri Berit destoying a previously-
controlled creature when it untaps in step 5b, and that creature having a when-
this-dies trigger requiring targeting). The damage-prevention AI, in turn, is
abbreviated compared to the general AI in that each run is stopped at the end
of the step, rather than running through the rest of the turn.
Since it doesn't run until end of turn, it won't see the adjustments some cards
make manually to ai_modifier (as is done extensively to simulate the next
turn's upkeep, and many other similar situations), nor effects from triggers
happening later in this turn. So it will still, for example, untap with the
idea of controlling a different creature that happens to be enchanted by
Unstable Mutation, without being aware that that creature will have another
-1/-1 counter by the time it can be controlled; and then cheerfully tap to
re-control the creature it just released.
Still, it's much closer to the assessment used when activating for real, and
much better than the Manalink behavior of retaining control of a Tundra Wolves
and ignoring the new Serra Angel the human plays afterwards.
Author: Korath <dgk@Dirge.none>
Date: Tue Oct 20 21:41:04 2015 -0400
[TH] FIX #757: T-to-control, optional-untap cards use AI assessment to untap
Rather than just untapping if the opponent controls a creature with a higher
power than the currently-controlled creature (as in the MicroProse version and
previous Shandalar ones) or never untapping if currently controlling anything
(as in Manalink), go through an abbreviated AI assessment similar to, but even
further abbreviated from, what's done in the damage prevention step.
Algorithm:
1. Backup the current game state (via backup_data_for_ai_frontend_0())
2. Untap all controller's cards except the optionally-untapping one
3. Check state-based effects (via recalculate_all_cards_in_play())
4. Run the AI evaluation function to get a baseline rating; add 12 to it to
give a slight bias towards not untapping.
5. For each valid target,
a. Restore the game state
b. Untap all controller's cards (including the optional one)
c. Check state-based effects
d. Tap the optional card
e. Reap dying creatures (via regenerate_or_graveyard_triggers())
f. Check state-based effects again
g. Gain control of the target
h. Run the AI evaluation function
i. Stop if the result is greater than the baseline rating.
This is abbreviated compared to the damage-prevention AI assessment in that it
only runs once for each target, and so might not get the best result in the
presence of auxiliary triggers (e.g., Merieke Ri Berit destoying a previously-
controlled creature when it untaps in step 5b, and that creature having a when-
this-dies trigger requiring targeting). The damage-prevention AI, in turn, is
abbreviated compared to the general AI in that each run is stopped at the end
of the step, rather than running through the rest of the turn.
Since it doesn't run until end of turn, it won't see the adjustments some cards
make manually to ai_modifier (as is done extensively to simulate the next
turn's upkeep, and many other similar situations), nor effects from triggers
happening later in this turn. So it will still, for example, untap with the
idea of controlling a different creature that happens to be enchanted by
Unstable Mutation, without being aware that that creature will have another
-1/-1 counter by the time it can be controlled; and then cheerfully tap to
re-control the creature it just released.
Still, it's much closer to the assessment used when activating for real, and
much better than the Manalink behavior of retaining control of a Tundra Wolves
and ignoring the new Serra Angel the human plays afterwards.
Posted by Korath » 03 Nov 2015, 04:07
Now doesn't untap at all if you don't control a creature, even if it's not controlling one.
4 Posts
• Page 1 of 1
Ticket details
- Ticket ID: 757
- Project: Shandalar
- Status: Reviewed
- Component: Duel AI
- Project version: Thieves Hideout 2
- Priority: Normal
- Severity: Minor
- Assigned to: Korath
- Reported by: lujo
- Reporter's tickets: List all tickets
- Reported on: 29 Sep 2015, 20:34
- Last visited by Korath » 31 Mar 2016, 23:21.
