UE1 - UT Footstep texture integration

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Rajada

Member
Jan 21, 2008
213
0
16
rajada.tumblr.com
I'm fiddling around with a bit of a total conversion for some game you've probably never heard of. I want to use the first unreal engine's per texture footstep sound field to make well, per texture footstep sounds. I found the WalkTexture event, but it doesn't seem to be called in any way that I can grab the texture data from it; I tried.

I had tried this once in what is basically UTPlayer:

Code:
Var sound CurTexStepSound;

event WalkTexture( texture Texture, vector StepLocation, vector StepNormal )
{
CurTexStepSound = Texture.FootStepSound;
}

simulated function FootStepping()
{
	local sound step;
	local float decision;
	
	if(!deathmatchgame(level.game).bGameIsAfoot)
	return;

	if ( FootRegion.Zone.bWaterZone )
	{
		PlaySound(WaterStep, SLOT_Interact, 1, false, 1000.0, 1.0);
		return;
	}

if(CurTexStepSound != none)
step = CurTexStepSound;

else
{
	decision = FRand();
	if ( decision < 0.34 )
		step = Footstep1;
	else if (decision < 0.67 )
		step = Footstep2;
	else
		step = Footstep3;
}
	if ( bIsWalking )
		PlaySound(step, SLOT_Interact, 0.5, false, 400.0, 1.0);
	else 
		PlaySound(step, SLOT_Interact, 2, false, 800.0, 1.0);
}

But that doesn't work, it would seem the event is unimplemented. SO my question would be does anyone have any ideas on how to implement a similar, custom function that can detect the texture you are walking on (and it's footstep sound field)?
 

gopostal

Active Member
Jan 19, 2006
848
47
28
They aren't implemented correctly. If you look at the variable ESurfaceTypes in UT2004:
http://www.gopostals.com/ut2k4/
You'll see there are a bunch of default sounds that are used broadly like "EST_Rock, EST_Dirt, EST_Metal, EST_Wood, EST_Plant, EST_Flesh, EST_Ice, EST_Snow, EST_Water, EST_Glass" and then a bunch of custom ones. The engine does a check on the walking texture and adjusts the footsteps sounds to match the surface. UT has none of this. You could force it by mod but I don't easily see any way to do it on pre-existing maps that wouldn't slow everything down with a bunch of checks.

If you were mapping forward, you could make this work but you will have to modify gametype to adjust footstep sounds (I think). Mutator won't get to it.
 

Rajada

Member
Jan 21, 2008
213
0
16
rajada.tumblr.com
Let's say I could edit nearly anything, Event WalkTexture was supposed to be implemented in walking and swimming states, so if I found a way to check the texture you're walking on in say, FootStepping() would it really be any more memory consuming than the Event WalkTexture would have been?

There has to be a way to check the texture below you, where is the Wormbo signal? :p
 
Apr 11, 2006
738
0
16
The Trace() function in UT2004 has an option to return a material - No idea whether this functionality exists in UT though. Worth a look at least.
 

gopostal

Active Member
Jan 19, 2006
848
47
28
You could do that but you'd have to subclass existing texture. No matter what, you'll still not get existing maps being able to use this.
 

Rajada

Member
Jan 21, 2008
213
0
16
rajada.tumblr.com
Not necessarily, let's assume for a moment (just so I can see if what I'm thinking is correct) I could edit texture and not a subclass and it worked fine. Could I use functions like Touch() in texture in a way that it detects if the touch is a pawn and sends FootStepSound to a storage variable in the pawn? Basically, I'm asking do basic functions (touch in this case) behave the same way they do in actors when used in Texture?

Edit:

Well touch is located in actor and unfortunately texture is below object, so what if instead I did something in Pawn, where I use a Touch() function to see if he touched a texture, then if the texture has changed from the last touched one, send the new footstep sound to that same storage variable?

Edit two:

No, Touch will only detect you touching an actor. Maybe I could fix the event walktexture with a bit of code in pawn? Is WalkTexture implemented anywhere where I could look at it and see how it works? Or at least why this one doesn't? Or perhaps would it be possible to script my own Touch function looking something like ObjectTouch(Object O)?
 
Last edited:

gopostal

Active Member
Jan 19, 2006
848
47
28
It is possible just that it's going to create a lot of overhead. In effect it will be another zoneinfo check, even though it will render as simulated.

Scratch that idea....It can't be simulated or the surrounding players will hear it wrong too. Damn...Yeah I'm starting to think like you that the cost-versus-reward is just too high.
 

Rajada

Member
Jan 21, 2008
213
0
16
rajada.tumblr.com
The only thing stopping me from figuring this out is the relation between a surface and a pawn. If I could figure out how to relay a touch between them I could figure the rest out easily. I'm not entirely convinced that this isn't possible, I mean, if they were going to use it for WalkTexture, there has to be a way to replicate it.
 

gopostal

Active Member
Jan 19, 2006
848
47
28
There is a reason they discarded it and I'll bet you are seeing it now. Some things were cut for bandwidth sake and I'll bet this was one.
 

meowcat

take a chance
Jun 7, 2001
803
3
18
You don't need to replicate anything. Just have whatever function does the footstepping be simulated and have it called from either the simulated 'tick' or 'timer', or better yet use the existing footstepping function (if it is present in the game you are using) that is called via an animnotify if in third person.

The Infiltration mod for UT had specific footstep sounds and decals for different walking materials. The way they did it (if I recall correctly) was they spawned and kept a reference to a special subclass version of 'decal' that contained all of the information for what decal to spawn based on the material type. For all of their materials used, they assigned a specific stepping sound to that texture's FootstepSound variable. The real trick was that since the decal class natively has a special version of trace (actually 'attachDecal') which returns the texture it hits, each time a footstep sound should be played they set the decal actor where the foot step would be, aimed it at the ground, attached the decal which then provided a reference to the texture, and then figured out from there based on the assigned sound, which actual 'decal' material to use.

The Unreal Fortress mod (I think) also used a modified decal class (player shadow perhaps?) to intermittently collect the ground texture when the shadow was updated. The name of the textures some times had material types in them (eg: SnowyGround_SNOWTEX or something like that) and you could just search the name for the material type to figure out what decal texture/sound to use. As I recall they use the ground texture to give their snipers camouflage (their cloaks took on the floor texture when they went prone).
 
Last edited:

Rajada

Member
Jan 21, 2008
213
0
16
rajada.tumblr.com
This would have been such an amazing solution if this game had decals in its actors, but alas it does not and has none of the special trace functions, sigh.
 

Creavion

New Member
Aug 27, 2005
471
0
0
Germany, Niedersachsen
Check AS-FOT-Chronoshift, copy the myleveled FootstepSoundManager actor, credit Revelation for HIS script in your maps readme then and done. Works in every gametype, but is supposed NOT work ONLINE.
 

Rajada

Member
Jan 21, 2008
213
0
16
rajada.tumblr.com
That also uses decals, the game I have never used decals so unless I can cram native functions in somehow (which I have tried) I can't use the decal method.
 

Rajada

Member
Jan 21, 2008
213
0
16
rajada.tumblr.com
I wonder if this class would help at all...

Code:
class TriggeredTexture extends Triggers;

var() Texture	DestinationTexture;
var() Texture	Textures[10];
var() bool		bTriggerOnceOnly;

var int CurrentTexture;

replication
{
	reliable if( Role==ROLE_Authority )
		CurrentTexture;
}

simulated event PostBeginPlay()
{
	Super.PostBeginPlay();
	CurrentTexture = 0;

	if( ScriptedTexture(DestinationTexture) != None )
		ScriptedTexture(DestinationTexture).NotifyActor = Self;
}

simulated event Destroyed()
{
	if( ScriptedTexture(DestinationTexture) != None && ScriptedTexture(DestinationTexture).NotifyActor == Self)
		ScriptedTexture(DestinationTexture).NotifyActor = None;
	
	Super.Destroyed();
}

event Trigger( Actor Other, Pawn EventInstigator )
{
	if( bTriggerOnceOnly && (Textures[CurrentTexture + 1] == None || CurrentTexture == 9) )
		return;

	CurrentTexture++;
	if( Textures[CurrentTexture] == None || CurrentTexture == 10 )
		CurrentTexture = 0;
}

simulated event RenderTexture( ScriptedTexture Tex )
{
	Tex.DrawTile( 0, 0, Tex.USize, Tex.VSize, 0, 0, Textures[CurrentTexture].USize, Textures[CurrentTexture].VSize, Textures[CurrentTexture], False );
}

This actor grabs a certain texture (scripted texture i believe) and changes it to one of ten others. I wonder if I could use that at all, maybe check if texture location equals player footzone location (really stretching it here, have no idea if it is remotely possible)? I'm just throwing the idea out there, but from what I've tried I don't seem to be able to put any of the functions from decal in as i believe they are defined elsewhere (in dlls/source code?) where I cannot actually access them.
 
Last edited: