Platypus and rotated platforms

I’m playing now with Platypus by @britzl and tried to rotate platforms like this:

platypus

But at some angle, the player is going literally into the platform. I’ve changed collision object of a hero to be a sphere - that helped a litlle bit, but still he can stuck. How can we make him going up the inclined plane basing on collisions?

Thank you for the report. I’ve created a ticket in the repo to track this:

I’ll look into the issue this evening.

1 Like

Thank you very much! :blush: when this could be improved, I think every surface could be handled! :wink: that’s great! :smiley:

I started working on supporting slopes:

It’s not perfect yet when going down slopes, but I’ll probably be able to tweak it a bit more. You can give it a try on this branch:

6 Likes

I have a strange problem: when the player’s GO is hitting an inclined platform its sprite tilts and unfortunately expands on X axis :thinking:
Then, when it goes down on a horizontal ground, the sprite tilts back, but the scale on X is still the same, so again, when going up the inclined slope the sprite tilts again and stretches even more, so after a couple times it looks like this:

strange

Could I make something wrong or is there a bug? If it is possible I would like to back out tilting the sprite too.

This sounds really really weird. You’re using kinematic collision objects right? There should be no modification of scale or rotation. The fact that the entire game object rotates seems to indicate the use of a dynamic collision object that has some angular velocity applied.

Yes, both hero and ground collision objects are kinematic :confused:

I’ve added this part to the update of the hero’s script:

if self.rot ~= go.get_rotation() then
	print("CHANGE!", go.get_rotation())
end

And in every moment the hero goes on the slope I get:

CHANGE! vmath.quat(0, 0, -0.082228384912014, 0.99540156126022)

And on the horizontal ground again:

CHANGE! vmath.quat(0, 0, 0.082228384912014, 0.99540156126022)

Hmm, are you rotating the game object yourself somehow? There is no code in Platypus that modifies rotation

I gave it another chance and started from scratch with platypus-slopes branch. The difference between an old project was, that I used dynamic collision object, additionally. Removing this redundancy helped to avoid this strange stretch.

Ok, great, so it’s working now then?

Yes, regarding the inclined slopes :smiley: A player can move up and down on slopes up to 45 degrees. As long as I tested, I didn’t found any weird situation, so we can assume it’s working.
Though, in your example from that branch there is another problem that I can’t figure out how to debug - it looks like the player stops every few meters. Changing its collision shape to a sphere helps avoid this, but in that case the problem with falling into the slope is appearing again :confused:
I’m using box shape and in my case, the problem with stopping doesn’t appear, so I started to look into controls.

It’s probably small gaps in the tilemap collision shape that we generate. This is a known problem and something not so easy to solve. Using a sphere will hide this problem. I’m able to avoid it while still using a box in the example project shipped with Platypus. I wonder what the difference is with your project?

Hmm, as I see, platforms in this example are not tilemaps - each of them has its collision object.

I just downloaded your project from the github today, but from slopes branch. In my project there are identical platforms - I use collision objects just like in the example, except I have them Static. (Changing it in your example still didn’t help)

Box collision object behavior:
platypus1

Sphere collision object behavior:
platypus2

Aaand there is a behavior without any collision object at all:
platypus3

1 Like

This is really weird. Everything works perfectly for me. I wonder if it’s an FPS thing and the physics not running with a sufficiently short timestep. I’ll experiment a bit tonight.

Man, no need to make it at night, it’s not so urgent :smiley: I could check something for you, what do you need? For me the strangest thing is that it work without any collisionobject, but looking into the platypus module it seems legit, I’m trying to understand it more

I’d like to see your examples with physics.debug turnés on.

Box shape:
platypusd1

Sphere:
platypusd2

1 Like

This is straight from an unmodified master branch:

1 Like

I pulled both master and slopes branches today, tried it, and the results are the same as I showed above :worried: I’m using 1.2.148, but will update right now. Laptop is HP Elitebook 840 G5 with Windows 10 64-bit.
EDIT: and tested both on 1.2.149, still the player can stop

I’m playing with the excellent Platypus now trying to get it to work with sloped Tilemap terrain. When applying a steady instance.down() impulse I get this result:

Edit: Only using instance.right() results in the player getting stuck on tilemaps seams:

Is it possible to make Tilemap slopes work with Platypus?

Test project, just in case: DefoldSlopes.zip (314.0 KB)

1 Like