Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411490 Posts in 69371 Topics- by 58428 Members - Latest Member: shelton786

April 25, 2024, 02:21:35 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Keeping measurements in pixels with fps independence/deltatime
Pages: 1 [2]
Print
Author Topic: Keeping measurements in pixels with fps independence/deltatime  (Read 2172 times)
J-Snake
Level 10
*****


A fool with a tool is still a fool.


View Profile WWW
« Reply #20 on: July 02, 2017, 07:13:23 AM »

You can still make your update fixed rate, just saying. That'd make things easier.
Well it's a bit unfair that you can just play on a slow pc or purposely slow it down in order to play in slow motion and get a better score :p
It is still the most fair thing you can do. As long as the machine isn't too slow to run the game you have potentially a fair game across all systems. Conversely, if you scale mechanics on deltatime you don't have a consistent and fair game at all. For example Counter Strike isn't fair, the one who can push more fps has a bigger advantage.

The framework I'm using (Nez) supplies me with a stable loop already, and supplies me with delta time. I just need to somehow handle the deltatime in such a way that I can still use my pixels per frame values, as opposed to scaling everything to accomodate for the deltatime.
It supplies you with a variable loop and vsync capability, I suppose. That is always stable. You have to implement the fixed update loop inside the variable loop, so you don't have to scale everything to accomodate for the deltatime. Without a fixed update loop you cannot have a consistent scale per frame as the fps and therefore movement per frame will vary.
« Last Edit: July 02, 2017, 07:23:46 AM by J-Snake » Logged

Independent game developer with an elaborate focus on interesting gameplay, rewarding depth of play and technical quality.<br /><br />Trap Them: http://store.steampowered.com/app/375930
Eendhoorn
Level 6
*

Quak


View Profile
« Reply #21 on: July 02, 2017, 07:16:11 AM »

You can still make your update fixed rate, just saying. That'd make things easier.
Well it's a bit unfair that you can just play on a slow pc or purposely slow it down in order to play in slow motion and get a better score :p 

You can't with a fixed timestep, that's part of the point. With a fixed update rate you have EXACTLY 60 or whatever simulation ticks per second when implemented properly, no matter how fast or slow the machine is.

Oh, you're totally right. I thought this was the default behaviour in monogame, but I just enabled it looks like it's the solution to all my problems  WTF
Logged

JWki
Level 4
****


View Profile
« Reply #22 on: July 02, 2017, 07:33:19 AM »

You can still make your update fixed rate, just saying. That'd make things easier.
Well it's a bit unfair that you can just play on a slow pc or purposely slow it down in order to play in slow motion and get a better score :p 

You can't with a fixed timestep, that's part of the point. With a fixed update rate you have EXACTLY 60 or whatever simulation ticks per second when implemented properly, no matter how fast or slow the machine is.

Oh, you're totally right. I thought this was the default behaviour in monogame, but I just enabled it looks like it's the solution to all my problems  WTF

Tadaaa   Gentleman
Logged
Pages: 1 [2]
Print
Jump to:  

Theme orange-lt created by panic