Little Fighter Empire - Forums
[solved] Nigative dvy with a ltr problem - Printable Version

+- Little Fighter Empire - Forums (https://lf-empire.de/forum)
+-- Forum: Little Fighter 2 Zone (https://lf-empire.de/forum/forumdisplay.php?fid=7)
+--- Forum: Data Changing (https://lf-empire.de/forum/forumdisplay.php?fid=11)
+---- Forum: Solved Problems (https://lf-empire.de/forum/forumdisplay.php?fid=14)
+---- Thread: [solved] Nigative dvy with a ltr problem (/showthread.php?tid=7171)

Pages: 1 2


[solved] Nigative dvy with a ltr problem - A-Man - 10-18-2011

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.


RE: Nigative dvy with a ltr problem - MH-Razen - 10-18-2011

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...


RE: Nigative dvy with a ltr problem - mfc - 10-18-2011

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


RE: Nigative dvy with a ltr problem - Azriel - 10-18-2011

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~


RE: Nigative dvy with a ltr problem - AKA_Mathieu - 10-18-2011

@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 ;) )


RE: Nigative dvy with a ltr problem - Silverthorn - 10-18-2011

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)


RE: Nigative dvy with a ltr problem - mfc - 10-18-2011

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


RE: Nigative dvy with a ltr problem - A-Man - 10-18-2011

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..



RE: Nigative dvy with a ltr problem - Silverthorn - 10-18-2011

(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?


RE: Nigative dvy with a ltr problem - mfc - 10-18-2011

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