Live data from Hacker News

Boardgame.io: State management and more for turn-based games

google.github.io

31–40 of 96 posts

Re: Boardgame.io: State management and more for turn-based games

#31

Earlier quoted context omitted.

I'm pretty sure websocket is fifo with delivery guarantees and as far as I'm aware cannot be used in the same manner as UDP. I haven't played around with WebRTC, but that might be an option.

Yeah, fifo and temporal updates generally tend to not mix well together.

Airmash uses two websockets and accepts updates from whichever arrives first. It's still fifo, but if one experiences fragmentation the other might be fine.

It's an interesting design and I wonder how well it works.

Re: Boardgame.io: State management and more for turn-based games

#33
post #19

Is there a good resource on category theoretical or linear logical game design?

Check out Chris Martens' work, like her thesis "Programming Interactive Worlds with Linear Logic": http://www.cs.cmu.edu/~cmartens/thesis/ (or some of the shorter papers on her website)

Thx, I saw this on HN a while back but totally forgot it existed.

Re: Boardgame.io: State management and more for turn-based games

#34

Earlier quoted context omitted.

Yeah, fifo and temporal updates generally tend to not mix well together.

Airmash uses two websockets and accepts updates from whichever arrives first. It's still fifo, but if one experiences fragmentation the other might be fine. It's an interesting design and I wonder how well it works.

Do you have a link to the source? I'd love to check it out.

Re: Boardgame.io: State management and more for turn-based games

#37
post #34

Earlier quoted context omitted.

Airmash uses two websockets and accepts updates from whichever arrives first. It's still fifo, but if one experiences fragmentation the other might be fine. It's an interesting design and I wonder how well it works.

Do you have a link to the source? I'd love to check it out.

I don't. The only reason I heard about it was because I happened to be playing when the dev hopped on and started messing with people. Someone asked him about architecture and they said they use two websockets to prevent congestion.

I'm skeptical about the design, but the only way to know whether it's effective is to measure it.

Carmack's great breakthroughs came from trying every logical possibility and then sticking with the ones that worked. There were dozens of dead Quake designs that no one knows about, e.g. beam trees.

One mistake I made in the early days was to go around asking people what to do or how to design something. The truth is, no one really knows the best way to design anything. The only thing you can do is think of possibilities, try them, and ruthlessly measure whether they're effective. Often the most effective designs come from unexpected combinations, which is why this dual websocket idea is worth taking seriously.

One nice property is that if it does work, it only costs 2x bandwidth. Realtime games' bandwidth grows as O(n^2) with the number of players (e.g. 90 players need updates about all 89 other players plus themselves). So doubling the bandwidth isn't a huge cost.

Re: Boardgame.io: State management and more for turn-based games

#38

Earlier quoted context omitted.

Yeah, fifo and temporal updates generally tend to not mix well together.

Airmash uses two websockets and accepts updates from whichever arrives first. It's still fifo, but if one experiences fragmentation the other might be fine. It's an interesting design and I wonder how well it works.

Wow that multiple TCP connection trick is very interesting. Each additional idle connection would theoretically be capable of firing off a single packet instantly with no congestion control getting in the way. I'm getting flashbacks of services that would allow multiple pending HTTP long-polling requests at once, so the server could push faster than the round trip time.

I wonder what the ideal number of connections would be. It could certainly be 2 of course; I've never thought about this problem before.

Re: Boardgame.io: State management and more for turn-based games

#40
This is excellent. That's the approach we have taken with the Qbix Platform, taking care of all the syncing and realtime updates and offline notifications and user accounts so you can just throw some tools on a page, make a new type of stream or tool (such as Chess/game) and it just works across all devices.

There is a lot that goes into this - for instance offline notifications must be delivered to each user's preferred endpoints (in app notifications if they installed cordova app, sms and email fallbacks if they didn't), you need to fill templates, enforce access control (can I see a guy's last name or a particular game / chat / etc?)

If you look at https://qbix.com/platform/features you will see we went with Streams and Messages rather than syncing data structures. This allows us to reason about explicit "moves in a game" or other changes and whether they are authorized or not per Stream.

In short - I am happy to see others adopting similar goals. Most of what I have seen til now has been syncing static data structures.

Post reply on HN