Building A CK Vehicle Damage Model
#1

This tutorial will be broken up into a few parts.
There will be the base vehicle / plane and what goes into it and there will be the damage model and all that is different from the base VSF vehicle / plane to a CK vehicle / plane.

First this tutorial will be done under the assumption that you all ready know how to build and texture a 3D model as we will not be getting into that here.

Vehicle Simulator Framework = VSF is the mother game and graphic engine for Canvas Knights so most things that are on the VSF home page for building a vehicle / plane will apply to Canvas Knights and can be found here; http://www.hangsim.com/vsf/plane.php

There is two kinds of models you can build for Canvas Knights one is on and off line and the other is just for off line, I will explain,

If you are going to build a model that will be used in online game then that base 3D model = the model that appeared first in game, should be no more then 40,000 ploys better if it was a little less.

If you are going to build a model that will be used just for off line game then you can have as many ploys as you want.

This game and graphic engine was tested with a million ploy 3D model of the ship Bismarck back in 2009 when it was developed, it was done on a XP PC, 1 core AMD 3.5 with 2 gigs ram and a high end vid card of the day back in 2009 and the game and graphics engine rendered a stormy scene and not only one Bismarck but two in the scene at 19 to 22 FPS and VSF models do not have any LODs, here is a screen shot I kept of it from back then;
You might need to click on the photo to enlarge;
[Image: Biz.jpg]

--------------------------------------------------------------------------
Tools you will need.

3D program, that you can move your X,Y,Z axes and do frame animation and can make a .3ds and a .ase, like 3D max.
Paint program.
Deep Exploration, for exporting to X file as it works for CK damage model the best.

CK base model = the model that appeared first in game.
This model will incorporate everything expect for the guns / bombs and pilot.
You can cut up this model any way you like, BUT keep in mind that a FPS friendly base model is best kept at 45 groups or less within the base model, when you go over 45 groups you will start to cut into your FPS.

There are a few part names that will effect the flight model when they take on damage they are;

aileronr, aileronl, ailerontr, ailerontl
rudderr, rudderl, rudderm
elevatorr, elevatorl, elevatorm
wingr, wingl
engine
pilot

Now lets say I was going to cut the top wing into 5 parts this is how I would name the parts.

You might need to click on the photo to enlarge;
[Image: WINGCUTNAMES.jpg]

Now you see a ( wingcnt ) this part will take on damage but will not effect the flight model where it does not have a ( R or L ) after wing the other parts will effect the flight model and note the names after ( R or L ) like ( wingrtmid ) this tells the damage model its a wingr the rest of it tells me its the top middle, you can use any name after the real parts name, just make sure they are small letters and no spaces or underscores, dots or hyphens or numbers.

--------------------------------------------------------------------------------------

There are a few part names that are not in VSF but are in CK I will tell you what they are and what they do.

Part name............ Damage it dose.
engine = 4 stages of damage and when it gets to the end of one stage of damage it louses 25 percent power and so on till it stops at the end of stage 4.

fuel = 4 stages of damage and when it gets to the end of one stage of damage it will start to louse fuel and so on and at the end of stage 4 it will explode the whole plane.

pilot = 4 stages of damage and when it gets to the end of one stage of damage you will start to see red and tunnel vision and so on and at the end of stage 4 you will be dead and louse control of the plane / vehicle.

------------------------------------------------------------------------------------

When you have your vehicle / plane in your 3D program you need to define parts that you will be adding effects to later in the damage CFG like smoke, fire, explode, the way that is done so the game engine knows where to put them effects is by putting the X,Y,Z axes on them parts as shown in the photo below.

[Image: PARTNAMESEFCT.jpg]

-------------------------------------------------------------------------------------

Here are some things to go by and remember;

It is best not to damage a landing gear, wheels or floats on a vehicle / plane and this is why, the hard points that make a vehicle / plane sit on the ground will not move when it is damaged, example; I make the right wheel come off a plane and bend up the gear, it looks great BUT the plane will still sit on the ground like nothing happened.

All part names have to be the same from the base model all the way through the last damage model, like this, if I was to give the front of the rudder the part that don't move the name ( frud ) then it must be that same name all the way through all the sequence of all the models for this vehicle / plane.

Any part or parts of a vehicle / plane can be in the damage model, the thing to remember is this, the parts you would like to stay on the vehicle / plane but take on damage need to stop at damage 3 stage, any parts you would like to fly off the vehicle / plane need to go to damage 4 stage.

You can use any of these texture formats with the CK game;
.bmp
.png
.dds
.tif
.tag
.jpg

Though we have found through much testing that .jpg works the best with this games graphics engine, it loads the fastest.
Do not exceed 2048 by 2048 for the main texture of the vehicle / plane all other supporting textures should be 1024 by 1024 or less.
Try to keep all textures square like this; 256 by 256 or 512 by 512 or 1024 by 1024 and so on.

The damage model will move for one stage to another a few different ways they are;

Colliding
Stress
Bullet impact
Bomb impact
Fuel exploding

Some of these above will cause total damage failure and others will be accumulated damage.

------------------------------------------------------------------------------

Ok now we are going to get into this tutorial, I am going to be using the Pfalz D3A as a example and this plane will be a add-on download to the mod-able CK game.

you might need to click on the photo to enlarge;
[Image: PD3ADAMGA.jpg]

This is the base plane = the model that appeared first in game, this need to be all setup in game first with instruments, guns, gun flash, flight model, hard points and detection points before you can continue on to the damage model, all the setup for a base vehicle can be found here using Vehicle Simulator then once done bring the whole vehicle / plane folder back over to CK and add its name into one of the two ini's allied or axes in the vehicles folder of CK; http://www.hangsim.com/vsf/plane.php

Note that the cockpit is part of the base vehicle / plane, so what you see on the out side looking in is what you see when your in the cockpit.

you might need to click on the photo to enlarge;
[Image: PD3ADAMGB.jpg]

Also note that the guns are not on the base vehicle / plane as they are drawn in game from another folder within that vehicles / planes folder called weapons and in doing this we are able to use more polys on the base vehicle / plane and even make the guns very high in ploys as the game engine looks at them as another model being drawn from another folder.

you might need to click on the photo to enlarge;
[Image: PD3ADAMGC.jpg]
[Image: PD3AGUNS.jpg]

--------------------------------------------------------------------

Once you have the base plane in game and all working just the way you want it then you need to go back to the 3DS file that you used to put the plane into game as this is the file that all the damage and damage files will be made from as everything needs to be exactly in the same place as the base vehicle / plane.

We will first start with the damage0.x file, this is the hit box file it contains all the major parts that will take on damage it is best to keep this file at no more then 2,500 polys better is less then that.

What I have done here is to go back to the base plane and stripped it of all its detail and anything that is not needed right down to a bear airframe, also note that I just used box's for the engine and prop giving them the correct names and putting them in the exact place and there is no texture for this damage0 model so remove all textures.

you might need to click on the photo to enlarge;
[Image: PD3ADAMGD.jpg]
[Image: PD3ADAMGE.jpg]

This is to show the different groups on how the model is cut up from the base model all the way through all damage models.

you might need to click on the photo to enlarge;
[Image: PD3ADAMGF.jpg]

-----------------------------------------------------------------------------------

Now we make a X file of damage0 3ds in Deep Exploration.
when you look at the X file that was made in Deep Exploration you will see it put all parts into folders and if you open the folders you will see the parts BUT they all have a #1 at the end of each part and we need to remove the #1 on each part so the game engine known the real part name.

[Image: Damage0A.jpg]

In your tools folder is a app called ( No_Ones ) copy that app right into the vehicle / planes folder hit select file and pick the damage0.x file and click open.

[Image: Damage0B.jpg]

Now you will see you have a ( damage0.x and a damage0_out.x ) delete the old damage0.x and take out the underscore and out = ( _out ) so now you just have a new damage0.x file

[Image: Damage0C.jpg]
[Image: Damage0D.jpg]

Now go look in Deep Exploration at you new damage0.x file and you will see the #1's have been removed from the part names.

[Image: Damage0E.jpg]

Now its time to test your damage0 file in game, go to free flight pick the Pfalz_D3A start single player and take off with the Pfalz and smash it into the ground, the game engine don't know what to do with the parts yet as the damage cfg and other 4 damage model files are not there yet so it just takes all parts and throws them every where, but this show you that your damage0 is working.

[Image: Damage0F.jpg]

Now we get on to making the damage model.
------------------------------------------------------------------------------

Now go to the 3D model that you used to put the base vehicle / plane = the model that appeared first in game and remove all parts that will not be taking on damage, remember do not move any parts as they need to be in the exact same place as the base vehicle / plane, I also do one more step and that is to separate parts like the full top wing, bottom wing, front body, back body, elevator, rudder and prop, this is so I don't have all parts in one 3D file and it makes it easy to work with them.

[Image: DamagePlaneA.jpg]
[Image: DamagePlaneB.jpg]

-------------------------------------------------------------------------------------

Up to this point making a CK damage model is the same, BUT now here is where you need to decide what kind of damage model you want to make there are 3 kinds that can be made they are;

1, Skin damage only.
2, Skin and some light 3D work.
3, 3D and some light skin work.

For me being a 3D guy I have done all CK stock planes as #3 and this tutorial will be done as the #3 way it is the more time consuming way of making a damage model but I think it has a better over all look in game, at some point I will try to get a full tutorial done for # 1 & 2 way of making a damage model as well.

------------------------------------------------------------------------------

First you need to make a copy of the vehicle's / plane's texture in this case it is called ( PfalzD3A ) and you need to take out the ( A ) and add a ( D ) at the end of the copy one so it says ( PfalzD3D ) it will be this texture that will be assigned through your 3D program to all damaged parts, this is so we can add textured bullet holes and smoke damage to this texture, so in game your vehicle / plane will be working from both textures, what is not damaged will be drawn from the PfalzD3A texture and what is damaged will be drawn from the PfalzD3D texture, also note that I have separated the parts but left them in the exact same place as they where in and I will start with the top wing damage parts first.

[Image: PFALZD3ADJPG.jpg]
[Image: TOPWINGND.jpg]

-----------------------------------------------------------------------------

Now you need to make a frame under the outer skin and it needs to be in 2 parts just like the parts to the wing that is under and it all needs to fit under the outer skin.

In this photo I have removed some of the outer skin so you can see the frames under and note they are in 2 groups ( RTIPFRAME ) and ( RMIDFRAME ) now you duplicate these and put them on the other side as seen in the full colour photo below, also make a aileron frame and do the same.

[Image: PD3TWFRAMEA.jpg]
[Image: PD3TWFRAMEB.jpg]

------------------------------------------------------------------------------------

Make a copy of your vehicle / plane damage texture in this case it is PfalzD3D, note I have one called ( Good 1 PfalzD3D ) and now the copy called PfalzD3D.

[Image: TEXTUREA.jpg]

Then go to your 3D program where you can see the part mapped on the texture and take a photo of it, bring the photo into your paint program and select the parts plus find a part that you can use as a key, then copy it and place it right on to the damage texture using the key as a guide then save it.

[Image: TEXTUREB.jpg]
[Image: TEXTUREC.jpg]
[Image: TEXTURED.jpg]

Then go back to your 3D part and make a top and bottom out of it again.

[Image: TEXTUREE.jpg]

Then take the top and add some vertex to it, then you will note they are below the part you need to bring them up so they just show above the part.

[Image: TEXTUREF.jpg]
[Image: TEXTUREG.jpg]
[Image: TEXTUREH.jpg]

Now delete the faces that are around the new vertex and make new faces using the new vertex, then re-group the part and remap it right on the lines of where it should be on the texture, this is why we put the part lines on the texture so you can map the part right back in the exact same place.

[Image: TEXTUREI.jpg]
[Image: TEXTUREJ.jpg]
[Image: TEXTUREK.jpg]

Now make a copy of that #1 part and call it #2 and do the same process but make it different then part #1, and where this part will fly off the plane we need 4 top parts in all and all being a little different then the one before it, so you will end up with 1-4 top parts, then do the same process for the bottom of this part.

[Image: TEXTUREL.jpg]
[Image: TEXTUREM.jpg]
[Image: TEXTUREN.jpg]

Its all built right on top of one another starting with the good part and copying the part before it for the next part and making the next part a little different.

----------------------------------------------------------------------

Now make a duplicate of that parts frame, on damage stage 1 most times I don't damage the frame but that's up to you, then group 1Top and 1 Bottom and the duplicate frame together and call the part in this case ( 1wingrtmid )

[Image: WNGMIDDAMA.jpg]
[Image: WNGMIDDAMB.jpg]

Now make another duplicate of that parts frame and this one is for the damage 2 stage and at this stage I start to brake up the frame a little, when done I make a copy of that broken frame for the next stage.

[Image: WNGMIDDAMC.jpg]

Now we go to stage 3 damage and I brake up the frame a little more and even delete parts of it then make a copy of it for the next stage.

[Image: WNGMIDDAMD.jpg]

Now we get to stage 4 damage and I brake up the frame even more and even delete more parts of it but we do not need to make a copy as there is no damage 5 stage.

[Image: WNGMIDDAME.jpg]

Now I take the good frame for that part that is left over and the center wing and damage stage 4 and I look to see what I want to delete from that good frame, once I have what I want left I adjust it then group it to the center wing and have part name ( 1wingtcnt )

[Image: WNGMIDDAMF.jpg]
[Image: WNGMIDDAMG.jpg]
[Image: WNGMIDDAMH.jpg]

Now you see all 4 damage mid right wing and center wing all built on top of one another and now you do the same process through out all the damage parts of the damage model.

[Image: WNGMIDDAMI.jpg]

I will finish this tutorial using some other planes that are already done as it will take me about a weeks time to compleat the damage model for the Pfalz D3A and I wish to get this tutorial done before that.

-------------------------------------------------------------------------------------

Once you have all your parts done like top wing, bottom wing, rudder and so on, you will see in each 3DS file you have all 3 to 4 stages of damage.

[Image: DONEA.jpg]

You now need to take each stage 1,2,3 and 4 from each file and reassemble back into one 3DS file of their own so you will have all the damage stage #1 parts all in one file and so on for all 4 stages of damage, then you need to take out the numbers in front of the parts and give the 3DS file the correct file names like ( damage1.3ds )( damage2.3ds ) and so on for all 4 damage files.

[Image: DONEB.jpg]
[Image: DONEC.jpg]
[Image: DONED.jpg]
[Image: DONEF.jpg]

------------------------------------------------------------------------------------

Now we need to put in all X,Y,Z axes points and they need to be in the same place as the base model = the model that appeared first in game, this also includes engine, prop, fuel, oil any thing that is in a damage file that is also in the base model that has a X,Y,Z point given to it.

This is the base model with all its pivot points X,Y,Z

[Image: PIVETA.jpg]

I will use the top left aileron as a example.

[Image: PIVETB.jpg]

What I do is to make small round cylinders as hinges for the ailerons, elevators and rudders then I pick one for each part and place the pivot point to it and use the same one on each damage model as in the base model in the exact same place.

Base model;
[Image: PIVETC.jpg]

Damage 1 model;
[Image: PIVETD.jpg]

Damage 2 model;
[Image: PIVETE.jpg]

Damage 3 model;
[Image: PIVETF.jpg]

Damage 4 model; = Fly off plane parts.
[Image: PIVETG.jpg]

Then save a 3DS of each damage model with all X,Y,Z axes points and bring it into Deep Exploration and make a X file of each damage model with the correct file names they are;

damage1.x
damage2.x
damage3.x
damage4.x

Now take the damage 1- 4 X files and the good damage texture without the lines on it and put them into your vehicle / plane folder and run the damage files through the ( No_Ones ) app like you did above for the damage0 hitbox file same process.

------------------------------------------------------------------------------

Now its time to test your damage model in game, there is a CK_D_APP exe in your game folder, this exe will be part of the full game so it needs a key to run for unlimited time, but you can skip activation and go on to demo and get 5 minutes time, if its not enough time just restart it and pick up where you left off.

[Image: DAPPH.jpg]

Now once the exe is started go to ( free flight ) pick the plane you wish to test and start ( Single Player ) once in game hit D key on your keyboard and up will pop the damage tester, always use damage0 model for testing do not switch damage models or you may not get correct results.

[Image: DAPPA.jpg]

You can move the damage tester around and even resize it, I will be using aileronr for this example, you can pick any part that shows up in the list.

[Image: DAPPB.jpg]

Click on the ( Break Part ) button, where there is no damage cfg at this time it will just jump with 1 click to damage #1.

[Image: DAPPC.jpg]

Repeat this process 4 more times and on the 5th time this part being a part that will come off the plane will do so.

[Image: DAPPD.jpg]
[Image: DAPPE.jpg]
[Image: DAPPF.jpg]
[Image: DAPPG.jpg]

Parts that come off the plane will hang around for about 15 seconds then disappear.

--------------------------------------------------------------------------------

Now its time for the damage cfg and to explain how it works.

I will work with the right top wing, most top wings are in 3 parts each side, some could be more or even less but for the most are in 3 parts they are;

Top right wing mid = in the case of this plane, wingrtm
Top right wing tip = in the case of this plane, wingrtt
Top right wing aileron = aileronr

Now if the mid part of the right wing was to come off first it should take the tip and aileron with it and how we tell the game engine to do this is by using the word ( contains ) like this;

[Image: DCFGA.jpg]

This tells the game engine that ( wingrtm contains wingrtt ) and that ( wingrtm contains aileronr ) so when the top right mid wing comes off it will take the tip and aileron with it as seen below.

[Image: DCFGAA.jpg]

This tells the game engine that ( wingrtt contains aileronr ) so when the top right tip wing comes off it will take the aileron with it and the mid wing stays on as seen below.

[Image: DCFGB.jpg]
[Image: DCFGBB.jpg]

A damage model will move from one damage model to another damage model from the ways described way above in this tutorial and one being by bullet impact but bullet impact needs to be set in the damage cfg and you can use any number from 1 to 50 = shots to move the damage model to the next one and you can add effects to it, I normally add effects only to the engine, radiator, fuel and oil and I will use as the example the engine.

This tells the game engine that the engine will take 3 shots to move to the next damage model, it also tells the game engine that on damage 1 there will be smoke and on damage 2 there will be smoke and on damage 3 there will be fire and on damage 4 there will be fire and a explosion.

Damage cfg for engine;
[Image: DCFGC.jpg]

Now we see it working in game;
[Image: DCFGC1.jpg]
I skipped damage 2 as its just more smoke.
[Image: DCFGC2.jpg]
[Image: DCFGC3.jpg]

This says to the game engine that;
[Image: DCFGD.jpg]

wingrtm will take 10 shots to move to the next damage model.
aileronr will take 15 shots to move to the next damage model.
elevatorr will take 30 shots to move to the next damage model.

And once you set the shots for each part it will take that many clicks using the damage tester to make the damage model move to the next one, think of the damage tester as a gun and each time you click the ( Break Part ) button you just gave that part 1 shot.

Once you have all that part shots settings done start up the CK beta 2 exe go to free flight and smash the plane into the ground a few times and try stressing it out even take it over to the other sides AA flack guns to see that all is working ok.

So now you have a good idea how the CK damage cfg works.

-------------------------------------------------------------------------------------

Now once you have all working just right go to your Vehicle Simulator folder and go to the tools folder and copy out the ( model_encoder ) to your plane folder.

[Image: MECODA.jpg]

Then click on ( Open Directory ) then pick the first model in line then click on open.

[Image: MECODB.jpg]

Then all your X file models will load to the left side, then click on ( Encode Files ) and the models will start to be encoded as XX files and will show up in the right side of the app and also in your model folder then just click the X to the top right of the model encoder to exit once done.

[Image: MECODC.jpg]
[Image: MECODD.jpg]

Now select all the un-encoded X files, the model encoder app, the no ones app and anything else that was used wile working on the model and delete that stuff from the model folder.

[Image: MECODE.jpg]

Now go to your damage texture and add in bullet holes, smoke up the front of the nose and anything else you might want to have on your damage texture.

[Image: MECODF.jpg]

Now make a folder inside you plane folder called ( skins ) and go inside that folder and make a folder called ( Default Skin ) if you have a void for people to paint your plane do the same for it as well or even any other skins you may have and you can name them anything you like.

[Image: MECODG.jpg]

Now open the default skin folder and add in the good plane texture, the damage texture and a photo of the plane in that skin, this is so when someone picks your plane in game they can see what it looks like in a preview window before going into game with it, also do the same for any other skins or void you may have for your plane.

[Image: MECODH.jpg]
[Image: MECODI.jpg]

That's it your done, now you can zip up your plane and give it out for download to the community. Big Grin

None of this is hard just time consuming.
Deutschmark Smile
Reply
#2

All Done!!! [Image: vil-super.gif]

Deutschmark
Reply
#3

DM,

Obviously this took some time to make this tutorial. The screenshots really help! Big Grin

Thank you for all your hard work! :Smile)


Clinton
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)