Building a Distributed Turn-Based Game System in Elixir

7 Likes

Any thoughts about Horde distribution strategies for a project like this? I’m toying around with a (very similar!) LiveView game, and it occurs to me that by default Horde will distribute procs uniformly across the cluster, but obviously you’d prefer your game server to start close to some users. I was thinking about making a DistributionStrategy for a fly.io context for the fun of it but maybe there’s some prior art?

2 Likes

Ha! Me too! I wrote the Tic-Tac-Toe app as a proof of concept. I also saw that the default Horde strategy was to equally distribute them. Like you, I realized that it makes more sense to build default to use the game-creating user’s region for where the game server should live. It’s most likely that their joining friends are in the same region.

So yes, I thought the same thing about a custom Horde strategy.

Another issue that the PoC showed me was state transfer when rolling out a new deploy so active running games aren’t lost. Again, the distribution strategy would be helpful there too.

2 Likes