Custom cars all need a .WAM file. (Crush data file) Carmageddon uses the WAM file to calculate extra features that are not included in the cars .txt file. It determines the maximum deformation limits of the car’s mesh, the behaviour of separate object on flapping, smashing and detaching and the behaviour of texture changes upon impact.
First the WAM file needs to be reference in the txt file, found below the impact settings of the DRIVABLE STUFF;
... carname.WAM // crush data file (will be incorporated into this file) ...
The WAM file consists out of the following parts; 1.1. Minimum and maximum deformations 1.2. Bendabillity, snappability and driver position 1.3. Separate crush data entries 1.3.1. Softness 1.3.2. Crush type 184.108.40.206. boring 220.127.116.11. Flap 18.104.22.168. Detach 1.3.3. Smash data entries 22.214.171.124. Material identifier and texture 126.96.36.199. Number of levels 188.8.131.52. Trigger threshold 184.108.40.206. Possible sounds 220.127.116.11 Shrapnel count 18.104.22.168 Number of explosion groups 22.214.171.124 Slick Material 126.96.36.199 Number of noncars activated 188.8.131.52 Radius of side effect smashes 184.108.40.206 Room turn on code 220.127.116.11 Award code 1.4 Notes
1.1 Minimum and maximum deformations
The deformation of the car is done by moving vertices and surrounding vertices of the car mesh on the X, Y and Z axis. The maximum and minimum values of this movement can limited per axis. If you do not limit the deformation, the car can end up having VERY unrealistic shapes. Take a look at this horrible deformation caused by falling down to the ground without setting a ‘Y maxs’ entry;
There are six entries, two for each asix; 'X mins', ‘X maxs’, ‘Ymins’, ‘Ymaxs’, ‘Zmins’, and ‘Zmasx’. Each entry can hold up to two points, meaning it can set two limits. In the following image we take the car roof limiting as an example;
The first limit will only affect the roof points. This means however, that the points below limit 1 can still move freely and create ugly shapes. However, when using a second limit to control the hood and trunk points, the mesh can be fully controlled.
The front and back of the car are affected by respectively the Zmin and Zmax entry. Top and bottom by the Ymin and Ymax entry and the left and right by the Xmax and Xmin entrie.
The red box in the above images show the limits I used for the dd2 mod cars, to control the deformation. As you can see I limited the mesh to not deform beyond the wheel front and rear wheel axis. I also used two limits for the bottom of the car, to prevent the rear bumper from deforming up in the air.
1 // Number of 'X mins' entries. .13 1 // Number of 'X maxs' entries. -.13 2 // Number of 'Y mins' entries. 0.17 0.45 2 // Number of 'Y maxs' entries. .023 .045 1 // Number of 'Z mins' entries. .23 1 // Number of 'Z maxs' entries.
Note; the deformation limits are ignored by the ‘oh dear, bodywork trashed’ cheat of the game.
1.2 Bendabillity, snappability and driver position
Occasionally, the car will bend when undertaking heavy damage, such as explosions. The bending of the car is affected by the bendabillity factors and the point of bending by the y min and y max entry.
1.000000 // Bendability factor -0.064000 // Bend point Z min 0.152000 // Bend point Z max
The bendabillity factor is a chance factor; enlarging it will simply make the car bend more, instead of snapping. The car mesh will bend around a certain point in space upon the Z axis. The z min and z max values create the limits between which the bend point will occur. Personally I like to enlarge these values, since they create more realistic bending shapes.
The other possibility of mesh deformation is snapping, the car splits in half. This happens when driving into sharp building corners or thin poles.
Snapping of the car is affected by the snappability factor and the y split position
1.000000 // Snappability factor 0 // Y split position
The snappability factor is again a chance factor, enlarging it will ensure the car snaps quicker then bending. The meaning of the y split position is hard to tell. I have a feeling the value at least needs to be between the minimum and maximum y height of the car’s mesh in order to prevent carma 2 from crashing.
The driver position values do not seem to affect anything in game. Perhaps they influence the possibility of snapping. Some custom cars tend to crash when snapping, these values might cause the crash. Anyway, I always use the origin of the driver model for these values, just to be accurate.
1.3 separate crush data entries
This is the part of the WAM file that defines special behaviour for car parts. You can set detachables like bumpers flying of, flaps for doors and hoods and smash entries for smashing headlights and windows.
The section starts with the number of crush data entries. Car parts without a special behaviour do not have to be mentioned, so only add an entry for special car parts.
Each car part will start off with a simple piece of code;
PARTNAME // Actor normal // Softness boring // Crush type 0 // Number of 'Smash data' entries.
1.3.1 Softness soft //easily deformed
normal //normal deformation
hard //stiff, hard to deform
uncrushable //cannot be crushed
1.3.2 Crush type
There are three crush types that can be used by the game, each with their own settings needed.
18.104.22.168 boring crush type
The boring crush type is standard. It is a static part of the car, nothing special. I could write a lot about how boring this part of the wam file is, but I will not. It would make the tutorial a whole lot more boring, and we wouldn’t want that now would we? Boring boring boring.
boring //nothing special
Flaps are used for doors, hoods and trunks. Flaps have the option of being operative. The ‘flap doors’ button will trigger the flap to rotate 90 degrees, and pressed again the flap will fully close. Using the flap will require extra lines of code;
flap // used for doors, hood, trunk or other flaps 6 //rotation axis start point 9 //rotation axis end point 5 //closed state point 1 // 0 = open with ‘flap doors button’ / 1 = inoperative normal //ease of flapping. //(very_easy, easy, normal, dificult very_difficult) box //bounding box for the flap (box, sphere)
To select the right points for the flaps, you will have to go in point selection mode within plaything. Navigate to the flap and select the according vertices on the model you wish to be a flap. Be sure to select point on the right object. This can be made easier when using the explode object view (cntr +E)
The numbers 1, 2 and 3 indicate the order in which I selected the points. The numbers on the left are in the same order, so number 1 is vertice #1, number 2 is vertice #0 and number 3 is vertice #5.
Detachables are parts that fly off. Bumpers, fender, spoilers all have to detach at some point, and setting them in the wam file makes the car act more realistic. When using a detachable crush type, extra lines of code are needed;
detach // Crush type easy // Ease of detachment //(very_easy, easy, normal, hard) stubborn // Type "normal","stubborn","fully_detach" box // the bounding box shape (box, sphere)
1.3.3 Number of smash data entries
Smash data entries are used for textures that can smash like headlights or glass. Each smashable texture has an Identifier and a Texture name. The identifier name stays the same, the texture changes. When using smashable textures, extra code has to be used;
1 // number of smashable textures 00hood // name of material identifier used in plaything 2 00hood // pixelmap to use when intact 1 // Number of levels 0.0005 // trigger threshold (default if zero) 1 // flags
1 // number of possible sounds 4520 // sound ID 0 // Shrapnel count 0 // Explosion size none // Slick material 0 // Number of non-cars activated 0 // Radius of side-effect smashes 0 // Extensions flags 0 // Room turn on code none // Award code 0 // No run-time variable changes
1 // Number of pixelmaps 00hood3 // pixelmap to use when smashed level 1
22.214.171.124 Material identifier and texture
The material identifier and texture name are pretty obvious. No need for extensions like .tif or .pix, the filename is enough.
126.96.36.199 Number of levels
The number of levels can be changed to create different smash stages of the texture. Usually two levels are common for windshields. A clear, cracked and broken state . Each state has to be mentioned, each with at least one pixelmap reference.
188.8.131.52 Trigger threshold
The trigger threshold, when increased will ensure the texture is less easily changed. For windshields, the first trigger threshold to get to a cracked state is often 0.0005, and the second to break the windshield is 0.002.
Connotations of the smashable texture;
184.108.40.206 Possible sounds.
you can increase the number of possible sounds, simply to increase the randomness of sounds ingame. There are not that many sounds available that fit a nice smashable texture. All sounds are found in the data/SOUNDS directory and their sound id is generated by the SOUNDS.txt file also found in this directory. By default, for headlights the ‘PLASTICS’ .wav file is used (ID 4520) For windshields the ‘CRACK.wav’ (4530) is used for the cracked state and the ‘WINDSCRN.wav’(4500) is used for the broken state.
220.127.116.11 Shrapnel count
The shrapnel count can be increased in order to generate custom shrapnels when a texture cracks. There are three types of shrapnel; 'shards', 'noncar' and 'ghostparts'
For the windshield of the car, the standard schrapnel used are shards with the texture SCRN4;
1 // Shrapnel count shards // Shrapnel type 0,0 // Min,max speed towards car 1.0 // Impact velocity factor 10.0 // Random velocity (max) 2.0 // Random up velocity (max) 0 // Random normal velocity (max) 100.0 // Random spin rate (max) 0.75,1.25 // Min time, Max time 0.005 // Min cut length 0 // flags SCRN4 // name of shrapnel material
In order to make sure the game uses the shrapnel and you leave the shrapnel material by default, the SCRN4 pixelmap must be placed in the data/cars/car folder. SCRN4.mat
Using a noncar as shrapnel material means the texture will spawn noncar models when it smashes. As an example, we take the 'Braindead' model by toxic ragers. This horribly scary vehicle spawns gib models as noncars.
Using noncars as shrapnel has the disadvantage that the noncar model needs to be related to the track, meaning; the .dat, .mat and .act file of the noncar need to be placed in the track folder, and the noncar.txt file needs to be reference in the track.txt noncar section. This means that if the track does not have the noncar referenced, the game will crash.
using a noncar as shrapnel material will demand extra lines of code;
noncars // Shrapnel type -2,-10 // Min, max towards you speed 10 // Impactee velocity factor 10 // Random velocity (max) 10 // Random up velocity (max) 10 // Random normal velocity (max) 12 // Random spin rate (max)
sphereclumped // Initial position type 2.500000 // Clumping radius impact // Clumping centre 20,20 // Min number of actors, max number of actors 0 // % Chance of fire/smoke // 15 // Number of fires/smoke columns // 0,1 // Min,Max smokiness (0 = fire, 1 = black smoke, 2 = grey smoke, // 3 = white smoke) &00gib.ACT // Name of actor file 1 // Number of separate actors in file &00gib.ACT // Actor name 1 00gib.txt // Non-car text file to use for the above actor
Again, the first line indicates the noncar to be used as shrapnel, and the six lines below the behaviour of the noncar models in speed and movement.
initial position type
The initial position type in this example is sphereclumped. This means the noncar models are originating from an invisible sphere shaped position, and start moving when spawned.
sphereclumped // Initial position type 2.500000 // Clumping radius impact // Clumping centre ('impact' or 'model')
the second option is boxclumped
boxclumped // Initial position type 2.500000 // Clumping heigth 2.500000 // Clumping width and length impact // Clumping centre ('impact' or 'model')
and the third is actorbased
actorbased // Initial position type
actorbased has the disadvantage that the noncars spawn in the centre of the map, so in our case this is not very usefull.
The other two, sphereclumped and boxclumped originate from the car's midpoint when setting the sphere centre to 'model' and from the midpoint of the impact when setting the centre to 'impact'. The radius of the sphereclumped and the height, width and lenght of the boxclumped can off course be changed.
Using ghostparts as shrapnel material works allmost the same as using noncar shrapnel material. The difference is in the actual code and in the behaviour of the shrapnel. Ghostparts cannot collide with other things and fall through the ground and disappear, while noncars are physical object.
so again, the shrapnel .act, .dat and .mat files have to be present in the tracks folder. However, the reference in the race.txt can be ignored, since we are not dealing with a noncar here. (it has no physics behaviour)
As an exmample I used some apples as ghostparts for the 'Braindead' model;
the code for this;
1 // Shrapnel count
ghostparts // Shrapnel type 0,2 // Min, max towards you speed 0.8 // Impactee velocity factor 4 // Random velocity (max) 3.5 // Random up velocity (max) 2 // Random normal velocity (max) 10 // Random spin rate (max)
sphereclumped // Initial position type 2.500000 // Clumping radius impact // Clumping centre 30,30 // Min time, Max time -1 // count 5 apple.act // Shrapnel material apple.act apple.act apple.act apple.act
Interesting new thing opposed to using noncars is the count of the shrapnel. setting it to -1 will tell the game to use only one of all shrapnells. The apple in my case could be combined with a banana and an oragen, and the first count would be -1. The second count tells the number of models, in my case; 5 apples. This is where you could set a number of 3. (an apple.act, a banana.act and an orange.act)
Using a combination of noncar, ghostpart and shards
The coolest thing would be to use a combination of shrapnel types alltogether. Simply change the number of shrapnels and add whatever you like, the game will deal with the rest.
18.104.22.168 number of explosion groups
in theory, explosion groups should work just like in tracks races, but unfortunately, the game does not know where to look for the explosion textures, and so the game crashes on attempting to add explosions. A real shame, since adding dust and explosions would be really cool!
22.214.171.124 slick material
changing the slick material will make sure a new texture will appear on the ground, just like oil slicks. In order to make this work the slick.mat file needs to be in the car's directory and the tiff in the tiffrgb folder.
in the braindead example, the GIBSLICK material was used.
GIBSLICK // Slick material, texture in the PIX16- or TIFFRGB-folder. 100 , 100 , 100 // ? 0.2 , 0.2 , 0.2 // Biggest number is the diameter of the slick 20 , 20 // Duration of skidmarks. 0.6 , 0.6 // Friction of wheels when skidmarking GIBSMEAR.MAT // Skidmark material, texture in the PIX16- or // TIFFRGB-folder, or use these.
the varialbles are self explanatory.
126.96.36.199 Number of non-cars activated
The smashable texture can also activate noncars. This however is very detailed modding, hardly ever used. Say you create a map with a distinct opponent, and that opponent has a texture that when smashed will create explosions all explosive noncars around it to explode... think of it as you regular endboss fight?!? :D To activate this, the noncar cuboid number needs to be increased;
1 // Number of non-cars activated 3,3 //Min time till next explosion, //max time till blah blah blah (0,0 = Instant) absolute //'relative' to the car,'absolute' to the map -1 //Noncar index number //(each activated item needs to be unique) //-1 = any noncar. 122.354,-0.6,-0.810 // Min cubiod co-ords 125.989,0.5,3.826 // Max cuboid co-ords 0,0 // Min, max towards you speed 0 // Impactee velocity factor 0 // Random velocity (max) 0 // Random up velocity (max) 0 // Random normal velocity (max) 0 // Random spin rate (max)
188.8.131.52 Radius of side effect smashes
Changing this value means you can create a chain reaction. The smashable texture ‘explodes’ causing an explosion cuboid that can activate the explosion of other nearby noncars. So when your car texture explodes near a gastank, the gastank can explode too. :p yummy yummy.
1 // Number of chain reaction style thingies 0,3 // Min time till next explosion, //max time till blah blah blah (0,0 = Instant) *.DAT // Stuff to chain react //(*.DAT = any other nearby noncars) absolute //'relative' to the car,'absolute' to the map 1,-30,-7 // Min cubiod co-ords 21,30,4 // Max cuboid co-ords // The above two sets of values create a cubiod // to blowup stuff within away // Direction of explosion (away, toward or parallel) 1001 // Force of explosion
184.108.40.206 Room Turn on code
over here you can trigger a powerup. Setting the number of a powerup found in the data/powerups.txt will trigger it. As an example , I took the MINE powerup.
... 14 // Room turn on code ...
220.127.116.11 Award code
The award code can be used to activate a credit system for the smashable texture and to display centred text onscreen or scrolling text on screen.
repeated // Award code. (repeated, doitregardless, //singleshot or none) 7500 // Credits 30 // Time bonus in seconds 0 // Static centered text message, //number of the line [data/text.txt] 0 // Scroller text message, //number of description - 10 [data/scrollers.txt]
quite self explanatory I think.
-the crush limit values do not work against the 'oh dear, bodywork trashed' cheat.
-be sure to pay attention to the crush limit values, as they are essential for nice realistic car deformation.
-choose wisely what type of shrapnel you choose. The noncar and ghostpart shrapnel need extra attention and cannot blindly be used by others aswell. Unless you are doing a total conversion, please make the installation of the shrapnel optional and manual for others.
motorised death, 1146 posts, joined Tue May 13, 2008 3:56 am, from Den Haag, Holland