Improving Autobuy: Handling debt cards and multiple buys

Previous topic - Next topic

Ingix

I'm always playing with autobuy and I'm very happy with it, it does handle many situations very well. There are however 2 situations where I'm scewing myself over repeatedly and which maybe could be improved:

1) When buying cards/events with debt, currently no treasures are played for the debt component of the cost.

It would be much better if the game could figure out the debt cost and play as many treasures to satisfy the debt cost (or play all if the debt can't be paid with all treasures).

2) When I'm having multiple buys, if I click on the card to buy, this is it, the game will only play the treasures to satisfy that buy. I am given the option to exersice my other buys, but since I can't play any more treasures this means usually only 0-cost buys are available.

I hope that the game could in this case allow me to continue to click on cards/events to buy (of course taking into account the maximum amount of money it could generate vs. the cost of what I already clicked on) until all my buys are used up. If the game could also take into account that several events and at least one card (Forum) provide buys when bought, this would be even more awesome.

Problems/corner cases I see:

a) buying a Villa must end the selection process,
b) disallowing to buy more cards from a pile than there are left on that pile,
c) showing the correct next card to buy on a split pile once the top card(s) have been bought,
d) not showing the next card on Knigths/Ruins when the top card has been bought.

a) and b) must be handled, of course. For c) and d), while I would like to have them handled in detail, an option would be to just disallow buying more than 1 card from a non-uniform pile (meaning a pile that contains potentially cards with different names) with autobuy.

Stef

1) is doable and sounds like a good idea.

2) is really complicated and I think you've only touched the tip of the iceberg on the edgecases.
All on-buy/on-gain abilities on cards, all on-play abilities on treasures, ...

Ingix

For 2):
The sequence is, as you know, to first play all the treasures, then to buy the card(s). Autobuy makes you (at the moment) do the selection of one card to buy, then figures out what treasures are needed to be played so you can afford the selected card.

It doesn't take into account all treasures, for example Contraband, which I'm totally fine with, because that obviously has problems with the Autobuy model. So let's keep it that way, all the treasures considered behave nicely and don't do anything strange (like Horn of Plenty). That means there are no complicated on-play abilities of treasures to consider. In addition, you would need to consider such on-play abilities of treasures anyway for the current implementation as well (which is probably exactly the reason why Venture, Loan and others are not considered for Autobuy at the moment).

For the on-buy/on-gain abilities of the bought cards: Those happen when the cards are bought/gained, which happens *after* the treasures are played, which is the primary concern of the Autobuy function. Consider it like this: Autobuy is

1) a fancy interface for the player to select a sequence of cards/events to buy, then
2) an algorithm that figures out which treasures are needed to be played so that the cards selected in 1) can be bought, and
3) a method that returns to "the game engine" by handing it the list of cards/events to buy (in order).

The game engine would then proceed to buy the cards/events one after the other, each time of course checking that this is still possible, but also handling all the on-gain/on-buy abilities as usual. In any of the cases where the buy is no longer possible, it aborts the process, but returns to the usual interface of buying cards in the buy phase.

My edge cases are mostly concerned with correctly dealing with 1), while you seem to think that 3) will give problems. But 3) is handled after 1) and 2) and if any problems occur, the process can safely be aborted. That concerns even the case of a Villa being bought, because returning to the action phase would be a reason for "buying the other selected cards is no longer possible".

At the current implementation, 1) is 'easy' because only one cards needs to selected and this may need some overhaul under my proposal. 2) wouldn't change with more cards to be selected and 3) is just a generalization of what happens now.

Examples:

A) Player selects to buy 2 Ports, when he has 2 buys and 8 coin "in hand", but only 2 Ports remain in the Port pile. Autobuy will play the 8 coin, then the game engine buys a Port, triggering its on-buy ability, so the players gains 2 Ports already from the first buy. The game continues, trying to buy another Port (as instructed), but fails, as there is no more Port in the pile. The game is in the state of the player having 1 remaining buy and 4 coin to spend.

B) Player selects to buy 2 Heralds, when he has 2 buys and 8 coin "in hand". Autobuy will play the 8 coin, then the game engine buys a Herald, triggering its on-buy overpay interface. The player suddenly realizes that he wants to overpay 2 coin. When all is done with the first Herald, the game continues, trying to buy the second Herald. But since the player only has 2 coin available, this can't be done. The game is now in a state of the player having 1 buy and 2 coin to spend.

Both cases A) and B) are situations where the player better had not used Autoplay, but at least he can spend his remaining coins.

Tl;dnr: There are interface problems to overcome, but all the on-play abilities of treasures are already being taken into account by the current implementation, and all the on-buy/on-gain abilities of bought cards happen later and the process can at this stage easily be aborted if a problem occurs.

tufftaeh

If on-buy effects as Swamp Hag and Haunted Woods were shown similarly as at MF (i.e. purple/orange background for the "+"), maybe 2 buys and debt could be shown similary, e.g. by copper color for "you will gain debt" respectively a different color (or different symbol) for "you have multiple buys" (both only if autobuy is active, of course)?
[Sorry for somehow hijacking this thread, but opponents' duration attack effects really should be made immediately visible.]

markus

Regarding 1) debt cards, there must be the option to buy a debt card with auto-buy on without playing all (basic) treasures (edge cases are e.g. Haunted Woods or Possession)

To be honest, I'm fine with auto-buy being something only for single buys not involving debt. Misclicks for single vs. multiple buys wouldn't be a problem, if "no-info" undo was available (barring edge cases like Inn). Auto-buying debt cards without playing enough treasures to cover the cost could give a warning, because the turn ends automatically otherwise and info is revealed.

markus

Fool's Gold is something where auto-buy could be improved on, because it currently always counts it as 1 coin.

Cave-O-Sapien

With the number of edges cases out there, I think it might be better to change the "Autobuy" button to say something like "Play All Basic Treasures" and leave it at that.

Right now, it's not really clear what "Autobuy" means or what I should expect it to do. Will it play my Bank? Will it play my Potion? Is it smart enough to not play Copper with Grand Market out? Will it play Silver first if I have a Sauna in play and want to trash a copper in my hand? etc. etc.

Rather than handle all these cases, I'd argue it should be scaled back and renamed.


Ingix

Maybe you misunderstand what I mean with "Autobuy". It is *not* the button in your buy phase that says "Play all Treasure". It is an option in "Options", which in your buy phase allows you to simply click on the (one) card to buy without playing any treasures first. The game determines what you can buy and it will then play the Treasures for you.

Cave-O-Sapien

Quote from: Ingix on 08 May 2017, 01:59:44 PM
Maybe you misunderstand what I mean with "Autobuy". It is *not* the button in your buy phase that says "Play all Treasure". It is an option in "Options", which in your buy phase allows you to simply click on the (one) card to buy without playing any treasures first. The game determines what you can buy and it will then play the Treasures for you.

Oops. Sorry to derail the discussion.