Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
    Bulat Kurbangaliev

    Hey folks! I'm building react app based on boardgame.io, I'm trying undo my last move, but stuck with the following error on:

    ERROR: No moves to undo turn-order-0b7dce3d.js:451
        errorfn turn-order-0b7dce3d.js:451
        error turn-order-0b7dce3d.js:456
        CreateGameReducer reducer-07c7b307.js:1104
        dispatch Redux
        LogMiddleware client-fa36c03a.js:256
        TransportMiddleware client-fa36c03a.js:300
        SubscriptionMiddleware client-fa36c03a.js:311
        TransientHandlingMiddleware reducer-07c7b307.js:927
        undo client-fa36c03a.js:239
        onClick Board.jsx:106
        React 23
        js index.js:24
        factory react refresh:6
        Webpack 3

    Moves configured as undoable. Any thoughts how I could debug that?

    3 replies
    Andy Wang
    This message was deleted
    2 replies
    Nick Jordan
    Hi all, I have been working with a MCTS bot with Local multiplayer... I have it working where the bot will enumerate through the moves I provide, find one it likes, then make the move. However I noticed that as part of enumerating through to find the best moves, the move functions themselves are called by the bot a number of times until it finds the move it wants, then the state seems to reset to the start of the bot's turn, then the selected move is made and the bot's turn ends.... is there a way inside the move functions to determine if the current iteration of the function call is the bot enumerating through the moves looking for the best one versus the bot having already enumerated and is actually making the move rather than discovering?

    I have been making a board game with pieces that I would like to animate after each move is made, but I can't find any functionality that lets me look at the actual move being selected by the bot rather than seeing every move the bot considered, not knowing if its the one that will be selected... the bot is allowed to make multiple moves before the turn ends, but I want to animate the board after each move.... is there any way to do this?

    Thanks in advance! I am happy to explain more if my questions dont make sense

    Nick Jordan
    I have found where if I implement the "play()" function in a custom implementation of MCTS bot I can see the move the bot is selecting... I thought maybe I could flag the move as "selected_by_bot" within this function so I will know within the move function that I should animate the move, but I can't edit the G state within the bot, so I don't think this approach would work. Please help!
    Nick Jordan

    To summarize my main question:

    As a MCTS bot calls the various move methods while enumerating through the list of moves I provide it, is there any field on G or ctx or otherwise that I can check in the move function (or onMove(), onEnd(), etc) that tells me the move is the one that was selected by the bot?

    5 replies
    Theo Salzmann

    Hey folks,

    What would be the correct way to import boardgame.ios server/utils? (if there currently is any)
    I currently need this, because I have a custom join-match route, which needs access to bgios createMatch-function.
    I can import utils via

    import {
      createMatch as bgioCreateMatch,
    } from 'boardgame.io/src/server/util'

    However this will make typescript typecheck these files and I get tons of errors. As soon as we us an import from 'src', an exclude inside the tsconfig will no longer work.
    Also I would prefer to import these from dist, but they currently don't seem to be part of the dist bundle.

    2 replies

    Hey all, I'm having trouble with implementing remote multiplayer functionality. I've validated the game logic and behavior in local multiplayer and am trying to now port to remote. The issue I have is my client is having issues communicating with the server. When I run with a React LobbyClient component on my app, the game name and min/max players correctly populate in the boilerplate code, but when I try to create a new game, I get the response failed to create match for Azul (Error: HTTP status 404). When I use the plain JS LobbyClient implementation and call listGames(), the server returns undefined and a POST request to server:PORT/games/<game-name>/create also returns a 404 (Not Found) status code.

    Here is my client and server code. index.js is located in base directory/src. server.js is located in base directory.

    index.js (client)

    import React from 'react';
    import ReactDOM from 'react-dom/client';
    import './index.css';
    import { LobbyClient } from 'boardgame.io/client';
    import { Lobby } from 'boardgame.io/react';
    import Azul from './Game';
    import AzulBoard from './Board';
    async function lobbyStuff() {
        const lobbyClient = new LobbyClient({ server: 'http://localhost:3001' });
        const { matches } = await lobbyClient.listMatches('Azul');
        const { games } = await lobbyClient.listGames();
        const { matchID } = await lobbyClient.createMatch('Azul', {
            numPlayers: 4
    const root = ReactDOM.createRoot(document.getElementById('root'));
                    { game: Azul, board: AzulBoard }
    const { Server, Origins } = require('boardgame.io/server');
    const Azul = require('./src/Game');
    const PORT = 3001;
    const server = Server({
        games: [Azul],
        origins: [Origins.LOCALHOST],
    1 reply

    Hi guys. I use flat-file to save the game's state. Sometimes things go sour, and I need a process to clean periodically zombie games. I'm trying to call directly the flat files methods but I can't figure it out. This code:

    const { FlatFile } = require('boardgame.io/server');
    const matchesDB = new FlatFile({
        dir: './db/matches/',
        logging: true
    console.log("Attempting List Matches");
        (result,error) => {
        ).catch((error) => {
            console.log("List Marches Error");

    Will throw an error :

    TypeError: this.games.keys is not a function
        at FlatFile.listMatches (/AbakIO/abak-evolution/node_modules/boardgame.io/dist/cjs/server.js:2710:39)
        at Object.<anonymous> (/Abak/Development/AbakIO/abak-evolution/src/assets/js/server/utilities.js:9:11)`

    Can someone help me to understand what I'm doing wrong?

    1 reply
    Lucifer Morningstar
    Hi all. When performing any action, the board is not redrawn
    2 replies
    Darian Hickman
    Can I hire somebody to migrate my 10 year old javascript board game to boardgame.io? If there's a better channel to post this request please reply with that. https://www.mavgo.com/portfolio/kenya
    4 replies
    Alex Jurkiewicz

    In the debug panel, I can select different player to change who a move is submitted by. I'm using this to test simultaneous stages. Is there any way to see which player is "active" in the context? playerId doesn't seem to get set, and currentPlayer is always set to the player whose turn it is.

    I'd like to know the currently selected debug player so I can update the UI to show their state

    10 replies
    Richard L
    Hi. I am implementing a game with a time limit on certain stages. I was hoping to implement this in the server with a ‘time left’ flag as part of the game state. But I couldn’t see how to do this within the BGIO framework. Any advice would be welcome. Thanks.
    2 replies
    Izzy Lancaster✨

    I'm trying to implement a card game with a "pass" mechanic. If a player passes, they're removed from the turn order until all but one player passes. Once that happens, the board is cleared and the remaining player starts a new round, with all the players added back into the turn order of course.

    What tools do I have to manipulate the turn order in board game.io? It's not immediately obvious how I can do this, since I know I can't modify the ctx object.

    3 replies
    I've been stuck on a problem wrt Stages for a while. I'm implementing an effect in a 2 player game where the opponent is made the active player for a move before being passed back to the current player. I go from { '1': 'some-stage' } and call setActivePlayers to set { currentPlayer: 'another-stage' } expecting ctx.activePlayers to be { '0': 'another-stage'}, then calling ctx.events.endStage() and going to {'0': 'last-stage'}, but instead after everything executes, I find myself in {'0': 'another-stage'}. Is there something fundamental I'm missing with how setActivePlayers and endStage works with regards to the current player not being an active player? Thanks!
    1 reply
    Hi, how can I check on which stage the current (client) player is on?
    I cannot see anything of sort in the G or Ctx objects.
    1 reply
    Francisco Alamino
    Hey! long time working with other parts of my game. Glad to see a lot of activity :D. Is there any correct way to use Unity with boardgame.io? I was wondering if I can just use the boargame backend and use unity as the client. This would be a great way to make my game multiplatform, but I don't know if its viable. If anyone already made something like this please be welcome to comment :D
    2 replies
    Nicolas Castejon
    Hey ! I have checked the deployment part with an example with Heroku for backend and client.
    Anyone has already done it with Vercel ? And how to setup such a deployment ? Thanks ! (I could not find an answer here and in the Github issues)
    David Torres
    hello, I've been working on implementing a card game design of mine in BGIO (0.49.12). I'm mainly interested in having an AI opponent to test against and playing around with the bot simulations to see what I can learn from those games. A few things I couldn't seem to figure out though:
    1. I have the turn structure broken out into 3 phases: a main phase where the bulk of the moves should happen, a cleanup phase where things are setup for the next turn, and a draw phase. Is this the right way to structure it?
    2. the AI never seems to progress to the next phase or pass the turn, despite returning an empty "moves" array (returning false throws an error)
    3. I cannot seem to figure out how to prematurely end the phase either. ctx.events as shown in the docs is an undefined property so I am unable to call ctx.events.endPhase() when my enumerate function runs out of moves. instead the bot just loops forever finding zero moves until it gives up.
    4. I'm only giving the AI valid moves, yet it still sometimes hits an invalid move (trying to access a card that isn't there). should I be looking harder for a bug in my logic or is this something that is expected to happen?
    5. currently my game only needs to do one move in the cleanup/draw phases so I would think specifying min/max moves to 1 would force those moves to happen. if there were multiple moves possible in a phase, how would the ai->enumerate method work in that case?
    5 replies
    thanks for any help in advance :)
    When it opens in 2019, the casino will have several different types of slots and table games available. Variety of slot machines, progressive jackpots, and a live dealer casino are all available (look at https://njcasimile.com/real-money-casinos/ reviews). It also has flexible payment alternatives, including bitcoin, and responsive customer support. Users may get their feet wet without risking any cash.
    Hello guys!
    Is there any way of changing current game stage with moves?
    2 replies
    Hey all. I've got a card game build on boardgame.io where many actions are automated and done in the background: decks shuffling, cards dealing etc. I have react native client dealing with all of this. On some of those actions I'd wish I can show players some animations to make them better understand what's going on in the app. I'm thinking some kind of websocket messages, some kind of events, sent from the server to clients while the state is changing. Is there a way of achieving this or something like that? Or am I going in a wrong direction and possibly I simply should add a field to a state that will say which actions happened since the last move? Thank you in advance :)
    3 replies
    Francisco Alamino
    I'm trying to implement a maxMoves in my mage but with the possibility of save moves for the next turn. Eg: I have 2 moves per turn, but if I only use 1, the next turn I will have 3 moves, and if the next turn I don't use any, I'll have 5, etc. Is there any /correct/ way to do this? I was looking for something like moves property in my G object and then use something like endIf in my turn object.
    1 reply
    There are so many awesome ideas that I would like to use in my project too! But for now, I draw experience from other challenging games and use other platforms as references. What games are you looking at and want to use cool features for yourself? I have a rather large list, so it's harder to implement this in one project but I think that watchfulness is the key issue.

    Hi, does somebody know how to programmatically dispatch a move. For instance when the user executes the "rollDie" move and it hits 6. I want the "Spawn" move to be executed automatically without any user interaction.

    EDIT: In other words: How can I execute/dispatch a Move<G, Ctx> object.

    1 reply

    Related to @ilivss question, can I execute a move/action with no user interaction at all? An example - on the turn start (OnBegin) I would like to automatically roll a die and more based on the result. with out the user taking any action on his turn unless the die hit 6. then I would like to provide the user the option to take a move.

    My problem is that ctx.currentPlayer or ctx.playerID are not defined at this stage. so I can not refer to the relevant player.

    2 replies

    I'm having trouble trying to run a client from node. I would like to simulate a client to run a bot, but I cannot accomplish that.
    This is my code:
    import { LobbyClient } from "boardgame.io/client"; let lobbyClient = new LobbyClient({ server: 'localhost:8000' }); lobbyClient.listMatches('AbakEvolution') .then((resp)=>{console.log(resp)}) .catch((error)=>{console.error(error)})

    And gives the following error:
    ReferenceError: fetch is not defined

    What puzzles me is that this runs perfectly in a web browser, but not node.

    Is there a package I should use that is missing?

    1 reply
    Hello, I just followed the tutorial with react on my local and the board doesn't update after making a move or when the game ends. Is there anything obvious that I should be looking out for? I've played with this package before on glitch with no issues. Any help much appreciated :)
    6 replies
    Emil Elgaard
    Are the docs / typescript defs out of date?
    I tried to call an event via ctx.events but that is not undefined.
    However I see that there is an object called "events" in the props of the Game object that contains all the methods such as setActivePlayers that shold be in ctx.events.
    James Moon
    Is there a built-in or preferred way to allow a player to move multiple pawns during a turn? I'm looking at the docs, specifically attributes like minMoves and moveLimit, but I'm not seeing how to end a turn when a player moves all of their pawns.
    3 replies
    Noé Bonnet
    Hi ! can anyone guide me on how to handle player disconnection ? is there an event or something in the game logic i can use to update my player state when someone leave the game ?
    8 replies
    Noé Bonnet
    I create an issue about this boardgameio/boardgame.io#1088 I hope someone can help me to achieve that
    Any guide on forking and using the forked dependency? The way I've done it is giving me Module not found: Error: Can't resolve 'boardgame.io/react'
    Bjarke Felbo
    Hey everyone, boardgame.io looks awesome! Excited to play with it.
    Anyone know why what made it take off so dramatically in Dec 2017? :sweat_smile:
    Most repos don't take off like that right after launch :smile:
    Hey! Is there any library for creating a client on, say, Unity3D, while still having the server on boardgame.io ?
    Alex Rod

    Hello! im having trouble fixing the "Error: failed to retrieve list of matches (TypeError: NetworkError when attempting to fetch resource.)"

    I'm attempting to host the backend in heroku and the client will be hosted separately, but I can't seem to get this to work even on localhost

    1 reply
    If I want to have classes for my cards, I can't store them fully in the board state because it doesn't allow that. So I'm just storing the data (i.e. {...someCardClass} and then when I want to use the method having to look that up and use the state rather than this. That seems really hacky. What's the right way to implement something like that? Would I have to store every cards unique methods as moves? (I'm hoping not)
    1 reply
    Judie Thai

    hi all, I'm having a lot of trouble deploying to heroku. I was able to follow the docs to get the game working with a lobby on local, but deployment has been rough.

    could someone check my project here and tell me what I'm doing wrong? https://github.com/djoodi/web-omok

    3 replies
    Good morning, boardgamers. Is there any good way to hook onto specific Game state changes to update the game state for all other players with animations?
    2 replies
    Desmond Rivet
    Hi there. This might be a stupid question, but I'm trying out the basic Tic-Tac-Toe React tutorial. I'm finding that the board doesn't update when I click on it. I'm not sure what I'm doing wrong. Is this a known issue?
    3 replies
    Noé Bonnet
    Hi ! just asking the community again, can someone helps me with this issue ? boardgameio/boardgame.io#1088
    Noé Bonnet
    For now i'm considering creating a new match each time a player leaves. For example for a match of 4 players, player 2 leaves, a second match is created using the first match players data of the 3 other players (points, board positions, etc..) and all the players in the first match are automatically connected to the new match. But it's not the ideal thing to do for our project... does anyone have another idea ? To add some precision, in my game players who leave the game are not allowed to come back.
    Noé Bonnet
    @apollov:matrix.org i tried using plugins to achieve that like you suggested, but the plugin methods are not called when someone leave the match
    Gabriele Castellano

    Thanks for this amazing framework!

    I am encountering a possible limitations in triggering some actions whenever something happens. Indeed, the available Events API is only for predefined events and is only related to the ctx object.

    To my understanding, it is not possible to create a custom event, and trigger / handle it server side from multiple areas of the code. For instance, I could define an event "CardPlayed" that is notified within a move (every time a player plays a card). Then, if there are one or more handler registered for that event, they will be executed. Otherwise nothing would happen.

    Am I missing something?

    2 replies
    is PlayerID on context optional when in a move?
    e.g.: ctx: {..., PlayerID: string | undefined} correct?
    Desmond Rivet

    Hi all. I have a couple of conceptual questions I'm hoping someone can help me out with.

    Let's say I have a game with two stages in the turn section:

    turn {
      stages: {
         doSomething: { 
              moves: { DoSomething }, 
              next: "selectCardsAndShowOne" 
         selectOneCardToShow: {
              moves: { SelectOneCardToShow} 

    Basically, each turn you do some move (the "doSomething" stage) and then you have to, let's say, pick two cards from a deck, show on on the board, and discard the other (the "selectOneCardToShow" stage).

    My issue is that the move in the second stage ("SelectOneCardToShow") consists of taking two cards into your hand from a deck and choosing one to display to everyone. In my mind, and maybe this is the wrong way to think about it, it's only the last part that's the actual move, because the only part where the player has to make a choice. The first part, where the two cards are picked from the deck, isn't really under the player's control. He has to do it, and he has to pick the top two cards.

    So how do you model that first part? What part of the framework runs the code which takes the two cards from the deck and puts them into the player's hand?

    One thought that occurred to me is that I could do it as part of the previous move, the "DoSomething". At the end of that move, I could transfer two cards into the player's hand. But that seems messy, especially since those cards have nothing to do with "DoSomething".

    Is there a "beginStage" hook I can run? That could work but I didn't see one in the docs.

    Another option is to treat the "Pick two cards" part as a separate move. That seems weird too, especially since the player doesn't really have anything to do except pick the cards. No choice to be made or anything. I guess one could do that, but I'm still not sure how I'd "enforce" the move, since it's basically mandatory now.

    Any thoughts or ideas? Thanks in advance.

    3 replies