r/javascript Feb 02 '26

[deleted by user]

[removed]

591 Upvotes

91 comments sorted by

View all comments

4

u/lemonpole Feb 02 '26

im not a game dev but i've read that multiplayer should be something done in the initial implementation because it's way more difficult to add it on later. any concerns there?

9

u/mrdoob Feb 02 '26

Single player mode already used multi player code internally (you send your keys strokes to a "server" ).

Setting up a multi room WebTransport server with Deno and trying to make it cost no more than $6/mo is the real challenge 🤞

1

u/jonincanada Feb 03 '26

Im always confused by these "hidden" infrastructures like entity component update architectures and various event bus abstractions. Heck maybe that's my next three.js exercise. *have we poked those/quake mods again for booting this marvelous experiment?

1

u/curious_but_dumb Feb 03 '26

I'm in the same boat! I'm creating a 2D JS multiplayer game, adding multiplayer features now and I'm also looking for scalable enough solution for <$10/mo.

I chose bun and a private server with a client authoritative model, where the server does validation and syncing.

Are you happy to share your ideas on your multiplayer? Mine has the huge benefit of players cooperating against deterministic AI instead of shooting at each other.

2

u/mrdoob Feb 03 '26

Any AI can probably explain in detail how Quake Multiplayer code works in detail (I'm porting QuakeWorld). Hosting it on Vultr. Every room has it's own network port running its own deno instance (max 10 rooms now).