how do you make a games speed not rely on fps?

Nyap

HTML Noob
OP
Banned
Joined
Jan 13, 2016
Messages
971
Trophies
0
Age
54
Location
That Chaos Site
XP
482
Country
so if you did this (pseudocode)
Code:
int main()
{
    while (inGame)
    {
        render stuff etc
    }
}
the game would be blazing fast at 200fps and slow-motion in 20fps. How do modern games remedy this?
 
Last edited by Nyap,

Tom Bombadildo

Dick, With Balls
Member
Joined
Jul 11, 2009
Messages
14,505
Trophies
2
Age
28
Location
I forgot
Website
POCKET.LIKEITS
XP
18,578
Country
United States
Most modern games use what's basically called a time step. Instead of having things like physics or game speed run based on the amount of frames someone's hardware can render, they use equations to limit actions performed in the game to a specific interval. This allows the game to run at whatever fps hardware can handle while keeping things like physics or in-game speed at a stable speed instead of increasing/decreasing. I suggest googling around about it for more in-depth information.

That's usually the preferred way of doing things in modern games, however there are some that instead will just limit the amount of FPS a game can render instead. Fallout 4 is one of the most recent examples I can think of, Bethesda made the game's speed tied to framerate and just capped the framerate. If you do a little modding and unlock the framerate to, say, 144fps, in-game actions would happen twice as fast; you run faster, objects fall quicker, etc.
 
  • Like
Reactions: Nyap
General chit-chat
Help Users
  • No one is chatting at the moment.
  • JuanMena @ JuanMena:
    Will you give me mouth to mouth oxygen if my throat closes?
  • K3N1 @ K3N1:
    Nah the air can do that
  • K3N1 @ K3N1:
    Ask @x65943 he's trained for that stuff
  • JuanMena @ JuanMena:
    Kissing random dudes choking in celery? Really? Need to study for that?
  • K3N1 @ K3N1:
    Yes it requires a degree
  • K3N1 @ K3N1:
    I could also yank out the rest of my teeth but theirs professionals for that
  • x65943 @ x65943:
    If your throat closes, putting oxygen in your mouth will not solve anything - as you will be introducing oxygen prior to the area of obstruction
  • JuanMena @ JuanMena:
    Just kiss me Kyle.
  • x65943 @ x65943:
    You either need to be intubated to bypass obstruction or create a stoma inferior to the the area of obstruction to survive
  • x65943 @ x65943:
    "Just kiss me Kyle." And I thought all the godreborn gay stuff was a smear campaign
  • JuanMena @ JuanMena:
    If I die, tell my momma I won't be carrying Baby Jesus this christmas :sad::cry:
  • K3N1 @ K3N1:
    Smear campaigns are in The political section now?
  • JuanMena @ JuanMena:
    Chary! Chary! Chary, Chary, Chary!
  • Sonic Angel Knight @ Sonic Angel Knight:
    Pork Provolone :P
  • Psionic Roshambo @ Psionic Roshambo:
    Sounds yummy
  • K3N1 @ K3N1:
    Sweet found my Wii u PSU right after I ordered a new one :tpi:
  • JuanMena @ JuanMena:
    It was waiting for you to order another one.
    Seems like, your PSU was waiting for a partner.
  • JuanMena @ JuanMena:
    Keep them both
    separated or you'll have more PSUs each year.
  • K3N1 @ K3N1:
    Well one you insert one PSU into the other one you get power
  • JuanMena @ JuanMena:
    It literally turns it on.
  • K3N1 @ K3N1:
    Yeah power supplies are filthy perverts
  • K3N1 @ K3N1:
    @Psionic Roshambo has a new friend
    +1
  • JuanMena @ JuanMena:
    It's Kyle, the guy that went to school to be a Certified man Kisser.
  • Psionic Roshambo @ Psionic Roshambo:
    Cartmans hand has taco flavored kisses
  • A @ abraarukuk:
    hi guys
    A @ abraarukuk: hi guys