19 ms·
Doom 3 in WebAssembly
- deleted 8y ago[deleted]
- jk_danson 8y agoI haven't played through the demo. But this is very impressive.
- Thaxll 8y agoLoading data...
- hermitdev 8y agoI tried to check it out, but it was taking forever to load. Downloading the assets at only ~500 KBps on a 150 Mbps link. Also only got maybe 10% through the download before I gave up, and the Chrome tab was already using 500 MB of RAM. This might be an interesting POC, but seems very impractical in reality.
- moreira 8y agoThis website might just be getting the HN hug of death if it can’t even serve you the game at full speed. It doesn’t seem like it’s related to how practical it is.
- hermitdev 8y agoYeah, seems likely. I'll have to come back and check this out later. I recently found my Doom 3 CDs and tried installing it on Win10, but apparently doesn't work out of the box on 64-bit (crashes at start) without manually patching for using > 2 GB of RAM from the cursory googling I did. If this does work later, will have to show it to my 11 year old step son. Was hoping to freak him out with Doom 3 when I found my disks (he loves shooters & scary movies, so thought he might get a kick out of it).
- xirdstl 8y agoYou can also get a Doom 3 Steam key right now from several places for less than $2.
- dpkonofa 8y agoThat's the BFG Edition, though, which, in my opinion, isn't nearly as good as the original. I liked the dynamic of needing to use the flashlight and some of the other tweaks made to the BFG edition ruin the feel of the game a little. That being said, it did also make some improvements but to each their own.
- xirdstl 8y agoI believe Steam has both editions. There are certainly different store entries for "Doom 3" and "Doom 3: BFG Edition".
- dpkonofa 8y agoYou are correct! I didn't realize you could get the original edition on Steam. It wasn't on there for a while. Sidenote: The Doom 3 BFG edition also gives you the original Doom games although they've been nerfed a little from the original. (e.g., the stimpacks no longer have the little crosses on them because of a lawsuit from the Red Cross)
- hermitdev 8y agoEven though its a mere $2, on the principle of the matter, I dont want to pay it as I still have my original CDs, plus the expansion.
- jsheard 8y agoYeah, it loaded in about a minute when I found it. Local HN submitter ruins everything :(
- tachyonbeam 8y agoIt might help to put the assets on one of those mirroring CDNs, or to implement some lazy loading scheme (assuming they are loading all assets for all levels at once currently).
- brod 8y agoFor those waiting and wondering, it's a ~370mb download
- techntoke 8y agoWhich makes absolutely no sense for distributing games, unless they can be saved to a reliable location that can be managed by the user.
- tree_of_item 8y agoWhy doesn't it make sense? You don't redownload it every time.
- techntoke 8y agoYes you do, if your browser cache gets removed then so does the game.
- tree_of_item 8y agoYou don't redownload it every time. If your browser cache gets removed then so does the game. Is your browser cache getting removed every time? This just strikes me as a really strange thing to say.
- techntoke 8y agoYes it does get cleared frequently because it is not part of my standard file system.
- sonofgod 8y agoI get some weird lighting bugs -- one side of everyone's face has massive shadowing from the centreline... ... but yes, surprised how well it ran on my old laptop!
- Thaxll 8y agoFor a game that released 15 years ago?
- rubbingalcohol 8y agoGetting something like this running in a web browser at acceptable performance is a significant technical achievement.
- nicoburns 8y agoIs it? Web browsers aren't that much slower than native (around 2x with web assembly and WebGL I think). It's much harder for apps that are trying to render to the DOM (which is very slow). But WebGL apps should be perfectly fast in browsers...
- johndough 8y agoAll WebGL implementations have significant overhead compared to native GL. For example, just clearing the screen at 60 fps taxes my CPU at 10% on Windows (30% on Linux) while a C program that does the same uses 0% CPU. The reason for the performance penalty with Firefox on Linux is that the framebuffer content is copied from GPU to host memory, compositing is done and then it's copied back to GPU. For other platforms I'm not sure. Further, SIMD support has been removed from Javascript and not been added back to WebAssembly yet, so that's another factor 4-8 for computation-heavy code. Experimental pthread support is only available in Chrome experimental for now due to the Spectre and Meltdown exploits. And general GPU compute apparently is really tricky to implement in a secure way, although DOOM does not use it.
- 8y ago
- potiuper 8y agoRedistributing game assets like this is legal how? https://github.com/id-Software/DOOM-3/blob/master/neo/sys/linux/setup/image/License.txt https://github.com/id-Software/DOOM-3/blob/master/neo/sys/li...
- sneakernets 8y agoIt's the demo.
- ChrisSD 8y agoDo the demo assets have a less restrictive license?
- sneakernets 8y agoIf you wanted to be pedantic, probably not, but given how easy it is to just download the shareware version yourself and open the WAD files or whatever, what's the point? Would be a silly restriction.
- ChrisSD 8y agoSure but it wouldn't be the first time a rights holder sued over a "silly restriction". If someone wants to take that risk then more power to them but they should be aware it is a risk unless they have a specific assurance.
- Gab_CV 8y agoI double checked on the License specific to the demo (License.txt in the install), and it is indeed less restrictive. However this might be gray area
- deleted 8y ago[deleted]
- pathartl 8y ago
- dschuetz 8y agoThis demo doesn't include shaders, it's mostly just polygons and textures and lightmaps. It was the shaders which made the game impressive back then. However, for a port to WebAssembly it's really a big deal.
- sneakernets 8y agoTo think, those were the old fixed pipeline ARB-style shaders, too. I still have trouble with games using those on modern cards.
- knorker 8y agoAs I recall it was the dynamic lighting that made it impressive. https://en.wikipedia.org/wiki/Shadow_volume https://en.wikipedia.org/wiki/Shadow_volume
- jdlyga 8y agoIs your browser ready for Doom 3?
- leowoo91 8y agoTook about 10 minutes to download and start, I also had half face rendering issue + lost some audio play randomly. FPS was low and cpu was hottie but it worked.
- LyalinDotCom 8y agoTook a long time to download but it does work, really amazed here
- cm2187 8y agoInterestingly it defeats Firefox's disable autoplay videos setting.
- j05huaNathaniel 8y agoWhat do you mean? You intentionally played the game. I don't understand your comment.
- zamadatix 8y agoIt's not a <video> element.
- cm2187 8y agoYeah, but if it can be done for a game, it can be done for obnoxious advertising.
- jillesvangurp 8y agoOnce this stuff stabilizes a bit, games wrapped up as progressive web apps might become a thing. Could be an interesting way to get distribution outside of the app stores via regular search engines for a lot of indie developers using e.g. unity. Also a nice way for mainstream game developers to show of demos without requiring cumbersome installations, lengthy detours via some app store, etc.
- meritt 8y agoI hope you're right. We've had this capability for quite some time but for some reason it never takes off. Bastion released a version for Chrome's native client 7 years ago, the game ran amazingly well, but that version of the game doesn't seem to exist anymore. NaCl was shut down in favor of webassembly so here's hoping. [1] https://kotaku.com/5866594/you-can-now-play-bastion-in-googles-chrome-web-browser https://kotaku.com/5866594/you-can-now-play-bastion-in-googl... [2] https://www.youtube.com/watch?v=MvKEomoiKBA https://www.youtube.com/watch?v=MvKEomoiKBA
- styfle 8y agoNaCl was not cross platform and not standardized the same way that Web Assembly is.
- lostgame 8y agoI’m wondering for kicks if this would run on my iPhone 7S, but I think it being at the top of HN is terrorizing the download speeds.
- saagarjha 8y ago> iPhone 7S Not trying to be rude, but this phone doesn't exist,
- aerovistae 8y agocould be an apple employee testing a new device who briefly forgot himself
- sebazzz 8y agoI tried it on iPhone 8, iOS 12.latest and it crashes Safari once it downloaded the data.
- rafaelvasco 8y agoOnly thing we need now is presentation/distribution. Download this stuff one time for the machine as a standalone progressive hybrid native/web app, and run as an exe from there on. With auto updates. No browser involved. HTML5 games don't take off because of the presentation/distribution. The browser is the problem. Now that we have WebAssembly, performance is much less of a problem.
- Klathmon 8y agoI absolutely disagree. The browser is the solution to the presentation/distribution problem. I don't need to worry about installing the game, or worry about what OS I'm on or where it was installed to or anything else. I go to the URL, and the game downloads if needed, then plays. Updates, local caching and storage, and more is all taken care of. If I want to play with a friend on some multi-player game, I send them the link, and they go to it and start playing themselves. no "launchers" needed, no app stores which take a cut, no platforms which can decide that the game isn't suitable for their system, no app stores which can decide that the app is too close to something they offer and removing it, no expensive publishing costs, and you have multiple browsers to choose from if you don't like any one in particular.
- rafaelvasco 8y agoI disagree. But I understand your view. The thing is I don't want the game running IN the browser. I want it running standalone, but being web enabled and having the facilites it provides.
- tyingq 8y agoThe WASM folks have plans to deepen the browser ties with direct DOM access, tying threads to webworkers, GC that's tied to the browser js, etc. I can see why you want what you do, but it will get harder over time.
- rafaelvasco 8y agoUnfortunate.
- BagOfPistchios 8y agoKinda neat, but why? Who really wants this? It runs a lot slower than a native exe, and waiting for something to load in the browser seems like a silly idea if you could wait for a real program launch.
- Gab_CV 8y agoWell, the end idea is to have sandboxed native speed applications, immediately available without any installation. The issue of "loading" needs to be tackled on. In that very specific case, it is just that the program was not designed for streaming of asset data. This is a technological demonstration of possibilities of running native apps in a browser. But lot of work are remaining to do.
- jhuni 8y agoInstallation is the point, you don't want to run a game only once.
- Gab_CV 8y agoHi! I am the guy who did this port. I am very sorry for long download times, but the HN/Twitter buzz was unexpected and the host server - a cheap shared hosting I barely use just for testing purposes - is currently crying very hard. Oops... Also, download code is dumb for now, it is downloading one big full .pk4 file (400MB) for each visitor loading the app. I know, it should be better to only preload necessary assets for sure! Smart streaming of game data is one necessary step for apps on the web.
- anderspitman 8y agoHave you considered webtorrent or IPFS for distributing the file? Webtorrent in particular looks very easy to setup, and then the most your server would ever have to handle is the equivalent of a single downloader.
- Gab_CV 8y agoI think it would be better to stream only needed data, using some lazy load mechanism. Still need to figure out what is the best approach
- anderspitman 8y agoThat's definitely the more permanent solution for games like this. I was thinking more along the lines of quickly solving the immediate problem so you don't have to spend more money on a different server. I wouldn't be surprised if you could replace the download with a webtorrent in less than an hour of work and be done with it.
- quasarj 8y agoExcellent job! I wanted to run the native copy for comparison, but it turns out you added support for the demo files yourself! Gah!
- miguelmota 8y agoI wonder if you could utilize IPFS as a distributed CDN for p2p file downloading to take some load off the server (assuming the .pk4 is static and stateless)
- km3k 8y ago"Site not installed". I think we killed it.
- Gab_CV 8y agoYes, it is dead just now. I guess I have to take another hosting option :)
- ndz 8y ago404 now
- andreimatei1 8y agoHi Gab_CV, this is really cool! Congrats! Are you planning on writing any notes about what the port took? You commits are quite clean, but still some narrative would be really interesting.