Jump to content


[0.82] New voice chat system


  • Please log in to reply
No replies to this topic

#1 BoeMan

BoeMan

    Developer

  • Administrators
  • 3988 posts
  • LocationFrysl├ón

Posted 24 March 2018 - 10:05 PM

Introduction
Over the past couple of weeks I've been working on a new voice chat sound system. For a while, this has been one of the most neglected systems within 1fx. Mod that hasn't got any attention for about 7 years. This overhaul extends some previous hard limits and adds a bunch of new functionality.

I just finished the code, and it is pushed upstream. That means the new nightly available tomorrow, Sunday March 25th 2018, will contain the new MVCHAT system. 0.82 final and higher will obviously also contain it.

MVCHAT sound system
The new system goes by the name of the MVCHAT sound system, where MVCHAT stands for: Multilingual Voice Chat.

The new MVCHAT sound system supports the following (in a nutshell, let me elaborate on it a little later on):
  • 1-999 sound tokens, extending the previous token limit of 200 greatly.
  • Support multiple languages per sound token, namely:
    • English (en)
    • Spanish (es)
    • Chinese (cn)
    • German (de)
    • Russian (ru)
  • Support gender sounds per sound token language.
  • Auto-select male/female sound dependent on skin or force gender when explicitly set.
  • Customizable default language per sound token.
  • Customizable "NEXT" sound (#n chat token).

As you might notice, even though there are 999 sound tokens available, the limit of actual sounds can exceeded 999 as one sound token may hold up to a maximum of 10 actual sounds across languages and genders.

How to use the sounds in chat
If you stick to the following rules, making binds and playing sounds is relatively easy.

Some examples.
If you do the following:
@1
The first sound, Call for Reinforcements, will play. Since you didn't explicitly specify a language (and gender), the default sound will play. English is set as the default sound language, so the English male or female sound will play depending on your skin.

If you always want to hear the English sound, for example for binds, you're far better off explicitly specifying the sound. That way your bind is consistent across servers. After all, another server may have set the Spanish sound to be the default.

You can specify the language by appending the country code directly to the sound, for example:
@1en <-- English sound
@1es <-- Spanish sound
@1ru <-- Russian sound

The above example still selects the male/female sound depending on your skin, if the sound is available to begin with. You can also explicitly specify the gender sound to be played. This effectively makes sure your bind always sound the same. To specify a gender, you must always specify the sound language too:

@1en:m <-- English male sound
@1cn:f <-- Chinese female sound

If the gender sound is unavailable for that language, e.g. female, and the male sound is available, that will play instead. If the language is unavailable, the default sound language will play instead.

Of course, doing hidden sounds is still supported, using '!' or '&' instead of '@'.

!1en:f <-- English female sound, no text is displayed
&1es:m <-- Spanish male sound, no text is displayed

Those features still work.

With this short tutorial you're ready to explore the new sounds in the default soundpacks.

List sounds
The /sounds command that used to list the first 100 sounds is now used as a tutorial command, to help people with the MVCHAT system. The sounds are now listed per "page". Each page holds up to 100 sounds (if available on the server) and can be issued as such:

/sounds0 <-- Sounds 1-100
/sounds1 <-- Sounds 101-200
...
/sounds9 <-- Sounds 901-1000

Sounds for 1fx. Mod on MP TEST
MP TEST (Demo) doesn't come with a lot of default sounds, therefore I created an alternative soundpack for MP TEST. It consists of 16 sound tokens (some have both male and female sounds). Nothing special, but it doesn't require the client to download any additional soundpack.

Extra default sounds
We've also extended the number of default sounds with 40 new sounds. You don't need any extra soundpack to use them. We've called it the "extended" soundpack.

v1.00 users: If you don't use the RPM soundpack on a server, those new sounds will be 111-150. If the server does use the RPM soundpack, the new sounds will be 201-240. This makes sure your existing binds are not lost.

Many thanks to Shoke for providing the extra sounds.

Upgrading your server
If you plan on upgrading your server to a 0.82 nightly containing the MVCHAT system, or to 0.82 final (or higher), you will need the new MVCHAT files.

You need to copy the following directory to your server:
  • 1fx/files/mvchats

The old .vchat files in the 1fx directory can be removed, since 1fx. Mod doesn't parse them anymore.

If you're on v1.00 and want to use the RPM soundpack, you need to perform the following manual tweak:
  • Delete 'extended.mvchat' from '1fx/files/mvchats'
  • Copy the 'rpm + extended.mvchat' from the 'Optional files/RPM soundpack' directory of your 1fx. Mod release to '1fx/files/mvchats'

New file structure
This section is for those that wish to create their own MVCHAT files. If you're just going to use the new system, you can skip this section.

Since the old file structure didn't suffice for this new system I've also created a new file type, called the .mvchat file. .mvchat files must be placed in the following directory to be recognized and parsed by the system: 1fx/files/mvchats. This is also where you'll find the default 0.82 mvchat files.

A sound is defined as such, this example only holds English male and female sounds:

1
{
	number		"1"				// The sound token number in chat, must be 1-999
	text		"Call for reinforcements"	// The text to display.

	en						// The country code for this language. Must match "en", "es", "cn", "de" or "ru".
	{
		default		"yes"			// When default is set to yes, this language is considered the default sound language.
		next		"yes"			// When next is set to yes, this sound token and this specific language is considered the next sound (#n chat token).

		male					// The male sound for this language.
		{
			sound		"sound/enemy/english/male/call_for_reinforcements.mp3"
		}

		female					// The female sound for this language.
		{
			sound		"sound/enemy/english/fmale/call_for_reinforcements.mp3"
		}
	}
}

This is what the same sound looks like but with multiple languages supported (all languages except German, also note how not all female languages are present):

1
{
	number		"1"
	text		"Call for reinforcements"

	en
	{
		default		"yes"

		male
		{
			sound		"sound/enemy/english/male/call_for_reinforcements.mp3"
		}

		female
		{
			sound		"sound/enemy/english/fmale/call_for_reinforcements.mp3"
		}
	}

	es
	{
		male
		{
			sound		"sound/enemy/spanish/soldier/call_for_reinforcements.mp3"
		}
	}

	cn
	{
		male
		{
			sound		"sound/enemy/cantonese/male/call_for_reinforcements.mp3"
		}

		female
		{
			sound		"sound/enemy/cantonese/fmale/call_for_reinforcements.mp3"
		}
	}

	ru
	{
		male
		{
			sound		"sound/enemy/russian/soldier/call_for_reinforcements.mp3"
		}
	}
}

Notes:
  • If no sound language is set to be the default language, the system will automatically pick an available language (checks from top, so English first).
  • If a sound token is defined without any actual sound files, it is considered empty and cannot be used at all.
  • If the g_mvchatCheckSoundFiles CVAR is set to 1 (default is 0), sound files defined are checked if they exist and if not, a warning will appear in the server console. This CVAR helps debugging new .mvchat files greatly.
  • If no sound is defined to be the next sound, no sound will play when someone uses the #n chat token.


I hope you guys like the redesigned sound system. If you have any questions or if you encounter any bugs, be sure to let me know.

Have fun!
Kind regards,

BoeMan




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users