# Platforms moving at angles + Platform Behavior = Weird Jump

For questions about using Classic.

### » Sun Feb 21, 2010 9:09 pm

I have a platform that goes downward at an angle (the movement, not the sprite) into some lava and a ledge for the the player to jump onto just in time. For some strange reason however, while jumping off the moving platform, the jump is all wrong. It doesn't have the same height or momentum. I'm not using anything special to do the jumping. It is just the Platform Behavior. I suppose it has something to do with the combination of how Construct handles jumping, movement, and standing on platforms, but I have no idea what to do.

How exactly does Construct handle Platform Behavior objects standing on platforms? It feels like it is applying some force to the player to keep him on the platform so then when he jumps, it feels like he's weighted down.

Edit: I've tried both Custom Movement and Path Movement for the moving platform. Both do the same thing.
B
2
S
2
G
2
Posts: 372
Reputation: 1,794

### » Sun Feb 21, 2010 9:35 pm

sounds just about right, it's a frame of reference thing.

When you're going down, you have downwards speed. When you jump, you add impulse and change your vertical speed relative to your current frame of reference. Meaning, if the camera was following the platform, it would look like a normal jump.

If you want the jump to be always as if you were standing still, you could substract the platform speed from the player speed upon a jump.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

### » Sun Feb 21, 2010 10:24 pm

thats not very realistic for downward movement. a body under the influence of gravity standing on another one which is moving downward simply falls onto that body to stay "connected", it doesnt have some arbitrary force gluing it. if you were to move that platform away faster than gravity could accelerate the body downwards you would start to fall. i havent played with this yet in platform movement but speed should only be added for a sideways or upwards motion, where theres actually some opposing forces sticking things together. again im not sure how the behavior works right now but what im hearing here makes it seem wrong no?
B
79
S
13
G
8
Posts: 1,977
Reputation: 9,947

### » Sun Feb 21, 2010 10:32 pm

[quote="QuaziGNRLnose":2ijj3dho]thats not very realistic for downward movement. a body under the influence of gravity standing on another one which is moving downward simply falls onto that body to stay "connected", it doesnt have some arbitrary force gluing it. if you were to move that platform away faster than gravity could accelerate the body downwards you would start to fall. i havent played with this yet in platform movement but speed should only be added for a sideways or upwards motion, where theres actually some opposing forces sticking things together. again im not sure how the behavior works right now but what im hearing here makes it seem wrong no?[/quote:2ijj3dho]

Yes but it's been added as a fix to keep the player squarely on moving platforms. It's something David struggled with for a long time. Basically when you're standing on a moving object you need to be glued to it to avoid jittering and falling through.

Perhaps the gluing thing could be disabled the moment you press Jump. That would probably fix it. As for a platform that falls away faster than the player is falling... probably not going to happen without Custom Movement.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

### » Mon Feb 22, 2010 2:09 am

But how then do professional/commerical platformers do it?

I'm still not sure what to do. Also, even when the platform is set to move slower than the player, it still happens. Should I just only use platforms that move horizontally?

Edit: What about some mixture of physics and friction? That's how it works in real life...

Edit 2: This sounds like it makes sense. http://www.gamedev.net/community/forums ... _id=541104
B
2
S
2
G
2
Posts: 372
Reputation: 1,794

### » Mon Feb 22, 2010 4:22 am

For the record: some big expensive commercial 3D games do have problems with moving platforms.

I've seen lots of jittery elevator sequences, for example in EA's Mirror's Edge you kind of sink into the floor while going up. In Pandora's Box (using Epic's Unreal Engine 3) there's a terrible bug where if you're doing over 60fps you go through the floor of the elevator right at the end of the game. There's lots of them so it seems there is no widely known perfect solution.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

### » Mon Feb 22, 2010 4:44 am

[quote="madster":xfrbit7w]For the record: some big expensive commercial 3D games do have problems with moving platforms.

I've seen lots of jittery elevator sequences, for example in EA's Mirror's Edge you kind of sink into the floor while going up. In Pandora's Box (using Epic's Unreal Engine 3) there's a terrible bug where if you're doing over 60fps you go through the floor of the elevator right at the end of the game. There's lots of them so it seems there is no widely known perfect solution.[/quote:xfrbit7w]
2D is entirely different than 3D. I don't think you can really compare them with something like this. I'm thinking more like 2D Mario.

Edit: Just remember I'm not a programmer...
B
2
S
2
G
2
Posts: 372
Reputation: 1,794

### » Mon Feb 22, 2010 7:46 am

When David comes back I'll ask him about the downward moving platform jump gravity mess-up thing. He should be able to make a fix for it.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

### » Mon Feb 22, 2010 7:24 pm

[quote="Mr Wolf":38g534px][quote="madster":38g534px]For the record: some big expensive commercial 3D games do have problems with moving platforms. (...)[/quote:38g534px]
2D is entirely different than 3D. (...)
Edit: Just remember I'm not a programmer...[/quote:38g534px]
nice edit XD
yeah it's different, but the motion problem is pretty much the same in concept and produces the same problems.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

### » Mon Feb 22, 2010 11:23 pm

[quote="deadeye":2j92zw4y]
Yes but it's been added as a fix to keep the player squarely on moving platforms. [/quote:2j92zw4y]

yea but were talking about momentum transfered to the jump here, not the repositioning of the sprite.
if im right the platform movement saves the x,y coords of the object relative to what its standing on checks to see if the solid object its standing on has changed position, and then moves it according to the coords saved before. when you jump, i assume that the rate of change (movement speed) of the objects position is saved aswell and added to the vectorx and vectory of the platform, but the "bug" were seeing now wasnt thought of.

repositioning it is 100% fine its the best way to do it, but when you jump momentum transfer would only occur for upwards or horizontal movements. something like a check to see if the rate of change (vertical movement vector in our case) is a positive (downwards) value to negate the vertical momentum transfer is all thats needed, but little things like this are always neglected because thats just the nature of obscure bugs, they don't appear until something played with in weird ways.
B
79
S
13
G
8
Posts: 1,977
Reputation: 9,947

Next

Return to Help & Support using Construct Classic

### Who is online

Users browsing this forum: No registered users and 0 guests