Progress in Framerate-Independent Platforming

Discussion and feedback on Construct 2

Post » 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
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » 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 ). :)
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
73
S
19
G
66
Posts: 2,198
Reputation: 42,188

Post » 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
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » 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
113
S
54
G
13
Posts: 112
Reputation: 16,085

Post » 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
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » 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! :o

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

Edit: Also this, viewtopic.php?f=152&t=117819
"Construct 4 lets YOU make advanced games! (but not play them)" Construct Classic - Examples Kit
B
113
S
39
G
17
Posts: 2,184
Reputation: 19,217

Post » 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
387
S
230
G
87
Posts: 24,248
Reputation: 192,238

Post » 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
127
S
33
G
17
Posts: 1,549
Reputation: 20,454

Post » Mon Aug 15, 2016 10:53 am

Sounds like a great solution @Ashley. And well done @calebbennetts for identifying the cause of this problem!
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
73
S
19
G
66
Posts: 2,198
Reputation: 42,188

Post » 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

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 2 guests