Welcome to symthic forums! We would love if you'd register!
You don't have to be expert in bit baking, everyone is more than welcome to join our community.

You are not logged in.

Hey! If this is your first visit on symthic.com, also check out our weapon damage charts.
Currently we have charts for Battlefield 3, Call of Duty: Black Ops 2, Medal of Honor: Warfighter and Call of Duty: Modern Warfare 3

Symthic

Head Administrator

(1,641)

  • "Symthic" started this thread

Posts: 965

Date of registration
: Nov 29th 2011

Platform: PC

Location: Finland

Battlelog:

Reputation modifier: 11

  • Send private message

151

Monday, April 9th 2012, 4:49pm

Re: Plotic - Graphical representation of weapon deadliness

Quoted from ""lqud""

General question about recoil mechanic.
....


Quoted from ""Symthic""

Distance still doesn't seem to be working from ini or did the template change aswell?
Titles etc. are tho.

The recoil decrease actually should also be added.

Heres how:
Lets take an example of 0.5 vertical and 0.3 horizontal recoil.
Decrease would be 18, or 1.8 while shooting.
Weapon would have 800rpm rof.
Pixels per degree scale would be 1000

we start from point x1000 y1700
the first shot without spread would land at:
x = 1000 + 1000 * 0.3 = 1300
y = 1700 - 1000 * 0.5 = 1200

Then we draw triangle between following points:
1000,1700 (the starting point)
1300,1700 (horizontal recoil taken into count but not vertical)
1300,1200 (both recoils taken into account)

Now we need to know length of each side of triangle.
Base is of course 300px (amount of horizontal recoil)
Side is 500px (amount of vertical recoil)
Hypotenuse or what ever its called is
sqrt(300^2+500^2) = 583,09518948453004708741528775456

The amount of decrease in pixels is Scale*Decrease/(RoF/60)
1000 * 1.8 / (800/60) = 135
We need to go 135 pixels towards the starting point from the calculated point of recoil.
we need to draw another triangle to get the coordinates of this point, but we only know the lenght of hypotenuse (135)
The angle of every corner in the triangle stays the same so we can use the same lenght ratios for new triangle than the one we draw before so:
500/583,0951 = 0,85749305730746151013788316862893
300/583,0951 = 0,51449583438447690608272990117736
Then we use these ratios to calculate the the base and side of the triangle with hypotenuse of 135
side = 135 * 0,857 = 115,695
base = 135 * 0,514 = 69,39

The point where shot will land with recoil decrease is
x = 1300 - 69 = 1231
y = 1200 + 116 = 1316




Every shot weapon recoil up same amount, except first shot recoil is multiplied by it's multiplier.
Every shot random is got between the horizontal recoil values.
This is the spot weapon jumps to.
Then recoil decrease takes the gun towards the center til the next shot is fired.
Again gun jumps upwards the amount of vertical recoil and again it gets random between horizontal recoil values. These are added on top of the spot where the gun is aiming at that moment when the shot is fired.

Spread question was answered by Demize, shots aren't evenly distributed at the circle of cone of fire but rather just random angle and random redius.
If it would be even distribution, it would be random angle, sqrt(random radius)

I've explained all these before in this topic.
BF3: Objective per minute: World top 1%

Posts: 59

Date of registration
: Mar 4th 2012

Platform: PC

Battlelog:

Reputation modifier: 5

  • Send private message

152

Monday, April 9th 2012, 11:46pm

Re: Plotic - Graphical representation of weapon deadliness

Thanks for clearing up. Any idea on whats the recoil Max values are for?

Also is there a transcript of Demize's info somewhere?

Symthic

Head Administrator

(1,641)

  • "Symthic" started this thread

Posts: 965

Date of registration
: Nov 29th 2011

Platform: PC

Location: Finland

Battlelog:

Reputation modifier: 11

  • Send private message

153

Tuesday, April 10th 2012, 1:55am

Re: Plotic - Graphical representation of weapon deadliness

Quoted from ""lqud""

Thanks for clearing up. Any idea on whats the recoil Max values are for?

Also is there a transcript of Demize's info somewhere?

Try shooting whole mag of ie 200 bullets full auto and you'll notice that the recoil stops at some point.
That's what max recoil does.

If there wasn't max and someone would shoot whole 200bullet mag in one go, after releasing the trigger he would find himself aiming at his toes because he would constantly fight the recoil by aiming more and more down until the "zero" point where the recoil decrease takes the gun, would point at ground.



And cant remember where he mentioned it... at least wasn't in any mails so it must have been some public place.
BF3: Objective per minute: World top 1%

Posts: 59

Date of registration
: Mar 4th 2012

Platform: PC

Battlelog:

Reputation modifier: 5

  • Send private message

154

Wednesday, April 11th 2012, 6:20pm

Re: Plotic - Graphical representation of weapon deadliness

The random radius random angle becomes just a square root distribution.
Getting P{hit} is simple for circles aimed at their center: get the ratio of target radius to spread radius, take sqroot of it and that is your Probability of landing in the smaller circle.

Symthic

Head Administrator

(1,641)

  • "Symthic" started this thread

Posts: 965

Date of registration
: Nov 29th 2011

Platform: PC

Location: Finland

Battlelog:

Reputation modifier: 11

  • Send private message

155

Wednesday, April 11th 2012, 8:15pm

Re: Plotic - Graphical representation of weapon deadliness

Quoted from ""lqud""

simple for circles aimed at their center
Yep but what if they're only partly on top of each other? ;)


RobotMonkey, theres something wrong when generating plots with small spread/recoil values.
Recoil goes down and it makes kinda heart shaped plots.


Are you sure you set the recoil decrease function "zeropoint" to same coordinates where the first shot goes w-o spread?


Oh and made some new functions to get the data from the files while adding weaponstats to mysql database for new charts.


Bullet data function to get damages etc:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
    Public Function getbulletdata(ByVal projectilehash As String, ByVal value As String)
        Dim viiva = InStr(projectilehash, "-")
        projectilehash = Microsoft.VisualBasic.Mid(projectilehash, viiva + 1, Len(projectilehash) - viiva - 1)
        Dim list As List(Of String) = GetFiles(*path to weapon files* + "\Common\Bullets")
        Dim data = Nothing
        For Each path In list
            data = My.Computer.FileSystem.ReadAllText(path)
            If InStr(data, projectilehash) Then
                Exit For
            End If
        Next
        Dim start = InStr(data, value) + (Len(value) + 1)
        data = Microsoft.VisualBasic.Mid(data, start, 200)
        Dim val As String = ""
        Dim leni As Integer = 1
        Do Until InStr(val, Environment.NewLine)
            val = Microsoft.VisualBasic.Left(data, leni)
            leni += 1
        Loop
        val = Microsoft.VisualBasic.Left(val, Len(val) - 2)
        Return val
    End Function


Projectile hash is in weapon files and you can get it via GetValue(weapon, "ProjectileData")
Value should match with whats in the files, ie StartDamage or DamageFalloffEndDistance
Replace GetFiles with any way you want to use to loop through the bullet files.
Heres new GetValue which works for any value found in the file (Replace " * tab * Zoom" via real tab char since the forum fucks it up):

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Public Function GetValue(ByVal weapon As String, ByVal value As String, Optional ByVal stance As String = "Stand")
        Dim data = GetData(weapon, "")
        Dim preparsevalues = "-IncreasePerShotMinAngleMaxAngleDecreasePerSecondRecoilAmplitudeMaxRecoilAmplitudeIncPerShotHorizo" + _
"ntalRecoilAmplitudeIncPerShotMinHorizontalRecoilAmplitudeIncPerShotMaxHorizontalRecoilAmplitudeMaxRe" + _
"coilAmplitudeDecreaseFactor-"
        If InStr(preparsevalues, value) Then
            data = Microsoft.VisualBasic.Right(data, Len(data) - InStr(data, "WeaponSwayData"))
        Else
            If InStr(value, "MinAngle") Or InStr(value, "MaxAngle") Then
                data = Microsoft.VisualBasic.Right(data, Len(data) - InStr(data, "WeaponSwayData"))
            End If
        End If
        stance = "-" + stance + "-"
        If InStr(stance, "Stand") Then
            data = Microsoft.VisualBasic.Right(data, Len(data) - InStr(data, "Stand"))
        ElseIf InStr(stance, "Crouch") Then
            data = Microsoft.VisualBasic.Right(data, Len(data) - InStr(data, "Crouch"))
        ElseIf InStr(stance, "Prone") Then
            data = Microsoft.VisualBasic.Right(data, Len(data) - InStr(data, "Prone") - 1)
            data = Microsoft.VisualBasic.Right(data, Len(data) - InStr(data, "Prone") - 1)
        End If
        If InStr(value, "ADS") Then
            data = Microsoft.VisualBasic.Right(data, Len(data) - InStr(data, "	Zoom"))
        ElseIf InStr(value, "HIP") Then
            data = Microsoft.VisualBasic.Right(data, Len(data) - InStr(data, "NoZoom"))
        End If
        If InStr(value, "Base") Then
            data = Microsoft.VisualBasic.Right(data, Len(data) - InStr(data, "BaseValue"))
        ElseIf InStr(value, "Moving") Then
            data = Microsoft.VisualBasic.Right(data, Len(data) - InStr(data, "Moving"))
        End If
        If InStr(value, "MinAngle") Then
            value = "MinAngle"
        ElseIf InStr(value, "MaxAngle") Then
            value = "MaxAngle"
        End If
        If InStr(value, "Speed") Then
            data = Microsoft.VisualBasic.Right(data, Len(data) - InStr(data, "InitialSpeed"))
            value = "z"
        End If
        Dim start = InStr(data, value) + (Len(value) + 1)
        data = Microsoft.VisualBasic.Mid(data, start, 200)
        Dim val As String = ""
        Dim leni As Integer = 1
        Do Until InStr(val, Environment.NewLine)
            val = Microsoft.VisualBasic.Left(data, leni)
            leni += 1
        Loop
        val = Microsoft.VisualBasic.Left(val, Len(val) - 2)
        Return val
    End Function
BF3: Objective per minute: World top 1%

Posts: 59

Date of registration
: Mar 4th 2012

Platform: PC

Battlelog:

Reputation modifier: 5

  • Send private message

156

Thursday, April 12th 2012, 4:17am

Re: Plotic - Graphical representation of weapon deadliness

Quoted from ""Symthic""


RobotMonkey, theres something wrong when generating plots with small spread/recoil values.
Recoil goes down and it makes kinda heart shaped plots.


Are you sure you set the recoil decrease function "zeropoint" to same coordinates where the first shot goes w-o spread?



Think found it.
in recoildecrease function, needs to check for

Source code

1
2
3
If diffYSmall > Math.Abs(ShootY - StartY) Then Return StartY
...
If diffXSmall > Math.Abs(StartX - ShootX) Then Return StartX


otherwise it will autocorrect past initial shot which drags it down, left and rigt but not in center (heart shape)

Posts: 72

Date of registration
: Dec 20th 2011

Platform: PC

Battlelog:

Reputation modifier: 5

  • Send private message

157

Sunday, April 15th 2012, 9:42pm

Re: Plotic - Graphical representation of weapon deadliness

Quoted from ""lqud""

Quoted from ""Symthic""


RobotMonkey, theres something wrong when generating plots with small spread/recoil values.
Recoil goes down and it makes kinda heart shaped plots.


Are you sure you set the recoil decrease function "zeropoint" to same coordinates where the first shot goes w-o spread?



Think found it.
in recoildecrease function, needs to check for

Source code

1
2
3
If diffYSmall > Math.Abs(ShootY - StartY) Then Return StartY
...
If diffXSmall > Math.Abs(StartX - ShootX) Then Return StartX


otherwise it will autocorrect past initial shot which drags it down, left and rigt but not in center (heart shape)



I'll fix this today along with adding the subs.
I can't be in love if it's plastic, To live on my own just seems tragic
But we'll raise our swords high when our day comes, You thought it was gold but it was bronze.
But if i see you again back in detox, put my remains in my snuff box!

Posts: 225

Date of registration
: Apr 12th 2012

Platform: 360

Battlelog:

Reputation modifier: 5

  • Send private message

158

Thursday, April 19th 2012, 3:44am

Re: Plotic - Graphical representation of weapon deadliness

I'm sorry to interject uselessly, but this thread is just the *best* kind of nerdy. And to think, our parents probably told us video games don't lead to any useful knowledge or skills...

Posts: 2

Date of registration
: Apr 7th 2012

Platform: PC

Location: Ukraine

Battlelog:

Reputation modifier: 5

  • Send private message

159

Thursday, April 19th 2012, 10:32am

Re: Plotic - Graphical representation of weapon deadliness

oke and i'm still waiting for some bipod recoil fix -:>-

Posts: 59

Date of registration
: Mar 4th 2012

Platform: PC

Battlelog:

Reputation modifier: 5

  • Send private message

160

Thursday, April 19th 2012, 7:15pm

Re: Plotic - Graphical representation of weapon deadliness

Quoted from ""Jazz""

oke and i'm still waiting for some bipod recoil fix -:>-

i could drop somewhere my tinkered version of plotic...

Also bipods have a bug where first 2 shots dont have any recoil between them, only spread (except for g3)
essentially turning every gun into AN94, so the correct Plotic plots would be inaccurate.