[BEHAVIOR] Sonic Physics

  • Still no idea why sometimes the player object gets stuck on slopes. And I mean really stuck, only movement that works is jumping. then is back to normal after i land.

  • Hooray! I remember seeing you posting this months back on the SFGHQ forums, was hoping you'd come by here and share. This behaviour feels very polished and tight! Nice work.

    I have been developing a Sonic engine using just events, and it's turned out pretty well and the performance is great, although there's certainly parts that could be improved but can't be improved easily due to some very specific limitations of C2's picking system (although there are awkward workarounds).

    As complicated as Sonic stuff can be, it's good to see a behaviour that does it all for you automatically

  • Ah yeah I saw the Sonic Portal thing on Retro, didn't have an account at the time though. From those videos it certainly looks like you had much more success with the event-based approach than I did. Looking forward to seeing what comes from that!

    KZR: Is it something you can reproduce reliably? I can have a look at it, but I haven't had any noticeable issues on slopes myself.

  • Try and stop on a slope. I also noticed that when switching between solids, sometimes the player object gets stuck in a strange angle if the contact surface is too thin. As if the object picks the poly line further away rather than the nearest one. I'd say It's best to keep a margin of 16 to 32 pixels on every solid to avoid this strange side picking.

    EDIT:

    Also, simulating "jump" with default controls off does not work, object is also not rotating at 90 degree intervals like i selected in the properties.

  • Wow, hats off! Pretty nice work, you could teach a thing or two to the guys who made Sonic 4 about old-school "Sonic physics" (at least on episode 1, I didn't try the second one)

    Toggling collisions on the slopes and playing with z order you can easilly make the classic Sonic loopings.

  • Momio: To be fair, the Sonic Physics Guide is the main thing that make the physics accurate.

    KZR: Still can't replicate the issue. Is it happening in the example capx? If not, could you give me one where it is happening?

    My weekdays have been fairly busy (and probably will be for a few months more unfortunately), so my general plan is to work on things on the weekends, releasing an update on Sunday evenings if I can get anything substantial done.

    That said, I might not manage to release anything by tomorrow. I'd like to address the tilemap issue in the next release, but I haven't made as much headway as I would have liked today. I guess I'll see how tomorrow goes.

  • A great effort in doing such behavior.

    Thanks for this great contribution and congratulations. I have been looking at the classic sonic engine documents to try and replicate but I'm not that good of a programmer.

  • PixelMonkey

    Load the example capx, disable default controls, create an event "on key down/ on key pressed" and assign to it the action "simulate control: jump"

    It won't jump.

    As for getting stuck on slopes, I figure it has to do with the fact that i configured the parameters in such a way that the player will not slide off slopes when it stops.

  • Now all we need is some Super Mario Galaxy/Sonic Lost World gravity (Point Gravity) style plugin to go with this and my dream can began. :V

  • KZR:

    Ah, sorry, I misunderstood you. The sim jump issue is definitely something I can reproduce, and I can have it fixed by the next release. For the slopes, have you changed the downhill slope factor then?

    Azu:

    Eventually the Set Angle of Gravity action should be able to manage things like that, though I need to go back and change a couple of angles to be relative to that.

  • Momio: To be fair, the Sonic Physics Guide is the main thing that make the physics accurate.

    KZR: Still can't replicate the issue. Is it happening in the example capx? If not, could you give me one where it is happening?

    My weekdays have been fairly busy (and probably will be for a few months more unfortunately), so my general plan is to work on things on the weekends, releasing an update on Sunday evenings if I can get anything substantial done.

    That said, I might not manage to release anything by tomorrow. I'd like to address the tilemap issue in the next release, but I haven't made as much headway as I would have liked today. I guess I'll see how tomorrow goes.

    This is Outstanding! PixelMonkey, thanks for sharing this kickass extension to C2. I will dive in a little later, but it sound like it pushes movement in exactly the direction I was hoping to take my C2 project. Digital Beers are on me

    Much Appreciation,

    Brendan G.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Keep it up! Could be useful not only for platformers, e.g. 2d skate board game.

  • is the jump thing fixed already?

  • PixelMonkey

    For accessing the tilemap's collision polygons I found looking at the physics behavior useful.

    Here is the basics of getting them:

    //This is how you know an instance is a tilemap
    inst.tilemap_exists
    
    //This is how you get a list of the tilemap's collision polygons.
    var collrects = [];
    inst.getAllCollisionRects(collrects);
    
    // for example grabbing the first poly like so:
    var c = collrects[0];
    c.rc //this is the bounding box
    c.poly  //this is the tile's collision poly if it has one.
    [/code:3k5mqmbl]
    "poly" is defined in common_prelude.js as "cr.CollisionPoly".
  • KZR:

    Yes, sorry, I've fixed the jump issue and added an air drag effect already, I just want to do a couple more things before I release an update. Sorry for the wait!

    R0J0hound:

    Ah, cool, that should be helpful, thank you!

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