Jump to content
DerelictStudios Forums
Ruderalis

Animated Shaders

Recommended Posts

Hi!

 

Doesn't belong to my question but first of all: Congratulations for completing a complex mod like Blitzkrieg II! I hope i can get CnC Generals running the next days to play it.. (good old serious error ;) )

...

But my question doesn't concern Generals but RA3 - Modding: Which Shaders are used for uv-animated Textures in RA3? I tried at least every shader delivered with the Mod SDK but couldn't figure out how to make a simple animation like moving treads. I think i get some kind of animation with some shaders but i don't know what i did exactly and uhm it didn't seem to have any kind of sense ;)

 

P.S.: I was modding Generals for some time when the game was out and there was a huge Modding Community if i remember things right. It doesn't look like there are a lot of guys interested in modding CNC3/RA3 or am i just looking on the wrong pages?

 

English isn't my mother tongue and i have not spoken it for about half a year so i hope you excuse mistakes. :)

Share this post


Link to post
Share on other sites

Thanks for your help. I used your tutorial some time ago to get some basics but i didn't remember your tutorial explained how to make treads going.

The shader options for defaultw3d look a bit different to those you show in your tutorials. The UVo scl settings are made with color channels. You can also change alpha, hue, saturation and value. Don't know if that matters.

If i see things right i have to assign a W3D material with my treads to the treads and then a shader which uses the w3d-material? Or can i just use the defaultw3d.fx, select my texture and work with the UVo settings. W3D-material doesn't seem to work for unknown reason. If i try to tick the box Stage 0 Texture 3DSmax crashes..

Share this post


Link to post
Share on other sites

If W3D material keeps crashing try using a standard material. Is the UVo scl setting only a colour swatch? No option to change it to a number swatch?

 

I really need to take an evening to play with the RA3 toolset...

Share this post


Link to post
Share on other sites

At least i can export it without error when using standard materials but i can't see any animation neither in 3dsmax nor in game. In 3dsmax the Treads are turning black when the shader is applied.

In game RA3 doesn't seem to work with hidden SubObjects for the treads. If i'm right this code

				<AnimationState
				ParseCondStateType="PARSE_NORMAL"
				ConditionsYes="MOVING"
				Flags="RANDOMSTART"
				StateName="STATE_DoorClosed">
				<Animation
					AnimationName="SUAntiVehicleVehicleTech3_MOVA"
					AnimationMode="LOOP"
					AnimationSpeedFactorMin="0.8"
					AnimationSpeedFactorMax="1.2" />
					<script>
						Prev = CurDrawablePrevAnimationState()
						if Prev == "STATE_DoorOpened" then
						CurDrawableSetTransitionAnimState("TRANS_DoorClose")
						end
					</Script>	
			</AnimationState>

is responsible for the moving animation. So there is no part for moving right or left neither, like i saw it in an other tutorial for CNC3 where there were SubObjects for Stop, Moving, Right and Left.

I don't own CNC3 so i can't compare it to RA3.

Maybe i'm totally wrong and the animations are defined anywhere else.

For the Uvo scl setting i can't find any way to change it to a number swatch but i think the RGB channels are the Options for movement.

 

Thanks for your effort!

Share this post


Link to post
Share on other sites

Looks like they've switched to a more efficient way to make treads work for RA3. I never really liked the way C&C3 did it.

 

Once I get some time off, I'll be able to look into this.

 

The only thing I can advise you for now is see if you can open any RA3 sample units in Max and have a close look at it. That's pretty much how I figured out C&C3 units, hopfully RA3 units are just as revealing.

Share this post


Link to post
Share on other sites
Looks like they've switched to a more efficient way to make treads work for RA3. I never really liked the way C&C3 did it.

 

Once I get some time off, I'll be able to look into this.

 

The only thing I can advise you for now is see if you can open any RA3 sample units in Max and have a close look at it. That's pretty much how I figured out C&C3 units, hopfully RA3 units are just as revealing.

Would have been nice by EA to put a tank with moving treads into the artpack which is included in the game...

It looks like they used one mesh for the complete model so there are no extra meshes for treads. To move parts of this mesh there is a smaller version of the model in the scene, which acutally has different parts like "Bone_tread_wheels_right". So this Object is linked to the right treads of the complete mesh, which is exported as geometry.

But i couldn't figure out how they get animated texture going with this way. I think there have to be a XML where Treads are defined?

 

I was wondering about the "MeshInstanceTemplate.xml" which seems to use the Predatortank of CNC3 in some kind of way:

<?xml version="1.0" encoding="us-ascii"?>
<AssetDeclaration xmlns="uri:ea.com:eala:asset">

<MeshInstanceTemplate
	   id="GlobalMeshInstanceTemplate">
	<Rule MeshID="GUPREDTANK.TREADSSTOP" Instances="4"/>
</MeshInstanceTemplate>

</AssetDeclaration>

Looks like RA3 is a bit different to CNC3 with the organization of the meshes.

Share this post


Link to post
Share on other sites

			<TruckDraw
			id="ModuleTag_Draw"
			OkToChangeModelColor="true"
			LeftFrontTireBone="Bone_Tracks_Front_Left"
			RightFrontTireBone="Bone_Tracks_Front_Right"
			LeftRearTireBone="Bone_Tracks_Rear_Right"
			RightRearTireBone="Bone_Tracks_Rear_Left"
			
			TireRotationMultiplier="0.0"		
			InitialRecoilSpeed="0.5"
			MaxRecoilDistance="5"
			RecoilDamping="2.0"
			RecoilSettleSpeed="3.0"
			
			ExtraPublicBone="Bone_Tread_Front_Left Bone_Tread_Front_Right Bone_Tread_Rear_Left Bone_Tread_Rear_Right FXTracksL FXTracksR Bone_Turret Bone_Turret_Pitch FX_Laser FXBone_Muzzle BONE_GUN_MUZZLE"
			TrackMarks="EXTnkTrack"
			TrackMarksLeftBone="FXTracksL"
			TrackMarksRightBone="FXTracksR">
			<TreadTerrainParticles>DefaultTankTerrainParticleMapping</TreadTerrainParticles>

			<TreadScrollingMap
				LeftTrack="Bone_Tread_Front_Left"
				RightTrack="Bone_Tread_Front_Right"
				SpeedMultiplier="-0.06"
				TreadDriveSpeedFraction="10%"/>
			<TreadScrollingMap
				LeftTrack="Bone_Tread_Rear_Left"
				RightTrack="Bone_Tread_Rear_Right"
				SpeedMultiplier="-0.06"
				TreadDriveSpeedFraction="10%"/>
											

This is from the Guardian Tanks XML. A Tank with Treads, not tires. Seems they manage the animation this way. But i couldn't explain to myself the part "TreadScrollingMap". Why do they use a bone here? ..

 

 

Share this post


Link to post
Share on other sites

It looks like they use a bone to label meshes that need to scroll the UVW map for the treads. Makes sense, much easier to set up the vehicle and this would also allow multiple independent treads on the vehicle.

Share this post


Link to post
Share on other sites
It looks like they use a bone to label meshes that need to scroll the UVW map for the treads. Makes sense, much easier to set up the vehicle and this would also allow multiple independent treads on the vehicle.

Hm at least i figured out how to du usual animated textures with the defaulw3d.fx and it works..

But how do you scroll the uvw map with a bone? Do i have to bind the vertices of the Mesh to the bone with this WWSkinBinding and use an animated texture on the bone? I don't get it..

Share this post


Link to post
Share on other sites

It's just a guess, I still can't test the idea myself but I think the game is hard-coded to scroll the texture across the mesh of the treads, much like how Generals did but this time you don't need any special settings for the texture. The bonus with the game being able to control it rather than having tread sets like C&C3 is the game can dynamically control the direction and speed of the treads better as the vehicle moves.

Just a normal texture for the treads applied to the mesh, then link the bone to the mesh with a WWskin and the game takes over from there.

Share this post


Link to post
Share on other sites
It's just a guess, I still can't test the idea myself but I think the game is hard-coded to scroll the texture across the mesh of the treads, much like how Generals did but this time you don't need any special settings for the texture. The bonus with the game being able to control it rather than having tread sets like C&C3 is the game can dynamically control the direction and speed of the treads better as the vehicle moves.

Just a normal texture for the treads applied to the mesh, then link the bone to the mesh with a WWskin and the game takes over from there.

If it worked this way it would have to work to use the Tread Meshes themselve as the bones defined in the <TreadScrollingMap......> or not?

I copied the tread to create a bone, linked the mesh with the texture to the bone with a WWskin but it doesn't work. If it worked this way i don't really get the point why you need a bone for the uvw scrolling.

 

Edit// Forget about the text above^^

I forgot to assign the bones in the XML. :(

So hail to the king killakanz ;) Thanks alot!

 

I used the ObjectsAlliedTread.fx as the shader for the Treads, doesn't seem to be much different to the normal AlliedObjects.fx, i have to test whether it works with both shaders.

At least its really simple. Just clone the treads, bind them to the bones with the WWskin and use the bones in the xml. Looks a lot easier and more comfortable than the way i've seen for CNC3.

 

edit2/ To have the treads moved at accurate time and on the right side when turning, you have to use the shader for treads, which is used by every faction.

Edited by Ruderalis

Share this post


Link to post
Share on other sites
Looks a lot easier and more comfortable than the way i've seen for CNC3.

 

edit2/ To have the treads moved at accurate time and on the right side when turning, you have to use the shader for treads, which is used by every faction.

 

Excellent, indeed a far beter way than C&C3. Good to know. Well done.

Share this post


Link to post
Share on other sites
Looks a lot easier and more comfortable than the way i've seen for CNC3.

 

edit2/ To have the treads moved at accurate time and on the right side when turning, you have to use the shader for treads, which is used by every faction.

 

Excellent, indeed a far beter way than C&C3. Good to know. Well done.

So you may add this as a hint to your tutorial for beginners in RA3-Modding. Everthing else is nearly the same and your tutorial is very good for beginners because it shows the whole way of bringing a model (and even model it) into CNC3/RA3 as a unit. And maybe this will get some new guys to do stuff for RA3.

P.S. If you want your tutorial to be translated in german i would like to do it.

Share this post


Link to post
Share on other sites

I might well do that, since there's little difference in other aspects of setting up a unit.

Also if you wish to translate, feel free to do so. I'm still waiting for my net connection at home to be sorted out before I can update the site, it's already been translated into Spanish.

Share this post


Link to post
Share on other sites

Had to do some work for university last weeks, but i've got some more time now, especially because i hurt my leg.. :angry:

If i would translate your tutorial, would it be ok to just translate the part concerning CNC3? At least i don't own 3dsmax in german so i don't know how some things are called in the german version. Translation would be easy without the modelling part.

@CountvonPhoib: If you don't want me to translate a book, i may translate some things. But i can't guguarantee anything.

 

Here are some screenshots from the work i did for RA3. Nothing special, just playing with the code and trying to use the shaders in a proper way.

Down at the right corner on the picture with the Phantom you can see, what you're able to do with the normal maps ;) This was more a kind of accident but i think you can do some pretty stuff with normal maps in RA 3 ;)

Hope you like it at least a bit, i didn't do any modding or even modelling/texturing work for a long time so don't be to hard B)

(Of course the tank has working treads ;) )

http://img269.imageshack.us/img269/826/hueyh.jpg

http://img228.imageshack.us/img228/5330/screenoio.jpg

http://img142.imageshack.us/img142/6994/allk.jpg

Edited by Ruderalis

Share this post


Link to post
Share on other sites
Ever considered signing up to the Volcano? :D

 

And I'm afraid the text is book-size caliber to translate, but if you are in need of a mod to model for... :)

I think i have to get into moddeling again before i'm able to do good work. At the moment my workflow is crappy and i forgot a lot.

At last the uvw unwrapping takes a lot of time right now but i'm getting better again..

But if you have a mod project searching for modelers, i'm open for everything. (don't know whether this is the right expression in english^^)

Don't know what you mean with the volcano? :o

 

Is your text another modding tutorial?

 

Share this post


Link to post
Share on other sites

The volcano... see my signature, it's our pet name for Derelict Studios :)

 

Do you have msn or ICQ?

 

Contact me on either;

MSN: emiel.suilen@gmail.com

ICQ: 57926201

Share this post


Link to post
Share on other sites
At the moment my workflow is crappy and i forgot a lot.

 

Sounds like everyone else here! When can you (not) start?

 

:P

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×