You are not logged in.

#1 2017-05-08 20:35:44

scindix
Member
From: Germany
Registered: 2013-05-07
Posts: 48
Website

Speed up or slow down applications by faking the system time

Hi community,
I am a enthusiastic player of a game called Rocket League which is a mixture between a racing game and a soccer game. However it has a tough learning curve and so I thought it might be helpful to slow everything down to figure some things out.
Moreover my PC isn't the fastest. To get 60 fps I have to use somewhat medium graphics settings. However I want to screencapture my replays at 60fps with highest settings. In order to do this I thought about capturing things in 30 fps with halved playback speed. (After capturing I can speed up the video myself.)

Rocket League itself doesn't come with a "slow down" option.
I tried community/libfaketime but it doesn't work.
Before I started I disconnected my PC from the internet and called the following:

faketime -f '+1s x0,5' ~/.steam/steam/steamapps/common/rocketleague/Binaries/Linux/RocketLeague

Steam asks if it should continue without login and then Rocket League starts without any problems. However it runs at normal speed.

Is there anything I did wrong? If not are there other ways to achieve what I want?

Thanks in advance.

Offline

#2 2017-05-09 10:34:41

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: Speed up or slow down applications by faking the system time

I'm honestly not sure whether or not you're trolling us right now...

This would only work if an application does everything based on the system clock. As such this will not work in most programs as most programs have no reason to rely on the system time for any of their operations.
Unless a game is very badly designed (or maybe originated from a console) it is using a delta time for its operations so even if you slow it down by capping the CPU or GPU cycles, this would just increase the delta.
So say you move 10 meters at 10 FPS (1 meter per frame) and slow it down to 5 FPS, you would still be moving 10 meters (but now at 2 meters per frame).
As I said, unless you have a very badly made game that does not account for delta time (looking at you Need for Speed), at best you're just going to make the game lag, not slow down.

Last edited by Omar007 (2017-05-09 10:36:41)

Offline

#3 2017-05-09 12:41:50

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: Speed up or slow down applications by faking the system time

Omar007 wrote:

So say you move 10 meters at 10 FPS (1 meter per frame) and slow it down to 5 FPS, you would still be moving 10 meters (but now at 2 meters per frame).

I thought the question was about moving 10 meters in 10 Frame-Per-Two-Seconds...?

I can't imagine you could ACTUALLY slow down a game as described in the original post, but... if you DID adjust how the Linux kernel counted time (slowed in x2), how else WOULD a game know how fast to run?? I am fascinated by this thread. yikes

Offline

#4 2017-05-09 13:20:56

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Speed up or slow down applications by faking the system time

You might be able to do what you want but what you would have to slow down is some high resolution timer which the game/program uses to determine how fast to run, slowing down system time should not do much. Not only that but there may several checks inside the game/program to make sure it actually runs at the intended speed in case one of the measurements is not reliable.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#5 2017-05-09 15:29:14

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: Speed up or slow down applications by faking the system time

Well if you go that deep it could potentially work. If you compile a custom kernel to adjust the high resolution timer (and w/e other timer not relying on those) it would indeed be pretty much impossible to know from a software standpoint that things should be running twice as fast.
The problem is that this would affect your whole system so there is no telling what that will do. Maybe it will just slow down everything? I don't know.
If you feel like trying that, please let us know how it went tongue

Last edited by Omar007 (2017-05-09 15:29:59)

Offline

#6 2017-05-09 18:58:10

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: Speed up or slow down applications by faking the system time

Did you check if RocketLeague has some sort of in-game console? Maybe it has a variable that can change how time behaves. I remember in Quake 3's engine you had a variable "timescale" that could be changed with cheats enabled. Setting for example "timescale 1.5" made the game run 50% faster.

Offline

#7 2017-05-09 19:42:43

seth
Member
Registered: 2012-09-03
Posts: 51,213

Re: Speed up or slow down applications by faking the system time

Preloading a lib that shadows clock_gettime might work in principle (a game would reasonable rely on one of the monotonic timers and call that via some userspace lib and not an ioctl directly - so no need to mess with the kernel), but this has impact far beyond the pure game speed (all I/O, sound,...) and there're several ways how this could still fail (eg. if the game queries the outputs frequency and then relies on blocking for the vblank signal to measure time)

Also and since you mentioned steam: multiplayer (online) games need to sync the time between all clients, typically by using the server time (for the game logics)

id tech 3 ftw!! this engine will likely never die smile

edit: lol, "engone will never die" ...

Last edited by seth (2017-05-09 19:43:22)

Offline

Board footer

Powered by FluxBB