[REQUEST] Developer to set FPS

Discussion and feedback on Construct 2

Post » Tue Nov 12, 2013 3:08 pm

You can't just half the tick rate, otherwise at 40 FPS you fall all the way to 20 FPS, and you definitely don't want to skip frames if it's a slow device and going to run at half-framerate anyway. It has to be smarter than that and try to schedule at exactly half vsync rate only when the framerate is higher than half vsync.
Scirra Founder
B
397
S
236
G
88
Posts: 24,423
Reputation: 194,560

Post » Tue Nov 12, 2013 3:21 pm

@Ashley - Thanks for doing this. I just tried it out with my game, and as you said it has some unusual behaviours. I have a event that reads:

Every tick - Apply Force Self.Physics.Mass*12*dt at angle 90

This creates a gravity in physics that I can turn around or completely turn off.

In any case, I'm finding that it appears to be twice as strong now. I believe it's the DT that's causing the change, which is unusual. Please see this capx for an example:

https://dl.dropboxusercontent.com/u/50465867/Errors/FrameRate.capx
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
80
S
12
G
7
Posts: 965
Reputation: 10,750

Post » Tue Nov 12, 2013 3:22 pm

The problem seems to stem from the frame rate independence. Toggling in and out of it causes more issues.
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
80
S
12
G
7
Posts: 965
Reputation: 10,750

Post » Tue Nov 12, 2013 3:29 pm

[QUOTE=AnD4D] Thanks for doing this. I just tried it out with my game, and as you said it has some unusual behaviours. I have a event that reads:

Every tick - Apply Force Self.Physics.Mass*12*dt at angle 90

This creates a gravity in physics that I can turn around or completely turn off.

In any case, I'm finding that it appears to be twice as strong now. I believe it's the DT that's causing the change, which is unusual. Please see this capx for an example:

https://dl.dropboxusercontent.com/u/50465867/Errors/FrameRate.capx[/QUOTE]

I don't think force should use dt in that case, if the frame rate is 30, the dt will double, it is normal, since dt is the time between frames.

or maybe I misunderstood
@AnD4DAphrodite2013-11-12 15:30:24
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Tue Nov 12, 2013 3:40 pm

Time
dt
Return delta-time according to the object's own timescale. See Delta-time and framerate independence for more information.
https://www.scirra.com/manual/133/common-expressions

https://www.scirra.com/tutorials/67/delta-time-and-framerate-independence
Image
B
108
S
24
G
18
Posts: 1,372
Reputation: 22,817

Post » Tue Nov 12, 2013 3:45 pm

You shouldn't use dt when applying forces. The physics engine applies dt itself if it has been enabled.
Scirra Founder
B
397
S
236
G
88
Posts: 24,423
Reputation: 194,560

Post » Tue Nov 12, 2013 5:04 pm

@Ashley - When I do not use dt with force in my game, the physical objects move slowly on mobile devices, even with framerate independence on. When I use DT, the physics moves as expected. This was a change I made only yesterday, and it improved my game somewhat.

Not sure what else I can do then. As I said, force doesn't appear to be working for me the way I want it to without DT.

It's only when I use the new frame rate half function that things break now.

What are my alternatives?AnD4D2013-11-12 17:11:58
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
80
S
12
G
7
Posts: 965
Reputation: 10,750

Post » Tue Nov 12, 2013 5:28 pm

Instead of every tick, change it to every 0.001 seconds? If using DT gives me the effect I want, how should I not use it?
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
80
S
12
G
7
Posts: 965
Reputation: 10,750

Post » Tue Nov 12, 2013 8:48 pm

Thanks a lot Ashley to try to implement it :)
I hope it will work well.
I can't try it (as a lot of beta, i have a "kernell32" pb that makes me unable to open the soft), but i hope it will be implemented on the next stable realease.
Thanks !
B
12
S
6
G
2
Posts: 105
Reputation: 3,969

Post » Wed Nov 13, 2013 3:36 am

OK, first impressions:

From testing on my Laptop (FW31ZJ on Chrome, wheezingly old but reliable), i9100 Samsung S2 & Toshiba Excite tab (both in Android Chrome and CocoonJS) and iPhone 4S (Safari). Tested using a couple of embryonic games I have.

Bottom line: Im not convinced....


On laptop (Chrome):
Is there a bug (?). If I set reduced framerate in layout 1 then this did not translate to layout 2: the game then played at 60 fps. If I set the reduced framerate in Layout 2 then all worked as expected (on Chrome in Windows 7).
Reduced quality on laptop. This is not because of the reduced framerate; to my eye it appeared that the game framerate was varying slightly even though the fps showed a constant 30.

Mobile / tablet:
Within CocoonJS (not compiled to apk only in debug app). I add this for interest as I know this will not be a direct concern. With reduced framerate enabled, CocoonJS debug display shows double the framerate I would normally expect (approx 120 on the S2) while on an on-game fps display I had the fps was shown as 60 and not 30... Wierd.
On mobile (Android Chrome / Safari): Results of variable quality. To be honest, I didnt notice any significant improvement in the quality of the displayed games when they were capped at 30 fps, as if similar to the case with the laptop browser the update rate was changing ever-so slightly during play even though the indicated fps figure was a constant 30 fps. This was similar behaviour I had observed when the fps was not capped, so this was not an improvement in my opinion.

So, I now take a big fat slice of humble pie. I think that @Ashley was right on this one (I owe you at least one beer!). Unless there is another way to cap the fps at a solid rate with less jerky results, this isnt the solution I was hoping it would be at least for my needs. As previously mentioned, the fix will probably be to be patient and wait until mobile browser / cpu technology catches up. Sigh.

Anyone else any thoughts?
A big fan of JavaScript.
B
74
S
20
G
71
Posts: 2,228
Reputation: 44,888

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 5 guests