Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[solved] Nigative dvy with a ltr problem
#1
My problem in brief is:
I have a negative dvy+ltr in a move. When the move hits an opponent the char goes extra up more than I wanted and noted in the dvy tag...
Is there any way to prevent this extra going up when the moves hit??.
I tried missing with the centery but a lot of glitches appeared.

Any help would be appreciated.
[Image: signature.png]
A-Engine: A new beat em up game engine inspired by LF2. Coming soon

A-Engine Dev Blog - Update #8: Timeout

Reply
Thanks given by:
#2
actually if you put a dvy: 50 for example, the char won`t go up 50 px, the 50 is more a variable for a function which calculates the height yoyu fly, so my suggestion is you make the dvy smaller and try out which value is good for your move...
[Image: random.php?pic=random]
www.lf-empire.de
Once I had a fortune, it said: "Leave now. Life is short. Time is luck"
Don't dream your life, live your dream!
Reply
Thanks given by: A-Man
#3
Negative dvy makes char go high.
dvy: -2 -a little high
dvy: -7 -higher
dvy: -45 -more higher
dvy: -70 -more more higher
These are not special numbers.
As you decrease the number; char goes higher..

Edit: mh ninja'ed:P
[Image: llqsMqz.jpg][Image: llqsMqz.jpg][Image: llqsMqz.jpg][Image: llqsMqz.jpg]
Reply
Thanks given by: A-Man
#4
dvy: -50 means go up 50 pixels per time unit;
also every time unit, t0 objects experience a 1.7 pixel gravitational force to the ground
so t0s will actually go up by 50² / (2 * 1.7) = 735 pixels before coming down if hit by that itr



Azriel~
Reply
Thanks given by: A-Man
#5
@Azriel: Very interesting your explanation, but wait a minute...

Why 50² and why 1.7 is multiplied by 2? ( I'm not saying your explanation is wrong, i'm just trying to understand 'cause i'm a noob ;) )
Reply
Thanks given by:
#6
y(t) = 1/2*a*t² + v0*t + y0 <= Basic equation for any object flying around
y'(t) = a*t + v0 = 0 <= Derivative, used to get the max/min-values

a = 1.7; v0 = -50 a = acceleration, v0 = start velocity

y'(t) = 1.7*t - 50 = 0
<=> 50 = 1.7t
<=> 50/1.7 = t <= this tells you when the maximum point is reached

y(50/1.7) = 0.85*(50/1.7)² -50*(50/1.7) + 0
y(50/1.7) ~ -735.29 <= this tells you the number of pixels relative to the ground, y-axis faces downwards

Yeah, good ol' mathma saves the day :p


So, in short:
Maximum height is determined by the following formula:
y = (dvy)²/(3.4)
Silverthorn / Blue Phoenix
~ Breaking LFE since 2008 ~

"Freeze, you're under vrest!" - Mark, probably.

» Gallery | » Sprites | » DeviantArt
Reply
Thanks given by: A-Man , AKA_Mathieu
#7
D: !
All this physics stuff looks so complicated!
(at least i know that "(v(start))*t + (1/2)*g*(t^2)" gives us the height from starting point)

But, how do you know the acceleration value of gravity?
From hex? o_O
[Image: llqsMqz.jpg][Image: llqsMqz.jpg][Image: llqsMqz.jpg][Image: llqsMqz.jpg]
Reply
Thanks given by: A-Man
#8
I guess that formula will not work when hitting 20 foes (knowing that sounds weird)......... I even tried using dvy: -3.4 so 11.56/3.4=3.4+same hight. I guess this can be solved by disabling the lagging when hitting thing using hex. Dunno, maybe U have a dc solution or an admin may please move this to HEX forums..
[Image: signature.png]
A-Engine: A new beat em up game engine inspired by LF2. Coming soon

A-Engine Dev Blog - Update #8: Timeout

Reply
Thanks given by:
#9
(10-18-2011, 12:33 PM)xmfcx Wrote:  But, how do you know the acceleration value of gravity?
From hex? o_O
Yeh, the gravity-constant is hardcoded in LF2. The first method that extensively made use of this constant is >Windmill's Flying Technique<


(10-18-2011, 01:22 PM)A-MAN Wrote:  I guess that formula will not work when hitting 20 foes (knowing that sounds weird)......... I even tried using dvy: -3.4 so 11.56/3.4=3.4+same hight. I guess this can be solved by disabling the lagging when hitting thing using hex. Dunno, maybe U have a dc solution or an admin may please move this to HEX forums..
As far as I know, it's virtually impossible to remove that hit-lag because it is an embedded part of the game-logic (which requiress way too much editing to be profitable).
Can you elaborate in which way this formula does not work? Do enemies get hit higher/lower than they should?
Silverthorn / Blue Phoenix
~ Breaking LFE since 2008 ~

"Freeze, you're under vrest!" - Mark, probably.

» Gallery | » Sprites | » DeviantArt
Reply
Thanks given by: A-Man
#10
Dvy tag doesn' work if fall value of itr is smaller than 70.

Also you don't need to calculate complicated things like that.
Just try dvy: -1, you didn't like it? Then try dvy: -2, ...

And also theese are same in dc programming: 1,8=1,5=1,999=1,45368=1.
The numbers after comma aren't used.

Can you tell me what exactly do you want?

Also @topic title: not nIgative, nEgative
[Image: llqsMqz.jpg][Image: llqsMqz.jpg][Image: llqsMqz.jpg][Image: llqsMqz.jpg]
Reply
Thanks given by: A-Man




Users browsing this thread: 1 Guest(s)