Not

Hacker News!

Beta
Home
Jobs
Q&A
Startups
Trends
Users
Live
AI companion for Hacker News

Not

Hacker News!

Beta
Home
Jobs
Q&A
Startups
Trends
Users
Live
AI companion for Hacker News
  1. Home
  2. /Story
  3. /A time-travelling door bug in Half Life 2
  1. Home
  2. /Story
  3. /A time-travelling door bug in Half Life 2
Nov 21, 2025 at 5:48 PM EST

A time-travelling door bug in Half Life 2

AshleysBrain
79 points
12 comments

Mood

informative

Sentiment

neutral

Category

tech_discussion

Key topics

Gaming

Bug

Half_life_2

Game_dev

Discussion Activity

Active discussion

First comment

1d

Peak period

15

Day 3

Avg / period

11

Comment distribution22 data points
Loading chart...

Based on 22 loaded comments

Key moments

  1. 01Story posted

    Nov 21, 2025 at 5:48 PM EST

    2d ago

    Step 01
  2. 02First comment

    Nov 23, 2025 at 2:50 AM EST

    1d after posting

    Step 02
  3. 03Peak activity

    15 comments in Day 3

    Hottest window of the conversation

    Step 03
  4. 04Latest activity

    Nov 24, 2025 at 12:28 AM EST

    2h ago

    Step 04

Generating AI Summary...

Analyzing up to 500 comments to identify key contributors and discussion patterns

Discussion (12 comments)
Showing 22 comments
g7r
23h ago
1 reply
Ah, nice story!

This reminds me of another story with FPU involved. I was a game developer once. We were making a game that consistently triggered assertion failures related to FPU calculations, but only on a single PC in the whole office. The game was explicitly setting FPU precision to 32 bits at the start to make all calculations more consistent. However, on that particular PC, there was a fancy hand writing input software that injected its DLL into every process. As you've probably already guessed, that DLL did FPU mode reset to the default in the event handling loop (i.e., main thread). I had to shift FPU mode setting code from process initialization to the event handling loop to be able to deal with the damage that third party DLLs could inflict.

djmips
17h ago
1 reply
nice detective work. Global FPU state had sure caused a lot of headaches.
zokier
9h ago
[delayed]
Ericson2314
10h ago
3 replies
It's a goal of mine to get Valve using Nix. (I hope our in-progress Windows support would make this especially compelling.)

One advantage of this is that it will become very easy to not only build the original source of the game, but also build it with the original toolchain and dependencies, the toolchains for those dependencies, etc. etc., all the way down.

Hopefully something like that at your finger trips would have made finding the root cause of this bug a good bit easier!

zenethian
3h ago
Nix seems like a cool tool but nix users are becoming increasingly irritating.
bpye
4h ago
> I hope our in-progress Windows support would make this especially compelling.

What is the current story for using Nix to build Windows binaries?

throwaway314155
7h ago
> It's a goal of mine to get Valve using Nix

They’re using Arch Linux. Let’s call it a win and move on lol.

zX41ZdbW
10h ago
1 reply
This reminds me of an old bug in simdjson - any usage of it breaks std::unordered_map in unrelated parts of the code due to an unintentional modification of FPU flags: https://github.com/simdjson/simdjson/issues/169
mattgreenrocks
7h ago
Beautiful, and by that, I mean completely and utterly horrific.
why_at
10h ago
2 replies
>a big innovation of HL2 was the extensive use of a real physics engine. The door and the guard are both physical objects, both have momentum, they impart an impulse on each other, and although the door hinge is frictionless, the guard's boots have some amount of friction with the floor.

It's been a while since I've played HL2 but this isn't exactly how I remember it. While a lot of things were physics objects I thought the doors would just smoothly rotate towards their target position without any physics at all. You can't bump them shut with another physics object for instance.

sigmoid10
9h ago
1 reply
You can't move them (apart from the opening and closing animation), but they can move other objects that are in their way. Both need to be physics objects for that to work, even though the door is just kinematic (i.e. it won't react to forces applied to it).
Lammy
6h ago
> I think you could get them stuck halfway closed by cramming something in the door frame that would get the whole thing jammed.

This was a popular griefing tactic when TF2 first came out: https://youtu.be/JUPzN7tp7bQ?t=243

accrual
7h ago
Just did some quick testing - the doors definitely have physics and can get stuck on objects and can impart forces. But impeded yes, they smoothly open/close.
accrual
8h ago
2 replies
> The door and the guard are both physical objects, both have momentum, they impart an impulse on each other

I wonder if the term "impulse" here has any connection to the various impulse commands available in the source engine. I remember using "impulse 101" and causing havok in the opening plaza area. Spawning zombies on the roofs, sending them after the combine, etc.

https://developer.valvesoftware.com/wiki/Impulse

ThrowawayR2
7h ago
1 reply
[delayed]
accrual
6h ago
Right, I was just wondering if the developers repurposed the term impulse from the physics engine when creating console commands. "impulse 101" is a common cheat to give all weapons with ammo, but why not "give" or "player.addItem" or something? Just a curiosity.
WatchDog
4h ago
The impulse console command originates from Quake, the Half-Life 1 engine (GoldSrc[0]), was based on the Quake engine, and the Half-Life 2 engine (Source), was based on GoldSrc.

In quake, the impulse commands were used mostly to switch weapons[1]. I'm not really sure about the naming though, why choose the word "impulse".

[0]: https://en.wikipedia.org/wiki/GoldSrc.

[1]: https://github.com/id-Software/Quake/blob/0023db327bc1db0006...

FrostKiwi
6h ago
1 reply
A Valve employee using YouTube Playthroughs [1] to diagnose a bug is hilarious to me. Awesome story.

[1] https://mastodon.gamedev.place/@TomF/115589894339657055

lomase
6h ago
Is Valve porting HL2 to VR? A 2013, sorry.
stevefan1999
6h ago
1 reply
Reminds me of what G-Man said in the opening scene of HL2: "The right man in the wrong place can make all the differences in the world"
powerclue
2h ago
Indeed, that quote is deployed prominently in red text in the thread, in fact.
dev0p
7h ago
>But on the SSE version, a whole bunch of tiny precisions are very slightly different, and a combination of the friction on the floor and the mass of the objects means the guard still rotates from the collision, but now he rotates very slightly less far.

Insanity. The values were just right. Just wow.

View full discussion on Hacker News
ID: 46009962Type: storyLast synced: 11/23/2025, 12:07:04 AM

Want the full context?

Jump to the original sources

Read the primary article or dive into the live Hacker News thread when you're ready.

Read ArticleView on HN

Not

Hacker News!

AI-observed conversations & context

Daily AI-observed summaries, trends, and audience signals pulled from Hacker News so you can see the conversation before it hits your feed.

LiveBeta

Explore

  • Home
  • Jobs radar
  • Tech pulse
  • Startups
  • Trends

Resources

  • Visit Hacker News
  • HN API
  • Modal cronjobs
  • Meta Llama

Briefings

Inbox recaps on the loudest debates & under-the-radar launches.

Connect

© 2025 Not Hacker News! — independent Hacker News companion.

Not affiliated with Hacker News or Y Combinator. We simply enrich the public API with analytics.