Bot player

Game development with Board Game Arena Studio
Post Reply
User avatar
AxeCrazy
Posts: 90
Joined: 15 March 2014, 01:07

Bot player

Post by AxeCrazy »

For a game i just requested alpha mode the publisher would also like to have the "SOLO" mode implemented.
In this solo mode a "bot opponent" is added to the game which always take the same steps (no real intellience though, just fixed action and the outcome is dependent on the order of the drawing deck).
Is such a bot player even allowed to add to a game and any thoughs on how to implemtend this?

I could created several "game" states for each move the bot makes (because no interaction is needed) and after the bot took his last action give turn back to the actual player.
would that work?(think so)
User avatar
Tisaac
Posts: 2736
Joined: 26 August 2014, 21:28

Re: Bot player

Post by Tisaac »

AxeCrazy wrote: 30 January 2025, 13:14 For a game i just requested alpha mode the publisher would also like to have the "SOLO" mode implemented.
In this solo mode a "bot opponent" is added to the game which always take the same steps (no real intellience though, just fixed action and the outcome is dependent on the order of the drawing deck).
Is such a bot player even allowed to add to a game and any thoughs on how to implemtend this?

I could created several "game" states for each move the bot makes (because no interaction is needed) and after the bot took his last action give turn back to the actual player.
would that work?(think so)
It is allowed and you can just have a single game state during which the bot acts on the board as you suggested
Oberstille
Posts: 12
Joined: 30 May 2023, 05:18

Re: Bot player

Post by Oberstille »

Yep, I've done this! You can take a look at Effortless (which is complete and in alpha now, just waiting for the beta release process) or its source code on GitHub (https://github.com/wardcanyon/bga-effortless) if you'd like to see how I did it.

In short, the game is built around the idea of "seats" rather than "players" (where each seat has a hand, a color, and so on). Each human player gets a seat, and then (per the rules) bot players are used to fill the table so that there are at least three seats. The "next turn" code selects the next seat, not the next BGA player at the table; if that seat is controlled by a human, it hands over control to the human player like normal, and if it's controlled by a bot, the game transitions to a state where the bot's logic runs.

I've found that pattern useful for other things, too---for example, in The Shipwreck Arcana (https://github.com/wardcanyon/bga-theshipwreckarcana/), I use it for the two-player challenge mode, where each player controls two seats, and in Burgle Bros 2 (which isn't complete yet), I'm using it to allow players to play multi-handed solo.
User avatar
AxeCrazy
Posts: 90
Joined: 15 March 2014, 01:07

Re: Bot player

Post by AxeCrazy »

Oke, thanks for your comments.
Got this working, so thats great.

But now i have 1 state in which several steps are done and thus several logging notifications are send.
I would like to "delay" the seperate notifications to simulate the "bot" takes time between steps.
Should i then create multiple gamestates and use a usleep in the php to get this gooing?
User avatar
AxeCrazy
Posts: 90
Joined: 15 March 2014, 01:07

Re: Bot player

Post by AxeCrazy »

Managed to get this done with async notif function on client side.
Thanks for support via discord!
Post Reply

Return to “Developers”