was expecting a bit more substance but always interesting to read different approaches. but I do wonder if BEAM is a bit of an overkill, even fly.io (known among developer threads to be very unreliable uptime) wouldn't be my first pick. Cloudflare Durable Objects really is generous, not often can you get replicated database and realtime sync for such low barrier in cost and implementation. I do wonder tho what Cloudf…
What I've Learned (So Far) Building Online Mini Games with Elixir and Swift
21–30 of 44 posts
Re: What I've Learned (So Far) Building Online Mini Games with Elixir and Swift
#22Really interested in hearing more about the architecture. Especially (1) why you chose Elixir, Phoenix over TS (2) how you dealt with real-time multiplayer. Aside: The links to the web game in the post don't lead to being able to play.
It (phoenix channels) worked out of the box. in the last 6 years of development and growth, not once have we ever had to even discuss scaling issues related to it.
It just works and when you're in a startup, the more you can focus on growing your product instead of scaling issues, the more you're winning.
Re: What I've Learned (So Far) Building Online Mini Games with Elixir and Swift
#23was expecting a bit more substance but always interesting to read different approaches. but I do wonder if BEAM is a bit of an overkill, even fly.io (known among developer threads to be very unreliable uptime) wouldn't be my first pick. Cloudflare Durable Objects really is generous, not often can you get replicated database and realtime sync for such low barrier in cost and implementation. I do wonder tho what Cloudf…
> Cloudflare Durable Objects really is generous, not often can you get replicated database and realtime sync for such low barrier in cost and implementation. BEAM gives it to you for free, and you don't rely on an Internet-scale monopoly to run it.
1) It's very difficult to ensure globally serialized ownership with strong consistency in a distributed Erlang cluster when nodes are allowed to fail. Stuff like Horde will let you do some rough "run an instance of this process somewhere in the cluster", but it's eventually consistent (you may have multiple instances at times) and doesn't deal with netsplits well.
2) Mnesia is fine to replicate state within a network switch or very reliable LAN, but not over WLAN/Internet. It can enter split brain conditions and require external reconciliation. RabbitMQ suffered from Mnesia problems for many years and ended up replacing it with their own DB implementation using the Raft protocol.
Re: What I've Learned (So Far) Building Online Mini Games with Elixir and Swift
#24I should've said more about the tech. I will later. The server is in NJ. If you're in the EU the game might really lag. Sorry!
You mention it is possible to play via Web, but all links just lead to pages which point to Apple's app store. Game over for Android and the web?
Re: What I've Learned (So Far) Building Online Mini Games with Elixir and Swift
#25Re: What I've Learned (So Far) Building Online Mini Games with Elixir and Swift
#26Really interested in hearing more about the architecture. Especially (1) why you chose Elixir, Phoenix over TS (2) how you dealt with real-time multiplayer. Aside: The links to the web game in the post don't lead to being able to play.
Phoenix is delightfully fast and not having to deal with two entirely different application stacks where your application is split down the middle (or the javascript ecosystem) is a breath of fresh air.
Re: What I've Learned (So Far) Building Online Mini Games with Elixir and Swift
#27My post about my recent project, Migo Games
I’ve never thought about how the room model matches the LiveView socket model before. Which socket library are you using?
Re: What I've Learned (So Far) Building Online Mini Games with Elixir and Swift
#28Earlier quoted context omitted.
> Cloudflare Durable Objects really is generous, not often can you get replicated database and realtime sync for such low barrier in cost and implementation. BEAM gives it to you for free, and you don't rely on an Internet-scale monopoly to run it.
I love the BEAM and programmed on it for many years, but it really does not provide anything like durable objects. 1) It's very difficult to ensure globally serialized ownership with strong consistency in a distributed Erlang cluster when nodes are allowed to fail. Stuff like Horde will let you do some rough "run an instance of this process somewhere in the cluster", but it's eventually consistent (you may have multi…
Re: What I've Learned (So Far) Building Online Mini Games with Elixir and Swift
#29Really interested in hearing more about the architecture. Especially (1) why you chose Elixir, Phoenix over TS (2) how you dealt with real-time multiplayer. Aside: The links to the web game in the post don't lead to being able to play.
I've been curious about elixir for years. Since maybe 2016. I tried in the days before AI, but I couldn't really get over the hump of syntax and BEAM and all of that.
I'd read it was the kind of thing that would be good for games, but I didn't really understand why until AI helped me build this.
A room is a GenServer. Which means its a process. Which means the unit of gameplay matches the unit of compute, kinda. That's really great. You can't really do that with node. Well, I guess with Durable Objects / PartyKit you have a closer match there.
There is a matchmaker process that runs. It assigns your socket to a room. But yeah, after that, your socket is exchanging messages with that room.
Because arrow physics are simple, the client predicts how it thinks the server will say things will be, and reconciles if / when wrong when it hears from the server about the room state.
Re: What I've Learned (So Far) Building Online Mini Games with Elixir and Swift
#30A question for OP: why did you choose Crunchy Data for your database, instead of Fly's own managed postgres offering? Because the latency between Fly and Crunchy Data must be quite high, given that they are probably not in the same datacenter.