How changing game speed is done in Spring?

How changing game speed is done in Spring?

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
BlueTemplar
Posts: 314
Joined: 28 Oct 2007, 22:37

How changing game speed is done in Spring?

Post by BlueTemplar »

Hello,

I've seen it said for another game :
Sadly though, slowing the game down on purpose is actually MUCH harder than speeding it up as speeding it up is about taking things away, slowing it down means you have to add information.
So I was wondering, if anyone could explain me how this is done in Spring?

Thank you in advance for your answer.
User avatar
Licho
Zero-K Developer
Posts: 3803
Joined: 19 May 2006, 19:13

Re: How changing game speed is done in Spring?

Post by Licho »

It's done by magic because apparently someone in some forum thinks its gotta be hard and people are never WRONG on the internet.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10452
Joined: 24 Jan 2006, 21:12

Re: How changing game speed is done in Spring?

Post by PicassoCT »

The plus and the minus key. You can look them up in your lobby. Have fun, disregard a grumpy licho.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: How changing game speed is done in Spring?

Post by hoijui »

the number of frames calculated per second is changed.
the default is ~30 frames per second.
it calculates the exact same things, just more or less times per second. this is essential, one could not just calculate less stuff when speeding up the game, cause this would lead to different games, when played at different speeds. i am pretty sure that no game that allows to change the game-speed does that (except cheap ones, or .. from 20 years ago or whatever).
if you set game speed to 100, that would mean ~3000 frames per second. as this is usually not possible with larger games (many units, lots of action), you will just get as much speed/as many frames as the computer is able to calculate.
User avatar
jamerlan
Balanced Annihilation Developer
Posts: 683
Joined: 20 Oct 2009, 13:04

Re: How changing game speed is done in Spring?

Post by jamerlan »

oops
User avatar
BlueTemplar
Posts: 314
Joined: 28 Oct 2007, 22:37

Re: How changing game speed is done in Spring?

Post by BlueTemplar »

Continued :
the game already plays X number of frames per second. You can't just add or duplicate data slices. Slow motion in real life is created by reducing the time slice and increasing the number of frames per second, relatively simply matter of speeding up the film as it goes by the lens. In a computer game there is not convenient light shining with all your needed data instantly...there is an update of reality per slice...you cannot increase that without increasing the need for processing power or your slow mo becomes just more lag slide show.
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: How changing game speed is done in Spring?

Post by Silentwings »

Ignore your quote, it's nonsense - gameframes and drawframes are different things. You are presumably looking for the -/+ keys.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: How changing game speed is done in Spring?

Post by zwzsg »

Slow motion in real life is created by reducing the time slice and increasing the number of frames per second
Real life is not made of time slices. Real life is not frame based. And slow motion is not a real life thing.
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Re: How changing game speed is done in Spring?

Post by SinbadEV »

zwzsg wrote:
Slow motion in real life is created by reducing the time slice and increasing the number of frames per second
Real life is not made of time slices. Real life is not frame based. And slow motion is not a real life thing.
Some quantum mechanics theorists would disagree (http://en.wikipedia.org/wiki/Chronon)... but it is certainly more than 30 FPS (though, since our consciousness cannot perceive time unless it is passing it's entirely possible that each Chronon takes an infinite amount of processing-cycles to pass to process out input, render our universe and send the output to our client-brains, we wouldn't be able to perceive anything but the quantum frame that we are currently perceiving).
User avatar
BlueTemplar
Posts: 314
Joined: 28 Oct 2007, 22:37

Re: How changing game speed is done in Spring?

Post by BlueTemplar »

Silentwings wrote:Ignore your quote, it's nonsense - gameframes and drawframes are different things. You are presumably looking for the -/+ keys.
I know about the +/- keys. The reason I'm posting in this subforum is because I want to understand how the actual slowing down is done in Spring, because the Lead Designer of another game (those quotes are from him) says that it cannot (easily) be done in that game, while I see it being done in Spring.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: How changing game speed is done in Spring?

Post by zwzsg »

We tell the engine to sleep for a longer time between each synced (= the simulation) frames.
The unsynced frames (= the player camera) still run as fast as they can.
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Re: How changing game speed is done in Spring?

Post by SinbadEV »

BlueTemplar wrote:
Silentwings wrote:Ignore your quote, it's nonsense - gameframes and drawframes are different things. You are presumably looking for the -/+ keys.
I know about the +/- keys. The reason I'm posting in this subforum is because I want to understand how the actual slowing down is done in Spring, because the Lead Designer of another game (those quotes are from him) says that it cannot (easily) be done in that game, while I see it being done in Spring.
Huh. Like he said, speed "1" is X number of frames processed per second, to slow down the game we simply process fewer "games" frames per second, to speed up we process more "game" frames per second... "draw" frames aren't synced and are generated as often as possible/necessary... if you have a game where "draw frames" and "game frames" aren't separated you would be watching a slide-show if you slowed things down (particularly in a case where the GUI draw is in the game's simulation code)
luckywaldo7
Posts: 1398
Joined: 17 Sep 2008, 04:36

Re: How changing game speed is done in Spring?

Post by luckywaldo7 »

zwzsg wrote:
Slow motion in real life is created by reducing the time slice and increasing the number of frames per second
Real life is not made of time slices. Real life is not frame based. And slow motion is not a real life thing.
FWIW, I think the quote refers to the process in film creation.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: How changing game speed is done in Spring?

Post by zwzsg »

SinbadEV wrote:Some quantum mechanics theorists would disagree
Yeah, and with relativistic speeds you can slow down or speed up time. But, as humans living on the surface of planet earth, neither have much bearing.
Post Reply

Return to “Engine”