
QuakeJS – A Quake Port to JavaScript with Emscripten - zaiste
http://www.quakejs.com/
======
benjojo12
EDIT: This appears to have died, now that the content servers for quakejs have
died. My servers are no longer starting anymore :(. For those reading on
later, there was peak of 10 on both servers just before it went down

    
    
      ioq3 1.36_GIT_4f7d7bf-2014-02-01 emscripten- Feb 23 2014
      ----- FS_Startup -----
      Error: Failed to download and parse manifest, Couldn't load 
      http://content.quakejs.com/assets/manifest.json. Status: 500
    

\---

Giving that at the time of viewing, the multiplayer servers are down, have
some of mine:

[http://www.quakejs.com/play?connect%20185.230.223.84:27967](http://www.quakejs.com/play?connect%20185.230.223.84:27967)

[http://www.quakejs.com/play?connect%20185.230.223.84:27966](http://www.quakejs.com/play?connect%20185.230.223.84:27966)

You will want to:

Go into settings via esc and set your name, and maybe also turn the game down,
it's quite loud by default. Maybe also mouse sensitivity too.

~~~
alouis44
[https://openarena.live/](https://openarena.live/)

Here's a link to the open source version of Quake called Open Arena, compiled
to WASM and using WebRTC for matchmaking.

~~~
dmix
The use of [https://kosmi.io/](https://kosmi.io/) here is what I found more
interesting. I've never heard of this service before but it's a great idea.
Reminds me of some much less...polished chat services I've used in the past to
group-watch videos. It's nice to see the concept fleshed out more with a
public lobby and a Discord-like client.

~~~
fragmede
Kosmi launched a bit ago, I first heard about it around a week ago on HN.

------
mouldysammich
There is a doom 3 port to wasm too

[https://wasm.continuation-labs.com/d3demo/](https://wasm.continuation-
labs.com/d3demo/)

~~~
lgl
The last "real" Doom imho. Although both Doom 2016 and the new Doom Eternal
look and run amazingly well, the thing with weapon alternate firing modes and
weapon mods are just not my cup of tea. I don't want a shotgun that fires
grenades and has full auto modes and whatever the hell the other mods do. They
lost a bit of the nostalgia with all those extras, or maybe I'm just getting
too old (?).

This browser port runs really great, when the game came out it was one of
those that made people have to completely migrate to the next generation of
hardware.

~~~
skocznymroczny
I share similar feelings. I feel like Doom 2016 (and Eternal) are more of a
sequel to Brutal Doom (a popular mod for original Doom games adding finishing
moves, over the top weapons and over the top gore/violence effects).

I've always viewed original Doom as more of a survival horror. People laugh
now, but Doom was a genuinely scary game back when it released. Gamers
nowadays obviously won't be scared by it. They also might play on lower
difficulty levels or with cheatcodes. So rather than "you are stuck here with
the demons", most gamers will play it as "the demons are stuck here with you",
and this is what Doom 2016 reflects.

~~~
dkonofalski
I have to disagree. Anyone who played DooM and DooM II more than just a single
time through the campaign is more likely to view the originals as bullet
ballets rather than as survival horror. DooM levels that seemed "scary" were
only scary because demons could jump out at you and give you a jump scare.
Once you know where the monster closets are, it's not that scary anymore.

If you played the original's multiplayer at all, then you'll remember how
quick and frenetic it was and how that changed the play style for the single
player levels. The new games reflect that much better than Doom 3, imo.

~~~
camgunz
Totally agree, the thing about Doom is the movement and the speed. I watched a
few hours of Doom eternal and within 2 minutes of watching the physics, my
only thought was "this is Quake".

------
lxtx
Quake's source code is very hackable. I forked ioquake3 for a personal project
and it was surprisingly easy to add WebRTC support to the C codebase, so you
could play it in your browser over WebRTC :)

~~~
k__
What was your experience with WebRTC?

I read some people tried to use it for multiplayer, but the performance
suffered with more than 10 players.

~~~
lxtx
Only played it with my friends, don't think a map ever exceeded 10 players. So
I can't say much about scaling - although it was a client-server model over
UDP and not peer to peer networking.

~~~
k__
Ah, so you had a WebRTC datachannel between the clients and the server?

~~~
lxtx
Basically yes, a custom datachannel implementation. Haven't updated it lately,
but it's up at
[https://github.com/seemk/WebUDP](https://github.com/seemk/WebUDP)

~~~
k__
Pretty cool.

You don't happen to have some ping comparisons betwen WebRTC and WebSockets?

~~~
lxtx
Sadly no, but I don't think there's much of a ping difference on a good
network. With WebRTC (datachannels in UDP mode) you just get the benefits of
UDP (or lack thereof :)).

~~~
k__
I see.

I had the impression UDP would lower the average ping, because you wouldn't
have to wait on lost packages like with TCP.

------
frompdx
This is great. Does anyone remember quakelive? Around 2010 it was playable in
the browser via a browser plugin. Loved playing it on my macbook. I don't
recall if the plugin was flash or a java applet but when support stopped for
those quakelive moved to steam as a desktop app.

Edit: Per wikipedia it used NAPI
[https://en.wikipedia.org/wiki/Quake_Live](https://en.wikipedia.org/wiki/Quake_Live)

~~~
rjeli
Not sure the specifics, but I don’t think it was flash or java because you had
to install a native extension.

~~~
frompdx
Ah it looks like you are correct. It used the NAPI. Per wikipedia:

> In November 2013, citing the planned deprecation of NPAPI browser plug-ins
> by major browsers, Quake Live began to phase out its browser version and
> began migrating to a standalone client. However, this change necessitated
> the removal of OS X and Linux support from the game.

[https://en.wikipedia.org/wiki/Quake_Live](https://en.wikipedia.org/wiki/Quake_Live)

Now I remember why I stopped playing as I only had a macbook at the time.

------
k__
I did a few game jams with my flat mate years ago, and I was really impressed
what is possible with the web in terms of game development.

Because of game pad support and fullscreen the browser worked superb for
couch-coop/local multiplayer games, but the high latency network support of
browsers made it kinda hard to do online multiplayer games.

Which is kinda ironic, because the browser is made for online interactions.

------
everdrive
Disappointed to find out this is not Quake 1

~~~
kube-system
Why? Quake III was the best Quake.

~~~
tachyonbeam
It depends on when you discovered the game and what you played most. Quake I
was the first "true" 3D game (with levels that could stack rooms vertically),
and many people remember it very fondly. Personally, I really enjoyed Quake
II. I did play Quake III when it came out, but the lack of a single player
mode meant the game had no backstory at all.

~~~
starpilot
When Q3 came out everyone was bored of single player. It looked like the whole
industry was going that way and that single player FPS was pretty much dead.
Then Half-Life was released and blew everyone's minds. I don't think anyone
has been able to craft an experience like HL to this day, it's like they just
"get" how interactive fiction should feel rather than being a shoot-em-up
interspersed with cutscenes.

~~~
lgl
This is wrong, Half Life was released in 1998, quake 3 arena in 1999.

~~~
Koshkin
And then came Unreal - the most advanced single-player shooter of that time.

~~~
lgl
Not exactly, Unreal the single player game is also from 1998.

If you meant Unreal Tournament, it was released November 22nd 1999, just a few
days before Quake 3 Arena that was released on December 2nd 1999. UT was also
mostly a multiplayer arena type game like q3a. It was a really hyped up battle
of giants back then between those two. Good times.

EDIT: corrected release dates after checking wikipedia

------
johnsolo1701
My understanding is that action-oriented multiplayer games in browsers have
always suffered because they can't use UDP. How does this achieve multiplayer
from a networking perspective?

~~~
mike_d
HTTP/2 with stream prioritization and server push kinda replaces the need for
UDP.

We can't allow UDP to be sent directly from browsers because that would enable
any random bit of JavaScript you load to launch a DDoS attack.

~~~
klodolph
HTTP/2 doesn’t replace the need for UDP at all, not in the slightest. For
latency-sensitive applications, it provides no advantages over HTTP that I can
tell.

The problem is with TCP, and the problem with TCP is that it prioritizes in-
order delivery, and missed packets cause head of line blocking. HTTP/2 is
designed to solve head of line blocking, but since it’s built on top of TCP,
it can’t solve the issue in this case.

------
dang
A thread from 2014:
[https://news.ycombinator.com/item?id=7247307](https://news.ycombinator.com/item?id=7247307)

[https://web.archive.org/web/20140301184841/http://www.inolen...](https://web.archive.org/web/20140301184841/http://www.inolen.com/articles/compiling-
quake-3-virtual-machines-to-javascript/)

------
airstrike
All I get is Cross-Origin Request Blocked: The Same Origin Policy disallows
reading the remote resource at
[http://content.quakejs.com/assets/manifest.json](http://content.quakejs.com/assets/manifest.json).
(Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

------
cabalamat
If I wanted to learn to write browser-based games what would be a good place
to start? I know some JavaScript but am not particularly enamoured with the
language. Should I learn TypeScript plus some framework? (React?) Or how about
something functional like Elm?

~~~
jonex
Frameworks aren't very relevant for games. I'd go with Typescript (because it
will tell you about some errors earlier and provide code completion support if
properly set up) and WebGL. Then do everything in the canvas and essentially
ignore the fact that you have a browser with a DOM etc.

An option is to target WASM and write the game in Rust or C++, using
Emscripten WebGL bindings. This is harder but allows you to write high
performance games that would run too slow in Javascript.

------
lbj
Impressive port. I still remember back in the day, when setting a background
image in Windows resulted in a big performance hit.

------
simlevesque
PSA: The game broke my laptop's speakers in 10 seconds.

I'm grateful that my laptop speakers are easily serviceable.

------
greggman3
Wasn't quake ported to JS via the Java version like 10 years ago?

[https://code.google.com/archive/p/quake2-gwt-
port/](https://code.google.com/archive/p/quake2-gwt-port/)

Still, it's cool to see it ported via other means.

~~~
cromwellian
Yup, it was done with Google Web Toolkit, mostly By Stephen Haustein and Joel
Webber (I contributed the OpenAL emulation and some other bits of code)

Here’s a deep dive we did at Google I/O on it [https://youtu.be/aW--
Wlf9EFs](https://youtu.be/aW--Wlf9EFs)

------
jaytaylor
Wow this really runs like crap on Android!

Is there no way to control it without a mouse? After dropping in, I could hear
sounds in the level room, with occasional odd crackle distortion.

Pretty cool.

[https://i.imgur.com/1LvPTWh.jpg](https://i.imgur.com/1LvPTWh.jpg)

------
theunamedguy
This reminds me of my port of Quake 1 to Rockbox (for MP3 players):
[https://news.ycombinator.com/item?id=22162834](https://news.ycombinator.com/item?id=22162834)

~~~
gspr
Completely off topic: do you have a Rockbox-compatible, dumb, tiny, cheap
music player to recommend for running? I burned through three or four Sansa
Clips and Sansa Clip Pluses over the years, but those lines are now
discontinued (and I refuse to participate in the scalping refurbished market),
and my last one just died.

~~~
theunamedguy
The AGPTek Rocker is one of our last targets still in production and can be
acquired for around $50. I haven't used one myself, but from what I hear it's
fairly decent but not perfect.

------
atum47
Yep, that's really awesome. Quick question: If one implemented the whole thing
again, using three.js or even raw webgl, would it be more performant that the
compiled javascript version?

------
the_duke
Controls don't work on FF74 / Webrender / Wayland.

The browser reports the mouse as captured, but mouse movement and movement
keys have no effect. Click to shoot does work though.

(Chrome works fine)

~~~
Firehawke
FF74 on Windows works great, so it sounds like it's something specific to that
setup. Can't use Wayland on my Linux laptop, but I should at least try this on
that config to see if it works on X.

------
athst
Wow! Q3F! That was my absolute favorite game back in the day, and I was always
sad how it fell off. I couldn't get a game loaded here yet, but looking
forward to it.

------
gigatexal
There goes my week -- this runs wicked smoothly in my browser.

~~~
codethief
Even on my Thinkpad W510 from 2010(!) it runs very smoothly – incredible. If
only it were as good security-wise… (no TLS?!)

~~~
yipbub
What are the threats from not having TLS? There's no information to protect
here is there?

~~~
codethief
There is always something to protect – in this case, your browser and your
system. How about zero-days in WebAssembly that a man in the middle might
exploit?

------
brobinson
I get a "A mutation operation was attempted on a database that did not allow
mutations." when I try to start any match.

~~~
rzzzt
If you are using Firefox, I think this is the related issue (IndexedDB not
working in private mode):
[https://bugzilla.mozilla.org/show_bug.cgi?id=781982](https://bugzilla.mozilla.org/show_bug.cgi?id=781982)

~~~
brobinson
Yup, FF in a private window. Thanks!

------
megamindbrian2
I've picked up working on this if anyone needs any help configuring.

------
partiallypro
I wish Quake Live had never been killed off.

~~~
hauxir
check out [https://openarena.live](https://openarena.live) :)

it allows playing quake3 in-browser and even allows hosting your own server
over webrtc

------
lagerstedt
The fact that this can now be run in a browser on a laptop rather than a high
end gaming rig is indeed amazing.

~~~
pjmlp
It was already possible in 2011, but alas politics.

[https://www.youtube.com/watch?v=UQiUP2Hd60Y](https://www.youtube.com/watch?v=UQiUP2Hd60Y)

[https://adobe-flash.github.io/crossbridge/](https://adobe-
flash.github.io/crossbridge/)

~~~
jchw
... the issues with Adobe Flash are quite a bit more varied than “politics.”
At best, it was always a drag on mobile platforms, reducing battery life and
hogging resources, and at worst it’s pretty much best known now for its
security issues that ultimately helped further its demise. If you want to go a
step further, in 2011 you could also have probably delivered your game as an
NPAPI extension and got pure native code instead. You could deliver these via
extensions, even in Chrome.[1]

Native Client also came to fruition in 2011, and Firefox chose not to support
it. I doubt many would chalk that up to just politics, either, but I think
it’s fair to compare.

[1]:
[https://developer.chrome.com/apps/npapi](https://developer.chrome.com/apps/npapi)

~~~
pjmlp
Apple speech I guess.

It was perfectly fine on any Symbian and Android device I got to play with,
and much better than J2ME ever was.

~~~
jjoonathan
One time I accidentally left SpinControl.app on for a week and went about my
business (SpinControl, RIP, was an app that logged stack traces any time an
app didn't flush its event queue for more than a few seconds -- i.e. caused a
beachball). A week later I came back and checked it to find something truly
astounding: with hundreds of logged spins, 100% of them were due to flash.
Usually in Safari, but sometimes in other embedded webkit contexts. You would
expect a few spins to creep into that list from other causes, and indeed I
triggered one with a mail index rebuild just to be make sure it was watching
more than the browser process, but no, SpinControl was working fine. 100% of
the beachballs in the last week were due to flash's suckiness, to say nothing
of power usage or security.

Flash's performance issues, at least on the mac, were very real. Good
riddance.

> much better than J2ME ever was.

If you lower the bar to the ground anyone can jump over it.

------
afro88
Amazed that this runs on mobile too (but no controls). Wow!

------
sitzkrieg
while this is neat, the mouse input is complete garbage, but its a zero
friction way to show someone the mods I guess

------
protean
very cool. may have to add instagib mode to this

------
ctdonath
Please, somebody port Quake 1 to iOS.

------
AdrianEGraphene
Now go win some $$ on

nanoquakejs.com

------
pgt
Oh. My. God.

This is amazing.

~~~
tehlike
Best thing: You can play at work! I did that for some time when I was bored

------
astlouis44
Another interesting implementation of Quake in the browser is this:
[https://openarena.live/](https://openarena.live/)

------
dvh
This is how news site will look like in 5 years (tech wise not appearance
wise). Good luck running adblock on it.

~~~
Koshkin
Good point, actually. How do you disable a poster on a wall which is rendered
as part of a texture inside a 3D game?

~~~
dkonofalski
There have been plenty of ways to inject textures into games to replace the
ones that are built into it. In online games, like this one, all it takes is a
host file that redirects the texture addresses with something else.

------
tomc1985
I guess this is cool. Not a big fan of "port everything to the browser"
though. I really don't want gaming to go any more in the direction of SaaS
than it already is. There is already too much rent-seeking.

~~~
tomcam
Where is the rent-seeking involved in this decision?

~~~
tomc1985
In the future, where every stupid little software program runs in the cloud,
and private ownership of bits is history. My wallet dies by death from a
thousand cuts and I have no ability to peek at game internals or tinker with
data files

~~~
rezonant
Sounds like just about every "cosmetic" premium currency microtransaction
"live service" "episodic" triple A video game that's come out in awhile and
they didn't even need the browser to do it!

