Rope swing?
hi, how are developers handling rope swing animations? Is it like sonic when he goes round the the loop, it's programs to handle it, or are there cases where animated frames are required or needed? Id like to know if anyone can suggest or educate/enlighten me. :)
I've seen the rope swing incorporated into the animation itself, but also having a static straight rope be altered in code by a Rotate() function in terms of Sin * elapsed_time.
Here is a Unity tutorial where the swing of the rope is handled by code. It is more complex than just a sine function since there are several generations of axis points calculated when the rope hits various parts of the rock, but it demonstrates the concept:
In Donkey Kong Country, the swinging rope is incorporated into the animation itself. This allows for a more dynamic bend (not just a straight line) and it has a more gently sloping curve near the top:
In my opinion, this is actually less realistic than a straight rope, though. In real life, the rope is always very straight between the payload and the fulcrum point at the top. Unless the rope is more like a flexible plastic rod or the payload is nearly weightless, the animation above doesn't look right to me.
Here's Lana Del Rey on a tire swing. Notice the rope is totally straight between her and the fulcrum:
--Medicine Storm
I agree with you there, so what about the character movement? Holding on to the rope? One frame? Or multiple frames for when the angle changes, I wonder if there's ever a need to have that, I've never coded anything that has/uses a rope swing. Im Going to have a guess and say one frame would be enough.
Chasersgaming | Support | Monstropolis |
In my stuff, I only use one frame for the character, but it is rotated at the same angle as the rope. It takes a bit of trigonometry, but it actually looks pretty good having the character assume the position and angle of the bottom portion of the rope. Though I've seen some games animate the character as they swing with details like hair and clothing flowing in the wind etc. I think that looks even better, but I don't have the animation skill to pull it off:
--Medicine Storm
I used the same method as MedicineStorm, in Spring's Adventure Doggo ^^
It isn't too complicated, depending on what engine you use of course. You just need that cosine fuction which transforms an x/y coordinate into a vector and back, if you can follow ^^
Here's a link to a video showing my rope swinging mechanism in use within the game:
http://www.youtube.com/watch?v=o6ewLa_K9Gg&t=13m8s
@chasersgaming are you using game maker?
If so, I can share my rope swinging function from SAD if you like.
@medicinestorm, I like that, but i suppose it comes down to what the 'needs' are for that particular project, I would like you and Spring, use the single frame. the reason I ask is coz I'm working on a Sprite sheet that has a rope swing frame, I just wondered would it be good to include in an animation. It's 8 way, so there would be quite some work to pull it off, but only if it would be worth it.i don't think it would be so I'm going to stick with the one frame for now at least. :) it's good to know what the 'norm' would be .
@spring I do use gamemaker, and gms2(when it wants to work), if you don't mind I'd like to have a look at that yeah. :) I've watched your videos on your game by the way, looks cool, I haven't had the pleasure of playing it yet, but I will. I was going to ask, are you planning on releasing it on any platforms?
Chasersgaming | Support | Monstropolis |
...
AH this is gibberish!
I will send it to you over discord instead @chasersgaming
@chasersgaming, about the platforms, I think there will be only releases for Windows and Ubuntu, no mobile systems.
You should talk to unC0Rr (creator of Hedgewars) in IRC. #hedgewars on irc.freenode.net. :-)
Interesting discussion....
There must be something to the DK style rope swing because intuitively it looks for 'realistic' than the straight line rope swing. I think it has something to do with the stiffness of the rope relative to the weight put on it. But I struggle to think of a real life example where I'd expect a rope to swing with such a pronounced bend.
As a quick note, if you don't care about proper weight and physics and all that, the curved DK style swing is a pretty simple extension of the straight rope swing. Just divide the rope into multiple segments attached end to end then rotate the lower segments more than the higher segments. This can be done either by adding the rotations as you go down the segments, or even by calculating the rotations seperately and just making sure to rotate lower segments more than higher (near fulcrum) ones.
https://withthelove.itch.io/
Thanks for all your comments, it's been interesting what the thoughts are and giving me something to ponder over when creating assets. I am going to settle on the one frame character on the rope and assume that the rope swing is programmed in by the dev as suggested by Medicinestorm and Spring, this seems to be the norm, however I have given it much thought to an animated swing character too, but right now I'm working within the NES limitations, and don't believe there is much call for that with such a small space to work in, but something like the megadrive/snes could do that much cleaner as in like flashback/another level. So I defo do something like that when I'm brave enough to tackle it and work on those limitations. :)
other thing I'm thinking about is having an 8 way directional swing in a game, I don't believe I have ever seen one, so I might make it my project during the jam, just to experiment.if I get the time:(
Chasersgaming | Support | Monstropolis |
Sounds like a good plan. And because I can't believe I forgot to mention it, here is the original gold standard of rope swings:
ps
done on an Atari 2600 too, so don't take any gruff from your programmer about 'it can't be done on a NES' ;)
https://withthelove.itch.io/
I hadn't forgot about the legend game pitfall, in fact I looked at it a lot,:) I don't have a programmer, I am the programmer, and I argue with myself all the time! Haha I can be me my worst enemy at times, sad isn't it.;)
Chasersgaming | Support | Monstropolis |
Hahah! The screenshot in my 2nd post is also from Pitfall, though it features Pitfall Harry Jr. Good times.
--Medicine Storm
@chasersgaming are you making an NES game? Using Gamemaker?
HOW DOES THAT WORK
@spring, not making a nes game. What I am doing is making nes assets right now and I want to be able to have a playable demo to show how they look, and give me an opportunity to test them, add anything that I think is needed, or correct anything that looks dodgy.:) I may do something for the jam that kinda kiills two birds with one stone, test my assets, create the project with the coding and the rope swing that I can use for ALL the assets created in the future. I don't get much time do what I do so I try and work smart.haha, there is method in my madness. :)
edit: you could make a game for nes with 'Nes Maker'
Chasersgaming | Support | Monstropolis |
@chasersgaming, yeah I've heard about NESmaker but I'm not too interested, I'd rather use gamemaker, all things considered.