Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Chris Swithinbank
    @delucis
    (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
    Adrian Gaudebert
    @adngdb
    Does anyone here have experience with using Svelte with boardgame.io? I'm considering moving from React because Svelte is much better at dealing with animations. Does that sound sane? Are there any pitfalls I should know about? Note that I have a lot of experience with React but quite little with Svelte (I only built one small Jam game with it).
    5 replies
    Kolja Kutschera
    @koljakutschera
    Heyhey, i wonder if its possible to run simulate like in debug panel on the server. Iam thinking of something where clients set up a game and the game is then run on server. Than the Server updates the clients on every simulated change. Is this possible? Can u give me a hint where i can find for example the method to run simulate programatically? Thank you! Btw. awesome Framework :D
    2 replies
    Peter-Frank Spierenburg
    @spierepf
    Hello. I'm following your tutorial. But I am having trouble with the "Creating a Client" step. When I run npm start I get an empty web page, and not the Debug Panel the tutorial describes...
    Uncaught ReferenceError: regeneratorRuntime is not defined
    Peter-Frank Spierenburg
    @spierepf
    Added import 'regenerator-runtime/runtime' to the start ot src/App.js. Fixed.
    Johnny Wobble
    @JohnnyWobble
    So I'm a bit confused about how the player counting works. In the game object, I have min and max players set to give a range. But in the client it wants me to pick one number for the number of players. How would I know what number to pick if I don't know how many players will join the game?
    8 replies
    Kolja Kutschera
    @koljakutschera
    I want to play an animation after each turn on the board. Problem is that after each turn the other player can directly start his turn but I want him to wait for the animation to finish. Whats the best way to accomplish this? Any examples?
    3 replies
    cwatsonc
    @cwatsonc
    In multiplayer remote master configurations do the server and client-server need to be coincident? CORS constraints seemingly would prevent any connections except to original host.
    2 replies
    Larry Wang
    @larry801
    How to setup boardgame.io with typescript? I tried ts setup in create-react-app and got following error:
    2 replies

    TypeScript error in C:/WebstormProjects/filmcentenary/node_modules/boardgame.io/src/core/flow.ts(76,7):
    Variable 'startingPhase' implicitly has type 'any' in some locations where its type cannot be determined. TS7034

    74 |   let moveMap = {};
    75 |   let moveNames = new Set();

    76 | let startingPhase = null;
    | ^
    77 |
    78 | Object.keys(moves).forEach(name => moveNames.add(name));
    79 |