Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: WebRTC Serverless 2-player 2048 Game with Annotated Source (instapainting.com)
11 points by chrischen on Oct 25, 2016 | hide | past | favorite | 13 comments


"Serverless" ? how do players connect with each others? I bet it isn't serverless at all. When will developers stop using these buzzwords that are effectively lies, from a strict technical point? There was no need to shove "serveless" anywhere in that title.


Its webrtc, so direct peer to peer connections during gameplay.

If you just looked at the code you can see for yourself.


> Its webrtc, so direct peer to peer connections during gameplay.

How does one player knows I'm connected without a server that tracks remote connections ? please explain.

edit: no need to explain, the library you are using does use a server, off course, I quote your comment :

> I believe PeerJS does use a server to broker conmections.

this isn't serverless, since it relies on a server. This is an important point and shouldn't be obfuscated by "serverless" buzzworld. Furthermore I doubt your project is going to run if I double click on an HTML page on my harddrive to launch it, it has to be hosted somewhere.


It'd be cool if you knew what you were talking about. These definitely can be made to be serverless if you really needed to stick to that strict definition of the word. However, there is a small "introduction" broker (server) involved in most of these kind of WebRTC apps. It basically says, "player A - meet player B. player B - meet player A" - after that the clients talk directly to one another and that server can completely go away and the multi-player functionality will work just fine. The clients communicate peer to peer after that.


> It'd be cool if you knew what you were talking about.

It'd be cool if people stop using bullshit buzzword in order to promote a project. There is a server period. It doesn't matter if "it does only a small thing". that bullshit needs to stop and I will call anybody engaged into bullshiting others out as long as they keep doing that.

The client talks directly to the other client but in order to connect 2 clients at first place you need a server to connect peers.

That's what you call serverless ? then that's a lie, period.

It's obviously you who don't have a clue what you are talking about.

"serverless" needs to die, no application that relies on the web is serverless, there is always a server.


Dude. You're really focusing on the wrong thing here. No one is lying or attempting to deceive. At worst, the term is being used loosely - at worst. At best it's only referring to the portion of the work that happens during "multi player".

I get your frustration with software development jargon but this seems like an odd choice to attack.

And to two of your points, here's a version that is "serverless", and can run completely from the file system.

https://github.com/cjb/serverless-webrtc

But is it truly "serverless"? I mean the file system is serving the file up to the browser!

C'mon.

Oh, and in case you were going to point out that there's a server involved in the link I posted because, "the WebRTC offer/answer exchange is performed manually by the users, for example via IM", (emphasis mine) - the information could just as easily be written on a piece of paper and exchanged via carrier pigeon. The pigeon may still technically be a server, in an architectural sense I suppose, but hopefully at that point you'd agree we're taking the argument past the point of any sensibility.


I could probably get behind what you're saying when I read definitions of "serverless architecture" like this: http://martinfowler.com/articles/serverless.html. Or when it's thrown around talking about containerization (virtualization).

If that's the gripe though, I think it'd be barking up the wrong tree to apply to these types of WebRTC patterns and OP's project.


Note: due to lack of support for WebRTC in Safari, the demo won't work on iOS or Mac Safari.


This looks like a good source to learn WebRTC data channels. Correct?


I've searched the internet for a quick demo/tutorial of WebRTC that teached me to send a text from one computer to another. Couldn't find anything small and simple enough and still usable. Wrote this: https://gist.github.com/fiatjaf/229a5db2f431ab707e3fb909240d..., it may be worth of your reading.


We just wrote a very detailed step-by-step article on getting started with WebRTC data channels using TDD: https://medium.com/@coldbrewtesting/getting-started-with-web...


It was more an experiment in creating a fully serverless game contained in client side JS. Even the matchmaking is client side, however I believe PeerJS does use a server to broker conmections.


Happy to answer any technical questions.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: