Question about bunnyhop and collisions

This forum is currently in read-only mode.
  • Hello everyone.

    My brother showed me Scirra Construct and encouraged me to try and make a game using it. So far I had some experience with Multimedia Fusion 2 so i'm not completely oblivious still it's different in many places so I'm still getting used to it.

    Game I'm planning to do is sequel to my multiplayer platform game - Kjujiki (meaning something like Wabbits). It's very similar to freeware PC game Jump 'n' Bump but with many additions (weapons, powers, traps and areas).

    First problem I've encountered is how strange jumping, colliding and changing direction works. Diasabling bunnyhop effectively prevented some bugs but playing without it turned out to be less comfortable. So is there a way to cause jump after landing while still pressing the button? Or to restrict bunnyhop by having the sprite touch the ground before succeeding jump?

    My second request is concerning collisions. Controllable characters are both solid sprites with platform movement but this hardly let's me modify anything. Would someone kind suggest other way to do this? I have slight idea... but can't really put it in use.

    I'm posting two files for reference: my new project (to show what I've made already) and my old game (to show what I'd like to accomplish collision wise). If you see anything that needs improvement I'll be glad to fix it.

    Kjujiki 2011: http://www.mediafire.com/?383ugb4y5b9i8xn

    Kjujiki 2006: http://www.mediafire.com/?cpzb54bjrenc4bc

  • First problem I've encountered is how strange jumping, colliding and changing direction works. Diasabling bunnyhop effectively prevented some bugs but playing without it turned out to be less comfortable. So is there a way to cause jump after landing while still pressing the button? Or to restrict bunnyhop by having the sprite touch the ground before succeeding jump?

    What bugs? What exactly is strange about the jumping, colliding, and changing direction? Could you be more specific? Or provide an example with bunnyhop enabled so we can see these bugs?

    As for manually creating a bunnyhop without bunnyhop enabled, you can do something like this:

    + Rabbit [Platform] is Falling
      -> Set Rabbit.Value('jumpReady') to 1
    
    + Mouse&Keyboard: Player 1 "Jump" is down
    + Rabbit [Platform] is On Ground
    + Rabbit is Overlapping platformTile at offset (0, 2)
    + Rabbit.Value('jumpReady') is equal to 1
      -> Rabbit [Platform]: Jump
      -> Set Rabbit.Value('jumpReady') to 0
    [/code:2pwjd4r8]
    
    The On Ground on it's own would trigger a bunnyhop when landing on another rabbit, since they're solid.  And I assume you don't want to do that...?  So by adding an Overlap at Offset condition you can make sure that not only are they on "ground" but that they're on the [i]proper[/i] ground.
    
    Likewise, if you only have the overlapping at offset on it's own then you would trigger a hop simply by intersecting any jump-through platform.  So you would need both in order to get it working right.
    
    As for platformTile, you could create your own custom attribute for both solid floors and jump-through platforms and set both of them to that so you only have to make one condition check for all of them.
    
    You might need to adjust that to suit your own needs but that's the general idea.
    
    
    

    My second request is concerning collisions. Controllable characters are both solid sprites with platform movement but this hardly let's me modify anything. Would someone kind suggest other way to do this? I have slight idea... but can't really put it in use.

    What are you trying to modify? I don't know what you're trying to do in the first place so I don't know of an "other way."

    I will say that although Construct looks a bit like MMF, it behaves a lot differently. I'm sure there is a way to do what you need (whatever that might be ) but you will likely have to unlearn your MMF methods in order to do it.

    Anyway, go ahead and post exactly what it is you're trying to do and what's going wrong and I'm sure someone will be able to help you out.

    By the way, nice bone animation on the rabbits

  • You could also use a sprite animation for the hop effect.I think i should post my fishpod demo as an example because this shows a hopping animation as well.I will post it at my D ravenX examples thread.

  • He's not talking about a hop effect or animation. He's talking about actual jumping, in regards to the "Allow bunny hop" option for platform behavior.

  • oh sorry

  • What bugs? What exactly is strange about the jumping, colliding, and changing direction?

    As you could see players compete in jumping on each other to smash (or suffocate) the opponent. So problems tend to results often from strange behaviour of sprites when they are being jumped on.

    At first I couldn't figure out why the red rabbit (one that was initially doing the smashing) was falling off the yellow one while he (yellow) was changing direction. Finally I found out that by default changing angle of sprite by 180 degrees turns it around by all angles in between. With sprite turning upside-down the one staying on top turned as well, still sticking to original surface. Selecting "No rotation" solves the problem but such occurence may come in handy some other time. Is there a way to alter it during gameplay? I just got the idea to experiment on gravity to make similar effect... so nevermind for the time being. (Unless it's very brilliant idea and you can't help but write it down.)

    Another behaviour I find troublesome is that sprite staying on top of other sticks to it all the time. Even when the sprite below changes it's position through event. Spawning at other position was success because I temporarily removed solid attribute while sprite played the animation of "dying" (which doesn't look unnatural because dead rabbit is almost completely flattened). But I plan to make portals appearing at random. Removing solid attribute all the time could be inconvenient. Is there other way to "un-stick" the upper sprite?

    Or provide an example with bunnyhop enabled so we can see these bugs?

    I turned off the "bunnyhop" option after simulating assault from above. The prey would be dragged to ground after being jumped on in mid-air. But while "bunnyhopping", the rabbit below didn't trigger the event "On ground" and was suspended playing "Jump" animation as long as player kept the button pressed down. At least... that's what happened before. Now it falls all the way down without problem. Maybe setting jump strength to "0" by mid air contact fixed the case.

    + Rabbit [Platform] is Falling

    -> Set Rabbit.Value('jumpReady') to 1

    + Mouse&Keyboard: Player 1 "Jump" is down

    + Rabbit [Platform] is On Ground

    + Rabbit is Overlapping platformTile at offset (0, 2)

    + Rabbit.Value('jumpReady') is equal to 1

    -> Rabbit [Platform]: Jump

    -> Set Rabbit.Value('jumpReady') to 0

    Thank you very much for that! Ultimately I altered it to make semi-bunnyhop (after jump you must release and press button again) but all the credit is yours. I made rabbits jump off each other but I wouldn't get the idea to make different attribute so once again thanks!

    What are you trying to modify? I don't know what you're trying to do in the first place so I don't know of an "other way."

    Well... I adressed most of my concerns already in this post. Yet... what bugs me is that rabbits slide off each other. I presume I could change their speed when they are on top. Action "Stop" (and "Bounce" when we are at it) doesn't work. Or works at impropriate time (if you don't think bouncing happily all over the corpse is impropriate I don't know what is...). It would be nice if they could bounce off a little if they bump at each other horizontally too.

    If you advise me any more I'd be sincerely indebted but I should already work on some colours (red and many of it's shades if you catch my drift).

    By the way, nice bone animation on the rabbits

    Thanks, that took awhile but I'm still amazed myself. This program can make some awesome looking stuff. My friend told me they're too cute for swift, murderous, killing automatons. Well,... time to add those colours...

    oh sorry

    Nevermind that. I'll check out your example anyway.

  • wow! I love the bunny demo.Looks fantastic.

  • Ah, I see...

    Just about all of the problems you mentioned are due to the fact that your bunnies are checked Solid.

    Platform behavior will automatically move along with any object that it is standing on if that object has Solid or Platform attribute checked. This is so you can easily make moving platforms or elevators.

    My suggestion would be to uncheck Solid on your bunnies and create your own custom bounce events. It's pretty easy to make one bunny bounce off of the top of another with something like this:

    + On collision between BunnyA and BunnyB
    + BunnyA [Platform] is falling
    + BunnyA.Y is less than BunnyB.Y
      -> BunnyA [Platform]: Set jump strength to half
      -> BunnyA [Platform]: Jump
      -> BunnyA [Platform]: Set jump strength back to full
    [/code:25bsimnv]
    
    Again, that's just a rough idea and you may have to tweak it to suit your needs.  By setting the jump strength to half (or whatever) you can make a small bounce off of the opponent instead of a full jump.
    
    As for bouncing off of each other horizontally, you could do much the same thing, depending on how you want them to bounce.
    
    For instance, it would be fairly easy to make them always bounce away from each other at a set speed by using the "Set X component of motion" action for Platform.  If you want to get more refined you could do some checks to see if both are currently moving, whether they're moving toward each other, and how fast, and adjust the bounce for each depending on that.  Just experiment with it and I'm sure you'll come up with something that works for you.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for quick reply. I'll test your ideas soon but I have more urgent question. I'm working on Construct 1.00. Will it change much if I install Construct Classic?

    Below: Welp... I couldn't find anything convenient and reliable like "Help->About" in Construct so I checked "File version" at Windows Properties. Now I know it wasn't really related so... my bad.

  • There is no Construct v1.0. It stopped at v0.99.something.

    And no Construct Classic shouldn't hurt anything. There were some additions made to the Platform behavior (and others, and some bugfixes) but nothing that should interfere with what you have so far. It was mainly just a name change to get away from v0.99.99999etc.

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