Announcement

Collapse
No announcement yet.

Wait..you can get footstep sounds in Darkplaces?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Hello Seven. I hope you're right about the copyleft, I'm already used to these sounds. Thank you for sharing the info !
    engine: quore.free.fr

    Comment


    • #17
      Originally posted by Seven View Post
      @ Rook,

      I would be very interested in your patch Rook.
      Code:
      void CL_Footsteps(entity_t	*ent, int frame)
      {
      	extern	sfx_t		*cl_sfx_step1;
      	extern	sfx_t		*cl_sfx_step2;
      	extern	sfx_t		*cl_sfx_step3;
      	extern	sfx_t		*cl_sfx_step4;
      
      	if (ent->steptime > cl.time)
      		return;
      
      	if (ent != &cl_entities[cl.viewentity])
      		return;
      
      	if (!((ent->modelindex == cl_modelindex[mi_player])||(ent->modelindex == cl_modelindex[mi_md3_player])))
      		return;
      
      	if (TruePointContents(ent->origin) != CONTENTS_EMPTY)// if in water etc.. no sound
      		return;
      
      	if (frame == 2 || frame == 5 ||	frame == 7 || frame == 10)
      	{
      		vec3_t	dest, forward, right,up;
      		trace_t	trace;
      		float f;
      		int	i,e;
      		entity_t *p;
      
      		AngleVectors (ent->angles, forward, right, up);
      		
      		VectorMA (ent->origin, -32, up, dest);					
      			
      		Q_memset (&trace, 0, sizeof(trace_t));
      
      		trace.fraction = 1;
      
      		SV_RecursiveHullCheck(cl.worldmodel->hulls, 0, 0, 1, ent->origin, dest, &trace);
      
      		if (trace.fraction == 1)
      		{			
              	ent->steptime = cl.time + 0.1;//R00k:(2.010) Since the player model animates at 10 frames per sec, no need to come back here until time + 1/10...
      			return;
      		}
      		
      		f = (rand()%4)+1;
      
      		e = (int)cl.viewentity;//play my own footsteps locally
      
      		if (f == 1)
      			S_StartSound(e, 0, cl_sfx_step1, ent->origin, 0.40f, 1.0f);
      		else if (f == 2)
      			S_StartSound(e, 0, cl_sfx_step2, ent->origin, 0.40f, 1.0f);
      		else if (f == 3)
      			S_StartSound(e, 0, cl_sfx_step3, ent->origin, 0.40f, 1.0f);
      		else
      			S_StartSound(e, 0, cl_sfx_step4, ent->origin, 0.40f, 1.0f);
      		
      		ent->steptime = cl.time + 0.3;
      	}
      }
      Last edited by R00k; 08-22-2010, 02:57 PM.
      www.quakeone.com/qrack | www.quakeone.com/cax| http://en.twitch.tv/sputnikutah

      Comment


      • #18
        Those sounds are from Half-Life.
        Quake 1 Singleplayer Maps and Mods

        Comment


        • #19
          Yeah definitely from half-life. Not sure if they would fit really. I like the Quake 2 and 3 steps, sounds like a huge marine boot. very quakey.

          Comment


          • #20
            Has the source for Half-Life been released ?
            I really dont know.
            Can lxndr use these sounds for his engine then ?

            Anyway,
            if you are sensitive and pay attention to the footsteps sounds,
            you will find the ones I posted above in many many Q1 mods available around.
            Using them for a complete engine is of course something different... I guess.
            I unfortunately dont know much about legal things,
            so I leave it to the ones that have.


            @ Rook

            Thank you very much for your code.
            A pity, you dont right one more word of explanation about it.
            So I dont know in which .qc file I have to implement it.
            But I guess its difficult and complicated, otherwise you would have surely write some words about it.


            Greetings
            Seven

            Comment


            • #21
              okay, it's all in cl_main.c, but just to clarify, this only plays footsteps for YOUR player, ie singleplayer, not anyone else's footsteps in multiplayer so I dont wanna hear peeps crying h4x0r!

              first create a cvar for footsteps, near the top of the file next to the other cvar definitions.

              Code:
              cvar_t	cl_footsteps		= {"cl_footsteps", "0", true};
              Register the cvar near the bottom of the file where u find the other registrations for cvars

              Code:
              Cvar_RegisterVariable (&cl_footsteps);
              Now in CL_RelinkEntities in the loop that runs through all the entities,
              Code:
              	// start on the entity after the world
              	for (i = 1, ent = cl_entities + 1 ; i < cl.num_entities ; i++, ent++)
              	{
              somewhere before the if model->flags will be a good spot, add...

              Code:
              		if (cl_footsteps.value)
              			CL_Footsteps(ent,ent->frame);
              now scroll back up somewhere BEFORE CL_RelinkEntities and add the CL_Footsteps function

              Code:
              void CL_Footsteps(entity_t	*ent, int frame)
              {
              	extern	sfx_t		*cl_sfx_step1;
              	extern	sfx_t		*cl_sfx_step2;
              	extern	sfx_t		*cl_sfx_step3;
              	extern	sfx_t		*cl_sfx_step4;
              
              	if (ent->steptime > cl.time)
              		return;
              
              	if (ent != &cl_entities[cl.viewentity])
              		return;
              
              	if (!((ent->modelindex == cl_modelindex[mi_player])||(ent->modelindex == cl_modelindex[mi_md3_player])))
              		return;
              
              	if (TruePointContents(ent->origin) != CONTENTS_EMPTY)// if in water etc.. no sound
              		return;
              
              	if (frame == 2 || frame == 5 ||	frame == 7 || frame == 10)
              	{
              		vec3_t	dest, forward, right,up;
              		trace_t	trace;
              		float f;
              		int	i,e;
              		entity_t *p;
              
              		AngleVectors (ent->angles, forward, right, up);
              		
              		VectorMA (ent->origin, -32, up, dest);					
              			
              		Q_memset (&trace, 0, sizeof(trace_t));
              
              		trace.fraction = 1;
              
              		SV_RecursiveHullCheck(cl.worldmodel->hulls, 0, 0, 1, ent->origin, dest, &trace);
              
              		if (trace.fraction == 1)
              		{			
                      	ent->steptime = cl.time + 0.1;//R00k:(2.010) Since the player model animates at 10 frames per sec, no need to come back here until time + 1/10...
              			return;
              		}
              		
              		f = (rand()%4)+1;
              
              		e = (int)cl.viewentity;//play my own footsteps locally
              		
              		if (f == 1)
              			S_StartSound(e, 0, cl_sfx_step1, ent->origin, 0.40f, 1.0f);
              		else if (f == 2)
              			S_StartSound(e, 0, cl_sfx_step2, ent->origin, 0.40f, 1.0f);
              		else if (f == 3)
              			S_StartSound(e, 0, cl_sfx_step3, ent->origin, 0.40f, 1.0f);
              		else
              			S_StartSound(e, 0, cl_sfx_step4, ent->origin, 0.40f, 1.0f);
              		
              		ent->steptime = cl.time + 0.3;
              	}
              }
              and finally, you need to assign the sound effects.

              open up cl_tent.c and add near the top
              Code:
              sfx_t		*cl_sfx_step1;
              sfx_t		*cl_sfx_step2;
              sfx_t		*cl_sfx_step3;
              sfx_t		*cl_sfx_step4;
              sfx_t		*cl_sfx_step5;
              and in CL_InitTEnts, load them...
              Code:
              	cl_sfx_step1 = S_PrecacheSound ("misc/step1.wav");	
              	cl_sfx_step2 = S_PrecacheSound ("misc/step2.wav");	
              	cl_sfx_step3 = S_PrecacheSound ("misc/step3.wav");		
              	cl_sfx_step4 = S_PrecacheSound ("misc/step4.wav");
              That's it!
              Last edited by R00k; 08-22-2010, 03:04 PM.
              www.quakeone.com/qrack | www.quakeone.com/cax| http://en.twitch.tv/sputnikutah

              Comment


              • #22
                Footsteps should not be done engine side.

                Reason: They will overwrite footstep sounds from mods, such as Remake Quake.

                Stuff that makes a sound ingame should be done from qc! Vanilla Quake isn't meant to have footsteps, please don't break mods by adding them engine side.
                Scout's Journey
                Rune of Earth Magic

                Comment


                • #23
                  True. Two things are possible, a player can use his own custom sounds for "player" footsteps, or set cl_footstep 0 and use the sounds the mod provides.
                  The default is OFF and even if enabled it only supports a single generic sound type for all surfaces. It's really meant for mods that dont have footstep sounds, like Malice, but for players who like the pitter-pat of lil feet.
                  www.quakeone.com/qrack | www.quakeone.com/cax| http://en.twitch.tv/sputnikutah

                  Comment


                  • #24
                    Players who like it will routinely set them to on, hence not even noticing when mods provide their own :-(

                    ah well, another reason to have your own engine.
                    Scout's Journey
                    Rune of Earth Magic

                    Comment


                    • #25
                      ...

                      I'll just rip the code out so there's no issue. Besides a quakeC solution, a better way would be CSQC.
                      Last edited by R00k; 08-23-2010, 01:28 PM.
                      www.quakeone.com/qrack | www.quakeone.com/cax| http://en.twitch.tv/sputnikutah

                      Comment


                      • #26
                        Ideally, the engine should provide the default functionalities, which in turn could be override/improved by mods.

                        But considering the number of mods and engines, there's a crucial need for a common protocol, often called standards. As there's none actually, we could define it just right here.
                        engine: quore.free.fr

                        Comment


                        • #27
                          Originally posted by lxndr View Post
                          Ideally, the engine should provide the default functionalities,
                          Ya, client-side quakeC code can be provided by the mod author for use with their mod. It can even use DarkSnow's footstep code, with a few changes for implementation, and using DarkPlaces features for texture lookup. In return, any engine that supports the functionality of CSQC can also use that code to facilitate footsteps for any other mod. DarkPlaces just so happens to also support CSQC. The original post of this thread was for footsteps in DP, not engine_xyz, or my_quakeC_mod.
                          www.quakeone.com/qrack | www.quakeone.com/cax| http://en.twitch.tv/sputnikutah

                          Comment


                          • #28
                            I have no idea how CSQC works, I guess it's time to me to look into DP/FTE code.
                            engine: quore.free.fr

                            Comment


                            • #29
                              DeathMatch Essentials v1.1 has footsteps for single player quake...i use doom3 player step wavs for it though becuase the mod sounds werent loud enough for me.

                              i like the mod but it has these sprite particles that look bad...if you run sprites it should look great.

                              i had to look around to find the zip file for this mod...i think havoc used some of this mods code for dpmod.

                              Comment


                              • #30
                                I would think that DME used havoc's code, since LH has a PhD in Quake
                                www.quakeone.com/qrack | www.quakeone.com/cax| http://en.twitch.tv/sputnikutah

                                Comment

                                Working...
                                X