Jump to content
Senshi

Classify magazines by size/weight/mass

Recommended Posts

I'm currently trying to find a way to get the (abstract) mass of a magazine. And I mean all kinds of magazines, including vehicle weapons. Basically I want a good automated way to quantify how much "bigger/larger/heavier" a 32x120mm HE shell magazine is compared to a measly 30x6.5mm STANAG.

 

I was hoping "mass" or "weight" in CfgMagazines would be a good indicator, but sadly both of these attributes are only sparsely populated in ArmA3 magazines.

 

I also looked at CfgAmmo (hoping I could multiply cfgMagazine "count" with a mass value in CfgAmmo), but the only thing there that resembles what I'm looking for is "cost". Which does not refer to the "price", but to the "reluctance to use it" for AI (so they don't use "expensive" ammo on cheap targets). Still, "cost" is close to what I'm looking for, but not really perfect (e.g. demo charges have a very high cost, 4 times that of a single 120mm APFSDS).

 

Anyone have any ideas where else I could look? How does ArmA calculate bullet drop, if it is not mass-based?

Share this post


Link to post
Share on other sites

Is there a way to return the caliber and the bullet count of a magazine from the configs? You could then set base weight values for all calibers and multiply them by the amount of bullets in a magazine.

Share this post


Link to post
Share on other sites

Is there a way to return the caliber and the bullet count of a magazine from the configs? You could then set base weight values for all calibers and multiply them by the amount of bullets in a magazine.

bullet count

 

magazin weight

 

ammo class name for ammo in magazine

U should instantly forget the magazine weight because i only got 0 as value as i tested it.

but here is how to get that values from config:

bullet count:

_bullet_count = getNumber(configfile >> "CfgMagazines" >> your_magazines_class_name >> "count");

magazin weight:

_mag_weight = getNumber(configfile >> "CfgMagazines" >> your_magazines_class_name >> "weight");

ammo class name of magazines content:

_ammo_class = getText(configfile >> "CfgMagazines" >> your_magazines_class_name >> "ammo");

if u want to use any value from CfgAmmo (I found nothing related in there) then u have to get the ammo class name first as shown in above example.

but heres an example for air friction:

 

_air_fric = getNumber(configFile >> "CfgAmmo" >> getText(configFile >> "CfgMagazines" >> your_magazines_class_name >> "ammo") >> "airFriction");

One solution for ur attempt is to define such weigth for every ammo type and then multiply that with the ammo count of the magazine similar to R3vos post.

But there is one big problem, you will not cover any mods with that.

So a better solution could be to use air friction as a weight indicator because bigger ammo is more decelerated from the air flow and mostly bigger ammo has more weight. thats not a perfect solution i think but it is one :-)

air friction has negative values and as more negative they r as more the ammo is decelerated..

Share this post


Link to post
Share on other sites

I know how to access config data ;) .

 

However, as already stated in OP, both weight and mass are fairly useless attributes, because they are mostly not filled ( = 0).

 

airfriction however could be an interesting approach. Still, anyone know how the effect of gravity is calculated on bullets (= bullet drop?). If there's a way to access that, that'd be an even better indicator for mass. Gravity is directly related to mass, whereas airfriction depends on shape (and can seriously be offset by active propulsion such as in missiles).

 

Manually defining weights always works, but is inflexible. I definitely want to define as little as possible in a static way.

Share this post


Link to post
Share on other sites

whereas airfriction depends on shape.

thats true but most shapes (if u look onto the front of the bullet) are very similar and the only difference is size which mostly interdepends with mass.

because of that fact it should be good to use.

 

(and can seriously be offset by active propulsion such as in missiles).

thats definetly wrong. propulsion is a counter force to air friction but it doesnt influence it!

Share this post


Link to post
Share on other sites

Still, anyone know how the effect of gravity is calculated on bullets (= bullet drop?). If there's a way to access that, that'd be an even better indicator for mass. Gravity is directly related to mass...

Gravity force is dependent on mass, but acceleration is not. So bullet drop does not depend on bullet mass, and can be calculated for any mass using g=9.81m/s2.

Share this post


Link to post
Share on other sites

thats definetly wrong. propulsion is a counter force to air friction but it doesnt influence it!

That's exactly what I meant with "offsets it". It's just semantics ;) .

Air friction is definitely NOT "mostly the same" for different projectiles. Neither in real life nor ingame:

7.62mm has -0.001

6.5mm has -0.0009

5.56mm has -0.0012

40mm APFSDS has -0.00012

40mm GPR has -0.0006

120mm HE shell has -0.000275

120mm APFSDS has -0.0000396

Titan_AA has 0.05 (positive, as apparently all missiles )

GBU12 LGB has -0.0005

There are drastic differences in air friction, which is the whole reason why there's about a dozen different AP shell types alone. And yes, mass influences it, but is not the decisive factor (see the wikifor some details.

Definitely not useful for a size/volume indicator.

@pedeathtrian: You are correct. My mistake :) . So that doesn't help me either.

---

Is there a way to get the bounding box of projectiles? That way I might get an indicator for volume.

And how does the vanilla reload on ammo truck work? That one does seem to take different amounts of time depending on projectile type (even if it is insanely quick in all cases). Anyone know if/where to find that in the config/functions?

Share this post


Link to post
Share on other sites

Another test result:

It's possible to get the volume of a projectile by spawning it and then calling boundingbox on it (boundingbox and boundingboxreal return the same results for fairly primitive models such as projectiles).

In my quick test I got the following results (volume = length * width * height):

B_9x21_Ball 0.004126984154

B_556x45_Ball 0.008610160447

B_65x39_Caseless 0.008610160447

B_762x51_Ball 0.004126984154

B_127x108_Ball 0.004126984154

DemoCharge_Remote_Ammo 0.002899307657

G_40mm_HEDP 0.0002912889915

M_Scalpel_AT 6.66293707

Sh_125mm_APFSDS 0.1410523565

Sh_155mm_AMOS 0.004233596937

Sh_82mm_AMOS 0.004233596937

Rocket_03_AP_F 0.6234897105

Missile_AGM_01_F 16.35820198

Bo_Mk82 0.5038736875

This also shows it's not really useful, as the mere boundingbox of some missiles or bombs is much larger than their actual volume because of fins extruding from the main body. Others seem to use the same model for different ammo.

I also tried getMass on them, but projectiles are not PhysX objects, so it always is 0.

Another problem is that I actually have to SPAWN the projectile to get this data. So I have to cause a massive detonation somewhere in the ocean at the start of the round, probably causing some severe lag, just to get the volume.

Share this post


Link to post
Share on other sites

the mass parameter for magazines is config defines which part of inventory volume it'll take.

You can spawn a projectile by createVehicle and immediately issue enableSimulation false on it - it will allow you to get a bounding box and work with it without rush.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×