Remix.run Logo
What I've Learned (So Far) Building Online Mini Games with Elixir and Swift(calvinflegal.com)
26 points by calflegal 3 days ago | 14 comments
zuzululu 4 hours ago | parent | next [-]

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 Cloudflare's ultimate game is, as I'd imagine once they corner the market and practically everything is running off it, wouldn't be hard to say raise the $5/month to something higher.

frail_figure an hour ago | parent [-]

> 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.

apt-apt-apt-apt 2 hours ago | parent | prev | next [-]

Really 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.

frail_figure an hour ago | parent | next [-]

Not OP, but TS (as in TypeScript, right?) is not even in the same universe as Elixir with Phoenix when it comes to building backend services.

It's a very productive and readable programming language with excellent documentation and conventions, and the most ergonomic way of handling concurrent operations (thanks BEAM) I've encountered.

The VM it runs on was originally designed for telephone switches, which, it turns out, cleanly translates to the internet/http era.

It makes it trivial to do soft-realtime because it's just actors (GenServers) passing messages.

I invite you (and others) to try it out and do a small weekend project. It'll make you reconsider reaching for TS on the backend :)

apt-apt-apt-apt 17 minutes ago | parent [-]

Thanks, interestingly Elixir handles concurrency in what seems like a natural way, actors passing messages to each other. It's cool that this way is used in production, though it seems to be used mainly in niche distributed scaling.

nesarkvechnep 15 minutes ago | parent [-]

Not at all. It’s used to build standard web applications too.

mcintyre1994 20 minutes ago | parent | prev | next [-]

I’d guess that 2 is a huge part of the answer to 1 here - Elixir makes real-time multiplayer easy.

colechristensen 2 hours ago | parent | prev [-]

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.

calflegal 3 days ago | parent | prev | next [-]

I 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!

oezi 3 hours ago | parent [-]

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?

karado 4 hours ago | parent | prev | next [-]

In my own projects I've found the feedback loop to be much slower in native mobile apps compared to web. For web apps my workflow has involved lots of human verification just through using the app myself and testing out the latest features/fixes. Sometimes I get the agent itself to do this before I do using Codex's chrome extension. This same process on mobile is a lot slower. How have you approached this aspect? Have you figured out a way to get the agent to control an emulator?

zuzululu 4 hours ago | parent [-]

Maestro but honestly you should always be testing on real devices

calflegal 3 days ago | parent | prev [-]

My post about my recent project, Migo Games

ipnon 4 hours ago | parent [-]

I’ve never thought about how the room model matches the LiveView socket model before. Which socket library are you using?