You are on page 1of 7

Quick Spin Tires Quide

Here is a quick overview of Spin Tires for people who want to make new trucks.

Panel in the top left of the screen allows you to switch Spin Tires into either user or dev mode.

User mode (default)
Allows you to add/remove up to 4 trucks, and switch between them
Dev mode
While in dev mode, Havok Visual Debugger is enabled that you can use to view the physical bodies in the
simulation.
Additional window with Log is also shown, containing list of possible errors in the XML files.

Additional buttons are:
Reload - reloads selected truck XML files, as well as all the texture files.
Snap - moves selected truck to camera position
Follow - trigger free camera. To move free camera, use Numpad. To pan free camera, move mouse while
holding right button.

Add... button
Opens truck manager dialog. List of available trucks is shown, and a list of installed Spin Tires mods.
A mod is separate folder located anywhere at your PC (folder can be a ZIP archive - root-level directories
in the archive must be classes, meshes, textures)

Mod contains following directories
classes\trucks - list of additional trucks (XML files)

XML file describing truck has following structure:

<?xml version="1.0"?>
<_templates Include="trucks">
_templates are elements that are used in multiple places (shared in different parts of XML)
Include=trucks means that _templates section also includes templates from templates\truck.xml file

<Wheel>
<Wheel
Mesh="kraz_wheel.xml"
TrackTexture="kraz_track__d.tga"
Radius="0.54"
Width="0.52"
Mass="200"
Friction="1.0"
SubstanceFriction="1.0" defines how effective wheel is in mud
>
<Softness ForceScale="0.4" MaxAccel="0.001" /> - softness applied to physics
simulation with other rigid bodies (solid terrain)
</Wheel>
<FrontWheel
_template="Wheel" inherits template Wheel, possibly overriding its
attributes
ConnectedToHandbrake="false"
SteeringAngle="40"
Torque="full" either full or default (disabled when full-wheel-drive is
disabled)
ParentFrame="CabinBone"
>
<Suspension
MinLimit="-0.4"
MaxLimit="0.4"
Strength="0.008"
Damping="0.1"
/>
<Steering JointOffset="0.2" Castor="8" /> - JointOffset is offset of point around
which wheel rotates in the direction perpendicular to the wheel. Castor is angle at which wheel rotates
when it turns.
</FrontWheel>
</Wheel>
</_templates>
<CombineTruck>
..
<TruckData

>

<OcclusionMap
Texture="occlusion_chassis__da_uncmp.tga"
Size="(9.4; 3.8)"
Offset="1.1"
/> - Occlusion map is a texture projected on terrain beneath the truck
<OcclusionVolume
Size="(6.9; 3.1)"
HeightFront="1.3"
HeightRear="0.75"
Offset="1.0"
/> - Occlusion volume is area where ambient shadow is applied to truck itself
<Deflector
Size="(7.5; 3.3)"
Offset="1.1"
Height="0.5"
/> - Deflector bends grass
<Axles>
<Axle
Frame="AxleBone1"
LeftWheel="0"
RightWheel="1"
/> - Defines a frame in mesh which rotates according to wheel positions
<Axle Frame="BoneAxleLeft4" SingleWheel="0" /> - Defines axle frame for single
wheel (in case of independent suspension)
</Axles>
<HeadLight
_template="Default" this is a Light template from trucks.xml
ParentFrame="Cabin"
Offset="(2.8; 2.0; 0.0)"
/>


<Shakers>
<Shaker
Frame="ExhaustBone"
MaxAngle="(2; 2; 0)"
MaxFrequency="8"
/> - Shaker is a frame that shakes when vehicles engine tension is high
</Shakers>
</TruckData>
<PhysicsModel>
<Body
Mass="2400"
CenterOfMassOffset="(0.4; 0; 0)"
ImpactType="Truck" one of ImpactTypes from media.xml, describes particles
and sound effects upon collision
> - this body doesnt contain ModelFrame attribute, so it control root frame in the mesh
<Body
ModelFrame="CabinBone" the frame from mesh that current body
would control. If XML doesnt contain description for body collision mesh, frame CabinBone must have a
child named cdt it would be used as a collision mesh
Mass="1600"
CenterOfMassOffset="(-0.5; -0.3; 0)"
ImpactType="Truck"
>
<Constraint a Ragdoll constraint
Type="Ragdoll"
PlaneAxis="(0; 0; 1.0)"
TwistAxis="(1.0; 0; 0)"
Cone="15"
TwistMin="-15"
TwistMax="15"
PlaneMin="0"
PlaneMax="0"
PivotOffset="(-2.0; -0.2; 0.0)"
>
<PlaneMotor Motor tries to bring bodies connected with
constraint to original position
Type="Spring"
Spring="900000"
Damping="60000"
/>
<TwistMotor
Type="Spring"
Spring="180000"
Damping="20000"
/>
</Constraint>


<Body
ModelFrame="LeftMudguardBone"
Mass="10"
AngularDamping="3.0"
Collisions="None"
>
<Constraint - a Hinge constraint
Type="Hinge"
MinLimit="-45"
MaxLimit="5"
Axis="(0.0; 0.0; 1.0)"
/>
<Shape> -Box collision mesh with offset
<Box HalfExtents="(0.1;0.7;0.1)" Translation="(0; 0.7; 0)"
/>
</Shape>
</Body>
</Body>
<Model Mesh="kraz_chassis.xml" /> - the mesh to be used for rendering
</PhysicsModel>
<ModelAttachments>
<Ignition> - truck attachments that are enabled when truck engine starts
<Flare
ParentFrame="Cabin"
Color="(46; 29; 16)"
Size="0.3"
Offset="(2.576; 2.75; -0.17)"
/>

</Ignition>
<HeadLight> - truck attachments that are enabled when head light is truned on
<Model a mesh is activated and rendered
_template="HeadLightRay"
ParentFrame="CabinBase"
Org="(1.86; 0.973; 0.57)"
/>

</HeadLight>
<ReverseSignals> - enabled when vehicle is reversing
<Light _template="ReverseSignal" Offset="(-3.75; 0.8; -0.68)" />

</ReverseSignals>
<StopSignals> - enabled when vehicle brakes

</StopSignals>
</ModelAttachments>


<VehicleConstraint SteeringForce="8000">
<ReverseGear
Torque="60000"
AngVelMin="-2.0" average wheel angular velocity at which torque is applied to
wheels
AngVelOpt="1.2" angular velocity at which maximum torque is applied
AngVelMax="8.0" angular velocity at which torque is no longer applied
LinVelMax="1.8" linear velocity at which torque is no longer applied
MaxDeltaAngVel="0.1"- maximum increase to angular velocity for given vehicle
/>

</VehicleConstraint>
<Wheels>
<Wheel _template="FrontWheel" DiffGroup="axle0"> - DiffGroup defines wheels that
are always differential-locked (their angular velocities are always the same)
<Suspension Hardpoint="(3.8; 0.3; 1.06)" />
</Wheel>
<Wheel _template="FrontWheel" DiffGroup="axle0">
<Suspension Hardpoint="(3.8; 0.3; -1.06)" />
</Wheel>
<Wheel _template="RearWheel" DiffGroup="axle1">
<Suspension Hardpoint="(-0.49; 0.3; 1.06)" />
</Wheel>

</Wheels>
</CombineTruck>


meshes\trucks - meshes that additional trucks use (X and XML files)

X file is a DirectX mesh file - you have to use one of the exporters (like Pandasoft for 3dsMax) to
generate it.

XML file named the same as X file describes its materials - and has following structure:

<?xml version="1.0"?>
<CombineXMesh>
<Material
Mesh=Cabin 0, Cabin 1"
AlbedoMap="kraz_wheel__da.tga"
Glossiness="8"
Specularity="1.0"
NormalMap="kraz_wheel__n.tga"
IllumMap="kraz_wheel__illum.tga"
SpecularMap="kraz_wheel__s.tga"
/>
</CombineXMesh>

Mesh=Cabin 0, Cabin 1" describes what mesh frames given material applies to.
Cabin 1 means material 1 (starting from 0) of frame named Cabin.

If there is single frame in the mesh, you can use * instead of frame name.

Glossiness="8", Specularity="1.0" describe how surface reacts to lights.

The rest is list of textures to be used.

For material describing wheels, list of <Materials> should be followed by
<WheelMesh RubberRadius="0.3" />

RubberRadius defines radius at which rubber start (part of wheel with softness simulation)


textures - textures for additional trucks (should be TGA files)
.TGA textures are automatically converted to .DDS files and saved to cache.

Textures should be named with lowercase.
If texture name ends with __da, a MIP chain would be generated, and alpha channel preserved (a typical
diffuse texture).
Normal map textures should end with __n.
Specular map textures should end with __s.


Notepad++ plugins
Notepad++ is a default a software that SpinTires developers use to edit XML files.

installation
Copy the folder Notepad++ to your folder with installed Notepad++

Usage
Several commands with hotkeys become available:
Plugins>Combine Plugins>PugiXML Format (ALT-SHIFT-F) apply default formatting to the document

Plugins>Combine Plugins>XML Comment (ALT-SHIFT-C) comment selected XML block

Plugins>Combine Plugins>XML Uncomment (ALT-SHIFT-U) uncomment commented selected block (the
one at which cursor is inside)

Plugins>Combine Plugins>XML Comment (ALT-SHIFT-O) browse files in given folder

To select folder, either use CombineTools (SpinTires editor) if you dont have it, add registry key (with
RegEdit) at
HKEY_CURRENT_USER/Software/Spin Tires/CombineTools/Workspace/CombineMediaPath=*your
folder+ (string key)

Plugins>Combine Plugins>Briowse XML (ALT-SHIFT-D) navigate to XML element byhname

Plugins>Combine Plugins CLR>Pick Color (ALT-SHIFT-P) put a cursor on the name of a color attribute,
and use color picker to select color.

You might also like