Jump to content
Sign in to follow this  
freesets

bounding sphere in geometry calculation

Recommended Posts

im in the process of building some big/small boats for arma 3(5 in total-2 small, 3 big) and i come across the damageresistance which requires the tgtradius from the bounding sphere calculated in geometry. i read the vbs2, arma2, 3 and even direct x docs(http://programming4.us/multimedia/3296.aspx) but i still dont find how it is calculated by the engine: my geo lod is around 130m* 12m* 20m(height) i loaded some binarized p3d (gnat OHP.p3d from arma2) in o2 and i saw a bounding BOX with dimensions similar to my geo lod maximums then a named property : -sphere: 67.65435

how the heck this sphere is calculated or what it is, my model is a mlod right now and i need to test the damage resistance for weapons with a hit of 300 and more? is the bounding sphere calculated AFTER the binarization? and if yes how can i pre-calculate it for trial and error with the weapons testing?

PS

i use crewVulnerable=0; (thats how you should do it), otherwise, like ALL the previous ship addons, even the rifleman shoot at them, in mine on the smaller one(hamina-class, 55m geolod lenght) only the harpoons and the front guns with over 350 hit shoot at it(very happy it works by default)

thanks for help

Edited by freesets

Share this post


Link to post
Share on other sites

what exactly do you want to achieve/change? you dont need to worry about "bounding spheres" when creating fire geometry/ geometry for models

Share this post


Link to post
Share on other sites
what exactly do you want to achieve/change? you dont need to worry about "bounding spheres" when creating fire geometry/ geometry for models

its very important when you want the ai units to target the vehicle only and not try to kill the crew, after you force the command: crewVulnerable=0;

if you put crewVulnerable=0;, the ai shoot at you with weapons that depend on your armor and VEHICLE strenght ONLY(trg radius is important in here), so in my case for 140m russian destroyer they(ai) only shoot with the harpoon with: hit=3000, indirecthit=1500, indhitradius=15. they dont use anything with a lower hit than hit=2140(value i obtain from testing by upping the hit of a test weapon in this case a shell class weapon).

now if i put crewVulnerable=1; they shoot with the front gun of another ship, the ciws, the m2 deck guns, the AA missiles and MAYBE the harpoons. the land/air units use machineguns and rifles mostly against my ship(and the other ships made by other addons makers). well no ai should use the coax/m2 gun against a destroyer when he sits in a tank.

my smaller ship(55m hamina) with crewVulnerable=0; work perfectly well: other ships shoot at it with the front gun(min hit=350; ) and harpoons and granit antiship missiles, the land/air units use rockets, missiles, rpg, tank shells(not mg) and tow missiles. the infantry/helo/planes dont fire a single bullet at the hamina from the rifle/mg/gau12, and it should be that way. in real life you dont engage a warboat with a mg or a rifle, you use the big guns.

so here comes my need of the damage resistance and the bounding sphere which radius is used for its calculation. i want to make my big ship damageable from any weapons with a hit bigger than 200-300 hit value, not 2140 as it is fixed no matter how i change the damageresistance value in config.cpp for the MLOD(i didnt binarize it yet) used to test. maybe i need to binarize it then try again??

for now my geolod is used for firegeo as well. maybe if i put a small block of 50-60m in the geolod and use my actual geolod as firegeolod it should do the trick but the ship will have weird collisions issues in front and back(walk through).

in directx documents they say that the bounding sphere is calculated from the farthest vertice of the model, in this case my geolod, and its visually understandable like the leonardo da-vinci circle around the man.

PS my config.cpp inheritance tree:

class CfgVehicles

{

class AllVehicles;

class Ship: AllVehicles

{

class NewTurret;

class Turrets;

};

class MY_Boat: Ship

{

the usual stuff

damageResistance=0.000238; //my last attempt

};

Edited by freesets
gramar and new info

Share this post


Link to post
Share on other sites

have you tried changing armor value (i'm talking about the one in the main config, not the values in the hitpoint classes) ?

According to the Biki tank config guidelines for A3:

Use armor to represent overall thickness of vehicle as seen by AI units, and armorStructural to finetune damage received.

Pretty vague though, more detailed information how AI handles this stuff would be handy...

Also, i can only suggest making a proper FireGeometry LOD with different hitpoint classes... not that it would really help with the AI issue though.

In the VBS tutorial it's mentioned that it's the objectradius (presumably the largest dimension of your geometry LOD divided by 2) that gets multiplied

damageResistance = (hit damage ^ 2) / armor config * (0.27 / object radius)^2

https://resources.bisimulations.com/w/index.php?title=Damage_Modeling:_Objects#armor

Edited by Fennek

Share this post


Link to post
Share on other sites
have you tried changing armor value (i'm talking about the one in the main config, not the values in the hitpoint classes) ?

According to the Biki tank config guidelines for A3:

Pretty vague though, more detailed information how AI handles this stuff would be handy...

Also, i can only suggest making a proper FireGeometry LOD with different hitpoint classes... not that it would really help with the AI issue though.

In the VBS tutorial it's mentioned that it's the objectradius (presumably the largest dimension of your geometry LOD divided by 2) that gets multiplied

damageResistance = (hit damage ^ 2) / armor config * (0.27 / object radius)^2

https://resources.bisimulations.com/w/index.php?title=Damage_Modeling:_Objects#armor

sadly i already did those, but like you said a liitle info from bis on how the ai target x, y, z stuff will be huge.

it solved itself the moment i added the model.cfg with the first turret anim and gunner. when i tested my models, i just put them in-game as ships with only a driver and no anims/model.cfg to see how it floats/move, then i put it against some oppfor units, but it wasnt perfectly binarized by the game. somehow i think even if there is no error reported in the rpt file, the engine don't binarize the addon propely if you use a mlod as a test model ingame. now i just played around with damageresistance value and set the rough value for something above 350-400 hit in ammo.

the golden rule(i think) is to put at least 1 anim or a very basic model.cfg(even if it has no anims) and have the name of the model in it, then later add the skeletons and anims to it.

PS when you said largest dimension, does this mean the entire geo lod(multiple components) or the biggest component in that geo lod.

geo lod is full of mysteries too: ex: i had 1 single component(will be used as physx lod) in my first try then the ship floated too high, then i split it into 5 component then somehow with the same mass it floated just perfect!!! all those test were done in arma2--> its easier to practice there then port it to a3 later.

Edited by freesets
add info

Share this post


Link to post
Share on other sites

well if you want to use A3 physx you need a buoyancy LOD which is solely responsible for floating... so its easier i'd argue.

If you look at the formulas in the VBS tutorial, provided they are still accurate, it looks as if you could calculate the bounding sphere size from damage you take ingame

structDamage = damage^2/(armorStructural*actualStrength)

Using armorstructural=1, and

actualStrength = (0.27^2 /(armor * object radius^2))

So in theory you get

radius = sqrt [(0.27^2)*structDamage / (armor * damage) ]

so if you can determine structDamage and damage for a single case you have the radius... i'm still totally confused by the names used -.-"

PS when you said largest dimension, does this mean the entire geo lod(multiple components) or the biggest component in that geo lod.

all components together. Game engines often do this bounding sphere thing for calculating collision and whatnot automatically (unfortunately without chance to manually correct it)

Edited by Fennek

Share this post


Link to post
Share on other sites

thanks fennek

as for the damageResistance i found a quicker way to do it. i use a bunch of test weapons with definite value of what i want it to hit it and in around 10 tries i have the right value with an acuracy of 3-4 hit values. what i did is let it first on default then decrease it then slightly increasing it...like the army do with blind artillery fire shoot 1 round farther another one before then decrease until its a direct hit.

as for the buyoance lod i remember reading into the shipbuilding wiki ( https://community.bistudio.com/wiki/Arma_3_Ships_Config_Guidelines ) or somewhere else that in the sample there is a speed boat with some blocks on this lod that can be moved...i downloaded the samples last week there is no speedboat like in the picture ...do you know where i can get that sample model?

picture:

400px-mkv_bouy_lod.PNG

400px-mkv_physx_lod.PNG

the samples i have is the rubber boat not this one, are there samples depending on where you live(geo filters in steam)

i will first make my boats for arma 2 then i will upgrade the models to a3 level while keeping the a2 alive as well. i just figure out(last week) how to have REAL vls missiles without ANY script, so be sure i will keep a2 upcoming version alive since my discovery work(already tested) in arma 1 and 2 perfectly. i might even bet that even ofp can support it but its just limited to 1 turret.

Edited by freesets
addit

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
Sign in to follow this  

×