Skip to content
← Back to Community
Multiplayer proof of concept with kaboom.js
Profile icon
chalcidfly

This is a dirt simple multiplayer POC using kaboom.js + socket.io. I may revisit it later and make something actually interesting with it. If Repl.it adds some way for me to monetize this as a creator I would certainly make a commercial game. Not having to worry about server infra is nice.

Some thoughts:

  • I originally wanted to use ws but that didn't work -- couldn't figure out the right invocation to avoid SSL_PROTOCOL_ERROR. socket.io seems better though tbh.
  • Since the server is the only trustworthy source of truth, that's where all the game logic happens and kaboom has to be synced manually. Not ideal, maybe there is a layer on top of kaboom for syncing state that can make this easier.
  • Suuuuuuuper laggy. 60 FPS is certainly unattainable, may have to pivot to a turn-based style game for a real game to be even playable.
  • TypeScript would be awesome b/c then client + server could share type definitions. Figuring out how to set up webpack et al for the nth time sounds too hard for this to be worth it for me right now. If there was a template already I'd do it in a heartbeat.
  • I wonder how far I could push it? Could I reasonably have 1,000 clients connected simultaneously? What about 100,000? I suspect true MMO may not be possible on this platform without toppling the backend, still may try at some point though. I'll probably have to implement lobbies.

Fun project, lots to think about.

Voters
Profile icon
theomarkkuspaul
Profile icon
elijahwright3
Profile icon
DhairyaPandya
Profile icon
chalcidfly
Comments
hotnewtop
Profile icon
amasad

I originally wanted to use ws but that didn't work -- couldn't figure out the right invocation to avoid SSL_PROTOCOL_ERROR. socket.io seems better though tbh.

I think this might simply be that we don't enforce https. Make sure that you are using the https version. We're going to start redirecting all HTTP to https traffic soon.

Since the server is the only trustworthy source of truth, that's where all the game logic happens and kaboom has to be synced manually. Not ideal, maybe there is a layer on top of kaboom for syncing state that can make this easier.

This makes sense. The ideal solution is that this happens transparently and the programmer has to do little thinking as to which logic should be enforced server-side.

Suuuuuuuper laggy. 60 FPS is certainly unattainable, may have to pivot to a turn-based style game for a real game to be even playable.

Is this is the problem with the kaboom engine or just a result of this architecture?

TypeScript would be awesome b/c then client + server could share type definitions. Figuring out how to set up webpack et al for the nth time sounds too hard for this to be worth it for me right now. If there was a template already I'd do it in a heartbeat.

This could easily be a template on top of kaboom. We'll ship type info with kaboom for autocomplete.

I wonder how far I could push it? Could I reasonably have 1,000 clients connected simultaneously? What about 100,000? I suspect true MMO may not be possible on this platform without toppling the backend, still may try at some point though. I'll probably have to implement lobbies.

10,000 concurrent maybe but certainly pushing it. We're introducing some more plans with more resources. Ultimately we need to figure out our horizontal scalability story.

Thanks a lot for giving this a shot and giving us your feedback