Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Corentin Dancette
    @cdancette
    I have another question, about the "undo" action. I tried to add a button, but any time I press it, the server outputs "ERROR: playerID=[0] cannot undo / redo right now"
    same for the other player
    is there something to configure to make it work?
    Chris Swithinbank
    @delucis
    Ah, that’s probably due to this bug: nicolodavis/boardgame.io#565
    7 replies
    The logic accepting/rejecting undo actions is not very good with stages active at the moment.
    Corentin Dancette
    @cdancette
    Ah, yes, i'm using a lot of stages
    Thanks, maybe i'll implement my own undo if it's really needed!
    About stages, in the documentation, it says that they're mostly useful for non active players, but I'm using them a lot for active players, is this a bad practice ?
    I use them to restrict the range of actions that the current player can do
    Chris Swithinbank
    @delucis
    That sounds like a good use, sure! They’re helpful for both scenarios.
    (Also, rather than implementing a whole undo system, you may like to look at the underlying code linked in that issue — there could be some very small changes we could make to fix the undo system using stages.)
    Corentin Dancette
    @cdancette
    Okay, neat :)
    I really like boardgame.io btw, so thanks a lot @nicolodavis, @delucis and other contributors for your work ! It makes it so much faster to code a multiplayer game! I enjoy particularely not having to deal with networking and state synchronization..
    Chris Swithinbank
    @delucis
    Nice to hear!
    Corentin Dancette
    @cdancette
    Hey! Is it possible to undo from the game, or is it only possible from the client ? Documentation mentions only the client this.props.undo()
    3 replies
    Davi Araki
    @DaviAraki
    I'm trying to run stages between phases, but i'm encountering 2 problems, first: i can't see which stage is as i can see the phase in ctx.phase. Second: the moves on the stage are not overriding anything
    17 replies
    Mohre
    @Mohre
    Hi. It wrote a custom player-view and need to mutate G in it.
    how can I apply immer to my custom player-view to let me change G instead of creating new one using spread syntax?
    2 replies
    Mohre
    @Mohre
    Is it possible to assign a client two different playerID?
    It is useful when a 4 player game played with 2 players each take 2 seats.
    2 replies
    aflorj
    @aflorj
    Hey, guys! I am making a card game and want to pause rendering at one point in each round.
    9 replies
    Günther
    @gunthergun
    Hey there, I am having trouble with understanding the PluginPlayer Code. I copied from the documentation what you are supposed to be using however, in my visual layer I cannot acces any values. G.player or G.players both are undefined. ctx.player is also undefined. The debug window also does not show any values from this plugin. However the setup runs at the start of the game for each player ? So what am I doing wrong ? Is there another way to access the player values that were setup at the start ?
    1 reply
    ThanosDodd
    @ThanosDodd
    Hello beautiful people. First-time user here. I'm creating a 2-player game whose movements are decided by 2 dice. Can I place the stages (and moves) of a particular phase within that phase or must I place stages separately inside turn: {} in the game constant?
    4 replies
    Alexander Craggs
    @popey456963
    Hey! Found boardgameio/boardgame.io#49 which points to simultaneous turns being possible using phases. Coudl anyone explain that somehow?
    ThanosDodd
    @ThanosDodd
    Hello! I'm making a 2-player game where each player's pieces move in opposite directions. I've solved this issue by changing the direction variable at the end of a turn but I'm a bit confused as to how to render the game in multiplayer mode. I want the board to look like their opponent's, but flipped (there is no issue with flipping the pieces as they are circular, the board is also symmetrical)
    1 reply
    Corentin Dancette
    @cdancette
    Hi! Is it possible to choose the playerID while using the default lobby implementation ?
    1 reply
    ThanosDodd
    @ThanosDodd
    Hello! Is a dice roll a 'move'? Meaning should it go in the game constant or the board.js?
    4 replies
    Alexander Craggs
    @popey456963
    Can stages have an 'onEnd'? For instance, we have a stage that applies to 'everyone' in a turn, letting them take one action. Once everyone has taken their turn, we want to run some other code.
    Oliver Ni
    @oliver-ni
    This library is awesome. Thanks for the hard work!
    1 reply
    ThanosDodd
    @ThanosDodd
    Indeed! Can I return the next phase within 'endIf' with a condition like so?
    endIf: (G, ctx) => { if () { return { next: 'option1'} } else { return { next: 'option2'} }},
    1 reply
    Alexander Craggs
    @popey456963
    My game always has two players, no matter what I do. How can I increase the number of players?
    10 replies
    ThanosDodd
    @ThanosDodd
    Hello! I'm looking to repeat a turn based on how many of the dice have been used. Can I call endTurn method like so at the end of the turn? next: { turnCheck(G, ctx) { if (G.dice.length > 0) { return "selectPiece" } else { return ctx.endTurn() } } }
    kngoh
    @kngoh
    Hi gang, I'm having an issues when I
    import { Local } from 'boardgame.io/multiplayer';
    Results in: Uncaught ReferenceError: regeneratorRuntime is not defined
    5 replies
    Alexander Craggs
    @popey456963
    @delucis any ideas on TypeError: JSONTree is not a constructor when I'm running tests? Specifically coming up on the line of import JSONTree from 'svelte-json-tree-auto';.
    3 replies
    Adrian Gaudebert
    @adngdb
    Hey folks! Is it possible to configure a phase so that it doesn't increase ctx.turn? I have a mulligan phase where players can choose cards in their hands, but I rely on the turn number at the start of my game for some special decisions. It's easy to solve, just look if ctx.turn is 2 instead of 1, but that smells very prone to bugs to me, so I wonder if there's a better way.
    3 replies
    Ahmed Mokhtar
    @xMokAx
    what is the best way to show the log in the client ?
    I'm thinking about looping over the log array and show the moves i want to move is this the best way to do it !?
    1 reply
    Randen Kelly
    @aowie1
    https://boardgame.io/documentation/#/secret-state
    says to import Game via
    import { Game, PlayerView } from 'boardgame.io/core';
    But Game isn't available in core
    8 replies
    Kumar Ayush
    @cheekujodhpur
    Hello folks, sorry for the silly question, but I am getting a Module Parse failed error
    Error in ./~/boardgame.io/dist/cjs/react.js Module parse failed: /home/cheeku/Projects/lama-client/node_modules/boardgame.io/dist/cjs/react.js Unexpected token (109:24)
    I've initialised my directory with create-react-app, then npm install boardgame.io, and then simply import { Client } from 'boardgame.io/react';
    This appears to be something trivial that I've missed, but having spent 2 hours over this, I must ask for help
    9 replies
    Mohre
    @Mohre
    How can we pass setupData to game setup function?
    I use Client from boardgame.io/react
    5 replies
    Gastón Ezequiel Durand Vadas
    @gdurandvadas
    Hello! Is it possible to end the game for specific players while the others continue playing?
    7 replies
    Adrian Gaudebert
    @adngdb
    hey @nicolodavis, I'm facing a new bug with v0.40.0-alpha, but the release is old, and @delucis added a bunch of changes to that branch since then. Would it be possible to make a new release of that branch, so that I could check if my bug persists with the latest changes?
    2 replies
    Chris Swithinbank
    @delucis

    @/all

    v0.40.0 has just been released. You can see a summary of the features and bugfixes in the changelog and details about breaking changes on GitHub.

    Thanks to everyone who contributed in putting this latest release together! :tada:

    2 replies
    Mohre
    @Mohre
    I make a minimal Splendor game hosted at bestboards.ir . I will be happy if you share your opinions with me.
    2 replies
    Hamilton-dfp
    @Hamilton-dfp

    Hi, folks. I'm looking for a bit of clarification on the server/client relationship:

    My game is single player, but I want to have a server because so much of my content (i.e. cards) are defined in yaml files. There is no need to load all of these at once, only as they are being used in a session. So I want the server so I can load content from there and add to the visible player state as needed.

    So I created a server like the one in the documentation:

    const Server = require('boardgame.io/server').Server
    const { DQ } = require('./Game')
    
    const server = Server({
        games: [ DQ ]
    })
    
    server.run(8000)

    I didn't see anything else in the documentation concerning how to run this, but the package.json file looked like it had some scripting that might try to start it on npm start. However my client is still seems to be running it's own Game object which is trying to load cards, and I can't seem to hit localhost:8000.

    I half expected that by creating a server with a game object, and a client with a game object, that the server would manage the game object and the client would call the server to get the state information, instead of running the game object in the browser. But if this is the case, then it seems like I need to do more than just name a file called server.js and run npm run?

    2 replies
    Adrian Gaudebert
    @adngdb
    Is there a "good" way to choose the first player randomly? Any way to initialize playOrder with a shuffled value maybe? Or do I have to write a custom turn order?
    4 replies
    Hamilton-dfp
    @Hamilton-dfp
    is it possible to add additional paths to the server? i.e. use the server to host a separate page for instructions?
    4 replies
    Larry Wang
    @larry801
    @Hamilton-dfp You can put instruction beside lobby component
    @adngdb I setup first phase to determine playOrder then store them in G.
    Larry Wang
    @larry801
    @nicolasca I found an issue about logs. Moves executed only on server do not show in logs. boardgameio/boardgame.io#795
    Adrian Gaudebert
    @adngdb
    @delucis Hey, I started using bgio-effects and it works great! But of course, the first feature I built with it raises questions… :D Is it possible to have effects sent only to a specific player?
    9 replies