Boardgame.io: an engine for creating turn-based games using JavaScript
41–50 of 69 posts
Re: Boardgame.io: an engine for creating turn-based games using JavaScript
#42Earlier quoted context omitted.
I think I have a good example from Magic: the Gathering. There’s a card called “Fact or Fiction”. You reveal the top five cards of your deck. Then your opponent splits the cards into two piles. Then you pick one of the two piles to take into your hand. You’ll need to store structures representing the choices that are intermediary steps (split cards, pick stack) in your state, which is basically function calls and the…
I had the same issue in AGoT:BG and I solved it by representing the state of the game as a tree. At any point of the game, the current game state is a leaf of the tree. You'd represent this kind of choice as a child node. When the user has made their choice, the code can return to the parent node with the choice being made so it can continue with the next "step" of the game.
If you are curious about it, I wrote a cc0 spec which stores hearthstone game state in xml. It’s based on how hearthstone stores game state on the server and client, and it was the first time a replay format was created for hearthstone: https://hearthsim.info/hsreplay/
Incidentally the UI we wrote for hearthstone replays is a react app. It’s funny because looking back it was the first time I used react and typescript, and both were not at all adopted by the js community yet at the time.
Re: Boardgame.io: an engine for creating turn-based games using JavaScript
#43Earlier quoted context omitted.
Put the screen on the kitchen table and sit around it, call it CounterTop Surface, have a little imagination man.
a tad further: a central phone or tablet as a main board that you interact with via touch and where you can then transfer over to your handheld device over the network to manage your hand. I've not seen this yet, and it would be a pretty great experience I think. No clean up
Re: Boardgame.io: an engine for creating turn-based games using JavaScript
#44This engine uses a Redux-like architecture. You have a State type (containing data like "the position of the black kingside rook") and a stream of in-game actions (like "knight to F3"). Each action is handled by a pure function which converts the current State to a new State. You can either transmit State deltas from the server to the client, or just transmit the actions themselves ( https://longwelwind.net/blog/netw…
My main pain point with any sort of Flux-like state management is transitions [1]. The state of UI is not fully described by the state of the game [2]. If I play a card, the game state can be instantly updated to the next decison-making point, but in reality I want to show steps of the game through animations, some of which are concurrent and some of which are consecutive. That usually ends up in a mess; and I've nev…
https://github.com/sjrd/barrage/blob/main/src/main/scala/be/...
Re: Boardgame.io: an engine for creating turn-based games using JavaScript
#45Original creator of boardgame.io here. A pleasant surprise to see this here after many years. More recently, I've been working on https://boardgamelab.app/ , which uses a visual programming language to model game rules while also taking care of the UI layer.
> More recently, I've been working on https://boardgamelab.app/ , which uses a visual programming language to model game rules while also taking care of the UI layer. Suppose there were a technology that could turn the canvas you authored into finished, consistent art; and a way to turn natural language rules into correct code. Would you use it? Why or why not?
Like a jpeg? Otherwise I don't understand your question.
" a way to turn natural language rules into correct code"
And this is straight impossible, as natural language is by definition ambigious in meaning and code is not. Try your luck with LLM's, they come closest.
(a subset of natural language might work, but this is kind of a complex research topic)
Re: Boardgame.io: an engine for creating turn-based games using JavaScript
#46This engine uses a Redux-like architecture. You have a State type (containing data like "the position of the black kingside rook") and a stream of in-game actions (like "knight to F3"). Each action is handled by a pure function which converts the current State to a new State. You can either transmit State deltas from the server to the client, or just transmit the actions themselves ( https://longwelwind.net/blog/netw…
My main pain point with any sort of Flux-like state management is transitions [1]. The state of UI is not fully described by the state of the game [2]. If I play a card, the game state can be instantly updated to the next decison-making point, but in reality I want to show steps of the game through animations, some of which are concurrent and some of which are consecutive. That usually ends up in a mess; and I've nev…
Every player action could cause a cascade of updates, which would all be resolved “instantly” to the point no more cascaded updates were left to be processed.
While this is happening, any update that includes an animation pushes that to an “animation stack”, then the animations are played back one by one to show the player what happened. In this animation state most input in disabled and the game is effectively on hold until the animations complete (or are skipped by the player).
The “animations” were basically commands that the Model used to update the View, just with the option to apply them one by one over time. So the model is always up to date as fast as possible as possible, and the view just lags behind a bit and catches up.
Re: Boardgame.io: an engine for creating turn-based games using JavaScript
#47Re: Boardgame.io: an engine for creating turn-based games using JavaScript
#48Original creator of boardgame.io here. A pleasant surprise to see this here after many years. More recently, I've been working on https://boardgamelab.app/ , which uses a visual programming language to model game rules while also taking care of the UI layer.
There was this iOS game which died which I wanted to recreate: https://web.archive.org/web/20161020010853/http://www.82apps... But I have 0 knowledge of game development. Maybe this could make my job easier? Or maybe somebody else who know how to write game can do it? Please?
Re: Boardgame.io: an engine for creating turn-based games using JavaScript
#49Earlier quoted context omitted.
My main pain point with any sort of Flux-like state management is transitions [1]. The state of UI is not fully described by the state of the game [2]. If I play a card, the game state can be instantly updated to the next decison-making point, but in reality I want to show steps of the game through animations, some of which are concurrent and some of which are consecutive. That usually ends up in a mess; and I've nev…
The way I did this was to design a more-or-less monadic container `Result ` for all my game logic functions. It batches a sequence of animation steps with a result. It can also model error conditions (like not having enough resources for example). I can then instantiate it any concrete result type, such as a full game state or just the result of individual computations. It was very nice to concisely write complicated…
Re: Boardgame.io: an engine for creating turn-based games using JavaScript
#50Earlier quoted context omitted.
The way I did this was to design a more-or-less monadic container `Result ` for all my game logic functions. It batches a sequence of animation steps with a result. It can also model error conditions (like not having enough resources for example). I can then instantiate it any concrete result type, such as a full game state or just the result of individual computations. It was very nice to concisely write complicated…
Interesting. Unfortunately, your repo seems to be private.
Here is a public gist with the `Result` data structure, as well a good portion of the file handling all the game mechanics, which should show it gets used. https://gist.github.com/sjrd/34fe234d1b6232cf42ffda5d23292d3...