Statistics
Latest topics
» Number of races?
Mon Mar 01, 2010 4:12 pm by raddick

» Nahrungsaufnahme und Stamina
Tue Dec 29, 2009 2:57 pm by Archon Short

» Unterstützung von Heilen
Tue Dec 22, 2009 1:21 pm by Tiberius

» uHUD - Fragen
Tue Dec 15, 2009 8:55 pm by Archon Short

» Realistic Bow System....
Fri Nov 13, 2009 6:57 pm by Archon Short

» Wettkampfsystem
Thu Nov 12, 2009 9:19 pm by Archon Short

» Vorschlag Regio-Server
Thu Nov 12, 2009 6:02 pm by Archon Short

» Weapon Tester
Sun Nov 01, 2009 4:02 pm by Archon Short

» Suggestions for handling of shield&armour
Thu Oct 29, 2009 8:21 am by Bartholomew Gallacher


How do you calculate weapon arc?

View previous topic View next topic Go down

How do you calculate weapon arc?

Post  woolyfsh on Thu Apr 09, 2009 5:45 pm

According to the METALIFE Develoers guide part 1:

MetaLife also automatically calculates valid attack arcs, so you are free to specify sensors with 360 degrees for your weapons. The higher the specified core range of a weapon, the smaller is the opening angle chosen by the meter (that means, a spear can attack from a larger distance, but not at a 90 degree opening angle like a sword, but at a much smaller angle)

OK fine, but since the delay on my weapons is triggered by a hit detection, an overly generous arc will make my weapons less efficent. For example: If I have a spear of length 3.5 meters, and ML sets the arc to say 45 degrees, and I use a weapons arc of 180 degrees in my sensor detect, I most likely will get false hit indications resulting in my weapons having extraneous delays and giving the user incorrect weapon hit feedback (sounds, blood splatter etc.). I want my hit detection to be accurate. This not only makes my weapons more efficient but it gives the user better feedback as to how to use the weapon.

So what is the formula that ML uses for calculating weapons arch based upon reach/range?

woolyfsh

Posts: 15
Join date: 2008-12-23
Age: 47

View user profile

Back to top Go down

Re: How do you calculate weapon arc?

Post  Tala on Wed Apr 15, 2009 7:16 am

woolyfsh wrote:
So what is the formula that ML uses for calculating weapons arch based upon reach/range?


Sorry for the late response ... the rule is an interpolation of the following values:

Core range 5.5m -> maximal arc 5 degrees
Core range 1.5m -> maximal arc 180 degrees
Core range 0.0m -> maximal arc 245 degrees

Tala
Admin

Posts: 59
Join date: 2008-06-27

View user profile http://metalife.powerrpg.net

Back to top Go down

Re: How do you calculate weapon arc?

Post  woolyfsh on Fri Apr 17, 2009 4:07 am

OK Tala its a non linear curve then ... Whats the formula?

woolyfsh

Posts: 15
Join date: 2008-12-23
Age: 47

View user profile

Back to top Go down

Re: How do you calculate weapon arc?

Post  Tala on Fri Apr 17, 2009 9:09 am

woolyfsh wrote:OK Tala its a non linear curve then ... Whats the formula?


Woolyfsh, it's a linear relation in terms of the cosine of the arc ... I'm on vacation right now and don't have the source code with me, let's talk next week!

Bye, Tala

Tala
Admin

Posts: 59
Join date: 2008-06-27

View user profile http://metalife.powerrpg.net

Back to top Go down

Re: How do you calculate weapon arc?

Post  woolyfsh on Mon Apr 20, 2009 2:17 pm

Thanx, Tala I appreciate you getting back to me on this.

woolyfsh

Posts: 15
Join date: 2008-12-23
Age: 47

View user profile

Back to top Go down

Re: How do you calculate weapon arc?

Post  woolyfsh on Sun May 10, 2009 3:40 pm

Just got the arc formula from Thank you! Here it is:

( -0.76 D + 4.28 ) * 180/(2Pi)

D is the reach of the weapon and the formula returns the arc in degrees.

woolyfsh

Posts: 15
Join date: 2008-12-23
Age: 47

View user profile

Back to top Go down

Re: How do you calculate weapon arc?

Post  woolyfsh on Sun May 17, 2009 5:13 pm

Just to finalize all this .. I went ahead and calculated the arcs based upon this formula in 0.1 meter increments .. This is what I get:


Range

Arc

Range

Arc

Range

Arc

0

122.6752

1.9

81.28662

3.8

39.89809

0.1

120.4968

2

79.10828

3.9

37.71975

0.2

118.3185

2.1

76.92994

4

35.5414

0.3

116.1401

2.2

74.75159

4.1

33.36306

0.4

113.9618

2.3

72.57325

4.2

31.18471

0.5

111.7834

2.4

70.3949

4.3

29.00637

0.6

109.6051

2.5

68.21656

4.4

26.82803

0.7

107.4268

2.6

66.03822

4.5

24.64968

0.8

105.2484

2.7

63.85987

4.6

22.47134

0.9

103.0701

2.8

61.68153

4.7

20.29299

1

100.8917

2.9

59.50318

4.8

18.11465

1.1

98.71338

3

57.32484

4.9

15.93631

1.2

96.53503

3.1

55.1465

5

13.75796

1.3

94.35669

3.2

52.96815

5.1

11.57962

1.4

92.17834

3.3

50.78981

5.2

9.401274

1.5

90

3.4

48.61146

5.3

7.22293

1.6

87.82166

3.5

46.43312

5.4

5.044586

1.7

85.64331

3.6

44.25478

5.5

2.866242

1.8

83.46497

3.7

42.07643




So using this formula the arc summaries should be:

Core range 5.5m -> maximal arc 2.8 degrees
Core range 1.5m -> maximal arc 90 degrees
Core range 0.0m -> maximal arc 122.7 degrees

Unless there is a multiply by 2 factor missing in the equation which would yield:

Core range 5.5m -> maximal arc 5.7 degrees
Core range 1.5m -> maximal arc 180 degrees
Core range 0.0m -> maximal arc 245.3 degrees

This matches Talas original summary better.

woolyfsh

Posts: 15
Join date: 2008-12-23
Age: 47

View user profile

Back to top Go down

Re: How do you calculate weapon arc?

Post  Tala on Mon May 18, 2009 5:28 am

The formula gives the arc value e.g. for the llSensor call. The real opening angle is double that value: for example 90 degrees arc (pi/2) in llSensor gives a real opening angle of 180 degrees (pi).

Tala
Admin

Posts: 59
Join date: 2008-06-27

View user profile http://metalife.powerrpg.net

Back to top Go down

Re: How do you calculate weapon arc?

Post  Archon Short on Fri Oct 09, 2009 1:11 am

My Idear for that....
I use this formula for most things I got to change by variables in Weaponscripts
For the Arc is this my way:
Arc = Arc_min + ((Arc_max-Arc_min)/(Range_max-Range_min)*(Range_max-CoreRange))
Arc = 5+((245-5)/(5.5-0.0)*(5.5-CoreRange))
Arc = 5+(240/5.5*(5.5-CoreRange))


This works like it should work....

Greetz Archon Short

Archon Short

Posts: 10
Join date: 2009-10-01
Age: 32
Location: germany

View user profile

Back to top Go down

View previous topic View next topic Back to top


Permissions of this forum:
You cannot reply to topics in this forum