Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Example of Damage to Model

  1. #1

    Example of Damage to Model

    THIS example is an OTT example and should not be seen as a good end product use section counts sparingly , many of these can cause lag , pls be sensible and create strategic damage like holes in tunnel roofs for rescues etc
    It will also work on vehicles to a degree too , but better use deform animation instead

    I wont have much time now or as much as i would like to play and mess with this game ,this is a brief example of something i made when i read about destruction in some other thread and i leave here for others to maybe learn from it.

    Tools i Used
    BI tools http://community.bistudio.com/wiki/BI_Tools_2
    C4D (demo 40 days)http://www.maxon.net/downloads/demo-version.html
    Nitroman4d xbreaker scripts http://nitro4d.com/blog/freebie/xbreaker/

    Overview of the download
    In the downlaod there is a Binarised PBO and a folder containing the unbinarised model and textures, the idea of the example is to show how you can Hide damage on a part of the model and how you can (A) script a particle effect to the effected area and or (B) config an engine based particle effect to the area affected.


    [B]Media/B]
    A small video follows to show (badly) a use for such an addon

    for visitor please use the LAND_ prefix in usual way and remember script wont init from that model make a module to define the handle your calling there
    HOW WHAT WHERE Model
    I presume you already know how to make addons altho with this downlaod and this description you can at least make walls for yourself.
    So make a box object in C4D and run the xbreaker script , ideally you probably only want the center to break so maybe choose 5 pieces for the script to break it into
    then only name and config the sections you want to be destroyed.
    Export the model as 3ds and import to the o2 , if you keep the name properties Piece_0-_x in the model then you can recycle my configs and cpp
    most of the breaks will allow you to create your geometry very easy bu copy and paste and component convex hull .
    finish in the normal way ( see whats in the download mlod) and your done.you could always use this on an existing wall in your own house model and not create a box.
    The Example is an OTT example you would never need 40 +pieces in such an object , i did it to create a template more than anything.

    HOW WHAT WHERE CPPand cfg

    in the Model.cfg we define the Hide animation like this

    first we define the bone
    Code:
    "piece_1","",
    then we define what we want to do with the bone , in this case Hide it.

    Code:
        class Animations
       {
        class hit1
        {
        				type="hide";
    				source="hit1";
    				selection="piece_1";
                                    minValue = 0;
                                    maxValue = 1;
                                   minphase = 0;
                                   maxphase =1;
    hideValue = 0.9;
    
        };
    this tells the engine to Hide piece_1 when the value of Hit1 is at 0.9

    the way we define Hit1 THE SOURCE is in the CPP like so :

    Code:
         class Hitpoints {
    			class Hit1 {
    				armor = 0.05;
    				material = -1;
    				name = "piece_1";
    				visual = "";
    			passThrough = 0.1;
    				convexComponent = "piece_1";
    The armor = 0.05 is a refference to the Hipotint being .05% of the total armor of the class
    The convex component will also hide the Geometry (may not be necessary to name it as the geo lod has it name same anyway)
    Visual is old way when Material had a number in 02 on texture and then texture will change so obsolete for this.
    Mess with the armor to suit you , geometry weight of model is also another factor here, however the biggest thing when defining here is to remember BIS use a Hit factor radius including an indirect hit radisu , this may affect your results if you set things too light or too heavy , it will certainly effect the precision in many cases i believe

    We can add aditonal Config Particles by adding the following to the hipoint

    Code:
       class Hit1 {
    				armor = 0.05;
    				material = -1;
    				name = "piece_1";
    				visual = "";
    			passThrough = 0.1;
    				convexComponent = "piece_1";
    				class DestructionEffects {
    			
    					class Dust {
    						simulation = "particles";
    						type = "ExploRocks";
    						position = "piece_1";
    						intensity = 0.1;
    						interval = 0.01;
    						lifeTime = 0.01;
    						size = 5;
    					};
    					
    					class Dust2 : Dust {
    						simulation = "particles";
    						type = "ExploRocks";
    						position = "piece_1";
    						intensity = 0.1;
    						interval = 0.01;
    						lifeTime = 0.01;
    						size = 3;
    					};
    					
    					class Dust3 : Dust {
    						simulation = "particles";
    						type = "ExploRocksDark";
    						position = "piece_1";
    						intensity = 0.1;
    						interval = 0.01;
    						lifeTime = 0.01;
    						size = 1;
    					};
    				};
    				
    			};
    Now the model will have particle effect at the point described in position = "piece_1";
    to achieve this perfect copy and paste the Piece_1 from the geo lod and place it in the Memory lod and press Shift + D , this will create
    one point at the center , sometimes because we have hiddeln Piece_1 the particle can fail so maybe rename this point in memory lod and CPP to piece_1D and position = "piece_1D";


    you can also make a ruin model for each piece if you wish by adding the following ( i have no time to show how to config the class ruin sorry, however to config in hitpoint
    its like this :

    Code:
    			     class Hit1 {
    				armor = 0.05;
    				material = -1;
    				name = "piece_1";
    				visual = "";
    			passThrough = 0.1;
    				convexComponent = "piece_1";
    				[B]class DestructionEffects {
    			
    					class Ruin1
    				{
    					simulation = "ruin";
    					type = "thromp_example\Ruins\thromp_example_piece_1_Ruins";
    					position = "dampiece_1";
    					intensity = 1;
    					interval = 1;
    					lifeTime = 1;
    				};
    					class Dust {
    						simulation = "particles";
    						type = "ExploRocks";
    						position = "piece_1";
    						intensity = 0.1;
    						interval = 0.01;
    						lifeTime = 0.01;
    						size = 5;
    					};
    					
    					class Dust2 : Dust {
    						simulation = "particles";
    						type = "ExploRocks";
    						position = "piece_1";
    						intensity = 0.1;
    						interval = 0.01;
    						lifeTime = 0.01;
    						size = 3;
    					};
    					
    					class Dust3 : Dust {
    						simulation = "particles";
    						type = "ExploRocksDark";
    						position = "piece_1";
    						intensity = 0.1;
    						interval = 0.01;
    						lifeTime = 0.01;
    						size = 1;
    					};
    				};
    HOW WHAT WHERE Scripted Damage

    As well as cpp effect there are many ways to script it , for normal use or cutscene

    For adding particles to the model when its damaged (becareful remember this is no matter what damage , not when damaged to 0.9 of 0.05% like defined in the model.cfg and the CPP)

    add an eventhandler that is called when damaged simple as so ( shown in example download)

    Code:
      class Eventhandlers {
    			init = "_scr = _this execVM ""\thromp_example\scripts\init.sqf"";";
    			dammaged = "_this call thromp_exampledebris;";
    		};

    Init could simply define the thromp_exampledebris and this isnt efficient to init same for every model , pls make a module or something for many models
    you can just use a format script for cutscene and use for TOH selectionposdamage .



    well i hope you have fun and pls leave any questions , i may have time to come here to answer them but until then :

    I hope you have fun and i hope i haven't made your life worse

    Thromp


    the download is in the spoiler
    Spoiler:


    IMPORTANT
    Please make sure if you do make something change folder names and paths and especially dont use Thromp_ anywhere make a TAG for you
    Last edited by Thromp; Jan 12 2012 at 06:32.

  2. #2
    Awesome proof of concept!

  3. #3
    First Lieutenant PuFu's Avatar
    Join Date
    Feb 17 2007
    Location
    unallocated
    Posts
    5,381
    hey Thromp, nicely explained proof of concept, and nice damage effect
    a few issues and questions:
    1. the link you provided via mediafire is NOT working.
    2. i would add a readme.txt to the archive, so that it can be hosted elsewhere as well (thinking about armastack, ofpec, etc...)

    other than that,

    PS:
    for you max users out there:
    1. you can do use the procutter tool (boolean, i personally don't really recommend)
    2. or the Fracture Voronoi Script 1.1 to create the individual pieces

    Spoiler:

  4. #4
    Can someone make sure the DEV team at Arma 3 see this? perhaps they can tweak it in time for Arma 3?

  5. #5
    First Sergeant
    Join Date
    Aug 26 2011
    Location
    lunar 5
    Posts
    849
    Author of the Thread
    Thanks Pufu
    I'll see about readme and link fixed

  6. #6
    This is extremely interesting, its a shame I am no good at modelling things.

    Very good work keep it up! (and maybe BIS will hire you at some point)
    My custom missions:
    TOH - COOP5 Operation Pegasus http://forums.bistudio.com/showthrea...ration-Pegasus
    TOH - COOP Convoy attack (both Hinds and stock versions) http://forums.bistudio.com/showthrea...-Convoy-Attack
    A2CO Multi-mission Template http://forums.bistudio.com/showthrea...48#post2182048
    Basic Vehicle respawn script (A3 Alpha) http://forums.bistudio.com/showthrea...72#post2389272

    [EVO] Multigaming Clan is recuiting at www.evoclan.net

  7. #7
    That’s a good thesis and example.

    I did investigate this for my precast concrete pipes, but as noted it rapidly becomes perversely costly geometry wise without including propagation across both visible & invisible/indirectly seen LOD’s or “lag” and like said is perhaps best suited to key small static areas of a larger modal – like e.g. locked/non opening door/s to gain access or like said specific area of a wall gain access to something.

    e.g. if 12 triangle wall become 400+ triangles, imagine if your modal is 500+ triangles for lod1 anyway your talking 10000+ triangles or more if its sectioned into components, you also run into problems with movable objects with many multiple components in contact with the ground causing weird effects with the physics engine like objects “vibrating” and thus moving across the ground or doing crazy things if time is speeded up, even default TKoH objects can do the same crazy things if time is speeded up or ropes attached or they are moved from their starting location or they are shot etc.

    So I am just making “ruins/wrecks” that just get swapped at X damage given its significantly cheaper geometry wise across all visible and indirect (e.g. shadow) LOD’s even if it is old hat.

  8. #8
    First Sergeant
    Join Date
    Aug 26 2011
    Location
    lunar 5
    Posts
    849
    Author of the Thread
    if 12 triangle wall become 400+ triangles
    Exactly thats why i think its important if used strategically it can make for good gameplay .
    in terms of TOH it would be nice for breaking into big tunnels to lower people in to recue etc.

    But your example which is good to show extreme , you wont need such polies in reality , you can make a wall with 2 sections only for a cost of 20 triangles for a basic U shaped hole
    A pipe also can have a nice star shape piece cut out or even split in half for less than 60 triangle .

    So I am just making “ruins/wrecks” that just get swapped at X damage given its significantly cheaper geometry wise across all visible and indirect (e.g. shadow) LOD’s even if it is old hat.
    i have described above how you can do that with ruin class , it also adds nice continual gameplay and with other unproven thepry Dependanton _x (seen in an a2 config i cant find )you wont have floating pieces
    anyway i hope people experiment i have no time anymore .
    i shall place tonight tomorrow a more MP friendly RTM example ( pls be aware my keyframe patience is low so it will look bad lol but an example will be there for good modelers
    Last edited by Thromp; Jan 12 2012 at 16:56.

  9. #9
    So is this feasible to implement for all the neighborhood backyard walls in a map like Shapur? Can you make it so walls take a ton of punishment from small arms but fall apart like that when hit by HMGs? Can HEAT rounds make small holes while pure HE blasts away whole sections?
    My Chernarussian Civil War SP missions:
    Enfilade Ambush
    Autumn Siege

  10. #10
    First Sergeant
    Join Date
    Aug 26 2011
    Location
    lunar 5
    Posts
    849
    Author of the Thread
    it is feesable as long as its done efficiently , like the header says this is an Ott example ,
    i guess one way to find out is to see how many of the example walls you can put on a map and play and then * by about 35 because an efficient wall would be 35 times less poly and selection heavy than the example

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •