unit reply sounds/voices

unit reply sounds/voices

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

unit reply sounds/voices

Post by knorke »

My main problem with them is that if you quickly click a unit multiple times the sounds play multiple times. Also happens if you give alot of orders in short time. This only allows the use of really short samples like "yea" or engine sounds. But something like "mega tank ready for mega battle, prepare for mega attack" will just become distorted noise.

Only game where it does not happen is zero K because they play the unit sounds via Lua.
Was that done because it allowed more features or as workaround because the engines unit reply system does not work so good?

Things I need help with:
-playing sounds should cut off if a new one starts.
-If you select more than one units, the "select" sound is not played at all, even if the units are of the same type.
-The "ok" plays on every order, like just pressing stop or changing move state. Is it possible to only play on move or attack?
-Is there a tag to give units an "engine sound" that loops as long as they are moving? (or on other events)

Atm in the unitdef I just do:

Code: Select all

	sounds = {
		select = {
			"unitreply/yea.ogg",
		},
		ok = {
			"unitreply/battle.ogg",
		},
	},
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: unit reply sounds/voices

Post by bobthedinosaur »

for some of those issues can you fill it with a blank sound file?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: unit reply sounds/voices

Post by knorke »

what do you mean?
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: unit reply sounds/voices

Post by bobthedinosaur »

a silent sound file to fill some of the alternative spots, as a cheap hack.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: unit reply sounds/voices

Post by knorke »

Code: Select all

ok = {
"unitreply/battle.ogg",
"5_seconds_of_silence.ogg",
"5_seconds_of_silence.ogg",
"5_seconds_of_silence.ogg",
"5_seconds_of_silence.ogg",
},
Like this?
I think the sounds are randomly chosen, so you would mostly get silence.
If they loop, it might somewhat work, depending on clickspeed.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: unit reply sounds/voices

Post by knorke »

tried it, does not really work. fast clicking obviously still gives annoying echoes. The sound needs to stop when a new one starts...
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: unit reply sounds/voices

Post by bobthedinosaur »

request an engine feature for more control over response sounds
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: unit reply sounds/voices

Post by Google_Frog »

Why don't you use a modified version of the Zero-K reply sound widget? You have shown you can write lua so modifying a widget to play sounds exactly when you want should be easy, a lot of the work is done for you already.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: unit reply sounds/voices

Post by knorke »

bobthedinosaur wrote:request an engine feature for more control over response sounds
made a mantis report http://springrts.com/mantis/view.php?id=2389
Google_Frog wrote:sound widget
yes but imo this is such a basic feature of an RTS engine that it is worth fixing.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: unit reply sounds/voices

Post by CarRepairer »

I don't think it's worth fixing. If it can be done in lua more easily than in the engine, why should time be wasted in engine development? In fact, by making this thread you prove the point that each mod and modder has different needs. Thus a lua widget is the best way to achieve this solution. Making a sound playing widget is very simple (and it was done many years ago already). If something is impossible or extremely difficult or costly to do in lua, that's when it should be an engine request.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: unit reply sounds/voices

Post by knorke »

each mod and modder has different needs
which modder has the need to hear annoying echo noises when he clicks on a unit?

lua sounds:
can they be made to obey the "unit reply volume" value in springsettings.exe or is there a way to read it?
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: unit reply sounds/voices

Post by FLOZi »

They can in next Spring, not sure if its available in current,


...

Damn I thought this had been added to the wiki.

And of course now I can't find it in the gitlog, because github search is dreadful.

Suffice to say, jK added a new parameter to PlaySoundFile which lets you specify which channel (general, unitreply, battle etc) it is played on.

I'm afraid I can't even tell you which number argument it is.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: unit reply sounds/voices

Post by knorke »

typical spring moment.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: unit reply sounds/voices

Post by FLOZi »

[17:31:27] <[S44]FLOZi> can you update wiki with new argument to playsoundfile? I could have sworn it was on there at some point :(
[17:31:37] <[S44]FLOZi> (and that is 0.83 right?)
[17:39:28] <[LCC]jK> done
[17:41:20] <[S44]FLOZi> <3
http://springrts.com/wiki/Lua_UnsyncedCtrl#Sounds

Code: Select all

Spring.PlaySoundFile Plays WAV or OGG sounds. 
 ( string "soundfile" [, number volume = 1.0
   [, number posx, number posy, number posz 
   [, number speedx, number speedy, number speedz ] ] ], [string/number channel ] ) -> nil | boolean
 `channel` is new in Spring0.83, and can be one of those:
   "battle" || "sfx" | 1
   "unitreply" || "voice" || 2
   "userinterface" || "ui" || 3
Image
Last edited by FLOZi on 27 Mar 2011, 18:43, edited 1 time in total.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: unit reply sounds/voices

Post by knorke »

nice.
closeenough.jpg
Post Reply

Return to “Game Development”