Platform2 [behavior]

0 favourites
  • Coming soon - Platform2...

    • This is a platform behavior for c2 and c3.
    • In addition to a built-from-scratch Platform2 behavior, it also uses a helper plugin on top of the Solid behavior to give one way doors, collision filtering, wall climbing. The collision filtering means you can run multiple player objects and control which ones are affected by which one-way doors.
    • Accurate acceleration and velocity calculations, so variations in dt don't cause variations in jump height.
    • Pixel perfect collision engine. No air-gaps. Even on moving platforms.

    Check out the simple demo.

    If all goes well then this should be ready well before the end of the year.

  • Looks like there's a sort of damping friction when in collision with moving platforms from below. Planned?

    Also the controls are kind of buggy when interacting with the directional blocks. Looks like it's mainly when you don't release a key.

    How hard was it to work with the solid behavior?

  • Thanks newt - both of those snags I've got on my to-do list. I need to reliably update the player velocity after contact with an obstacle. The plugin currently zeroes velocity bit I hadn't properly considered all circumstances.

    Working with solid was no problem because it's just a flag, so all I did was look for the flag in potential collision candidates. I had hoped that I could use the runtime solid functions like push-out solid, but my desire for collision filtering scuppered that (the runtime functions don't have a method for ignoring objects, ie solid is solid and it would incorrectly try to push-out of a one way door). So I wrote my own...

    Thanks for the help. I think it's gonna take me a few days, in between Xmas sherries, to create a viable update.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well it's looking good so far, and it will be nice to have another platform behavior that's not just an altered copy of the official one.

    Good luck, and merry Xmas!

  • Cheers, newt - Merry Xmas!

  • I'm so happy to see this. Thanks and congratulations!!

  • Thanks Macbee!

    Just an update:

    I've been (enjoying?) doing a lot of performance testing. Version 1, which is the demo in the first post, utilised too many overlap checks (and had some bugs) - the performance was not a problem on desktop but not ideal for mobile. I then created a Version 2 that used raycasting... Initially I thought that would have been amazing - it was very fast but I think it lacked flexibility as a general plugin (box shape only, minimum obstacle size required). So it was then back to the drawing board to create a more efficient overlap check version. So far, the optimised Version 3 is doing very well. Performance at idle is slightly up on the standard plugin, but performance when moving is about the same. I've been comparing script time for each plugin - my objective is to ensure that this version will be at least as fast as than the standard (I think that the standard plugin is about as fast as possible in c2runtime if collision shapes are not limited to circles and boxes). I should have a demo of this in the next few days. Happy new year!

  • OK. I learned some good lessons in the last couple of weeks. Please have a try of the latest update - either here or via the updated link in the first post.

    This version was created with a completely different collision filtering philosophy and, I have to say, I am very pleased with the results! It also includes an edge behavior function, so you can decide if the player should move back from an edge, move forward, etc.

    Performance at idle is not as good as the standard platform plugin, but once you get moving then there's not much in it (< 0.25 ms total time spent for each plugin). The standard plugin was modified for this demo so that the script time could be measured. This means you can compare how much work each plugin is doing at any particular time.

    Of note, in my system both plugins occasionally spike at taking more than 1 ms to do their calculations.... and the standard plugin decelerates more quickly (by design) when a move is commanded for the opposite direction of travel.

    So, the following are now working:

    Triggers:

    On jump

    On fall

    On land

    On move

    On stop

    On wall

    Conditions:

    Is on floor

    Is jumping

    Is falling

    Is on wall (pick a side)

    Is edge behavior moving away from edge

    Is edge behavior moving toward an edge

    Is passing through a one-way door

    Is passing over a one-way floor

    I've got do do some more code-tidying, and then add some actions and conditions to the helper plugin (Solid2) that is added to objects with the standard Solid behavior. More info to follow...

  • Please ensure you can see >= "version 1.0.0.7" in the top middle of the display, to ensure you have the correct version running. Thanks.

  • Ok, I think I'm finished! Unless I can find a bug or some important feature to add, this should be ready in the next day or so.

    Added to the demo: option to use WASD keys to control the standard Platform object and an option to toggle the next-to-edge behavior.

    More functions added to the plugins:

    Solid2:

      Condition: Platform2 object overlap Condition: Platform2 object with UID overlap

    Platform2:

      Condition: is moving Condition: compare speed Actions: you can set all parameters via events Expressions: all parameters are available

    Both plugins:

      Support for JSON save and load Work with minify / Google Closure export
  • Looking good.

    The wall climbing seems a little limited, but that may just be how its set up.

    Otherwise all the other stuff handles quite well.

    Congrats.

  • Thanks newt! What else would you like to see to expand the wall-climb? I'll see what I can do...

  • I kind of expected to climb on up button.

    Perhaps as as an option like double jump?

  • I've updated the demo to include an optional wall-climb using events - I think that anything more than a basic wall-climb (or wall-hang) isn't necessary because the event system is powerful enough for you to make it behave exactly as you wish. For example, do you want to wall hang and nothing else (the plugin default), do you want to climb using up/down when holding left or right so you can also jump up the wall using ctrl-up alone (as in my demo), or do you want to be able to climb using up/down and only be able to fall off the wall by using left or right (no jumps unless air jump enabled)? I don't think I could realistically and slickly satisfy all options.

    As long as the mechanic you want is easily achievable using events then it doesn't need to be in the plugin, I think. I'll include the event-wall-climb demo with the plugin.

  • Colludium when can we expect c3 port ?

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