Request: Platformer Object: TRIGGER JUMP

From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.

    I totally know what you mean, especially when editing an existing system or something. The knock-on effect is unpredictable.

    After thinking this through, I think I can see the possible issues by adding something seemingly easy. Whilst it wouldn't affect existing projects for sure, if people began to use "force jump", it could interfere with double-jump, and then you'd end up with a bug report with a specific case for this, which leads to editing double jump, which could lead to many unexpected issues that DO affect other projects.

    Many thanks for the insight.

    it could interfere with double-jump, and then you'd end up with a bug report with a specific case for this, which leads to editing double jump, which could lead to many unexpected issues that DO affect other projects.

    Yeah, this is exactly the kind of thing that happens.

    I had a look and this is probably a good example of a "sounds simple but is actually complicated" feature request. Just off the top of my head and glancing at the code, some questions that come up are:

    • Does forcing a jump in mid-air count as a double jump? Some people will assume it should, others it shouldn't; whichever answer we choose someone will want something different
    • Should landing while forcing a jump beyond the jump sustain time allow bunnyhopping? Perhaps yes because you're forcing the jump, perhaps no because it should follow the normal jump rules
    • Should it trigger "On jump"? Perhaps yes because it's a jump, perhaps no because that should only happen in response to the user input controls (real or simulated)
    • The code contains a check that there is no obstacle 1px above when jumping, and blocks the jump if it's not clear. Should forcing a jump bypass that rule? Someone will probably want that on the basis they're forcing a jump so it should be attempted anyway; we've dealt with even more subtle things than that in the Platform behavior.
    • Should the ceiling collision mode affect forced jumps? I don't know. I would fully expect someone out there to want forced jumps in the ceiling to slide past, and someone else to bounce off, and someone else to want a dynamic response based on gameplay circumstances.

    "Just do it" glosses over all these complications which we inevitably will have to deal with if we do it. I know that implementing these things means signing ourselves up to dealing with all the fallout, and I don't take it lightly. Meanwhile you can answer all these questions yourself via event logic and "Set vector Y".

    The rule of thumb is changing existing complicated code is a very complicated thing to do, and the Platform behavior sure is complicated.

    Very informative!!

    Thanks again for the insight into this, I feel like I understand a lot more now.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads

    I do agree that having a built in "force jump" action would be an awesome add, but understand that these things are rabbit holes and man it does not sound easy to fix. That being said I have found a way that i believe is a good work around whilst not using setVectorY at all.

    I add this here not to deter any construct product devs to say "just use this", but hopefully to allow game devs and construct devs to see the logic laid out using only "platform jumping" and 2 added booleans. That way game devs can move forward with their respective games and maybe it'll spark an idea or 2 for a construct dev. Bear in mind i don't claim this to be bug free, but its a start and i cant get it break (but i'm sure someone will find a way heh)

    Hope this helps

    Man wish i could edit the post. Just to add here is an example of that calling that function:

    I agree with Ashley that its better to use the advanced features of the behaviour... My own personal solution is:

    If CanJump = true, then

    If "Jump" is pressed, then set Y vector to "-JumpStrength" (as mentioned

    this does not allow for JumpSustain as it currently works)

    If "Jump" is released & Y vector < 0, then set Y vector to "Y vector * 0.25"

    (this essentially kills the jump but still allows the movement arc to feel

    natural)

    For coyoteTime:

    If OnGround = true, then set "Coyote Timer" to 1 (or whatever duration you prefer)

    Else set "Coyote Timer" to "Coyote Timer - dt"

    If "Coyote Timer" > 0, then CanJump = true

    Else CanJump = false

    So basically I check the conditions for CanJump, ie: IsOnGround, JumpCounter is less than JumpMax, CoyoteTimer > 0, etc, and then execute my jump with Set Y Vector, and do my own Sustain method. Honestly, for my purposes it works flawlessly, and to be fair, Construct 3 is intended to be accessible for beginners to help them learn to become more advanced... I honestly think adding the DoubleJump to the platform behaviour was overkill, as it was also easily done in events...

    Btw, I only use events, I have 0 code writing ability beyond doing some simple equations inside of event value fields... so like testing basic conditions and doing basic math instead of entering hard values into a given field...

    Hope this might help, cheers!

    you could use javascript to code jump power and sustain why not do that

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