It is currently 07 Jul 2021, 11:55
   
Text Size

Shandalar - Program Bugs

Fetchlands-AI bad decision if no land of 1 of the coloursin deck (reviewed)

 

AI has a problematic behaviour when using a fetchland like Bloodstained Mire and the deck has no basic lands of one of the colours: eg deck has Bloodstained Mire,has Swamps but has not Mountains.AI was searching each of the times I observed it the one not in AI's deck = mountain in my example.Also AI was really low on lands (2)at the time and needed badly some lands also if AI searched for Swamp AI had a creature to play that turn but searched for Mountain and then had nothing to play with the available mana,otherwise it was a legit play to just shuffle the deck especially if you have few cards on library (not this case it was the beginning of the game)and don't want to run out of cards.
Last edited by Korath on 19 Oct 2015, 04:27, edited 2 times in total.
Reason: Component none->Duel AI

Comments

Posted by Korath » 04 Oct 2015, 14:35

I can't see if it would matter if there's only one of the two types available. It might matter if there's only one valid card in the library, or if there's only one card name available - with Bloodstained Mire, for example, if there are Swamps and Underground Seas to pick from rather than just Swamps.

Posted by lujo » 05 Oct 2015, 13:04

I can't make any sense of the OP, but the AI does have issues with fetch lands when it has no basic lands in the deck that it can fetch. This happens fairly regularly if you walk into a dungeon with Power Struggle on while having fetches in your deck.

What happens is pretty obvious, if you don't crack the fetch the AI gets hold of it and cracks it, loses a life and gets nothing out of it.

Sure, it can be adressed by replacing the godforsaken annoying Power Struggle as the default dungeon card (with whatever at all, Font of Fortunes from Theros would be fine - anything at all is better and less annoying than Power Struggle). But it's likely worth actually fixing with proper fetch AI.

EDIT: Adn while we're there, it's also probably a good idea to default-replace the Leviathan for Blue castle with anything at all temporarily. Font of Fortunes should, again, be fine simply because it's not a goddamned island eating Leviathan.
Last edited by lujo on 05 Oct 2015, 13:08, edited 2 times in total.

Posted by Korath » 19 Oct 2015, 04:55

There's two things going on here.

The quite-difficult-to-fix one is that the AI's giving too much weight to what's on top of its library, so that at least one of the random library orderings it gets while speculating outweighs paying 1 life and sacrificing a land. It then tries to follow that path when it's done speculating, though of course it just gets a new random ordering instead of the one it picked.

The much-more-difficult-to-fix one is yet another manifestation of the AI branch desync problem first identified with Giant Growth targeting, #531. I'm still getting desyncs even after fixing the targeting desync in NB.

It's relatively easy to see with tutors and especially ones like fetchlands, since there aren't many legal choices. In the originally-reported scenario, there's just two - choice 1 is pick a Swamp, and choice 2 is pick nothing. What's happening is that the AI is selecting choice 7 or 43 or whatever.

I'm not sure whether to hope that it's storing further branches from after the shuffle or not. If not, it means I'm back to searching for what's causing the desyncs, and I can't think of what else would cause them other than the class of ones I've already found.

If so, it means I've got to eventually figure out how to start speculation anew at that point; the closest I've come is running speculating during upkeep in Manalink, and that's only ever really half-worked, and probably mostly by accident. (Alternately, I could add a second RNG for things like shuffling and random discards, and store and restore its internal status when AI speculation starts and stops so it gets the same result every time. Of course, then I'd just get complaints that the AI always knows whether it'll benefit from activating a Soldier of Fortune or whatever to shuffle its library.)

As a stopgap, if recorded_rand() gives me an invalid choice while tutoring, I can just pick a random valid one, as is done with normal targeting.

Posted by Korath » 25 Oct 2015, 05:50

commit 7feca1ddd773149f0385b555325f9cedfe0a4575
Author: Korath <dgk@Dirge.none>
Date: Sun Oct 25 01:50:13 2015 -0400

[TH] #766: force recorded_rand() to allowed range even if AI desyncs

This doesn't actually fix the problem, just detect it and try to do the right
thing when it happens anyway.

Ticket details

  • Ticket ID: 766
  • Project: Shandalar
  • Status: Reviewed
  • Component: Duel AI
  • Project version: Thieves Hideout 2
  • Priority: Normal
  • Severity: Normal
  • Assigned to: (unassigned)
  • Reported by: Aswan jaguar
  • Reporter's tickets: List all tickets
  • Reported on: 03 Oct 2015, 04:45
  • Last visited by Korath » 28 Jul 2016, 17:15.
 
cron

Login Form