Platform Physics

0 favourites
  • 15 posts
From the Asset Store
A pack of 76 platform designs for a platformer game with a mushroom/jungle theme
  • Here's what seems to be the best way to do full physics platform movement :

    http://amazingretardo.simiansoftwerks.com/2010/02/17/platformer-character-control-farseer-physics-engine/

    I couldn't reproduce it in Construct though :(

    From what it says it is able to reproduce a mario style movement at some extent. It also auto rotates the character on slopes. But it uses some features that i think C2 doesn't have yet.

  • Yeah... What the physics behavior is missing is the fixed angle and angle joints. A Revolute Joint keeps the two objects together and the circle spinning, but the rectangle keeps falling over.

    Just add those two joints, and this would be a piece of cake to implement, I think.

  • You can make it in C2, just instead of using a fixed angle joint set the box property "prevent rotation" to yes.

    You can then apply a torque to the wheel or a force to box, or even both.

    example

  • Ah, I can see how it works, and it works quite well, that is, if you don't plan on having the box rotate on slopes. Right now, it can't really do that, which prevents it from being able to do stuff like, say, Sonic-style loops.

  • My example doesn't do that, but it's possible to implement it.

    You can change the box angle according to the angle of the ground and you will have it. The tricky part is detect the angle, but is totally doable.

    Edit: I updated my example with a simple angle detection, but currently only works for ground.

  • Oh wow. /bookmarked

  • Here is a half sonic loop example:

    Loop Example

    The ideal would be to create an angle detection algorithm that doesn't depend on the angle of the objects but just it's collision polygon, so the player can interact with other physics objects too.

  • Nice example. But the idea is to make his movement as "Mario Style" as possible. So the movement "damping" must be high. I don't know what other paramaters to tweak though.

  • Well, the current angle detection system is fairly rudimentary, it doesn't work with certain tiles. I know a method, but I can't implement it right now.

    Anyway. It seems clear to me that there are a couple of features missing to make a fully-featured Mario/Sonic style platformer:

    • Families (duh!)
    • Using events to selectively choose what a certain physics object can collide with or pass through, such as platforms, or how Sonic games use a 'gate' method for loops, with one half of the loop being completely solid to the player and the other half being non-solid, and they switch states as the player passes through.
  • Nice example. But the idea is to make his movement as "Mario Style" as possible. So the movement "damping" must be high. I don't know what other paramaters to tweak though.

    Just make an event to apply an opposite force whenever the move keys are not pressed. If you apply the whole opposite force it will stop instantly, if you want a smooth damping multiply it by a float between 0 and 1 before applying.

    Anyway. It seems clear to me that there are a couple of features missing to make a fully-featured Mario/Sonic style platformer:

    - Families (duh!)

    - Using events to selectively choose what a certain physics object can collide with or pass through...

    You mean a (physics based) platformer, and that's not totally true.

    Families is obviously an extremely useful feature for any game, but it's certainly possible to make things work without it, it's just more labor intensive.

    In the same way it's possible to make a "loop gate". It would be really handy to have an action to activate and deactivate physics from an object through events, or even have selective collisions, but for now you can make an event to set the physics to "immovable" and move the "gate object" to another position. You can then place an identical object below the "gate" so nobody will perceive any visual difference.

    Again, it's already doable, although it would be really nice to have some features to better support it.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Farseer, we used here with XNA. Is a good physics engine, but we have many problems with water.

  • ou mean a (physics based) platformer, and that's not totally true.

    Families is obviously an extremely useful feature for any game, but it's certainly possible to make things work without it, it's just more labor intensive.

    Families is an upcoming feature anyway (probably within a couple of builds, I think), so...

    n the same way it's possible to make a "loop gate".

    True, but still...

    Anyway, I've implemented an angle detection system (originally designed by Davo) that doesn't rely on the actual object's rotation to work. There's a slight problem with jumping, however - at random, jumping causes the player objects to shoot up at incredible speeds for no apparent reason (and no, my angle code ain't the problem).

  • So. I've been thinking about this lately...

    Who wants to start a collaborative project to create a physics-based platforming engine, with rotations, a physics-based environment ala Trine, that sort of thing? That could be an interesting way to gain exposure for Construct 2.

  • any progress with this?

    My motorbike can't do a full loop yet :(

  • No progress afaik :( Event then i don't mess with physics much.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)