Live data from Hacker News

Half-Life 2 in a Browser

hl2.slqnt.dev

251–260 of 283 posts

Re: Half-Life 2 in a Browser

#251

Earlier quoted context omitted.

I personally love openra. It’s a smooth free online implementation of red alert 2 with multiplayer

> openra is an online implementation of red alert 2 Are you sure? As far as I know, OpenRA is a reimplementation of the first Red Alert game, and also it's not playable in the webbrowser (which is what this post is about)

Ah yes I mean command and conquer 2 red alert - go easy on me it is a bit confusing

Re: Half-Life 2 in a Browser

#252

Earlier quoted context omitted.

Performance of the game is much more important than download time Its really common to sacrifice disk space for runtime perf For gamers 100GB is not a big deal, CoD is like 200GB and its extremely popular

I disagree with your assertion that games running in a browser are not performant enough. WebAssembly being ~45% slower than native sounds scary, sure, but that's basically what you can expect from using any non-native language anyway. So if Unity is performant enough where all C# code has similar overhead then it should all be fine. Plus not all games are AAA.

Unity doesn't use C# for everything. Notably the game engine itself is not C# but C++. C# is essentially just the scripting language.

You're also ignoring the overhead of WASM -> WebGPU -> native graphics API, not to mention how much harder it is to develop and debug that platform than it is a native one.

Re: Half-Life 2 in a Browser

#253

Earlier quoted context omitted.

I disagree with your assertion that games running in a browser are not performant enough. WebAssembly being ~45% slower than native sounds scary, sure, but that's basically what you can expect from using any non-native language anyway. So if Unity is performant enough where all C# code has similar overhead then it should all be fine. Plus not all games are AAA.

Unity doesn't use C# for everything. Notably the game engine itself is not C# but C++. C# is essentially just the scripting language. You're also ignoring the overhead of WASM -> WebGPU -> native graphics API, not to mention how much harder it is to develop and debug that platform than it is a native one.

Unity is just an example. And depending on the game you may actually be doing heavy work in "just the scripting language" instead of the engine. XNA, MonoGame, Love2D, etc. are all frameworks rather than game engines so they're absolutely doing typical engine work in the scripting language, if you need a different example.

> You're also ignoring the overhead of WASM -> WebGPU -> native graphics API

Wine -> DXVK -> native graphics API works great for many people. I can't imagine it having significantly worse performance characteristics, especially when WebGPU is closer to the native graphics API than DirectX on Linux is.

> not to mention how much harder it is to develop and debug that platform than it is a native one.

But why? You still have access to a debugger.

Re: Half-Life 2 in a Browser

#254
this is amazing and brings back memories.

Curious though about the bugs. Right at the start, as g-man talks his eyes are missing textures and his mouth doesn't move. Both of those bugs continue, when I get to the part where the guard removes his mask, his lips don't move and the video monitor doesn't change to show the professor.

Is it just a minor oversight or is that something hard to fix?

Booting up the original, some shadows and other graphic details are missing.

Not complaining! Just curious. It made we want to play again!

Re: Half-Life 2 in a Browser

#255
post #245
post #9

And Quake 3: https://thelongestyard.link/q3a-demo/ And Unreal Tournament: https://dos.zone/mp/?lobby=ut There's also https://noclip.website/ which, while not playable, has hundreds of levels from dozens of older games that you can explore freely. Including Half-Life 2, with more accurate rendering than this web port (which seems to be missing many shaders including character eyes).

Here's RuneScape 2 in a browser: https://2004.lostcity.rs/client?world=2&detail=high&method=0

Hey I'm playing that right now!

Re: Half-Life 2 in a Browser

#256
post #131

With WASM and WebGL being mature technologies, I'm not sure why there aren't more video games published this way. For really big games with lots of assets, having those assets in local storage makes sense. But I wouldn't mind if a game "installer" is just your browser asking "This game wants to use up to 20 GB of local disc space. Is that okay?"

Technical reasons I know of: - Support from major engines is still bad: Unreal Engine does not have web exports. Godot 4 does not support them when using C#. That only leaves Unity. - While WebGL is mature, it's based on openGL es3, which is an ancient api/shading language with limited features. If you were previously targeting vulkan/dx12, now you have to restrict your feature set or find (costly) workarounds to mak…

> Support from major engines is still bad: Unreal Engine does not have web exports. Godot 4 does not support them when using C#. That only leaves Unity.

Pretty dishonest to imply that C# is commonly used in Godot. The vast majority of games are Gdscript which exports to browsers perfectly

Re: Half-Life 2 in a Browser

#257

this is amazing and brings back memories. Curious though about the bugs. Right at the start, as g-man talks his eyes are missing textures and his mouth doesn't move. Both of those bugs continue, when I get to the part where the guard removes his mask, his lips don't move and the video monitor doesn't change to show the professor. Is it just a minor oversight or is that something hard to fix? Booting up the original,…

someone here commented earlier that the animations had to be disabled because they were causing some issues

Re: Half-Life 2 in a Browser

#258
post #37

Interesting, I am not able to play HL2 on Steam because macOS no longer has 32-bit support and Valve never compiled if for 64-bit but here we are, it’s playable on the same OS in the browser. BTW IIRC there was some method to convert the 32-bit game binaries to make them run on recent macs. I remember doing it.

How is that possible? 32 bits should be compatible with a 64 bit machine. You can always use less bits for your memory addresses. Are there any other architecture changes that are preventing 32 bits binaries from running? Does that also mean that old software no longer runs unless there is a 64 bit version? In windows you can run x32 and x64 executables in a 64 bits machine

Sure, but you need to use any such executable with 32 bit system-level libraries. Those are what Apple has removed.

Re: Half-Life 2 in a Browser

#259
post #136

Input doesn’t work so well on my iPad (lol) but seeing that intro rendered in safari on said ipad, wild. So cool

A few years ago, before I bought a Nintendo for my kid, he was playing Minecraft on an iPad. I tried to pair a Bluetooth controller, and had no luck. I think the OS was too locked down. At the same time, I could connect a Bluetooth controller to my Android phone and play Minecraft with no problem. In fact, I've said for a long time that I wish I had a nice Android tablet with a Tegra chip that I could both use as reg…

Nvidia used to have exactly that tablet, though it’s quite old now. I ended up with 2 even through a battery recall program where you were supposed to just throw out the recalled unit. Maybe a little ahead of its time, but it was awesome for retroarch. Had HDMI out so you could use it as a console. Fun times.

Re: Half-Life 2 in a Browser

#260
post #173

Earlier quoted context omitted.

The CPUs were powerful enough, sure. The GPUs (Intel GMA950) absolutely weren't. Even on Windows with better drivers, Half-Life 2 is a slideshow on that class of hardware.

Depends a LOT on the res. E.x. notebookcheck indicates that FEAR (released a yearish later) could get 20-30ish FPS at 640x480 but chokes at 1024x768 (at numbers matching the HL2 lost coast demo slideshow at 1024x768). Gotta remember a lot of mac people were just happy to play something more modern than Marathon or Giants CK

There were also MacBook Pro models with dedicated GPUs that were capable of running HL2 decently. The 2006 MacBook Pro 15-inch had a 32-bit only Yonah Core Duo and a Mobility Radeon X1600.

I got my gaming start on one such machine - the Mobility Radeon was fine for HL2/Portal at 1024x768. Good memories.

Post reply on HN