Live data from Hacker News

Game devs explain the tricks involved with letting you pause a game

kotaku.com

201–210 of 273 posts

Re: Game devs explain the tricks involved with letting you pause a game

#201

One of the fun features that I developed for Warcraft (the RTS) was to fade the screen to grayscale when the game is paused. Since the game uses a 256 color palette, it was only necessary to update a few bytes of data (3x256) instead of redrawing the whole screen, so the effect was quick. I also used this trick when the game stalled due to missing network packets from other players. Initially the game would still be…

Oh, and I forgot to mention that pause had to be synchronized across the network, so the pause button would pause for all players.

And in the "this is why we can't have nice things", that also introduced problems, because we didn't want a player who was losing to keep pausing the game until the winning player quit out of frustration, so I think we kept a per-player pause counter, which would only be restored if other players also paused? (I don't quite remember all the details, just that we had to prevent yet another abuse vector).

Re: Game devs explain the tricks involved with letting you pause a game

#202

Earlier quoted context omitted.

> There's probably something eloquent by Hannah Arendt about how 190,000 Americans killed by health insurance companies Health insurance companies don't kill people, quite the opposite. If it weren't for health insurance, a lot more people would die. Murdering their CEOs is crazy extremism.

Physicians For A National Health Program put the figure at 200,000 people annually[1]. What's your source for saying the number is zero? When they deny claims, people die. When they override medical doctor recommendations and insist on cheaper treatments, people die. When they tangle up customers with paperwork and bureaucracy, that some people can't access the health insurance they pay for. When they take money out…

> Physicians For A National Health Program put the figure at 200,000 people annually[1]. What's your source for saying the number is zero?

I'm not saying the number is zero. I'm saying the number is vastly negative. They are overall saving a lot of people rather than killing them. Health insurance companies are hugely net-positive.

> but sticking a label on it and saying "leftist extremism" and then denying real issues is not helping.

Talking about murdering CEOs is helping far, far less.

Imagine I believe that the Democrats are net-negative. Would this justify people saying that Democrat leaders should be murdered? Or that labelling these justifications of murder as "rightist extremism" is "not helping"?

Re: Game devs explain the tricks involved with letting you pause a game

#203
post #51

Earlier quoted context omitted.

It wasn't really that much to do with determinism. Quake uses a client-server network model all the time, even when you're only playing a local single-player game. What the demo recording system does is capture all of the network packets that are being sent from the server to the client. When playing back a demo, all the game has to do is run a client and replay the packets that it originally received from the server…

I don't see why it makes a difference for this purpose that you're replaying network packets or controller inputs or any other interface to the game engine. The important thing is that there is some well-defined interface. I guess designing for networked multiplayer does probably necessitate that, but if the engine isn't deterministic it still isn't going to work. There was a twitter thread years ago (which appears t…

> I don't see why it makes a difference for this purpose that you're replaying network packets or controller input

Building a simulation that has perfect determinism is incredibly time consuming. Incredibly. Especially one that is identical across platforms, chipsets, and architectures.

Deterministic simulation replay also breaks anytime you change the simulation. Which is kind of obvious. But quite meaningful.

In any case, I’ve shipped games that use both solutions. And let me tell you, deterministic simulation from input is an order of magnitude more effort to build, test, and maintain!

Re: Game devs explain the tricks involved with letting you pause a game

#204
The ability to pause is extremely important in games (at least single player ones).

I hate when games are into multiplayer modes even when played in single-player campaign (e.g.: Generation Zero) and thus cannot be paused.

Another thing that I hate in this regard are unpausable cutscenes. I remember when I was playing The Witcher 3, that at last there was some cutscene advancing some plot point, and right into the middle of it The Wife™ would barge in telling me something important that would require my attention... but I cannot pause that scene so I had to miss it while I listened to her. Why, oh why, devs hate pausing cutscenes so much??

Re: Game devs explain the tricks involved with letting you pause a game

#205

Earlier quoted context omitted.

One of my favourite things of being on HN is reading comments like this. Namely, devs who worked on games I played growing up. I absolutely love hearing stories from their past about little technical nuances like this comment. The more technical / specific, the better. I'd honestly love to compile a book of "war stories" told by devs like netcoyote. Maybe I will. Net, if you're interested, hit me up.

This is a great idea, but respectfully, if you're going to get traction you need to be the one instigating getting people to talk to you. Have a pitch, have an explicit ask, and be willing to put effort into making it happen. Fantastic idea though, you should do it.

There are a few of these floating around for older games, but the world needs more:

Ara technica has a war stories feature on game development.

https://arstechnica.com/video/series/war-stories

For apple 2 games John Romero did a podcast. It’s decent but he seems to have stopped doing them.

https://appletimewarp.libsyn.com/ Or YouTube

Ted dabney experience has a lot of interesting interviews with older arcade game designers:

https://www.teddabneyexperience.com/episodes

Re: Game devs explain the tricks involved with letting you pause a game

#206

The strangest pause bug I know is in Mario Sunshine: pausing will misalign the collision logic (which runs 4 times per frame) and the main game loop. So certain specific physics interactions will behave differently depending on how many times the game has been paused modulo 4.

There is another great one in one of the Legend of Zelda games. The game world is paused whenever Link pulls an item from a chest, but because his animation does not loop perfectly, because of a missing frame, he slowly slides across the ground and even through walls. One of the minimum % speedrun abuses this by looping the animation for many hours in order to glitch through a wall, and not collect a progression item…

My favorite as a kid was also in a Zelda game.

In the original (and maybe also DX) release of Link's Awakening, the game uses a top-down view with the world split up into tiles. Walking of the left side of a screen makes you end up on the right side of the next screen over.

What you could do is pause at the right frame on the screen transition, and you would end up on the new screen but link's position would not change. So you walk off the left side of a screen and end up on the left side of the new screen. Lots of fun to be had with skipping important stuff with that.

Re: Game devs explain the tricks involved with letting you pause a game

#207
I would prefer to understand why a paused or backgrounded game still manages to consume a ton of CPU or GPU

Like, you're still just churning away at the main game loop while literally nothing else is happening except for you waiting for me to unpause it?

Because THAT would be an actual achievement. Hell, I can suspend any process from the Unixy side of things by sending a SIGSTOP signal, for a far more perfect "pause".

If I was a game dev, I would not settle for "looks like paused, but still burning down the environment and heating up my home as a side effect"

Re: Game devs explain the tricks involved with letting you pause a game

#208
Pausing is unintuitive in Unity because you don't control the main loop - all active objects get updated every frame. The recommended way to do it is to set the "time scale" to zero and have menu animations use special timers that ignore time scale. If you control the game loop, you can usually just get away with an "if (paused)" [0].

[0] https://github.com/rameshvarun/marble-mouse/blob/8b25684a815...

Re: Game devs explain the tricks involved with letting you pause a game

#209
for our game dev project in undergrad we built an rts game as our capstone, and we used the "slow stuff down" trick - except different systems had different clock/time systems! and so some things were still running while it was paused, which led to some weird side effects (eg money glitch)

i did the thing you're "not supposed to do" and attached everything to a world clock so everything ran at like 60fps in terms of events, so it was a real-time "turn based" system

Re: Game devs explain the tricks involved with letting you pause a game

#210

Earlier quoted context omitted.

You're right, I must have gotten that mixed up. Sorry. I guess floats are still mostly deterministic if you use the exact same machine code on every PC.

> I guess floats are still mostly deterministic if you use the exact same machine code on every PC. Nope, they are not. Part of the problem is that "mostly deterministic" is a synonym for "non-deterministic".

Floating-point non-determinism issues usually come from one of these sources:

- Inconsistent use of floating-point precision, which can arise surprisingly easily if e.g. you had optional hardware acceleration support, but didn't truncate the intermediate results after every operation to match the smaller precision of the software version and other platforms.

- Treating floating-point arithmetic as associative, whether at the compiler level, the network level, or even the code level. Common violations here include: changing compiler optimization flags between versions (or similar effects from compiler bugs/changes), not annotating network messages or individual events with strictly consistent sequence numbers, and assuming it's safe to "batch" or "accumulate" deltas before applying them.

- Relying on hardware-accelerated trigonometric etc. functions, which are implemented slightly differently from FPU to FPU, since these, unlike basic arithmetic, are not strictly specified by IEEE. There are many reasons for them to vary, too, like: which argument ranges should be closest to correct, should a lookup table be used to save time or avoided to save space, after how many approximation iterations should the computation stop, etc.

Post reply on HN