Live data from Hacker News

A time-travelling door bug in Half Life 2

mastodon.gamedev.place

21–30 of 88 posts

Re: A time-travelling door bug in Half Life 2

#22
>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.

Re: A time-travelling door bug in Half Life 2

#24
post #22

>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 thou…

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). Although if I remember correctly, they are not even fully kinematic. I think you could get them stuck halfway closed by cramming something in the door frame that would get the whole thing jammed.

Re: A time-travelling door bug in Half Life 2

#25
post #16
post #15

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…

nice detective work. Global FPU state had sure caused a lot of headaches.

I recall that D3D liked poking FPU state too, which of course had all sorts of fun results

Re: A time-travelling door bug in Half Life 2

#26

It seems to be typical - some calculations break while switching from x87 to SSE. The same happened with TF2 too - it's ammo calculation code worked slightly differently on GNU/Linux build of the game, because it was built with SSE instructions (Windows version still used x87).

I expect this is / was a very common problem for people porting 32-bit game code to newer compilers. I work on a fairly old codebase that forces use of x87 for a handful of code paths that don't work correctly otherwise. GCC will use default to x87 if you do an i386 compile, but will default to SSE for 64-bit builds, so you have to be careful there too.

Re: A time-travelling door bug in Half Life 2

#27

I wonder how on earth stuff like x86->ARM translation works so well if games break even after switching from x87 registers to SSE preserving all the logic otherwise...

Rosetta uses software emulation for x87 floating point. That's slow, but in practice that doesn't matter much. Mac software never had a reason to use x87 FP, every Intel Mac had at least SSE3 support.

Re: A time-travelling door bug in Half Life 2

#28

Wait, so is that "beta" of Half Life 2 VR a thing I can play? If it is, how did I not know about this, and if not... why not? I'd also love to play Portal, actually. They say it makes you sick, but to my knowledge I'm immune from VR motion sickness, so worth a try...

I don’t know about the beta, but there’s an excellent HL2 VR conversion mod you can play today. It feels just right and got me to play HL2 again after all these years.

https://store.steampowered.com/app/658920/HalfLife_2_VR_Mod/

Re: A time-travelling door bug in Half Life 2

#29
post #28

Earlier quoted context omitted.

I don’t know about the beta, but there’s an excellent HL2 VR conversion mod you can play today. It feels just right and got me to play HL2 again after all these years.

https://store.steampowered.com/app/658920/HalfLife_2_VR_Mod/

Fantastic! If HL3 releases on VR, maybe I'll do HL2 in VR (refresher), then Alyx, then HL3. :)

Re: A time-travelling door bug in Half Life 2

#30
> 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

Post reply on HN