tobymao / 18xx

A platform for playing 18xx games online!
https://18xx.games
Other
298 stars 185 forks source link

Add an auto option, with a "maximum bid" setting, for all auctions of single items #10048

Open slapphappyjazz opened 11 months ago

slapphappyjazz commented 11 months ago

18EU has a set of options for speeding up the auctions in its lengthy initial stock round. These allow a player to set their maximum bid. On their turn, the game will automatically raise their bid by the minimum amount, unless this would exceed the maximum they have set, in which case the game will enter a pass command.

This seems a useful option for any game that auctions a single item at a time. E.g. parliamentary rounds in 1862, initial privates in 1860 and 1817, starting new companies in 1817 and 1861/67, and many others. I think it would speed up async play noticeably.

This would not be suitable when multiple items are auctioned simultaneously, as with 18GB privates or the myraid auctions in 1822. It could potentially be used in 1830-style auctions when multiple people have bid on a private, but the time saving may be minimal in such cases.

I don't know how best to implement this. Perhaps it could be a library that developers could call from games as appropriate? It would be nice to have the option presented on the main screen along with the normal bid options, rather than on the auto tab, or perhaps a reminder on the main screen if the auto command is available.

(N.b. the 18EU implementation is more complex than I've described here because it also has to handle decreasing "dutch" auctions, but that isn't relevant to other games).

benjaminxscott commented 11 months ago

+1

In 18EU does the auto auction button show up in Game during the auction round?

To me there's a couple things: 1 - expand auto-auction functionality to other games 2 - (for convenience and visibility) include the 'auto action' button in the Game auction round UI, similar to Auto Pass during SRs

Looks like the implementation is here: https://github.com/tobymao/18xx/blob/master/lib/engine/step/programmer_auction_bid.rb#L14

Rendering here https://github.com/tobymao/18xx/blob/master/assets/app/view/game/auto_action/auction_bid.rb

18MT seems to support it as well as 18EU (only those two for now)

https://github.com/search?q=repo%3Atobymao%2F18xx+ProgramAuctionBid+path%3A%2F%5Elib%5C%2Fengine%5C%2Fgame%5C%2F%2F&type=code

fwiw 1848 has dutch auctions