Inconsistencies

Get help using Construct 2

Post » Wed Aug 22, 2012 2:22 am

So I have been having a strange issue, when I run a test on my game the character jumps about 64 pixels high. When I send the file to my friends to test it the character jumps only about 32 pixels high. Anyone know what the issue might be? I'm using the provided platforming system.
B
5
Posts: 29
Reputation: 758

Post » Thu Aug 23, 2012 12:37 am

Sorry, I don't mean to be a nuisance but it's really impeding my progress currently. Does anyone have any ideas why the game might operate differently on different computers?Jakten2012-08-23 00:37:18
B
5
Posts: 29
Reputation: 758

Post » Thu Aug 23, 2012 12:53 am

It's hard to say without you posting a capx for us to see how you coded/implemented your game.

The platform behavior is framerate independent so there shouldn't be differences.

New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Thu Aug 23, 2012 7:47 am

Here is a link to the .capx

I placed the character next to a platform with an arrow pointing to it, when I test the game on my computer I can easily jump to it but when I test it on other computers I can't even reach the top of the ledge. Sorry for the messy organization this is mostly just testing out ideas.

Controls are the arrow keys and space to jump.Jakten2012-08-23 07:48:25
B
5
Posts: 29
Reputation: 758

Post » Thu Aug 23, 2012 8:30 am

Indeed, I can't reach the platform either.
What's your computer specs and OS ?
Anyway, if you change the value of jump strength the platform is reachable.

@Ashley any idea about this ?
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Thu Aug 23, 2012 10:08 am

The computer I'm using isn't spectacular. I'm running on Window XP and 2 gigs of ram.
B
5
Posts: 29
Reputation: 758

Post » Thu Aug 23, 2012 12:44 pm

This may be a completely stupid answer, could it have anything to do with Firefox? as I run it in chrome and it it cannot reach the ledge, I do not have Firefox to try?
B
22
S
8
G
5
Posts: 14
Reputation: 3,859

Post » Thu Aug 23, 2012 12:57 pm

I also noticed that you can grab the edge of the arrowed level and get up that way, edge grab or whatever you call it?
B
22
S
8
G
5
Posts: 14
Reputation: 3,859

Post » Thu Aug 23, 2012 7:47 pm

I think the jump height does vary with the framerate.
Jumping is just projectile motion and you can calculate mathematically the jump height with this formula:
jump_height = (jumpStrength^2)/(2 * gravity)

In the case of the example the calculated jump height should be 50 pixels.
When I ran the capx I measured the jump height and it was 56 pixels. On my machine it was running a about 30fps.

The platform behavior currently changes the y position like this:
y = y + v_velocity * dt

If it's changed to this:
y = y + v_velocity * dt + 0.5 * gravity * dt * dt
Then the measured jump height will match the calculated jump height regardless the framerate.

@Ashley my proposed fix is to change this:
..\Construct 2\exporters\html5\behaviors\platform\runtime.js lines 582-583
[code]this.inst.x += this.dy * dt * this.downx;
this.inst.y += this.dy * dt * this.downy;[/code]
to this:
[code]this.inst.x += (this.dy * dt + 0.5 * this.g * dt * dt) * this.downx;
this.inst.y += (this.dy * dt + 0.5 * this.g * dt * dt) * this.downy;[/code]R0J0hound2012-08-23 19:50:47
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Wed Aug 28, 2013 12:31 am

thousand apologies for necroing this post, but has this been addressed? I'm seeing height inconsistencies in my really lightweight game. Firefox *and* chrome.
B
19
S
6
G
2
Posts: 188
Reputation: 2,744

Next

Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Rezzon71, shinkan, tarek2 and 20 guests