Better to set really high Vector Parameter, or temporarily lower Platform Deceleration

0 favourites
  • 6 posts
From the Asset Store
Summon a legendary high elf character in your next game with AAA Game Character High Elf!
  • Hey hey :)

    I'm curious about something, and figured I would make a quick post in the community before I power down for the night. While working on some new gameplay features in my current project. I was messing around with different knock back functions. When the player gets damaged, sending it backwards(relative to enemy.x or projectile collision) and upwards or downwards, by adjusting the Platform Behavior Vectors X & Y. Then flashing, taking damage, putting into Hurt State, etc.

    What I noticed is I need to set the Vector X parameter to an extremely high amount of pixels, to get the result I am looking for. But, the Vector Y can be much much lower. I figure this is because of the Platform Behavior's, default Deceleration property. And, I'm assuming the Platform Gravity has nothing to do with any Friction slow down the player on the X plane, as the value can be far lower for sending the Player upwards on the Y plane.

    Does it really make any difference, whether you are just setting an extremely high amount of value to the Platform Vector X? Or if you temporarily lower the Platform Deceleration, and then use a lower value on the action adjusting the Vector X(positive or negative depending on location to enemy), before setting the Deceleration back to it's default? I store all default platform behavior values for the Player as variables on start of layout, to easily set them back to default. If I ever need to change them for any other actions.

    I'm not really sure if it makes a big difference or not computing/performance wise. I've tried it both ways, and can get the effect I'm looking for either way. Setting a really high value to Vector X, as a positive or negative value. Is just far less action blocks within the function, and keeps the event sheets a bit cleaner. But I'm working on a couple different knockback functions, to keep the event sheets minimal, either way.

  • Platform vector value can not be higher than the max speed. I believe if the max speed is 200, it doesn't matter if you set vector X to 500 or 1000000 - the character will still move at 200 px per second.

    So for the knockback you need to temporarily increase the max speed and possibly reduce the deceleration parameter.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Platform vector value can not be higher than the max speed. I believe if the max speed is 200, it doesn't matter if you set vector X to 500 or 1000000 - the character will still move at 200 px per second.

    So for the knockback you need to temporarily increase the max speed and possibly reduce the deceleration parameter.

    That's good to know. Thank you for your input :).

    It's odd, because if I do set Vector X to 1000000 or -1000000 the player does move further than say setting it to 100000 or -100000

    I'll play around with the Platform Behavior values within the functions some more. Once, I get back to working on the project tomorrow.

  • It's odd, because if I do set Vector X to 1000000 or -1000000 the player does move further than say setting it to 100000 or -100000

    Maybe you've set a very high deceleration value? I just tested and couldn't see any difference between vectors 400, 10000 and 10000000. (character max speed=300, deceleration=1000)

  • > It's odd, because if I do set Vector X to 1000000 or -1000000 the player does move further than say setting it to 100000 or -100000

    Maybe you've set a very high deceleration value? I just tested and couldn't see any difference between vectors 400, 10000 and 10000000. (character max speed=300, deceleration=1000)

    Hmmm. I've got my PlayerBox set at 2000 for Default Deceleration.

    EDIT: Max Speed is 330, acceleration 1500

    EDIT 2: I do have a very high deceleration value for the Custom Movement Behavior. But, I am not using that at all within the PlayerDamage Functions. Purely the Platform Behavior for all movement on Vector X/Y.

    I'm going to play around with it some more this afternoon. If it doesn't make much difference which way the bounce back is achieved. I will just leave it as is. It looks perfect right now, for this use.

  • I got this sorted out perfectly just now. It turned out better to disable deceleration, have Player Slide, Stop, then re-enable default deceleration for Platform Behavior.

    This way, it doesn't matter if the Player is Running, or Walking. Causing it to move it different speeds on the X plane. The player will bounce back the same distance, every time.

    Thanks again for your support & helpful input dop2000 :)

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