frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Game Devs Explain the Tricks Involved with Letting You Pause a Game

https://kotaku.com/video-game-devs-explain-how-pausing-works-and-sometimes-it-gets-weird-2000686339
57•speckx•2d ago

Comments

bitwize•1h ago
For my game (custom engine) I had a way to stop the game clock from advancing, while the input and draw loop kept running. It would also put the game into the "pause" input state during which only the resume button would be active.
DeathArrow•1h ago
Not sure if slowing down time is the right approach.

The best approach would be using something like if(game_is_paused) return; in the game loops.

astrobe_•1h ago
It depends on how your timers are implemented. If they are implemented as a "rendez-vous" absolute date (as in UTC for instance - not in local time unless you want to add "eastern eggs" related to daylight saving time...), this will cause bugs. If you implement your own in-game monotonic clock that you can stop, it should be ok.
sweetjuly•56m ago
>If they are implemented as a "rendez-vous" absolute date

Do people actually do that? What's the plan for when the user sleeps their machine? All the events just inexplicably happen all at once when they wake it?

stoltzmann•35m ago
I've implemented timers that had timeouts using unix timestamps, but only for multiplayer - when a player's attempt to connect to the server times out, etc.

Inside the game loop, we would keep the global tick counter that incremented on every tick, and timeouts would be based on that rather than on UTC.

The tick counter was updated only when the game logic was actually running. Our approach to pausing was to not run the functions that handled frame updates or physics updates, and to only run the rendering functions.

Generally we would never care about actual world time other than for some timeouts like for network (as the time passes for everyone), or for easter eggs like changing the tree models for Christmas or so.

I don't think anyone serious would implement event timers based on real time.

kdheiwns•59m ago
Games are multithreaded and have loads of objects running everywhere. If you're using anything that's not a custom game engine, there really isn't a single main() function that you can plop an if statement like that into.

Slowing down time applies it universally. Otherwise you're going to need that condition to every single object in the game.

danhau•54m ago
The slowing down thing sounds like a hack needed for engines that don’t give you control over the main loop.

I haven’t tried this yet, but for a custom engine I would introduce a second delta time that is set to 0 in the paused state. Multiplying with the paused-dt „bakes in“ the pause without having to sprinkle ifs everywhere. Multiplying with the conventional dt makes the thing happen even when paused (debug camera, UI animations).

vintermann•53m ago
One of the things that impressed me in Quake (the first one) was the demo recording system. The system was deterministic enough that it could record your inputs/the game state and just play them back to get a gameplay video. Especially given that Quake had state of the art graphics at the time, and video playback on computers otherwise was a low-res, resource intensive affair at the time, it was way cool.

It always surprised me how few games had that feature - though a few important ones, like StarCraft, did - and it only became rarer over the years.

dSebastien•52m ago
I wish I kept my demo files!
applfanboysbgon•46m ago
Checking in as a random indie developer who still prioritises determinism in my engine. I don't understand why so many games/engines sacrifice it when it has so much utility.
bob1029•34m ago
Determinism isn't essential to achieve record/playback experiences. You could just record the transform of the player at some fixed interval and then replay it with interpolation. This is arguably more "deterministic" in a strategic sense of shipping a viable product.
JoshTriplett•19m ago
I think if it were as simple as "remember the RNG seed", game developers would do it every time. But determinism also means, for instance, running the physics engine at a deterministic timestep regardless of the frame rate, to avoid differences in accumulated error or collision detection. And that's something that needs designing in from day one.

Thank you for still prioritizing it.

Krutonium•2m ago
Tying physics to framerate at all is a mistake. Like, should be filed as a bug mistake.

There's no scenario in which that's desirable.

And yet even Rockstar gets it wrong. (GTA V has several framerate dependent bugs)

Lerc•39m ago
I had a puzzle game were all of the solutions it would show were playbacks of my keypresses as I solved it myself. As the puzzles got more difficult it got harder and harder to record a solution without having pauses to think about what to do next.
GaelFG•37m ago
I'm pretty sure it's because it's in fact 'just' a cool side effect to a common network architecture optimisation from the time where you could'nt send the 'state' of the entire game even with only delta modifiers and so you make the game detertministic to only synchronize inputs :) an exemple article I remember : https://www.gamedeveloper.com/programming/1500-archers-on-a-...

The main downside which probably caused the diseapearance is that any patch to the game will make the replay file unusable. Also at the time (not sure for quake) there was often fixed framerate, today the upsides of using delta time based frame calculation AND multithreading/multi platform target probably make it harded to stay deterministic (specialy for game where you want to optimize input latency)

foota•27m ago
Fun fact, overwatch must have done a similar things because they would let you play back games up until some release when you could no longer replay them unless you'd saved the render.

I think if I remember right there were also funny moments where things didn't look right after patches?

amiga386•23m ago
I think it's more the patching thing that made "collect and replay inputs" less common.

Networked games have a "tickrate", just for the networking/state aspect. For example, Counter-Strike 2 has a 64Hz tickrate by default. They also typically have a fixed time interval for physics engines. Both of these should be completely independent of framerate, because that's jittery and unpredictable.

Silphendio•19m ago
You don't need to tun the whole game at a fixed framerate, only the physics. That's actually common practice.

The bigger problem is that floating point math isn't deterministic. So replays need to save key frames to avoid drift.

Quake used fixed point math.

anthk•14m ago
Quake needs a FPU; if that was true it would run on a 486 SX.
nagaiaida•35m ago
saving rocket league replays to watch yourself play from your opponent's perspective was super helpful in 1v1
silisili•34m ago
Quake1 was my first love. From the old DOS version to the GLQuake to grappling hooks on Trinicom. I was amazed not only by said demo system but by QuakeC, and how heavily it was used, especially in college communities. I remember MIT and UWisc both being unreasonably productive modders in said language.

As a kid, I couldn't wait to see what came next. Sadly, Q1 was rather one of a kind, and it was many years until anything else like it showed up.

jval43•27m ago
Bungies Marathon series (1994) had the same recording system, as other commenters mentioned due to networking multiplayer.

What's totally insane is that the modern engine rewrite Aleph One can also play back such old recordings, for M2 Durandal (1995) and Infinity (1996) at least.

eterm•21m ago
Related to that is the ability to watch games using the game-client too.

This used to be a promoted feature in CS, with "HLTV/GOTV", but sadly disappeared when they moved to CS2.

Spectating in-client is such as powerful way to learn what people are doing that you can't always see even from a recording from their perspective.

gryfft•13m ago
> Related to that is the ability to watch games using the game-client too.

Halo 3's in-engine replay system was the high water mark of gaming for me.

ErneX•12m ago
Rocket League is a relatively recent game that allows match recording. It’s nice.
greazy•5m ago
Interesting you mention StarCraft. The replay feature could diverge off due to the non deterministic nature of the game.

https://news.ycombinator.com/item?id=21920508

bel8•51m ago
I quite like when games keep playing some visual-only animations when paused.

Like torch flames and trees swaying in the wind.

Lerc•49m ago
I find the notion odd that this is even a problem to be solved.

It suggests a level of control way below what I would ordinarily consider required for game development.

I have made maybe around 50 games, and I think the level of control of time has only ever gone up. Starting at move one step when I say, to move a non-integer amount when I say, to (when network stuff comes into play) return to time X and then move forward y amount.

recursivecaveat•44m ago
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.
gobdovan•12m ago
When I present TLA+ [0], I am referencing game pauses (pause buffer / item duplication Legend of Zelda exploit, Dark Souls menuing to cancel animations) and deliberate crashes as mechanics to exploit games, as those are still valid actions that can be modeled, and not doing that allows such exploits to happen.

A system is only correct relative to the transition system you wrote down. If the real system admits extra transitions that you care about (pause, crash, re-entry, partial commits), and you didn't model them, then you proved correctness of the wrong system.

[0] https://lamport.azurewebsites.net/video/videos.html

dwroberts•10m ago
The console cert ones are interesting but all the others are just Unity/Gamemaker/Unreal not allowing the developers to write normal code? The nonzero timestep thing is very strange
jonahs197•6m ago
>linking to kotaku
xhevahir•3m ago
When I first played the NES the pause feature impressed me even more than did the graphics. Apparently Atari already had the feature on the 5200 console, but even as late as 1988 it felt like magic to hit a button, go and eat dinner, and an hour later resume my game with another press of the button.

Game Devs Explain the Tricks Involved with Letting You Pause a Game

https://kotaku.com/video-game-devs-explain-how-pausing-works-and-sometimes-it-gets-weird-2000686339
59•speckx•2d ago•33 comments

NIST scientists create 'any wavelength' lasers

https://www.nist.gov/news-events/news/2026/04/any-color-you-nist-scientists-create-any-wavelength...
294•rbanffy•11h ago•133 comments

Anonymous request-token comparisons from Opus 4.6 and Opus 4.7

https://tokens.billchambers.me/leaderboard
511•anabranch•16h ago•499 comments

What are skiplists good for?

https://antithesis.com/blog/2026/skiptrees/
56•mfiguiere•1d ago•13 comments

College instructor turns to typewriters to curb AI-written work

https://sentinelcolorado.com/uncategorized/a-college-instructor-turns-to-typewriters-to-curb-ai-w...
263•gnabgib•13h ago•252 comments

The electromechanical angle computer inside the B-52 bomber's star tracker

https://www.righto.com/2026/04/B-52-star-tracker-angle-computer.html
324•NelsonMinar•16h ago•89 comments

SI Units for Request Rate (2024)

https://entropicthoughts.com/si-units-for-request-rate
57•fanf2•2d ago•28 comments

Updating Gun Rocket through 10 years of Unity Engine

https://jackpritz.com/blog/updating-gun-rocket-through-10-years-of-unity-engine
71•tyleo•2d ago•28 comments

Keep Pushing: We Get 10 More Days to Reform Section 702

https://www.eff.org/deeplinks/2026/04/keep-pushing-we-get-10-more-days-reform-section-702
36•nobody9999•1h ago•3 comments

Why Japan has such good railways

https://worksinprogress.co/issue/why-japan-has-such-good-railways/
393•RickJWagner•20h ago•361 comments

The RAM shortage could last years

https://www.theverge.com/ai-artificial-intelligence/914672/the-ram-shortage-could-last-years
17•omer_k•1h ago•10 comments

The world in which IPv6 was a good design

https://apenwarr.ca/log/20170810
31•signa11•5h ago•7 comments

State of Kdenlive

https://kdenlive.org/news/2026/state-2026/
391•f_r_d•20h ago•122 comments

Modern Common Lisp with FSet

https://fset.common-lisp.dev/Modern-CL/Top_html/index.html
144•larve•3d ago•18 comments

Migrating from DigitalOcean to Hetzner

https://isayeter.com/posts/digitalocean-to-hetzner-migration/
758•yusufusta•19h ago•383 comments

Metatextual Literacy

https://www.jenn.site/metatextual-literacy/
22•dado3212•3d ago•3 comments

Optimizing Ruby Path Methods

https://byroot.github.io/ruby/performance/2026/04/18/faster-paths.html
93•weaksauce•11h ago•35 comments

Zero-Copy GPU Inference from WebAssembly on Apple Silicon

https://abacusnoir.com/2026/04/18/zero-copy-gpu-inference-from-webassembly-on-apple-silicon/
70•agambrahma•9h ago•27 comments

Dizzying Spiral Staircase with Single Guardrail Once Led to Top of Eiffel Tower

https://www.smithsonianmag.com/smart-news/a-dizzying-spiral-staircase-with-a-single-guardrail-onc...
23•bookofjoe•2d ago•9 comments

Thoughts and feelings around Claude Design

https://samhenri.gold/blog/20260418-claude-design/
296•cdrnsf•13h ago•193 comments

Sumida Aquarium Posts 2026 Penguin Relationship Chart, with Drama and Breakups

https://www.sumida-aquarium.com/special/sokanzu/en/2026/
208•Lwrless•3d ago•10 comments

Bypassing the kernel for 56ns cross-language IPC

https://github.com/riyaneel/Tachyon/tree/main/docs/adr
39•riyaneel•2d ago•16 comments

NASA Shuts Off Instrument on Voyager 1 to Keep Spacecraft Operating

https://science.nasa.gov/blogs/voyager/2026/04/17/nasa-shuts-off-instrument-on-voyager-1-to-keep-...
163•sohkamyung•8h ago•77 comments

Show HN: MDV – a Markdown superset for docs, dashboards, and slides with data

https://github.com/drasimwagan/mdv
111•drasim•17h ago•42 comments

My first impressions on ROCm and Strix Halo

https://blog.marcoinacio.com/posts/my-first-impressions-rocm-strix-halo/
37•random_•10h ago•31 comments

Scientists discover “cleaner ants” that groom giant ants in Arizona desert

https://www.sciencedaily.com/releases/2026/04/260414075641.htm
96•t-3•3d ago•37 comments

Binary Dependencies: Identifying the Hidden Packages We All Depend On

https://vlad.website/binary-dependencies-identifying-the-hidden-packages-we-all-depend-on/
5•PaulHoule•2d ago•0 comments

Understanding the FFT Algorithm (2013)

https://jakevdp.github.io/blog/2013/08/28/understanding-the-fft/
86•peter_d_sherman•4d ago•9 comments

Fuzix OS

https://www.fuzix.org/
99•DeathArrow•17h ago•25 comments

80386 Memory Pipeline

https://nand2mario.github.io/posts/2026/80386_memory_pipeline/
105•wicket•4d ago•15 comments