HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

s=d/t involving Distance

01-03-2007, 07:40 AM#1
Chocobo
Someone has the formula to calculate the time between 2 points involving the Projectile Arc, the Speed, and the Distance?
My last formula was t=d*(1-a)/s (t = time, d = distance, a = arc, s = speed), but it never works with a projectile arc of 1.00. Any ideas?
01-03-2007, 07:53 AM#2
Jazradel
I had no idea the arc affected the speed. I always just use time = distance / projectile speed and it works fine for me.

It won't work with an arc of 1 because 1-1 = 0 and you multiply by 0 is always 0.
01-03-2007, 08:00 AM#3
Chocobo
Quote:
Originally Posted by Jazradel
I had no idea the arc affected the speed. I always just use time = distance / projectile speed and it works fine for me.

It won't work with an arc of 1 because 1-1 = 0 and you multiply by 0 is always 0.

It always returns t=d/s ? (Even if I use the projectile arc?)
01-03-2007, 01:29 PM#4
Ammorth
Not sure, but a quick test would provide you with the information. 2 archers, 1 has a really high arc, the other doesn't, same missile speed; see which one hits a target first.
01-04-2007, 07:30 AM#5
Chocobo
Quote:
Originally Posted by Ammorth
Not sure, but a quick test would provide you with the information. 2 archers, 1 has a really high arc, the other doesn't, same missile speed; see which one hits a target first.

I'm using a Dummy Projectile and I did fine the height/speed thing but I still losing with the Projectile Arc. Maybe I should simply go to Anitarf's Vector System and my problem is solved without hurting something.


And :P 2 archers seems to hit at the same time if I remember.
01-04-2007, 07:54 AM#6
Jazradel
I just did the archer test and the missile speed does only affect horizontal speed. So my formula is correct when working with blizzards missiles.

For a custom system that uses both vertical and horizontal speed, use time = d / speed where d is the hypotenuse of a square with distance base and x * arc height.

I'm not sure if thats' what you wanted, but I think that's how you would do it.
01-04-2007, 09:12 AM#7
The)TideHunter(
Guys, look.
Arc does effect distance, do it obviously effects time.
Heres 2 arcs



The red arc has less to go, so it going to reach the end faster, while the blue arc goes alot further, even though the distance between starting and ending point is constant.

Now, i havent learnt too deep into maths yet, as im still at school -.- .
But if you want Arc calculation, you can definatly ask PipeDream, he has solved problems like this many times before.
01-04-2007, 10:52 AM#8
Jazradel
That was the point I was trying to make.

The projectile speed in Warcraft III only applies to the horizontal distance travelled. The distance vertically travelled isn't directly affected.
01-04-2007, 10:54 AM#9
Anitarf
The)TideHunter(, what you said would be true if the starting speed of the projectile was the same in both cases; in the case of warcraft projectiles, that is not the case. The projectile speed you specify in the object editor only affects the projectile's horizontal speed, so no matter how high the arc is two projectiles with the same speed set in the object editor will travel the same distance in a same ammount of time.

Also, in your example, unless the two projectiles were not affected by the same gravitational force, which would be odd, they wouldn't fly the same distance.
01-04-2007, 12:04 PM#10
BertTheJasser
In WE you always define the XY-speed, z speed is calculated by arc and XY-speed
01-04-2007, 12:16 PM#11
The)TideHunter(
Quote:
Originally Posted by Anitarf
Also, in your example, unless the two projectiles were not affected by the same gravitational force, which would be odd, they wouldn't fly the same distance.

The blue line is longer than the red line, that is what i was trying to say, even though the starting and ending points are the same.
01-04-2007, 12:39 PM#12
Chocobo
Quote:
Originally Posted by The)TideHunter(
The blue line is longer than the red line, that is what i was trying to say, even though the starting and ending points are the same.

So I can make it to be an Ellipse?
01-04-2007, 01:34 PM#13
Ammorth
Anitarf, at this point it's impossible to tell which projectile would fly farther. One could have no vertical wind resistance where the other only looses a meter a second because of vertical wind resistance. But thats beside the point.

Chocobo, using the fomula t = d / s will yield the proper answer if you use the speed stated in the object editor. Distance is in game units, time is in seconds.