| 05-10-2009, 02:41 AM | #1 |
How do I find them? I know finding velocity issues is V = Vi + at Vi= vf-at vf = 0 How would I go about doing it? It should not be a vertical jump. Anybody here has the formula to do the rest? |
| 05-10-2009, 03:16 AM | #2 |
Since it's not likely that the unit will be in the air long enough for friction to matter, assume constant horizontal velocity - it makes everything much easier. Real-life acceleration due to gravity is 9.8 meters per square second - which can probably be approximated at 1000 units in-game. After that, decide which variables are going to be independent. If you want to keep jump height constant, you'll have movement speed dependent on distance traveled. If you want to keep movement speed constant, your unit will be making shorter jumps to travel shorter distances. |
| 05-10-2009, 03:26 AM | #3 |
Jump height maximum is constant, unit's movement speed will be constant and acceleration will be constant. So how do I go about doing it? 1000 for accleration? Isn't that abit too much. |
| 05-10-2009, 03:45 AM | #4 |
WAIT!!! you need to make a loop which changes the vertical velocity according to the gravity. z = zo + vzo*t -0.5*9.81*t^2 yo= GetLocationZ(GetUnitLoc(u)) t is the varaible that we should increase in the looping function Horizontal velocity is ALWAYS constant. x = xo + vx*t xo = initial position of the unit. |
| 05-10-2009, 06:59 PM | #5 | |
Quote:
|
| 05-11-2009, 05:50 PM | #6 |
id get all the forces involved - impressed/movement/effective and internal/drag/gravity - then associate them with each other / sum them up / make it wholesome or w/e. probably: firstly, the movement/moment w/e u wanna call it of the moving thing/guy, w/c goes upwards (duh) and towards some horizontal direction. then i'd make little 'compartments' for each possible 'interacting force' or w/e. so i can enable/disable each 'compartment' independently of the others - say i wanna have a no-gravity and with-drag environment, etc. and the operations in each 'compartment', corresponding to the influence of the interacting force does that influence for the force on the movement. interacting forces may be: gravity, drag - basically just counters the movement, so this would have x and y components as the movement (which goes up (duh) and horizontally) does, but negative to the latter and at a scale/coefficient or w/e u wanna call it. i c.b.f with maths ;c |
| 05-11-2009, 07:16 PM | #7 | ||
Quote:
Quote:
Remember, it's meters per square second, so before the first second passes our change in velocity is relatively low. Depending on your chosen fixed velocity, your unit could jump quite high before coming back down. Jump height is most easily found by taking the derivative of the unit's height and finding when that equals zero. JASS:function GetLocalExtremum takes real a, real b returns real // (dy/dx)(a * x - b * x * x) = a - 2 * b * x // a - 2 * b * x = 0 // <=> a = 2 * b * x // <=> a / (2 * b) = x local real x = a / (2 * b) return (a * x - b * x * x) endfunction My calculus is a bit rusty, since I haven't done any of it for a year... |
| 05-12-2009, 09:33 AM | #8 |
Wait, so who should I listen to? @Cosmicat. What is the recommended value for a fixed velocity? |
| 05-12-2009, 07:38 PM | #9 | |||
Quote:
Quote:
Quote:
Again, if your spell has a point or unit target, it needs to have at least one dependent variable in it. Try to think of all the variables involved as elements of a system of linear equations. If you define every single variable, you have only one possible solution, which works in exactly one cast. If you leave one free, you get infinitely many (but only along one dimension, so it's still predictable). Almost every variable in our system can be solved with integrals. Normally, an integral leaves an unknown constant behind, but luckily we're dealing with velocity and acceleration from a known location, so we aren't going anywhere mathematically uncertain. Unfortunately I have to get to a class right now, and there are more things required of me after that, but I'll try to get a few of the formulas worked out for you later. |
| 05-13-2009, 01:42 AM | #10 |
Well ok, I'll wait for your other formulas. The ability I am trying to make is to make a unit fly to location B which is the target location and from location A , unit location. |
| 05-13-2009, 06:50 PM | #11 |
Bah, since I'm lacking time, and since there's a perfectly good resource out there that probably has exactly what you need, I'll just link you to that. |
