PDA

View Full Version : Ball jump mechanic



GribbleGrunger
09-26-2012, 04:35 PM
How would I go about moving a ball left to right with tilt and allowing it to jump with X?

Agarwel
09-26-2012, 04:46 PM
Just simple controlinator? Connecting tilt controls to righ/left mover and X button to UP mover?
And maybe just adding some rotator what would activate on impact and based on speed and direction makes the ball rotating so it doesnt look too weird?

GribbleGrunger
09-26-2012, 05:17 PM
I'll give that a go to see how it looks. Thanks.

sportbil
09-26-2012, 05:52 PM
A bit random, but a friend of mine who's worked on a lot of platforming games once shared a tip on how to make a nice springy analogue jump:

Basically for jumps to feel nice you want all the UP force to hit at a single frame.
So normally you would just wire up so the Jump-button hits an UP mover with high acceleration for one single frame, but that would give you the same jump height no matter how long you hold down the button.
Now if you instead wanted variable jump-height, the first solution most people think of is to just keep adding a diminishing UP force until you release the button, this however will make the jump lack that nice "springy feeling".

So instead:
Still have all the jump-force activate for only 1 frame as you push the button, then as soon as you release the jump button you start adding a slight medium/low DOWN-force.

You'll obviously have to tweak the acceleration settings in you movers and what not until it feels nice, but in my experience this really makes for nicer, gamier analogue jumps compared to the "keep adding up-force" way of doing it.

GribbleGrunger
09-26-2012, 06:20 PM
Before I do anything else, I need the tilt controls to work properly. At the moment the ball only rolls when my Vita is vertical left and right. Surely you can have subtler movement than that?

edit: Ok, so now I have a timer set to positional before the mover which is set to signal strength and that seems much more responsive, but I need it to get faster the more I tilt it and it only moved at the top speed I set the mover too. Any ideas?

edit 2: Got it working nicely now. splitter into two timers set to positional. Both timers into another splitter and then that splitter into an advanced mover set to speed scale!!! Works a treat but I have to have a battery into the on and off switch of the advanced mover to be able to set it to speed scale. Is there a reason it's set up like that?

secondary problem is that if it hits a wall and hops up it stays up and hovers instead of falling back to the ground.

sportbil
09-26-2012, 06:57 PM
Hmm, I don't think the positional timer really does anything in that scenario, just passes along the analogue signal to the mover?
It sounds like at first you might have had the mover set to on/off instead of strength or speed scale?

If it doesn't keep going faster while you're still adding forces to it it sounds like you might have too high decellerate setting. The decellerate means it'll try to cap your max top speed towards the speed you've set up in the mover, with the strenght of the deceleration value. So for instance if you're running speed scale as input type and then 100% acceleration+decelleration it'll try to speed up or slow down as fast possible to speed set by the "analogue-input-signal" * "max-speed setting".

Think of movers as something that's actually applying forces trying to "shove" your object around in the physics engine, and all your settings multiplied by the input signals simply dictates how it applies those forces, and in which directions.

So in your case it sounds like it could possibly be better to use strength-scale instead of speed-scale from the tilt, and then something like 70% accel, 0% decel and the max speed depending on the scale of things you're building (of course i'm making up random values, but you get the idea).

Also it's always nice to pull the tilt signal into notes (direction splitter, into 2 notes) and set the notes to display strength scale so you see what values are going into the mover to make sense of what it's trying to do. I think there's also a tweak setting in the controlinator for tilt strength scaling and deadzone?

^^ all above was before your second edit, didn't see it :)

Update: The reason it's hanging in the air is the acceleration/decelleration as mentioned above.
It's decellerating the Y-speed to 0, because you don't have any input in the advanced movers up/down, so the movers strenght is stronger than the global-gravity.

Btw, I'm not sure why you'd use positional counters, (actually are there positional counters, thought it was only on timers?) as that would only make a smooth tilt-analogue value into a stair-looking one?

Also, I think the advanced movers left/right/up/down is always speed-scaled by the input-signal, and then you get an extra speed/strength/on/off scaler for the input where you plugged in the battery that affects all movement directions.

GribbleGrunger
09-26-2012, 07:11 PM
^^ all above was before your second edit, didn't see it :)

Update: The reason it's hanging in the air is the acceleration/decelleration as mentioned above.
It's decellerating the Y-speed to 0, because you don't have any input in the advanced movers up/down, so the movers strenght is stronger than the global-gravity.

Btw, I'm not sure why you'd use positional counters, (actually are there positional counters, thought it was only on timers?) as that would only make a smooth tilt-analogue value into a stair-looking one?

Also, I think the advanced movers left/right/up/down is always speed-scaled by the input-signal, and then you get an extra speed/strength/on/off scaler for the input where you plugged in the battery that affects all movement directions.

Yeah, my mistake, they're timers not counters.

Part of the problem could be that the movers are on a ball and so the force is not always being exerted left or right. Could it be that when it hits the wall the last direction of the movers could be up or at an angle instead of directly right or left. Perhaps I could embed something inside the ball that had a gyroscope on it so that the movers are always guaranteed to only face left and right?

edit: wait, I don't think that would happen if it wasn't set to local space... would it? It's probably what you said about the up and down setting. I reckon the jump mechanic would sort that out automatically because the default would be down until I pressed X.

sportbil
09-26-2012, 07:18 PM
Unless your mover is set to local space it'll always apply left/right/up/down properly.

I'd really suggest just testing to see what happens if you just plug your tilt input into a normal (non advanced) mover set to strenght scale, up/down to 0, left/right to the max positive you want, decell to 0 and accell to whatever you want.

GribbleGrunger
09-26-2012, 07:48 PM
Unless your mover is set to local space it'll always apply left/right/up/down properly.

I'd really suggest just testing to see what happens if you just plug your tilt input into a normal (non advanced) mover set to strenght scale, up/down to 0, left/right to the max positive you want, decell to 0 and accell to whatever you want.

I tried that to begin with but for some reason it wouldn't work as well. I'll give it another try in case I'd set something wrong.

sportbil
09-26-2012, 08:54 PM
Doh, forget what I said about using a normal mover and not an advanced, I forgot that normal movers don't change directions when they get a negative input :)
(I suppose you could still signal split left/right into two normal movers if it for some reason feels better to use strength scale instead of speed scale.)

GribbleGrunger
09-26-2012, 09:03 PM
Doh, forget what I said about using a normal mover and not an advanced, I forgot that normal movers don't change directions when they get a negative input :)
(I suppose you could still signal split left/right into two normal movers if it for some reason feels better to use strength scale instead of speed scale.)

Well I've got it working to a degree but the ball tends to jump up and down in a triangular movement. I need to learn more about analogue signals I think. The ball is really my only concern to be honest. The rest will be relatively easy, but I do need the ball to be prefect for it to look any good. I need to be able to make the ball gather speed upwards for a moment, slow to a point and then slowly increase speed downwards so that it arcs. I also need to make sure that the tilt doesn't effect it while it's in the air, but momentum does (depending upon the speed it was moving at when I pressed jump) I think speed scale and positional will play a major role in that.

Scary stuff for me!

GribbleGrunger
09-27-2012, 08:27 PM
Ok, so I've got this working reasonably well, but when it hits the floor again the impact sensor keeps flickering and stops it working. It sometime hovers too. Here's the set up I have at the moment:

http://i3.api.vita.lbp.me/img/ft/c238adaa11c38d6a6ab7a0c092453937ffd92323.jpg

can anyone see anything wrong here? The timer at the bottom right is redundant by the way. The material tweaker is there to add a little bounce to the pinball... Could that be effecting it?

GribbleGrunger
09-28-2012, 05:01 PM
Sorted it! I replaced the splitter and the Advanced Mover with two Movers set to speed scale. It's improved everything including the fact that now the inertia has an effect and it doesn't just stop immediately and move in the opposite direction when titled. Thanks anyway Comphermc. Hope your move went well.