high resolution love.run function for 0.8.0

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: high resolution love.run function for 0.8.0

Post by raidho36 » Tue Aug 27, 2013 8:00 pm

Microseconds (10^(-6) seconds) are only three orders of magnitude smaller than milliseconds (10^(-3) seconds).
I just realized I was thinking in binary when said "several tens", LOL. Still too much though.
In most cases, 0.8.0's delta time is not noticeably less 'smooth' than 0.9.0's.
That really depends. If game calculations frame takes about as much as timer granulation time, then it runs fine. If takes much more or less, there would be noticeable computational errors, especially if there's fluctuations in time consumption.
I'm confused about why you chose to use local variables in the loop, because the code is a bit harder to understand now (partly due to the naming) and because if a few local instead of global variable accesses in the outermost run loop is causing measurable performance differences, it's likely there is little or no other code at all in the loop.
Because why not? And yes, I perfectly realize that any speed difference is neglectible. But I stick to my philosophy of making it fast whereever it's possible. You know, you make slow this and make slow that, and then you realize that the whole thing is god damn slow. I kid you not, I once installed a dosbox front-end that took TWO MINUTES to startup on my high end PC with 100% CPU load, and every screen re-draw operation was taking between 1 and 10 seconds. "Ridiculously slow" doesn't even start do describe it. That's what happens when you don't pay enough attention to performance and "just write". Also, the british stocks server failure was also due to inadequately performing software so they switched to another one; they sure also switched to Linux from Windows, but that doesn't makes speed difference of program execution in order of several times.

User avatar
RedHot
Citizen
Posts: 87
Joined: Mon May 27, 2013 2:43 pm
Location: Poland

Re: high resolution love.run function for 0.8.0

Post by RedHot » Tue Aug 27, 2013 8:10 pm

slime wrote:
RedHot wrote:2) Lower time step = more calculations. Why would you occupy your CPU with redundat calls if fewer are sufficient?
Using a higher resolution timer has little to do with the amount of time steps.
If I am getting this correctly you wish to use a more precise timer with the old amount of iterations? The typical time step is 13ms. Higher precision would add a decimal place. Considering a maximum change of 0.5 ms you would get a 4% change. Your typical simulations work well thanks to the amount of iterations and a small timestep. Having 1 iteration with 1s vs 1.0000001s doesn't make a difference. However, 60 iterations with a 13 ms timestep mean a lot. Still 13ms vs 13.49999 ms is only a matter of 4% difference (See the pattern?). Your simulation wouldn't even get smoother.

To get a smooth simulation you would operate on the nanoseconds themselves. This means MORE iterations. If not, it would be like boosting your old car engine with a nitro and never using it (or driving under 60). Sure, the idea of having a boost is nice. Your acceleration from 0 to 60 might even get better, but who cares when you are not using it to the full extent?

User avatar
qaisjp
Party member
Posts: 490
Joined: Tue Sep 04, 2012 10:49 am
Location: United Kingdom
Contact:

Re: high resolution love.run function for 0.8.0

Post by qaisjp » Tue Aug 27, 2013 11:29 pm

what could i use these nanoseconds for?
Lua is not an acronym.

User avatar
RedHot
Citizen
Posts: 87
Joined: Mon May 27, 2013 2:43 pm
Location: Poland

Re: high resolution love.run function for 0.8.0

Post by RedHot » Tue Aug 27, 2013 11:50 pm

Like I said, if you'd turn the Vsync off (Granted the FPS is bound to the refresh frequency by default) you can profile your code very accurately

User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: high resolution love.run function for 0.8.0

Post by raidho36 » Wed Aug 28, 2013 8:33 am

Looks like my habit to conduct counter-constructive conversations with little to no valid argumentation and attempting to point out others' mistakes out of nowhere bites pretty hard. I gotta seriously reconsider my approach to dealing with this kind of threads.

RedHot, so far you've contributed 0.0 (zero) useful content, and displayed a lot of ignorance on the topic. Also, no, it can never be "accurate enough" when we're talking about physics simulation.

User avatar
RedHot
Citizen
Posts: 87
Joined: Mon May 27, 2013 2:43 pm
Location: Poland

Re: high resolution love.run function for 0.8.0

Post by RedHot » Wed Aug 28, 2013 9:43 am

I sure wish you would keep your mouth as closed as your mind. It's not the first time I see you spreading nonsense.

I have just explained it to you why you are wrong. Yet you aren't even capable of comprehending a simple text and instead of having a valuable discussion and providing arguments you prefer to say "NO" like a five-year-old and disregard any piece of information handed to you.

I rest the case, at first I thought you were only uninformed and confused. Turns out you are both uinformed and ignorant and validating your theories is beyond your reach.

User avatar
Plu
Inner party member
Posts: 722
Joined: Fri Mar 15, 2013 9:36 pm

Re: high resolution love.run function for 0.8.0

Post by Plu » Wed Aug 28, 2013 9:49 am

RedHot, so far you've contributed 0.0 (zero) useful content, and displayed a lot of ignorance on the topic. Also, no, it can never be "accurate enough" when we're talking about physics simulation.
We're not talking about physics simulation, we're talking about building games... it's pretty easy to be accurate enough for games, even when the subject is physics. You only need to simulate enough to make it enjoyable.

User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: high resolution love.run function for 0.8.0

Post by raidho36 » Wed Aug 28, 2013 12:52 pm

Yeah, speaking of closed minds. "We don't need more precision because current values are tolerable." You sound like people who were against railroads because horse carriage was good enough already.

User avatar
Plu
Inner party member
Posts: 722
Joined: Fri Mar 15, 2013 9:36 pm

Re: high resolution love.run function for 0.8.0

Post by Plu » Wed Aug 28, 2013 12:53 pm

If you only send one horse carriage of mail per week, a horse carriage is good enough... unless you actively run into a problem with an implementation or find something worthwhile to improve, there's no need to improve anything.

User avatar
Azhukar
Party member
Posts: 478
Joined: Fri Oct 26, 2012 11:54 am

Re: high resolution love.run function for 0.8.0

Post by Azhukar » Wed Aug 28, 2013 4:31 pm

Code: Select all

lt_sleep ( 0 )
Wat.

That does nothing, no?

Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests