Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411493 Posts in 69377 Topics- by 58433 Members - Latest Member: graysonsolis

April 29, 2024, 10:19:54 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityTownhallForum IssuesArchived subforums (read only)Archived ProjectsIndie BrawlFluid Double Jumping.
Pages: [1]
Print
Author Topic: Fluid Double Jumping.  (Read 4787 times)
Yellowboy
Level 0
**


Hey, hey, whaddya say?


View Profile
« on: May 30, 2009, 11:20:41 PM »

If it's not too late to include double variable jumping, I've figured it out. I heard talk that some people wanted traditional "double jumping," and others wanted "proper" variable jumping, and I think Soulliard said that he really wanted a combination. This is for you, if you want to implement it.

Create Event:
Quote
//Variables
jM=2; //double jump possibility
jH=-6; //jumping force
jT=-jH;  //Jumping time (Used with Fluid Variable Jumping)
yG=0.25;     //Gravitational acceleration
ysp=0;       //Current vertical velocity
topt=0;     //Time that influences gravity and collision.
global.jumpingstyle=2; //0=Variable jumping. 1=Fluid jumping. 2=Fluid variable
global.topcstyle=1 //0=bounce off roofs. 1="cling" to roofs.
keyjump=ord("A");
action="none"; //For recognizing whether you're wall-jumping, edge-grabbing, etc.
state=1; //1=ground, 2=air

/*Fluid jumping is Mario style, Variable jumping is the double jump. The third style
is a combination of the two, together. (This section was editted AFTER William's question to avoid confusion.)*/

(Begin) Step Event:
Quote
//Variables - Need these.

{if global.jumpingstyle=0 then jump=(keyboard_check_pressed(keyjump)*-jH*sign(1+block))
else if global.jumpingstyle=1 jump=(keyboard_check(keyjump)*-jH*sign(1+block))
else if global.jumpingstyle=2 jump=(keyboard_check(keyjump)*-jH*sign(1+block))}

//Regular Jumping
if global.jumpingstyle!=2{
if(place_free(x,y-1) && jump)
{if(jM>0){state=2;ysp=-jump;topt=-1;jM-=1;} else ysp+=(sign(ysp)==-1)*-0.1;}
}

//The combination of Mario style jumping and double-jumping.
if(global.jumpingstyle=2){
{if(jump && jM>0 && jT>0){state=2;ysp=((-jump)+(yG/jT))/1.5;topt=-1;jT-=.5;}
else if!(jM>=0 && jT<=0 && action="edgegrab") ysp+=((sign(ysp)==-1)*(-0.1));}
{if(keyboard_check_released(keyjump) && jM>0) {jT=-jH;jM-=1;}}}
}

//Landing
if(!place_free(x,y+1) && ysp>-3 && ysp<0) then {ysp=0;state=1;action="none";}
ysp+=yG; ysp=min(ysM,ysp); repeat(abs(ysp)){if(action!="edgegrab" && place_free(x,y+sign(ysp))) y+=sign(ysp);}

//Collisions with objects from below
if(topt>=0)topt-=1; if(topt=0){ysp=0;action="none";}
if(!place_free(x,y+sign(ysp))) if global.topcstyle=1 {if(ysp>=0 && topt<0) {action="none";state=1;topt=0;ysp=0;jM=2;jT=-jH;}}
else if global.topcstyle=0 then {if(ysp>0 && topt<0) {action="none";state=1;topt=1;ysp=0;jM=2;jT=-jH;} else if(action!="climbing" && ysp<0 && topt<0) {ysp=0;topt=1;}}//End of Jumping

It's still a little bit of a mess, but as far as I know, it's a matter of changing the variables in the Create section. If you guys can make a cleaner and smaller version of this, post it up!



Edit: The only slight problem with this coding is that the jumping height that you achieve with each style is not synchronized, but that doesn't make this unusable, since manipulating the jumping force (and/or gravity) with each style can equalize the heights. Of course, fluid and variable jumping algorithms never truly synchronize, let alone all three types; each style works a different way.
« Last Edit: May 31, 2009, 06:02:01 PM by Yellowboy » Logged

Well, well, how can you tell?
William Broom
Level 10
*****


formerly chutup


View Profile
« Reply #1 on: May 31, 2009, 04:07:40 AM »

Uh, maybe a dumb question but what exactly is variable jumping?
Logged

Piranha
Level 1
*


capital z


View Profile
« Reply #2 on: May 31, 2009, 06:46:27 AM »

I'm not completely sure about this, but I think it's when the character only does a small jump if you tap the jump butto but does a large jump if you hold it.
Logged
Yellowboy
Level 0
**


Hey, hey, whaddya say?


View Profile
« Reply #3 on: May 31, 2009, 08:33:51 AM »

Uh, maybe a dumb question but what exactly is variable jumping?

Variable jumping is the standard double jump, just tapping the jump button with no control on how high you jump.

Fluid jumping is the Mario-like jump where you jump higher the longer you hold the jump button.

EDIT: I've heard of the Mario jumping style be called "Variable," and tapping style "Variable" in a tutorial. I chose to name the Mario style "fluid," to avoid confusion. (Of which I failed. :c Sorry for any confusion.)


"The good stuff" is a combination of the two, where you can hold the button to jump higher, than do another such jump in midair, with a limit to how many times you can jump.






All you really need to do is create a character object and a solid box object and just paste this code into the character's events.
« Last Edit: May 31, 2009, 08:38:07 AM by Yellowboy » Logged

Well, well, how can you tell?
Soulliard
Level 10
*****


The artist formerly known as Nightshade


View Profile WWW
« Reply #4 on: May 31, 2009, 03:43:05 PM »

First of all, you may want to check out the jumping code already in place, since most of the stuff you're suggesting is already in there somewhere.

As for the matter at hand, Fluid Double Jumping is not difficult to implement. I have not included it by choice.

Think about it from a player's point of view.
In a situation with fluid jumping only, when the player wants to make a long jump, he holds the button down for as long as possible.

In a situation with double jumping only, when the player wants to make a long jump, he taps the button, and then taps again at the right time.

With fluid double jumping, when the player wants to make a long jump, he holds the button, quickly releases, and then holds the button again.

Of the three options, fluid double jumping is generally the most difficult to use and the least intuitive. The only major advantage it provides is that it is easier to make aerial attacks on grounded enemies. However, since there's little distinction between grounded and aerial attacks, and many attacks change the character's momentum, this is not really a problem.

I'm curious to hear others' thoughts on this issue, but my stance is that double jumping and fluid jumping are both fine, but you should really pick one or the other.
Logged

Nitro Crate
Level 3
***



View Profile
« Reply #5 on: May 31, 2009, 04:14:07 PM »

Of the three options, fluid double jumping is generally the most difficult to use and the least intuitive.

It worked pretty wonderfully for smash bros.
Logged
Soulliard
Level 10
*****


The artist formerly known as Nightshade


View Profile WWW
« Reply #6 on: May 31, 2009, 04:44:32 PM »

The jumps are not very fluid in Smash Bros, and I don't believe that the double jumps are fluid at all.
Logged

LaserBeing
Level 0
**


it's laser time boyzz


View Profile
« Reply #7 on: May 31, 2009, 04:55:02 PM »

Of the three options, fluid double jumping is generally the most difficult to use and the least intuitive.

It worked pretty wonderfully for smash bros.

The only major advantage it provides is that it is easier to make aerial attacks on grounded enemies. However, since there's little distinction between grounded and aerial attacks, and many attacks change the character's momentum, this is not really a problem.

In the case of Smash Bros, there is a distinction between grounded and aerial attacks.
Logged
Yellowboy
Level 0
**


Hey, hey, whaddya say?


View Profile
« Reply #8 on: May 31, 2009, 05:33:57 PM »

Oh, now I see what you meant when you mentioned "double jumping and fluid jumping not going hand-in-hand."

There is also the part where you would have to hold jump buttons while tapping attack buttons, which is definitely confusing (of course, if the minimum jump height is high enough, it shouldn't be too much of a match for reflexes.)

I really don't any real argument, not that I'm shoving the idea down throats, I'm simply proposing the idea with some coding. I didn't know you actually conquered this feature (at least I admit that it was tricky, anyway) and decided against its implementation.

If I got through that web of scripting to actually implement the feature usefully, we could probably compare the two and see how each does, but if I were to do that I would probably be overstaying my welcome. Durr...?
Logged

Well, well, how can you tell?
Soulliard
Level 10
*****


The artist formerly known as Nightshade


View Profile WWW
« Reply #9 on: May 31, 2009, 05:45:00 PM »

In the case of Smash Bros, there is a distinction between grounded and aerial attacks.
Right, which is why a small amount of fluidity (short hops) is necessary. Since Indie Brawl does not have that distinction, short hops are not necessary.

To clarify, here's the way jumping works in Smash Bros:
When the player presses the jump button, the character crouches for a split second (just like in Indie Brawl). If the jump button is released before the crouching animation ends, the character will perform a short hop. Otherwise, the player performs a standard jump. So the jumping is not fluid in the sense that Mario is.

Now, I can add a similar system to Indie Brawl in a matter of minutes. As a matter of fact, I might just do that. But, unless I'm completely misreading things, that's really not what the thread is about.

If I got through that web of scripting to actually implement the feature usefully, we could probably compare the two and see how each does, but if I were to do that I would probably be overstaying my welcome. Durr...?
I welcome all suggestions. But I have pretty strong opinions on game design, so it takes some work to convince me.  Gentleman
Logged

Yellowboy
Level 0
**


Hey, hey, whaddya say?


View Profile
« Reply #10 on: May 31, 2009, 06:18:09 PM »

To clarify, here's the way jumping works in Smash Bros:
When the player presses the jump button, the character crouches for a split second (just like in Indie Brawl). If the jump button is released before the crouching animation ends, the character will perform a short hop. Otherwise, the player performs a standard jump. So the jumping is not fluid in the sense that Mario is.

Now, I can add a similar system to Indie Brawl in a matter of minutes. As a matter of fact, I might just do that. But, unless I'm completely misreading things, that's really not what the thread is about.

(b'.')b

Actually, that's probably the smartest (and safest c:) plan, people would be able to get more comfortable with the game after playing Smash.
Logged

Well, well, how can you tell?
William Broom
Level 10
*****


formerly chutup


View Profile
« Reply #11 on: May 31, 2009, 11:32:10 PM »

Smash Bros style shorthops sound like a good idea to me. They would be quite intuitive for new players, but might add more strategy once you get into the game. Since there's no dodging in this game, players often jump to avoid attacks. A long jump could be used to avoid large scale attacks (i.e. Chiquita Bomb) while a short hop followed by a downward strike might be an effective way to counter melee attacks.
Logged

Yellowboy
Level 0
**


Hey, hey, whaddya say?


View Profile
« Reply #12 on: June 01, 2009, 03:15:38 PM »

While a short hop followed by a downward strike might be an effective way to counter melee attacks.
Now, when you say counter, do you mean "negation" counter? or "strikeback" counter? Or does it vary?
Logged

Well, well, how can you tell?
shig
Guest
« Reply #13 on: June 01, 2009, 06:18:36 PM »

Depends.

It could be an attack with higher priority, speed or range. In wich case it'd be a "negation" counter. Or you could use the hop to dodge the attack and strike afterwards.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic