# Progress in Framerate-Independent Platforming

Discussion and feedback on Construct 2

### » Sun Aug 14, 2016 10:18 am

@calebbennetts also with the Plus method I saw that the time to go from the beginning of the jump to the top (in fact half the time to do the jump completely) was 0.64999999...
with the minus it was 0.65833333...
and with the null it was 0.65416666...

it should be JumpStrength / gravity aka 0.650, so it is also nearer newton in that department it seems.

I edited my original maths topic to have all the equations between jumpstrength, gravity, height, and time from beginning to top

PS: all times are in seconds
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
54
S
22
G
18
Posts: 2,123
Reputation: 17,150

### » Sun Aug 14, 2016 10:52 am

@calebbennetts, the acceleration factor should be added iaw s = ut + 0.5 * a * t^2.

I think that a capx example using platform motion does not provide a representative example because the equation to modify the sprite's position acts in opposition (or in addition) to the platform behaviour movement - the sprite is effectively moved twice per tick. To make a truly representative analysis you would have to disable the platform behaviour and substitute your own equation in its place (or use a spreadsheet :p ).
A big fan of JavaScript.
B
76
S
20
G
86
Posts: 2,359
Reputation: 52,712

### » Sun Aug 14, 2016 10:09 pm

Also it seems C2 tends to give an higher jump height than desired when the framerate is correct, we should try your version in bad framerates to see if it solves the initial issue: varying/too short jump heights, as the actual jump height is lower, we can expect that the framerate variation can make it even lower.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
54
S
22
G
18
Posts: 2,123
Reputation: 17,150

### » Sun Aug 14, 2016 11:23 pm

@Aphrodite: I’m not sure how to test it effectively with lower framerates, except 60 fps. I set minimum framerate to 60 and tested the program. With “null,” jump height is about 216.7, with “plus,” it’s around 211.4, and with “minus,” it’s around 222.1. I think we can consider my original suggestion (subtracting (1/2)*a*t^2) quite well out of the running, and the additive method gives a more accurate result than the built-in behavior, but to see how well it keeps accuracy with changing framerates, we would probably have to turn back to the spreadsheets.
Eh, Steve!
B
116
S
54
G
13
Posts: 114
Reputation: 16,185

### » Mon Aug 15, 2016 8:24 am

well if the minimum framerate is set to 60, I guess the game will slow down instead of "skipping" so that would be fine, however that does not mean it will be framerate independent enough if people don't have this kind of setting, for now this subject is more about errors in the platform behavior which should be corrected.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
54
S
22
G
18
Posts: 2,123
Reputation: 17,150

### » Mon Aug 15, 2016 9:36 am

calebbennetts wrote:A while back, I stumbled upon a thread where some game developers noticed pixel-perfect platformers had different jump heights depending on the framerate.

This is something we had confirmed as an issue a while back as well, thanks for the amazing work tracking down the issue and providing a solution to us fellow C2 users!

It's pretty funny that you not only did the in-depth debug/investigations, but even created the solution/bug fix lol! Nice work again!

Edit: Also this, viewtopic.php?f=152&t=117819
Construct Classic - Examples Kit Dropbox is a pile of trash and if you need my old files PM me! :)
B
133
S
43
G
18
Posts: 2,246
Reputation: 20,754

### » Mon Aug 15, 2016 10:27 am

Okay, I guess we should fix this, but it's a breaking change and would throw loads of existing games ever-so-slightly off. So I think we need a project setting like "enable better acceleration precision", which defaults to on for new projects but off for old projects, or something like that.
Scirra Founder
B
408
S
242
G
92
Posts: 24,929
Reputation: 198,711

### » Mon Aug 15, 2016 10:46 am

Ashley wrote:Okay, I guess we should fix this, but it's a breaking change and would throw loads of existing games ever-so-slightly off. So I think we need a project setting like "enable better acceleration precision", which defaults to on for new projects but off for old projects, or something like that.

Sounds like a good idea for keeping the old projects working.

Also, amazing work everyone who contributed to this solution. It's great to have such a community with users who spend their time discovering/analysing/fixing such problems. Thank you.
B
141
S
34
G
17
Posts: 1,561
Reputation: 21,046

### » Mon Aug 15, 2016 10:53 am

Sounds like a great solution @Ashley. And well done @calebbennetts for identifying the cause of this problem!
A big fan of JavaScript.
B
76
S
20
G
86
Posts: 2,359
Reputation: 52,712

### » Mon Aug 15, 2016 12:12 pm

cooperation is a beautiful thing to behold.
B
81
S
32
G
23
Posts: 1,053
Reputation: 35,965

PreviousNext