DerelictStudios Forums: How To Make A Tread Move - DerelictStudios Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How To Make A Tread Move

#1 User is offline   killakanz 

  • Man with a heart, a soul. And a gun.
  • Group: Volcano Lord
  • Posts: 4,636
  • Joined: 12-November 03
  • Location:Hampshire, UK
  • Mod Registrations:

Posted 08 January 2005 - 12:46 AM

I'm posting this so every man, woman, child and phoib can easilly refer if they forget how to make treads move.

It's a simple trick that makes the tread texture move along the mesh, simulating tread movment.

As you are applying the texture in RenX, in the material editor under Pass 1, Vertex Material tabs, you have the Stage 0 Mapping section. There, drop the box down aside Type: and select Linear Offset. In the box immediatly below, type in:
CODE
VPerSec=1


Then continue to apply your material as normal and line it up with UVW Mapping. It wont be moving in gMax.

Export to game, and take a close look. If the tread is moving sideways, replace the V in the code with a U or W. If the tread is moving backwards, place in negative 1 after the equals sign. If the tread isn't moving, start again and type it right, it is case sensitive. If that fails it's a mesh name/ini problem, but in my experience getting the treads moving is rarly the problem. Getting them to stop is a problem which sparks up much more often.
0

#2 User is offline   Count von Phoib 

  • Dark Volcano Lord
  • Group: Volcano Lord
  • Posts: 15,322
  • Joined: 05-April 03
  • Mod Registrations:

Posted 08 January 2005 - 12:59 AM

QUOTE(killakanz @ Jan 7 2005, 11:46 PM)
so every man, woman, child and phoib

Did I just get owned? ph34r.gif
0

#3 User is offline   killakanz 

  • Man with a heart, a soul. And a gun.
  • Group: Volcano Lord
  • Posts: 4,636
  • Joined: 12-November 03
  • Location:Hampshire, UK
  • Mod Registrations:

Posted 08 January 2005 - 01:01 AM

you pinned it for all to see forever domo.gif

This post has been edited by killakanz: 08 January 2005 - 01:01 AM

0

#4 User is offline   flyby 

  • Grumpy Grandpa
  • Group: Volcano Officer
  • Posts: 5,049
  • Joined: 20-April 03
  • Mod Registrations:

Posted 09 January 2005 - 11:53 PM

To complete this, let me add a few remarks :

To have the treads move correctly ingame you actually needs 2 models.
One model with no moving texture, for when the tank stops.
One model with moving texture, when it is moving.

You then define the models as conditionstates, with the first as default and the second model as MOVING conditionstate.
You'll then have no longer the problem of models who's treads keep moving when standing still...
0

#5 User is offline   flyby 

  • Grumpy Grandpa
  • Group: Volcano Officer
  • Posts: 5,049
  • Joined: 20-April 03
  • Mod Registrations:

Posted 11 January 2005 - 11:27 AM

Made a small tut for those who know their way around in gmax:




Having the treads of a tank display correctly in Generals involves 2 different models:

One model will be used as default CondotionState, for the idle position, where as a second model will be used as MOVING ConditionState model.

ConditionState = MOVING
Model = xxxx_mov
End

The default model can be made as usual; however, the illusion of movement comes from second model:

2 options to approach this moving model: with only 1 texture template or with 2 textures.

Both approaches need to have the treads as SEPERATE objects, meaning: detached from the main body!

When using only 1 texture for the complete tank, you HAVE to fill the strip completely, where the track image comes. This is because of the way the UV displacement works: it makes the texture scroll either vertically or horizontal. As a result you need to have a strip with a tiled tracks image within your model texture.

When using 2 textures, you can layout your model texture without much consideration as your second texture will include only your tracks image. One important aspect is the keep in mind the aspect of the tracks needs to be a power of 2 when using DDS. Usually I take something like 32x128. Applying a texture also means the tracks need a separate UV layout. If you unfold the tracks, using chilliskinner, you can easily apply planar mapping. Don't forget to choose bitmap fit, so that your UVWmap takes the aspect of the bitmap, resulting in zero distortions. Once you got the aspect right, you can then scale the map so it fits the width of the track. Make a W3D texture, with the tracks texture set as stage0. For those who wish can even use alpha blending if you've added an alpha map to your tracks texture. Go to the vertexmaterial tab in the W3D material. in the dropdown list you will find "linear offset". In the "args" section you add either UPerSec=(float) or VPerSec=(float), with (float) being a positive or negative floating point value (eg -0.3). Usually, negative values make the treads move correctly (=backwards). Apply this texture to both track objects on the model. Apply the other texture to the other model parts and export...
0

#6 User is offline   Catman 

  • 2nd Lieutenant
  • Group: Volcano Citizen
  • Posts: 111
  • Joined: 04-February 05

Posted 10 February 2005 - 04:24 AM

In maya, for the extreme few who use it, you just go into the UV texture editor. Select all the UV's on the outside tread faces and hit "s". then move forward 2 frames, move the uv's a small amount over the texture, and hit "s" again. Go into the hypergraph, and select the keys you set under the UV map, go into the menu "post infinite" and click cycle with offset. Now your treads will move in a constant rate forever, but there are ways to make the speed change.
0

#7 User is offline   killakanz 

  • Man with a heart, a soul. And a gun.
  • Group: Volcano Lord
  • Posts: 4,636
  • Joined: 12-November 03
  • Location:Hampshire, UK
  • Mod Registrations:

Posted 27 February 2005 - 05:36 PM

I actually notice that these lines in the INI make the treads stop when the tank does:

CODE
   TreadAnimationRate    = 1.0; ammount of tread texture to move per second
   TreadDriveSpeedFraction = 0.3; fraction of locomotor speed below which treads stop moving.
   TreadPivotSpeedFraction = 0.6; fraction of locomotor speed below which we allow pivoting.


As long as your tread meshes are named
CODE
TREADSL01

and
CODE
TREADSR01

it'll work.
0

#8 User is offline   Liger 

  • Captain
  • Group: Volcano Soldier
  • Posts: 502
  • Joined: 19-March 04
  • Location:Melbourne, Australia

Posted 02 March 2005 - 08:35 AM

What if I have 4 treads? on either side?

LIKE

TREADSL01
-
TREADSL04

Cos I can't seem to get mine working ingame. I've followed this tutorial to the T and still cant get it to work. Help would really be apprechiated. Model exports fine and run ingame but treads still dont animate.

*** Figured it out in the end. Have to go File > Export for the tread to move ingame properly.

This post has been edited by Liger: 06 March 2005 - 09:51 AM

0

#9 User is offline   key0p 

  • Brigadier General
  • Group: Volcano Soldier
  • Posts: 2,107
  • Joined: 01-March 05
  • Location:Australia

Posted 08 March 2005 - 12:30 AM

QUOTE(killakanz @ Feb 28 2005, 1:36 AM)
I actually notice that these lines in the INI make the treads stop when the tank does:

CODE
   TreadAnimationRate    = 1.0; ammount of tread texture to move per second
   TreadDriveSpeedFraction = 0.3; fraction of locomotor speed below which treads stop moving.
   TreadPivotSpeedFraction = 0.6; fraction of locomotor speed below which we allow pivoting.


As long as your tread meshes are named
CODE
TREADSL01

and
CODE
TREADSR01

it'll work.

This is correct.With this code you only need one model.It will override the material settings for VPerSec and UPerSec.
0

#10 User is offline   killakanz 

  • Man with a heart, a soul. And a gun.
  • Group: Volcano Lord
  • Posts: 4,636
  • Joined: 12-November 03
  • Location:Hampshire, UK
  • Mod Registrations:

Posted 08 March 2005 - 12:47 AM

wow, KeyOp, since when have you been on the DS team matey?
0

#11 User is offline   medicdude 

  • Brigadier General
  • Group: Volcano Soldier
  • Posts: 2,879
  • Joined: 01-April 04
  • Location:Siberia; A place that is cold, the largest body of fresh water on Earth. Also, it is a good place to get uranium, olives, or a h

Posted 08 March 2005 - 12:50 AM

Since IA came in...
0

#12 User is offline   key0p 

  • Brigadier General
  • Group: Volcano Soldier
  • Posts: 2,107
  • Joined: 01-March 05
  • Location:Australia

Posted 08 March 2005 - 01:28 AM

Yeah, 1 week for me now, gday killa wink.gif
0

#13 User is offline   EvilViking 

  • stargazer
  • Group: Volcano Officer
  • Posts: 3,413
  • Joined: 10-April 04
  • Location:Virginia, USA

Posted 08 March 2005 - 01:37 AM

Hey Key0p! Welcome to DS man! laugh.gif

hehe, better stop spamming this before Phoib comes after me... ph34r.gif
0

#14 User is offline   flyby 

  • Grumpy Grandpa
  • Group: Volcano Officer
  • Posts: 5,049
  • Joined: 20-April 03
  • Mod Registrations:

Posted 08 March 2005 - 11:35 PM

Just come to think about it:
we should find the correlation between the "texture sliding speed" and the speed set in the locomotor, so that the sliding actually matches up...
0

#15 User is offline   key0p 

  • Brigadier General
  • Group: Volcano Soldier
  • Posts: 2,107
  • Joined: 01-March 05
  • Location:Australia

Posted 12 March 2005 - 05:20 AM

QUOTE(flyby @ Mar 9 2005, 7:35 AM)
we should find the correlation between the "texture sliding speed" and the speed set in the locomotor, so that the sliding actually matches up...

I dont think there is one, I think that TreadAnimationRate = 1.0 would be eqivelant to VPerSec = 1.The UV layout of the treads will also effect scroll rate.

This post has been edited by key0p: 12 March 2005 - 05:21 AM

0

#16 User is offline   Topknot 

  • 1st Lieutenant
  • Group: Volcano Soldier
  • Posts: 350
  • Joined: 04-February 05

Posted 28 March 2005 - 01:12 PM

Also to further simplifly this whole "tread" issue, here are some "rules" that should be followed:
    - Always design your Treads to run from Left to Right of your texture map
    - It's best to take the tread texture and have it reach both left and right side completely
    - You need to seperate the mesh faces that you want to texture as the treads, otherwise you'll find other parts of your model's uv's moving as well
    - They need to be named according to what side they are on: Hense Right side = TREADSR01 & Left Side = TREADSL01. This is also needed for like when the tracked vehicle pivot's to turn, then the treads counter rotate to eachother for a more real effect.
    - Make sure all your faces you're mapping FLOW in the same diretion, meaning that if you select all the faces in the uv edior and slide them left to right your viewport should show the textures all sliding in the same direction. Otherwise you'll get some faces going one was and others going opposite and no manner of V or U Persec's will fix it..wink.gif
    - You can overlap your faces but I find giving them as much texture space from left to right in a row not overlapping makes for a much prettier look and feel in game.
If you follow these guidelines then you'll have no problems getting them working. It is the easiest method to do it. Trust me I've done over 22 tanks now for Blitz 2 and I know it by heart now biggrin.gif

Here's an example of how you can save texture space for your main object and keep your treads all in one nice single texture:



Then you can select any type of tread so you desire by simple moving up or down the strips..biggrin.gif

Topknot wink.gif

This post has been edited by Topknot: 28 March 2005 - 01:14 PM

0

#17 User is offline   key0p 

  • Brigadier General
  • Group: Volcano Soldier
  • Posts: 2,107
  • Joined: 01-March 05
  • Location:Australia

Posted 01 April 2005 - 01:58 AM

Good work on consolidating the process topknot, now all we need is a new sticky, as a lot of people will probably not read the entire thread before trying it out wink.gif

As UVs are tiled, you can also map the treads to a single tiny bitmap like:

0

#18 User is offline   flyby 

  • Grumpy Grandpa
  • Group: Volcano Officer
  • Posts: 5,049
  • Joined: 20-April 03
  • Mod Registrations:

Posted 01 April 2005 - 11:12 AM

Correct, but if you want some dirt variation, you might make the treads a bit longer.

If you do it with a small map, you might considering making a 1:4 or a 1:8 map(32x256). As long it has the power of 2, it's fine.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users