oysi92
|
  |
| Joined: 20 Nov 2008 |
| Total Posts: 361 |
|
|
| 27 May 2012 04:02 PM |
| When roblox f'd up the waiting system, they made the minimum wait time be 1/60 as opposed to 1/30. What this means is that we can have 100% smooth everything. Like, our animations and stuff like that can work at 60 fps (like the rendering) instead of the boring laggy-by-one-frame 30 fps. THANK YOU ROBLOX!!! I HOPE YOU DON'T CHANGE IT, PLEASE DON'T, I REALLY REALLY REALLY WANT THIS!!!! =D |
|
|
| Report Abuse |
|
|
Quenty
|
  |
| Joined: 03 Sep 2009 |
| Total Posts: 9316 |
|
|
| 27 May 2012 04:03 PM |
Yay. :D
Someone teach me to use delta now! |
|
|
| Report Abuse |
|
|
LocalChum
|
  |
| Joined: 04 Mar 2011 |
| Total Posts: 6906 |
|
| |
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 27 May 2012 04:08 PM |
| JAAAAAAAAAAAAAAAAAAAAAAAAAAA JA JA JAAAAAAAAAAAAAAAAAA |
|
|
| Report Abuse |
|
|
Quenty
|
  |
| Joined: 03 Sep 2009 |
| Total Posts: 9316 |
|
|
| 27 May 2012 04:08 PM |
I'll bet some of my animations are screwed, but that's OK.
Someone teach delta pl0x? |
|
|
| Report Abuse |
|
|
nightname
|
  |
| Joined: 10 Jun 2008 |
| Total Posts: 8960 |
|
|
| 27 May 2012 04:13 PM |
@Quenty
What don't you understand about delta? Delta is used in mathematics and science as the "change in" or "difference" operator; it is represented by a triangle.
If you are talking about delta in Game Programming, and main loops, then I use delta for counting how much time has passed since the last loop. Nothing terribly hard.
Basically, every time it finishes looping, delta should become zero - then start count again. |
|
|
| Report Abuse |
|
|
oysi92
|
  |
| Joined: 20 Nov 2008 |
| Total Posts: 361 |
|
|
| 27 May 2012 04:14 PM |
Basically... Say you have a brick which is supposed to move 1 stud per sec, and you want it to work for any fps.
local part = script.Parent local to = Vector3.new(0, 50, 0)
local fps = 60
while true do local delta = wait(1 / fps) part.CFrame = CFrame.new((to - part.Position).unit*delta) end
What happens here is, if the fps is 2, that CFrame change will only occur two times a sec. And the delta will be 0.5 every time it's called. Which causes it to go 1 stud per sec, because 2*0.5 is 1. If the fps is 10, however, it will be called 10 times a sec. But then the delta is 0.1. And so on. The more calls per sec, the smoother. At 60 fps it will move by ultra small steps, but be called enough times (60) to make it go 1 stud after 1 sec. |
|
|
| Report Abuse |
|
|
Quenty
|
  |
| Joined: 03 Sep 2009 |
| Total Posts: 9316 |
|
|
| 27 May 2012 04:21 PM |
| I kind of get it. How are you calculating the FPS again? |
|
|
| Report Abuse |
|
|
oysi92
|
  |
| Joined: 20 Nov 2008 |
| Total Posts: 361 |
|
|
| 27 May 2012 04:27 PM |
| Well, in roblox you'd simply do [ delta = wait(1 / desiredFps) ] |
|
|
| Report Abuse |
|
|
Quenty
|
  |
| Joined: 03 Sep 2009 |
| Total Posts: 9316 |
|
|
| 27 May 2012 04:29 PM |
Ahh... Don't you want the DesiredFPS to be like... math.huge or something?
How would you set it up? |
|
|
| Report Abuse |
|
|
oysi92
|
  |
| Joined: 20 Nov 2008 |
| Total Posts: 361 |
|
|
| 27 May 2012 04:34 PM |
| Why? Logically, with math.huge, you'd get an infinite amount of calculations done per sec. Luckily, roblox confines this. Which is the point of this thread. It used to be 30, now it's 60. But, you only need 60, because the average screen can't even render faster. The thing is, with roblox, you get a pretty steady fps delta flow, so you don't really NEED to use delta, for most things (in roblox, that is). But, the 60 fps is actually like 56-60. The 4 frames won't really matter that MUCH for animations and stuff, but if you want to be 100% accurate, or something, you'd need to use delta. |
|
|
| Report Abuse |
|
|
Quenty
|
  |
| Joined: 03 Sep 2009 |
| Total Posts: 9316 |
|
|
| 27 May 2012 04:39 PM |
It does matter. Plus, if I want to pause the whole server or something...
Lol. Anyway, I really can't pause physics... Still... I guess I see how using wait() would work... :D
Thanks. :D |
|
|
| Report Abuse |
|
|
nightname
|
  |
| Joined: 10 Jun 2008 |
| Total Posts: 8960 |
|
|
| 27 May 2012 04:52 PM |
"Well, in roblox you'd simply do [ delta = wait(1 / desiredFps) ]"
You shouldn't do that, not to mention that is incorrect. The calculations may have also took more time than you suspected, thus not having a consistent FPS.
What you should do is check how long the calculations took, then take that away from the time to sleep for - thus giving you a constant FPS. If I wanted an FPS of 60, then I would make the the thread sleep for 17milliseconds, because 1000 milliseconds (1 second) divided by 17 is approximately 60. Thus, sleeping about 60 times in 1 second.
Now all you need do is to check how long it took to calculate everything and update the game, then take that away from the time to sleep. So if it took 3milliseconds, then it should sleep for 14milliseconds.
If you do it this way, the "real way", then you should try implementing a safety procedure - just in the case that it took 17 milliseconds or more to update, your computer doesn't try to wait negative seconds but instead wait a fixed amount of time to prevent not sleeping and crashing your computer. |
|
|
| Report Abuse |
|
|
|
| 27 May 2012 05:00 PM |
'But, you only need 60, because the average screen can't even render faster.'
Mine can. 75Hz. |
|
|
| Report Abuse |
|
|
Sorcus
|
  |
 |
| Joined: 29 Nov 2010 |
| Total Posts: 3775 |
|
|
| 27 May 2012 05:02 PM |
Should be a mistake. Will be fixed.
~Sorcus |
|
|
| Report Abuse |
|
|
|
| 27 May 2012 05:03 PM |
| ...This was supposed to be a good thing... |
|
|
| Report Abuse |
|
|
nightname
|
  |
| Joined: 10 Jun 2008 |
| Total Posts: 8960 |
|
|
| 27 May 2012 05:05 PM |
Most screens have a refresh rate of 48 or 72, I don't really understand what he is saying. Maybe he is speaking about how the human eye can only precieve up to about 50Hz - but there is an argument to that.
If the screen refreshes too fast, it starts to blur - if it refreshes to slow, you'll notice it flickering. Thus, you'll probably want a refresh rate of about 60 - 120. |
|
|
| Report Abuse |
|
|
Quenty
|
  |
| Joined: 03 Sep 2009 |
| Total Posts: 9316 |
|
|
| 27 May 2012 05:06 PM |
The human eye refreshes around 15 FPS or so. So I mean, 30 is good.
|
|
|
| Report Abuse |
|
|
|
| 27 May 2012 05:07 PM |
'The human eye refreshes around 15 FPS or so'
24* I think. |
|
|
| Report Abuse |
|
|
nightname
|
  |
| Joined: 10 Jun 2008 |
| Total Posts: 8960 |
|
|
| 27 May 2012 05:12 PM |
@Prehistorican & Quenty
Nope, that is not right. 24 FPS is what TVs use, but now most use 48 or 72 to give a crisp image. If you are watching TV with 24 FPS, and a high speed movie comes on, it'll be moving too fast that you'll feel sick. If at 48 or 72, the movie will be continuous, so less nausea.
Also, Quenty is right about the it "processing" 12 frames in a second - but it can still perceive any frames in between them. Thus, creating the effect of continutity between frames.
If it is too high, the continuity becomes a blur. |
|
|
| Report Abuse |
|
|
LPGhatguy
|
  |
 |
| Joined: 27 Jun 2008 |
| Total Posts: 4725 |
|
|
| 27 May 2012 05:21 PM |
@nightname No? On a 120Hz monitor, there is a noticeable difference between 60fps and 120fps (notably between M&B or MC and BF3) It isn't blurry. With interlacing, it might be, but it's not interlaced. |
|
|
| Report Abuse |
|
|
nightname
|
  |
| Joined: 10 Jun 2008 |
| Total Posts: 8960 |
|
|
| 27 May 2012 05:40 PM |
@LPGHatguy
I never said 120 FPS is blurry. We want it to be blurry between perceivable frames to remove motion blur - and you'll need a high FPS to do such a thing, higher than 30 FPS.
However, if your FPS is far too high - it can cause blurring. Not to mention that you would never want an FPS which is far too high (GPU's FPS, not the screen's). |
|
|
| Report Abuse |
|
|
jrf2112
|
  |
| Joined: 29 Jun 2008 |
| Total Posts: 3354 |
|
|
| 27 May 2012 05:43 PM |
When a screen is blurry between frames it reduces eye strain. That's why motion blur is not only cool, but it helps.
vsauce did a video on it once, it was very interesting. |
|
|
| Report Abuse |
|
|
LPGhatguy
|
  |
 |
| Joined: 27 Jun 2008 |
| Total Posts: 4725 |
|
|
| 27 May 2012 05:43 PM |
@nightname I have no problems ever with blurring running Minecraft at 900 FPS and displaying 75 FPS to my screen
Naturally I now limit the framerate to 75 FPS because that's my current monitor refresh rate, but still, my point stands. |
|
|
| Report Abuse |
|
|
|
| 27 May 2012 05:46 PM |
60 FPS AHHHH YEAAAH
@Sorcus
Don't fix it pleaasee.....30 FPS is okey but 60 FPS is really good for ROBLOX and would provide more opportunities for GAAMEE Development |
|
|
| Report Abuse |
|
|