GTA Modification Forums
San Andreas Vehicle Tech Doc (PC only!) Model, Wheel & Texture Layout, Mar-10-06
 |
|
 |
| |
DexX  |
Posted: Wednesday, Nov 10 2004, 05:09
|
Black Hat

Group: Retired Staff
Joined: May 16, 2002


|
This is NOT a question/answer topic!! Unless your question/comment relates to the topic at hand it WILL be DELETED!!
Car models cannot be edited, or created for GTA:SA 2.00 (Second Edition) Ok, now they can.San Andreas Vehicle Tech Doc Model and Texture/Material Layout San Andreas vehicle technical documentation. This Document contains: -Model Struture overview, including revised hierarchy layout, object names and descriptions, and class-specific objects (low rider parts for example). -Textures and Material Guides and settings, including texture sizes, directories and material types. -Basic Instructions for simple editing, like wheel sizes There are significant changes between the GTA3 / Vice vehicle layout, and the methodologies implemented in San Andreas, so be sure to read all the way through. This guide will be updated over time as new discoveries are made. Model Changes - Object Naming Conventions, New objects, and Hierarchies: Name Changes The first changes that are noticeable, and very imporant, are the object names. Gone is the "hi" section of all object names. Example:"door_rf_hi_ok" is now "door_rf_ok". repeat for every part witn "_hi_" in the name. New Objects There are many new possible parts, depending on what vehicle class your your vehicle is. Cars are now upgradeable via the following parts: Hood upgrades (parent=bonnet_dummy) ug_bonnet ug_bonnet_left ug_bonnet_left_dam ug_bonnet_right ug_bonnet_right_dam Trunk/Boot (parent=boot_dummy) ug_spoiler ug_spoiler_dam (ty.augh) Front Bumper (parent=bump_front_dummy) ug_lights (cosmetic only, will not cast or display actual lights) ug_lights_dam Chassis Object/Main Body (parent=chassis) ug_roof ug_nitro (the actual nos-kit model when you buy it) ug_wing_left ug_wing_right Exhaust/Tailpipe (parent=chassis_dummy) exhaust_ok (tailpipe upgrade) Additional handling flags set to be set in the handling.cfg forlowriders to correctly use the lowrider pieces. Those are parts that are upgradeable, but not necessary, to the functioning of the vehicle. The following parts, while new, are much more important, and "useful" for standard cars. Parent objects are listed after the object name Obj - Parent - DescriptionWheel - wheel_rf_dummy: probably the single biggest change, is the elimination of the "wheels.dff", that was formerly in the generic folder. Each car/truck now has its own individual wheel model, stored inside of the car model itself, under the parent object "wheel_rf_dummy". Also important to note that the "vehicles.ide", also has 2 wheel scale values, the first is for the front wheels, and the second is for the rear wheels. the "wheel" on Sa cars (only one per model!) is scaled to be the correct size on the model, as it would be in real life. you'll need to manually change the scale in the vehicles.ide to match the wheel model size. PC update: the wheels.dff is there, but it still remains unused. dont ask me, but R* threw it there for some reason(or simply forgot to remove it). But the above information still applies! Wheel Sizes:| QUOTE (Brief Wheel instructions) | 1. To change wheel sizes, open the vehicles.ide, and find the vehicle you will be replacing. That data will look like this:
400, landstal, landstal, car, LANDSTAL, LANDSTK, null, normal, 10, 0, 0, -1, 1.0, 1.0, -1
2. If your using a custom car that was converted from vice, or the wheels look drastically too big in general, change the number in red, from -1, to 0. when this value is set to 0, it tells the game to scale the wheel model, with the next set of values. when this value is -1, it derives the size of the wheel model, directly from the mesh, and the wheel scale values will only affect the wheel collision.
3. the blue values control the actual size of the wheels, front and rear, adjust them as necessary to get the desired size ingame.
thanks to offroader23 for helping with this info. |
Cerbera has put together a useful guide for SA handling differences, you can check that out here: http://www.gtaforums.com/index.php?showtopic=153355where <carname/root obj> is, is the name of the vehicle your looking at. Engine - <carname/root obj>: where the engine smoke comes from. Petrolcap - <carname/root obj>: shoot it and the car explodes. 'nuff said. Ped_arm - <carname/root obj>: actually I've seen this object in other places in the hierarchy, so this (hierarchy position) may not be applicable to ALL vehicles. or it may not matter at all. Peds now seem to rest their arms on the sides of the car sometimes, I would assume this is where. during driveby's, they also sometimes sit, and lean over the roof of the car to shoot, and it also appears to be where this dummy object is. Headlights2 - <carname/root obj>: another headlight object. used in conjuntion with the standard headlights object. Yes, you can now have 2 working headlights, same for tails below. This version however, doesnt not give the "cone" effect, that the first headlights object does. Tailllights2 - <carname/root obj>: another taillight object. used in conjunction with the standard taillights object. exhaust_ok - chassis: where the tailpipe upgrade piece goes? plate_front_ok - bump_front_ok: front license plate, undamaged. Its important to have separate objects for the license plates now, as the game will actually generate, and use, text and colors from another file, to produce authentic license plates. Neat! plate_front_dam - bump_front_dam: same as above, except damaged. plate_rear_ok - bump_rear_ok: same as above, except for the back. plate_rear_dam - bump_rear_dam: same as above, except damaged. See the end of the texturing section (below) section for info on how to make "working" license plates. Collision Methods Collision files are stored in the same DFF as the vehicle. The collision file not only stores collision data for the model this time, but also a shadow mesh, from where a shadow for the vehicle is generated. Although the .col format is pretty much the same, with the addition of the shadow mesh, the "vehicles.col" is no longer used. Texturing and Material Methods Signicant changes From GTA3/Vice to SA
-Local TXD's (<carname.txd>) are still used, But the majority of textures that are repetitive, like damage, headlights and tails, reflections, are stored in a global TXD, "vehicles.txd", that is used by virtually every car in the game. Local txd's are used only for vehicle specific textures.
-Vehicles use Mutilple UV channels. However, the 2nd uv channel is only for reflections. you cannot add a 2nd diffuse map on a different uv channel, and expect it to work. it wont. If a paint job is applied to a car, the diffuse map for the main body material is swapped out, but uses the same UV coordinates. i did write a Brief Tutorial on how to add paintjobs.
-To compliment the new Wheels system used for the cars, even the wheels themselves are UV mapped differently. While they still use 64x64 textures, they are mapped in such a way, that the mapped image on the object is only 1/4 of the total image (model 1/4 of the wheel, then duplicate/rotate 3 more times), and the end result on the wheel, is equivalent to 128x128 texturing. Being that they are part of the car mesh itself this time around, the wheels also are capable of (some do) using the reflection maps the car uses, depending on the material. This makes it possible to produce more "chrome" effects. The wheels.dff of gta3 and vice did not allow refletion maps on the rims for some reason. Interestingly, all the tire tread i've come across so far, is in the vehicles.txd, wheras the rimface of the wheel itself, is stored in the local txd's of the vehicles. clever bastards they are.
-There's an additional section to some materials to accomodate the extra reflection map. The 2nd reflection section, vehiclespecdot, tells the game to perform per-vertex specular lighting on the model, similar to that which is done from the xbox mod for the pc vers of VC.
-The "body" texture that is used for 99% of the cars in the vehicle.txd, is more like a "dirt" texture (vehiclegrunge256) that is animated over time. The TV Van in the following screenshot is shown while dirty, and after cleaned (they can only be cleaned at transfender, upgrade shops, and Pay N Spray, Actual car washes do NOT work!!): http://gregval.phpwebhosting.com/uploads/savan_dirt.jpg PC Update: the cars dont appear to get "dirty" anymore, the 1.01 patch fixes this.
Using Carcol materials on your model Set the diffuse color of your material to one of the following colors, to have its color ingame, controlled by the carcols.dat file.
| QUOTE | RGB colors for each carcol color: Primary - 60, 255, 0 - This color Secondary- 255, 0, 175 - This color Third - 0 255, 255 - This color Fourth - 255, 0, 255 - This color
To use the third and 4th colors, you need to put your vehicle in the "car4" section, at the end of your carcols.dat file.
|
-License Plates In order to get "working" license plates (where the text changes, and the plateback, changes per city) you need to texture the license plate objects a certain way: the "back" of the license plate, the larger section that IS the plate, needs to be textured using the image "carpback" in your vehicle.txd. the white texture is a placeholder for the images that are used ingame, and they get swapped around from city to city. The plate "text" needs to be textured using the "carplate" image in your vehicle.txd. The game will render text to that texture, per car, and apply it automatically. the image in the txd is just a placeholder. Headlight and taillight texturing in San Andreas-Headlights and taillights. These use one of the global textures from the vehicles.txd (vehiclelights128 and vehiclelightson128). During the game, your car will normally use the first texture, and at night, the game will swap it for the 2nd image, which has pre-illuminated textures. It works well in conjuntion with their improved lighting system overall. Vehicle-specific headlight and taillight textures are NOT possible (if you still want them to "work" that is). you have to use the images in the vehicle.txd to get fully-functional lights for your car. See below. This section quoted from Majestic, and slightly edited by me  | QUOTE (Majestic) | the lights now act sort of as [prim] and [sec]. in order to have the lights working you need: -assign one of the 4 colors (one for each light) -assign texture 'vehiclelights128' This would be done in the material editor of the application your using to export models. The "diffuse color" would be set to one of the options below, which will make alteast 4 distinct materials necessary, one for each light type. -' dexx
this is what happens in game: -during day, the 'vehiclelights128' texture is used, and color is something like 50% gray. -during night, the 'vehiclelightson128' texture is used instead, and color becomes 100% diffuse and 100% ambient (or something like that?)
RGB colors for each light: Left Headlight - 255, 175, 0 - This color Right Headlight - 0, 255, 200 - This color Left Taillight - 185, 255, 0 - This color Right Taillight - 255, 60, 0 - This color |
update 1 - first posting, 11-9-04 more to follow. The texturing method has changed, and ill post that next chance i get. update 2 - Texturing and Materials, 2-14-05 Added info on the texturing and material systems used by the game. update 3 - Collision methods, 6-10-05 updated existing content for pc version, quick collision mention. update 4 - Headlight and Tailight sorting, 6-23-05 Sorted instructions on how to properly set up materials, to have illuminated headlight and taillight textures ingame. update 5 - , 12-29-05, 8-7-06 general overhaul, some corrections, and a little snippet about how to properly do license plates. Leave any comments you may have. This post has been edited by DexX on Monday, Mar 30 2009, 17:39
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
DexX  |
|
Black Hat

Group: Retired Staff
Joined: May 16, 2002


|
| QUOTE (Augh @ Nov 10 2004, 04:36) | Sorry if I just missed it in there somewhere, we got any idea how these independant drivetrains are being handled? (Lowriders, monster trucks and so forth, unsure what else makes use of them...)  |
If you mean the suspension pieces, i checked out the Tahoma and Blade models, and the only pieces they had that would make sense, are "misc_a", and "misc_b", which i beleive to be some sort of all-purpose generic parts, that have a specific use depending on the car type, or some handling flags. These are linked to the chassis_dummy. Blade also has a "misc_c", its purpose i do not yet know. The Monster truck has 2 extra pieces, called "transmission_f, and "transmission_r", which are again, linked to the chassis_dummy. The towtruck *also* has misc_a, and misc_b, but here, misc_b is a child of misc_a, and misc_a, is a child of the chassis object. Except in this instance, i beleive these parts to be the "hook" that grabs other cars when you tow them away, misc_a being the bar that swings, and misc_b, being the hook itself. the "dozer" has "misc_a" under the chassis_dummy. i havent driven the dozer, so i dont know what this does. Rhino *also* has misc_a, and misc_b and a misc_c, again here, miscb is a child of misc_a, and misc_a, is a child of the chassis object., and misc_c is a child of misc_b. Buuut! But! The rhino only has one door! Door_lf_dummy. And although the rhino model only lists 6 wheels in the mesh (total), ingame i counted 6 wheels, on EACH SIDE of the vehicle! Clearly some sort of crazy-ass mirroring is being done I know some people will want to replace the quad (i damn sure do!), so here's the extra parts for that. It uses a standard car setup, then these.. -rear_axle -handlebars -suspension_lf -suspension_rf these all are linked to the root object, "quad" Ack, anyway, the point being that objects with the names "misc_<whatever>" seems to have multiple purposes, depending on the vehicle they are assigned to. i Dont know if these special attributes are a combination of handling flags, or hardcoded (please god, no) but i really hope its some of the new flags.. hmm.....scripted maybe, in the main.scm? i could deal with that.. hardcoded = we're f*cked. @GTAguy, they may have gotten the initial idea from him, we'll never know. im glad they went further though, and only required one instance of the wheel, instead of manually placing all of them.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Augh  |
|
Unspoiled by progress

Group: Members
Joined: May 11, 2004



|
Ah hah, thanks  Hrm, ruminating... Is it possible that a basic flag handling/parsing system or "sort code" within the lib (possibly the wrong term, I don't know) might be in operation to dictate that where certain objects are present, flags will automagically apply themselves there, as in know that object is the one they're applied to? (Axles, basically is what I'm considering) I'm thinking that actually I'm just flailing around helplessly trying to avoid the "hardcoded" possibility. It would certainly seem to work on paper that the monster truck, working from a chassis, transmission_f and transmission_r basis, where those trans objects know to be handled by the mcpherson flags, would then correctly trundle over stuff, articulating correctly, as it certainly appears to. Just occurs to me if axle movement is already a given, and the mcpherson flag already "knows" it refers to axles, that might tidily sort the whole mess out. Sorry, this may be counterproductive, I'm really just brainstorming. Give the word and I relent
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
ThaKilla  |
Posted: Wednesday, Feb 16 2005, 21:34
|
I'm not wack, im all wacked-out!

Group: Members
Joined: Sep 17, 2004


|
I have looked into this and I belive it might be a Flags and the main.scm. Here are the Flags for Vechiles you mentioned above. BladeAnimation Group = "0-standard car" Model Flags |_____Double Exhaust |_____Axle R(ear) Solid |_____Force Ground Clearnce Handling Flags |_____Hydraulic Geom |_____Low Rider |_____Swing Chassis TahomaAnimation Group = "0-standard car" Model Flags (none) Handling Flags |_____Hydraulic Geom |_____Low Rider |_____Swing Chassis MonsterAnimation Group = "20-monster" Model Flags |_____Hanging Boot |_____Is Big Handling Flags |_____1G (1st gear) Boost |_____Offroad Ability |_____Offroad Ability2 |_____Use Max (Sp)Speed Limit |_____NPC (Non-Player Controlled) Anti-Roll |_____HB Rear Wheel Steer Tow TruckAnimation Group = "13-van" Model Flags |_____Is Van |_____Axle R(Rear) Solid |_____Axle F(Rear) McPherson Handling Flags |_____Offroad Ability |_____Use Max (Sp)Speed Limit |_____F(ront) Wheel Narrow |_____R(ear) Wheel Wide2 |_____Hydraulic None Intresting Note: Only the Tractor, Packer, ForkLift, Dumper, Dozer, and Cement all have a the Flag "Hydraulic None"RhinoAnimation Group = "24-tank" Model Flags |_____Is Big |_____Force Door Check |_____Force Ground Clearance Handling Flags |_____Offroad Ability |_____Offroad Ability2 |_____HB Rear Wheel Steer |_____F(ront) Wheel Wide2 |_____R(ear) Wheel Wide2 |_____Hydraulic None QuadBikeAnimation Group = "12-quadbike" Model Flags |_____No Doors |_____No Exhaust |_____Tandem Seats |_____Axle R(ear) Solid |_____Axle F(ear) Reverse Handling Flags |_____1G(ear) Boost |_____F(ront) Wheel Narrow |_____NPC Anti Roll Also if you copy your GTASA DVD to a floder on your computer, than you can use my GTASA-Ultimate Editor to see the flags for yourself. Download it from: GTA Community This post has been edited by ThaKilla on Wednesday, Feb 16 2005, 22:38
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
ThaKilla  |
Posted: Thursday, Feb 17 2005, 06:28
|
I'm not wack, im all wacked-out!

Group: Members
Joined: Sep 17, 2004


|
I think that is almost true, but i think the animation group is for the actual doors and most of the old GTA3/VC stuff.
As far as the tow truck and tractor hooks: I think it might be in the dff files, because it would be hard to stream the main.scm(or maybe they have a clever way of running part of it from RAM. I just have not seen how it's to different from GTA3/VC's main.scm, and it's just not built that way).
Besides the flag for "Hydraulic None'" is set only to the Tractor, Packer, ForkLift, Dumper, Dozer, and Cement. Because they all have moving parts (or should), then that would set them a part.
By the way if any of you want my Prog. just PM me and i will help you set it up with it.. I have been slackin, waiting on the PC to come out in June
This post has been edited by ThaKilla on Thursday, Feb 17 2005, 15:24
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
DexX  |
Posted: Saturday, Jun 11 2005, 07:37
|
Black Hat

Group: Retired Staff
Joined: May 16, 2002


|
it looks like zmodeler2 will be able to export working SA cars, even with the unregistered version. here's the deal as i understand it: if you have zmodeler 2 for free, and unregistered, you can either create a new vehicle in zmod 2, and export to SA, or import a zmodeler 1 .z3d file, and export the car from there, to SA. but you will NOT be able to import dff files into zmod 2 unless you register your copy of zmod 2. if you have it registered, you get the import filter as well, so *in theory* you should be able to import dff's, probably from vice and gta3 too, and re-export them for sa. So yea, it will be technically possible to convert a previous car as long as you have the original z3d file for sure. however, it wont be just file -> export, you'll have to change a number of things on the model to make it work with SA. Should be able to convert txds and col files pretty soon
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
DexX  |
Posted: Wednesday, Jun 22 2005, 11:33
|
Black Hat

Group: Retired Staff
Joined: May 16, 2002


|
i have a good idea how the animated suspension works for cars that have it, and some of you may be disappointed by the answers. First of all, theres several types of suspension animations, hydraulics, the monster truck-style axles, and the moving shocks on the bandito and the bf injection. we'll come back to the quad. but lets take the others in order. Hydraulics - appear to be a combination of handling flags, and custom pieces on the cars. it would appear that you could, in theory atleast, add hydraulic geometry to pretty much any vehicle, as the handling.cfg has entries for it. should be just a matter of adding the right pieces and naming them, then setting the flag in the handling file. Monster truck style solid axles - the monster trucks, dumper, and duneride (offroad delivery truck), all have solid axles, that move with the wheels, great for offroading effects. they are also declared as their own vehicle type in the vehicles.ide, mtruck. vehicles declared as "mtruck", seem to have a couple additional parts in the model - transmission_f, and transmission_r, which by process of elimination and common sense, have to be the moving axles. Edit: now tested, and confirmed. Independent suspension - bandito, hotknife and bf injection. The best i can guess for these cars, since they have no similar flags in the handling, or custom entries in the vehicles.ide, is that the effect is hardcoded. they DO have special pieces that move, but the movement of those pieces is assigned to just these vehicles it would seem, through the exe. that is, i can find no special references to them in the handling files, vehicles.ide, or main.scm. you should be able to replace these vehicles, and maintain their moving parts, as long as you have the correct parts named, and in the hierarchy correctly, but you cannot add these parts to other vehicles  Edit: tested and cofirmed, these effects ARE hardcoded to these vehicles. The Quad - nothing really i can say about this. theres only one in the game, and i havent messed with it  basically it drives like a 4-wheeled bike, and everything is animated. Cerb, i'd say the game engine automatically knows what to do with the suspension pieces when it finds them. it probably just sets their z position and rotation to match the height of the corresponding wheels on the vehicle, and rotates along the x/y axis if necessary, again matching the wheels. Edit: yea, suspension pieces inherit rotation properties from the wheels.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
123abc  |
Posted: Wednesday, Jun 22 2005, 22:16
|
Text Book f*cking Mental

Group: City Link
Joined: May 13, 2004


|
That answer I like better. I guess its not possible to have IFS and a solid axle out back then.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Majestic  |
Posted: Wednesday, Jun 22 2005, 23:22
|
dirty commie

Group: $outh $ide Hoodz
Joined: May 22, 2002


|
working headlights and taillights: the lights now act sort of as [prim] and [sec]. in order to have the lights working you need: -assign one of the 4 colors (one for each light) -assign texture 'vehiclelights128' this is what happens in game: -during day, the 'vehiclelights128' texture is used, and color is something like 50% gray. -during night, the 'vehiclelightson128' texture is used instead, and color becomes 100% diffuse and 100% ambient (or something like that?) colors for each light: Left Headlight - 255, 175, 0 Right Headlight - 0, 255, 200 Left Taillight - 185, 255, 0 Right Taillight - 255, 60, 0 the taillights i'm 50% sure which is left and which is right  At the moment, I dont think you can use custom textures for lights - i've tried, and it didnt quite work. We'll see though - maybe with some magic it will work. But for now, everyone's gotta stick to the generic lights texture...
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Cerbera  |
Posted: Saturday, Jul 16 2005, 11:08
|
Ben "Cerbera" Millard

Group: Members
Joined: Jun 22, 2002



|
| QUOTE (ashdexx @ Jun 22 2005, 12:33) | Independent suspension - bandito and bf injection. The best i can guess for these cars, since they have no similar flags in the handling, or custom entries in the vehicles.ide, is that the effect is hardcoded. they DO have special pieces that move, but the movement of those pieces is assigned to just bandito and bfinject it would seem, through the exe. that is, i can find no special references to them in the handling files, vehicles.ide, or main.scm. you should be able to replace these vehicles, and maintain their moving parts, as long as you have the correct parts named, and in the hierarchy correctly, but you cannot add these parts to other vehicles  |
About the apparently missing suspension animation stuff for these two. | CODE | 424, bfinject, bfinject, car, BFINJECT, BFINJC, BF_injection, executive, 6, 0, 0, -1, 0.84, 0.92, -1 568, bandito, bandito, car, BANDITO, BANDITO, null, ignore, 4, 0, 0, -1, 0.55, 0.7, -1 |
I assume the BF_injection setting for the anim column just enables the animated cambelt on the rear and that the independant suspension is hardcoded? Since the Bandito and BG Injection use visually different suspension parts with different spring lengths, wishbone lengths and different start angles I guess they are assigned different hardcoded suspension behaviours? | QUOTE (Ashdexx @ Jun 22 2005, 12:33) | The Quad - nothing really i can saw about this. theres only one in the game, and i havent messed with it  basically it drives like a 4-wheeled bike, and everything is animated. |
| CODE | | 471, quad, quad, quad, QUADBIKE, QUAD, quad, normal, 4, 0, 0, -1, 0.6, 0.6, -1 |
Seems to use its own anim value in the vehicles.ide file. This would presumably include enabling all the leaning of the player in the same way that motorbikes and bicycles do? | QUOTE (Ashdexx @ Jun 22 2005, 12:33) | | Cerb, i'd say the game engine automatically knows what to do with the suspension pieces when it finds them. it probably just sets their z position and rotation to match the height of the corresponding wheels on the vehicle, and rotates along the x/y axis if necessary, again matching the wheels. |
Looking at the handling.cfg data, the HandllingFlag data has no suspension options ticked at all. I enabled AXLE_F_MCPHERSON and AXLE_R_MCPHERSON and it had no effect to the way the wheels tilt with suspension movement. Another hardcoded effect, it seems.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Pages:
(4) [1] 2 3 ... Last »
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|