
Show HN: WebRTC Serverless 2-player 2048 Game with Annotated Source - chrischen
http://www.instapainting.com/2x2048/index.html
======
aikah
"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.

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

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

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

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

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

~~~
chrisbraddock
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](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.

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

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

~~~
fiatjaf
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...](https://gist.github.com/fiatjaf/229a5db2f431ab707e3fb909240dcdf2),
it may be worth of your reading.

------
chrischen
Happy to answer any technical questions.

