
Real Time Multiplayer in HTML5 - EtienneK
http://buildnewgames.com/real-time-multiplayer/
======
Maro
3D gaming in the browser is coming. Interestingly, while in the past people
like John Carmack had to get around the limitations of the hardware, in the
browser we'll be working around the limitations of the software layers between
the game (presumably written in Javascript, using WebGL) and the hardware.

Anyways, I think this is a super interesting line of research and development,
I wish I would not be tied up doing other stuff for the next 12 months. I'd
love to just take the Quake 1 engine and (try to) implement it in Javascript
with WebGL and see what happens. I estimate that's the level of graphics
that's ambitiously doable in the browser in 1-2 years, by the time something
like this would ship.

EDIT: As helpful commenters point out below, Quake 3 seems doable.

Also see yesterday's post on this topic:

<http://news.ycombinator.com/item?id=4258670>

~~~
SvenBergstrom
Maro, try this link : <http://centrc.com:4005/> It is a proof of concept I did
in one evening for the next part of the discussion. It uses Three.js to render
the stuff.

:)

~~~
Maro
It says: "The Facility. Play online. Sandbox." Can't get past that (Enter,
ESC, click). FF14 on Win7.

~~~
SvenBergstrom
Did you try clicking Sandbox? Thats the only option in that demo atm... but it
might only work in chrome as it was a one night test :)

------
sreyaNotfilc
God technology moves so fast. I'd be stupid not to learn this stuff. It could
be life changing!

The question remains; When do I have the time to learn this stuff? I was
thinking about this for a while. Besides working/planning/coding on my own
project, I feel like I don't have much time for this.

I think I'm going about this all wrong though. I should divi up my week into
departments. That is, have a few hacking days, a planning day, a maintenance
day and a R&D day.

Having one day a week to study new techniques doesn't sound like much, but at
least it gets the juices flowing. Its all about balance.

~~~
jblow
Look ... guys ... this is NOT TECH, unless you classify hooking up a sewage
pipe at the RV Park as tech too.

This is just another example of fighting through a gross kludgey mess to do
something relatively trivial that we already knew how to do, much more
robustly and performantly, in other systems.

Any time you see an article titled "X in HTML5" you know you are about to ride
the short bus. I recommend learning some computer science.

See also Alan Kay's comments about the Web vs the Internet, recently linked on
HN...

~~~
sreyaNotfilc
Are you trying to say that the utilization of existing technologies and
concept to create or solve other technological problems (e.g. innovations) not
technology or in the field of technology?

Does that mean that my Android phone is not a part of technology since, well,
a phone existed long before a mobile phone was made? The GUI OS was
"perfected" decades ago. So, the Android OS isn't part of the technology club
either? What about using the internet on said device? I gather that it was/is
very trivial to just hook up a phone and an OS and the internet and whatever
other components of these mobile devices does not constitute it as technology
because it should have been straight forward to just hook these things up
together.

Basically all Computer Science really is is a collections of 0s and 1s thrown
together to make things happen. I guess our minds and imaginations just
doesn't compare to a room full of monkeys randomly typing 0s and 1s on a
typewriter and having it go through a compiler. I'm sure they'll launch
astronauts to the moon fairly soon.

Wikipedia defines technology as "...the making, modification, usage, and
knowledge of tools, machines, techniques, crafts, systems, methods of
organization, in order to solve a problem, improve a preexisting solution to a
problem, achieve a goal or perform a specific function."

But, who knows, Wikipedia isn't always accurate, right?

As for you statement, I guess I'll just deal with riding the short bus. This
bus has a lot of fascinating things that are just simply mind-blowing to me.
Yes, a lot of concepts existed before. Perhaps even better than what's
presented in the blog. But the fact that someone did think of a really
cool/elegant way to solve this "gross kludgely mess" and present to us for
free is alright by me. I love this type of stuff, no matter how trivial it is.
Its really a celebration of the human mind and spirit that we can overcome
faults in existing problems. _shrugs_

~~~
jblow
Is hooking up your toilet considered technology? This kind of plumbing used to
be super-high-tech at one time in human history. I think you would find few
people who think of it that way now, though.

Hey, make your own choice about what you want to do with your life and what
you want to consider cool.

~~~
nightski
I have written programs using native OpenGL/DirectX that are over a decade
old. You are completely correct in that the technology is not new, in fact it
is far inferior. However, the one thing to get excited over (and the only
reason I even consider doing this type of development) is the accessibility of
the finished product. It is far easier to get people to try out your product,
game, whatever when all they have to do is visit a web page.

In addition, the "connected" nature of the web, real time communications
aspect of it is exciting. Sure this could be done in C, but the _cost_ of
doing it in this type of environment is far less.

So while on a technical level it is not impressive, I wouldn't dismiss it.

------
mikeknoop
I got 1/3 of the way into the article and said to myself, gosh this sounds
just like Valve's Source Multiplayer writeup they did many years ago. Sure
enough! The author mentions 1/2 way the work is based off of it.

~~~
SvenBergstrom
Yea, their approach is one of many, I found it simplest to try and explain in
a shortish article.

------
SvenBergstrom
Article Author here \o Glad Etienne posted here, for some reason I couldn't
find my login for HN.

------
webdigi
Socket.io works well, we put together this demo where an iPhone is used as a
controller for a browser game <http://www.webdigi.co.uk/fun/space>

~~~
prezjordan
Dead-simple, too. I only have moderate experience with web applications and I
found socket.io extremely approachable.

~~~
SvenBergstrom
Agreed, i really was blown away the first time I wrote something simple and it
just worked... On my phones, my pc and my friends browsers.

------
james33
This is the exact formula we are using for the rewrite of our poker game
(<http://pokerrpg.com>). We are still beta testing the new poker tables, but
so far they are running incredibly smoothly using no plugins, just vanilla
Javascript, Node.js, and MongoDB. Glad to see these getting pushed more for
games!

------
yesimahuman
If anyone is interested in a live example of a MMORPG built in HTML5, this was
a project of mine at my last job: <http://play.parallelkingdom.com/>

It uses the Cometd javascript and java libraries. In my opinion, you can get
very "real-time" feeling games on the web with these technologies.

------
ashcairo
I been using the same technique for the hobby multiplayer game
(<http://softpoetry.com/projects/burgers/>) I've been working on. Got it
running using the same stack on iOS/Android and PCs, so it's a good thing to
note that it's not just for web browsers.

~~~
SvenBergstrom
Yes good point, the first prototype of an older game ran on
mac/windows/linux/android/iOS and browser using impact.js, phonegap, titanium
etc. All the usual stuff still obviously works too :)

------
nopjia
Looks like this is already happening: <http://www.webgl.com/2012/06/webgl-
game-cloud-party/>

------
chasing
Open web standards, but as far as I can tell, no RSS feed!

(Also, I know it's a Microsoft-funded thing, but the animation in the
background of the main page runs very poorly on Firefox.)

~~~
icebraining
_Open web standards, but as far as I can tell, no RSS feed!_

Looking at the source, reveals:

    
    
        <link href="/atom.xml" rel="alternate"
         title="Build New Games" type="application/atom+xml">
    

With any decent RSS reader you should be able to plug in the blog post URL and
let it auto-discover: <http://www.rssboard.org/rss-autodiscovery/>

------
caycep
someone needs to implement Bolo in html5

~~~
sil3ntmac
<https://github.com/stephank/orona/>

------
wilfra
Wish we had read this last November when we started! We're using Pusher for
the connections instead of Node.js. Working on switching now.

One thing we've done you didn't mention was using Redis for the game state,
instead of writing to the HD most things are handled in RAM. We run the risk
of losing the last ~five seconds of data on all running games if the server
goes down or something but that's a small price to pay for being able to
process most game actions faster than the eye can perceive them.

Our game: real time multiplayer HTML5 version of Risk <http://warsocial.com>

~~~
SvenBergstrom
The game is looking pretty cool! Hopefully the article/demo helps out in some
way.

------
Toshio
I just realized I physically can't read this post, the pink background hurts
my brain. I'll try to find a browser add-on to mitigate that disaster.

~~~
rpsw
Or paste this into your address bar:
javascript:void(document.getElementsByTagName("html")[0].style.background='#FFF');

