![]() |
|
|
#1 |
|
Registered User
Join Date: Jan. 21st, 2008
Posts: 196
|
Footstep texture integration
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);
}
__________________
How to play NAB |
|
|
|
|
|
#2 |
|
Registered User
Join Date: Jan. 19th, 2006
Posts: 589
|
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. |
|
|
|
|
|
#3 |
|
Registered User
Join Date: Jan. 21st, 2008
Posts: 196
|
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
__________________
How to play NAB |
|
|
|
|
|
#4 |
|
Registered User
Join Date: Apr. 11th, 2006
Posts: 695
|
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.
|
|
|
|
|
|
#5 |
|
Registered User
Join Date: Jan. 21st, 2008
Posts: 196
|
Doesn't look like UT has it. Since this is a TC, how about coding something into texture?
__________________
How to play NAB |
|
|
|
|
|
#6 |
|
Registered User
Join Date: Jan. 19th, 2006
Posts: 589
|
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.
|
|
|
|
|
|
#7 |
|
Registered User
Join Date: Jan. 21st, 2008
Posts: 196
|
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)?
__________________
How to play NAB Last edited by Rajada; 9th Feb 2011 at 02:51 PM. |
|
|
|
|
|
#8 |
|
Registered User
Join Date: Jan. 19th, 2006
Posts: 589
|
Don't forget you will also have to replicate this stuff too.
|
|
|
|
|
|
#9 |
|
Registered User
Join Date: Jan. 21st, 2008
Posts: 196
|
Well that's a given but it doesn't help if I don't actually create it first which I am starting to think isn't possible.
__________________
How to play NAB |
|
|
|
|
|
#10 |
|
Registered User
Join Date: Jan. 19th, 2006
Posts: 589
|
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. |
|
|
|
|
|
#11 |
|
Registered User
Join Date: Jan. 21st, 2008
Posts: 196
|
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.
__________________
How to play NAB |
|
|
|
|
|
#12 |
|
Registered User
Join Date: Jan. 19th, 2006
Posts: 589
|
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.
|
|
|
|
|
|
#13 |
|
Registered User
Join Date: Jan. 21st, 2008
Posts: 196
|
Though you may be right, the bandwidth back then was less than great. Remember when our modems made screechy noises?
__________________
How to play NAB |
|
|
|
|
|
#14 |
|
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).
__________________
"What do you mean it doesn't exist clientside?" Got a Pawn problem? Ask me about: Leaning, Prone, Limiting Strafing, Mantling, Dashing, Crouch Jumping, Using Cover, Parkour Moves My Generic Mods for UT2K4: Yet Another Real-life Mod: Class-based play, generic realistic weapons, unoriginal gameplay, w/ cheap COD4 knockoff ![]() TD Vehicles v124: HMMWV, MI4Hound, Black Hawk & AH-6 Helicopters, Motorcycle, IFAV Jeep, Abrams Tank * The only "truth" is what you can get away with * Last edited by meowcat; 9th Feb 2011 at 09:18 PM. |
|
|
|
|
|
|
#15 |
|
Registered User
Join Date: Jan. 21st, 2008
Posts: 196
|
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.
__________________
How to play NAB |
|
|
|
|
|
#16 |
|
Dunno if it helps, but the UT single player mod Operation Na Pali institutes texture-specific footstep sounds as well.
|
|
|
|
|
|
|
#17 |
|
Registered User
Join Date: Jan. 21st, 2008
Posts: 196
|
Well, it probably also uses decals, but I will take a look since I own it.
__________________
How to play NAB |
|
|
|
|
|
#18 |
|
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.
__________________
My maps: UT99.org CMP2 Maps (7 total, including bonuspack) Single Player + Monsterhunt: Antalius (Jungle Setting) CTF-UTR-Syntra (Standalone UTR Bonus Map) |
|
|
|
|
|
|
#19 |
|
Registered User
Join Date: Jan. 21st, 2008
Posts: 196
|
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.
__________________
How to play NAB |
|
|
|
|
|
#20 |
|
Registered User
Join Date: Jan. 21st, 2008
Posts: 196
|
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 );
}
__________________
How to play NAB Last edited by Rajada; 11th Feb 2011 at 02:05 AM. |
|
|
|
![]() |
| Tags |
| footstep, texture |
| Thread Tools | |
| Display Modes | |
|
|