Top
Best
New

Posted by speckx 3 days ago

Game devs explain the tricks involved with letting you pause a game(kotaku.com)
419 points | 228 commentspage 4
MrGuacamole 14 hours ago|
One game that I thought had a great "pause" feature was Dragon's Dogma, you can pause the game mid fight to use items that heal or remove status effects. At first I felt this was kind of cheesy, but due to the games inventory weight limits it actually made traveling long distance or tackling dungeons more strategic because you had to bring the appropriate items for the enemies you'd be facing and use them sparingly or you'd be in trouble. Further into the game it actually felt like it required more strategy and planning, I thought it was pretty great game design and really liked it.
gordian-mind 21 hours ago||
I was suspicious of those random game developers getting quoted, and this is the pinned post of the one giving this cute silly story about slowing down game speed time:

"Announcing TORMENT HEXUS, a match-3 roguelike about putting technofascist CEOs on the wrong side of skyscraper windows!

[...]

And remember: they SHOULD be afraid of us. #indiedev #indiegame"

Weird times.

qwery 19 hours ago||
I'm not sure if you're saying that your suspicions were valid or not. Suspicious of what, exactly?

Like, yes, the most likely people to respond to such a call for "stuff to put in an article on Kotaku" are probably developers that want some publicity. But this is hardly surprising.

delusional 21 hours ago|||
Eh, I remember the myriad of both "Torture Bin Laden" as well as "Torture George Bush" flash games in the early/mid 2000s. I think it's very on brand for indie developers.
cubefox 18 hours ago||
Bluesky has a lot of left-wing extremists where things like murdering CEOs is cool because they are allegedly "technofascist".
esrauch 18 hours ago|||
"Evil megacorp" media is hardly new.
cubefox 18 hours ago||
Murdering CEOs is extremism, saying something is an "evil megacorp" is totally different.
jodrellblank 14 hours ago||
There's probably something eloquent by Hannah Arendt about how 190,000 Americans killed by health insurance companies goes unnoticed while one person killing a CEO becomes a spectre of "left wing extremism" held up as an example.

Or was it by The Joker from Batman?

Or was it when protesters in Latin America sat down blocking a road to protest environmental destruction and an American driver was so angry that he was mildly inconvenienced that he got out of his car and murdered one of them with his gun. And Joe Rogan's podcast commentary was "what did they expect?", more annoyed at the inconvenience to drivers than the murder of a human.

Or maybe when Just Stop Oil protestors threw soup and mashed potato on the glass in front of a painting, with the idea "look how angry you are at the damage to a valuable and irreplacable object, this is how angry you should be at the damage to the valuable and irreplacable environment which keeps all humans alive" and Fox News laughed at them for both damaging something important and not causing any real damage so they were ineffective. Then the judge gave them 2 years in prison on the grounds that throwing a can of soup at someone's face would be violence, so throwing it at a painting is violence. But no oil executives overseeing the Exxon Valdez disaster or the Gulf of Mexico disaster faced any jail time at all.

Or when the suffragette movement cut a painting of Venus de Milo to protest against Emmeline Pankhurst being arrested and rough-handled, and people were angrier about the harm to the painting of a woman than about the harm to a real woman.

Or when Fox News says "they aren't protesting the right way" so Kapaernik asked actual verterans how to peacefully protest respectfully and they told him to kneel during the national anthem, and the complainers didn't care a whit and said that was still the wrong way and disrespectable, and he lost his job and the president tweeted rude things about him personally, and the national football thingy made that kind of protest forbidden, almost as if the objection "protesting the wrong way" was all bullshit.

Yes, probably Hannnah Arendt could put it eloquently.

But you're right, murder is wrong, and that's all there is to it.

cubefox 13 hours ago||
> 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.

jodrellblank 12 hours ago||
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 of the system as profit, that money isn't helping the sick. When United Healthcare spends $12M/year on lobbying[1] it isn't doing that to improve patient care.

> Murdering their CEOs is crazy extremism.

When a system doesn't have a pressure release valve, the pressure doesn't go away. When a system blocks or ignores peaceful protest, the pressure doesn't go away. The thread running through my comment is that harming humans is wrong, yes murder is wrong - but sticking a label on it and saying "leftist extremism" and then denying real issues is not helping. The system needs ways to hear people saying "things aren't fine" before those people go crazy extremist, not after.

[1] https://pnhp.org/news/estimated-us-deaths-associated-with-he...

[2] https://www.opensecrets.org/federal-lobbying/industries/summ...

cubefox 11 hours ago||
> 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"?

jodrellblank 9 hours ago||
Compared to no healthcare at all, yes, but similar could be said of Crassus' firefighting service in ancient Rome. He brought his slaves to your burning property and they stood around outside while you negotiated selling your property to Crassus at a bargain price. If you agreed, he ordered his slaves to fight the fire and you got some money. If you didn't, they let it burn and you got nothing. Crassus would be there to buy the ruins for even less if you couldn't afford to rebuild. That's a net positive for Rome compared to no fire service - fires don't spread to other buildings as often, people get something instead of nothing - but it's hardly a ringing endorsement, and it could be better.

Observation 1: you are bothered by the murder of the CEO. You dismiss the business-as-usual harms to hundreds of thousands of poor people. You consider yourself to have a good grasp of what is crazy.

Observation 2: when faced with claims that insurance companies kill people, you turn to dreaming of a world where you can talk of killing Democrat leaders. You still consider yourself to have a good grasp of what is crazy.

Complaints, letters to the editor, letters to congresspersons, achieved nothing; the murder of a CEO has achived nothing; what size event would make you notice?

> "Imagine I believe that the Democrats are net-negative"

Just feels important to say, for the record, that facts don't support that position; the Economic Policy Institute[1], and the Senate Joint Economic Committee[2] found that since 1949 the economy performs better under Democrat administrations than under Republican administrations. Job growth is greater. GDP growth is faster. Unemployment is lower. Small business creation is higher. Manufacturing investment is higher. Stock market returns are higher. Wage growth is faster. Recessions start less often.

> "Would this justify people saying that Democrat leaders should be murdered?"

First problem here is your implication that I would support the Democrats being awful and not be on the side of people objecting [although not calling for murder]. Second is the implication that I would want to silence your free speech instead of, say, supporting your right to say things I disagree with, or sarcastically mocking you. Third (or really, first) problem is that you're replying to claims that insurance company behaviour causes humans to die with "Left bad".

[1] https://www.epi.org/press/new-report-finds-that-the-economy-...

[2] https://www.jec.senate.gov/public/index.cfm/democrats/2024/1...

[3] https://en.wikipedia.org/wiki/U.S._economic_performance_by_p...

dwroberts 18 hours ago|||
Log off and go watch Robocop, jesus
08627843789 16 hours ago||
[dead]
marcosscriven 19 hours ago||
This reminds me of the Action Replay device you could get for the Amiga 500 in the ‘90s.

You could use a knob to slow down any game to a stop. You could also press a button to go to a console that let you change memory.

It would even figure out which bit of memory kept the number of lives of you deliberately lost a life and it could see what decremented.

Neikius 15 hours ago|
There was some cheat software that did the same back in the windows 9x/XP days. Dont remember the name but there were many I am sure.
elpocko 15 hours ago||
Cheat Engine

https://github.com/cheat-engine/cheat-engine

bitwize 1 day 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 23 hours 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.

kdheiwns 23 hours 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.

flohofwoe 20 hours ago|||
It's usually not as simple as that. You'd still want to at least keep the UI alive, and you also need to continue rendering while the game is paused because the swapchain surfaces might lose their content (window resizing, changing the display mode, alt-tabbing to the desktop etc).

E.g. when you open the ingame menu, the inventory (etc) you usually want to pause the gameplay, but still want to interact with the UI. Sometimes that means that at least also some of the gameplay logic needs to remain alive (inventory management, crafting, levelling up, etc...).

There are also a lot of games which need some sort of 'active pause', e.g. the gameplay needs to stop while the user can issue commands to units (traditional example: real-time combat with pause like in Baldurs-Gate-style RPGs).

Sometimes the underlying engine also doesn't properly separate gameplay logic from rendering, e.g. you can't skip one without also skipping the other (which is an engine design bug, but similar situations may also happen up in gameplay code).

Finally: pausing and the save-game-implementation is often an afterthought, but really should be implemented as the very first thing. It's quite easy to run into the trap that a frame also needs to advance time. If the game has the concept of a fixed-duration 'game logic tick' which is independent from the frame rate you're already halfway there though, but many games simply use a variable-length game tick which is identical with the frame duration.

qwery 19 hours ago||
Yep, this comment does a good job of illustrating the (surprising) complexity of this.

I'll add that the notion of the "time scale" variable as mentioned in the article is something that's only solidified/codified since Unity and the like came about. And at the same time, the way Unity et al. works[0] doesn't really encourage thinking about what I'd call "main loop logic" in the bottom-up way that's required to build a really robust system for managing states. You can do it, of course, (you can write as much code as you want) but by default, everything in the scene is "active" and somewhat independent from everything else, and you don't have direct control over the various major systems.

[0] I guess I should say "worked" -- I mostly used 3.x and a little bit of early version 4 -- I'm sure it's improved but I wouldn't expect anything drastically different.

daemin 4 hours ago|||
A surprising number of systems break down if you pause time by passing a 0 time delta, hence why slowing down time is usually the thing that gets done. The alternative (which you imply with your suggestion) is to pass the many paused states down to every system which further complicates their implementation and is a major source of bugs.

The added fact is that many systems still need to continue running, such as audio, video, and input otherwise the program doesn't appear to respond to input and so isn't in a useable state any more.

danhau 23 hours 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).

torginus 20 hours ago|||
I don't think it's a hack necessarily - as a well implemented time system would produce the same results at game rate = 0 as with pause.

Also there's a need for different time domains - like imagine, in a paused state the menu animations still need to play, or if the player enters a conversation, the game logic needs to pasue (depending on designer intent etc.)

kdheiwns 21 hours ago|||
Unity does this. You get scaledDeltaTime (when you set game speed to 0, it'll return 0) and unscaledDeltaTime (returns time between frames ignoring game speed). Pauseable logic uses the former. Pause menus use the latter.
astrobe_ 23 hours 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 23 hours 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 23 hours 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.

astrobe_ 18 hours ago|||
That's sort of the point TFA. You make implementation choices that feel OK and then the time comes to implement the "trivial" pause function...

In other domains, adding the delta time of your main loop to your timers can cause (logical) clock drifts in the long term because of resolution errors.

groundzeros2015 15 hours ago||
Can we just link to the twitter thread the article copies content from?
hanisong25 14 hours ago||
[dead]
jonahs197 22 hours ago||
[flagged]
faangguyindia 22 hours ago|
How difficult can it be when Cloud providers are able to do live migration of VM from one bare metal server to another?
flohofwoe 20 hours ago||
Pausing a game is not as simple as freezing its entire state (and saving is also not as easy as dumping the entire game state to disc, at the least you'd end up with gigabyte-sized savegames).

Many game systems need to remain active in paused state (the UI needs to remain working for example, and actions in the UI may also manipulate game state (inventory, crafting, levelling up...). There are also plenty of games with 'active-pause' where the user can issue commands to units while in paused state.

tuetuopay 22 hours ago||
Likely more difficult.

Live migration boils down to copy memory over the network, stream the page faults till you converge enough, and resume execution on the other host. It’s not a hard problem but a precise and tedious one.

Pausing a game might involve a lot of GPU contexts to freeze, network resources to pause, storage streams to pause, input handling, sound, etc. Add to that physics engine that may be tied deeply in the system and you end up with a hard problem.

What a VM does is not the role of the hypervisor, thus it can apply its hammer that works in pretty much all cases, and VMs are pretty much all the same. On the other hand, all games are bespoke with custom plugins and custom integrations, which make them the opposite of "generic pause implementation".

faangguyindia 20 hours ago||
that's exactly what i wanted to know, trick works: be confidently wrong on web and get the right answer :D