Full Speech!?

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Locked
Kory

Full Speech!?

Post by Kory »

Hello! I've been enjoying Exult for many years. My thanks to the Exult team!

I don't want to be banished after my first post... but... I just have to ask -- how plausible is it to trigger an mp3 file (if it exists in a specified folder) for each block of conversation speech?

- Kory
Deceitful Dragon
TDI

Re: Full Speech!?

Post by TDI »

Probably a super-duper huge lot more plausible than recording all of that speech.
Kory

Re: Full Speech!?

Post by Kory »

hehehe.. yeah... tons of recording work!!!

... which is why I was thinking it would be an optional feature enabled by the existence of the specific mp3 file.

Also, the work load it one of a few reasons why I was thinking mp3 instead of the existing format used for the guadians speech... The average U7 fan can download Audacity or whatever and read through some lines of the conversation script for one character. If a logical naming convention could be made (-.mp3), then we're nearly there.

I could put together a website where people could submit their lines to be reviewed and rated by other players. In fact... based on the snippets I've seen of the conversation scripts, I could probably get the site to parse it and provide drop-downs of npc's and a upload form for each of their lines to make it easier for ppl to figure out what they need to submit... Then, when all the lines for one character are submitted, people could rate the acting/sound quality and the highest-rated for each npc would be added to periodic releases...

... I'm no voice actor, but I could do the lines of a peasant or two... Maybe someone else out there has always aspired to be a Sherry the Mouse... Eventually people with better sound equipment and acting ability will submit their lines... and maybe some day we'd have a decent collection...

- Kory
Deceitful Dragon
marzo
Site Admin
Posts: 1925
Joined: Thu May 14, 2020 1:34 pm

Re: Full Speech!?

Post by marzo »

Playing speech for each dialog line: unlikely, but possible. There would have to be the need to identify what dialog to play for each dialog line in more than just English, though.

Recording all of the dialog to be played: much more unlikely, not to mention that it would be a huge download. Moreover, good quality voice acting is difficult and expensive.

Using mp3 as the format for the voice: no chance at all. We don't want to jeopardize Exult by burdening it with mp3 patent issues, and until mp3 patents expire, it is simply not going to happen.
------
Marzo Sette Torres Junior
aka Geometrodynamic Dragon
[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
Guru Dragon
Posts: 42
Joined: Thu May 14, 2020 1:34 pm

Re: Full Speech!?

Post by Guru Dragon »

You could always run the dialog through text to speech. Although you'd have to create different voices for the hundreds of characters as well as a pronunciation guide for all the bizarre terms used. And, the option would only be available for those with text to speech capable computers.
Kory

Re: Full Speech!?

Post by Kory »

There would have to be the need to identify what dialog to play for each dialog line in more than just English, though.
You're right... And I forgot to include the "page" of multi-"page" responses. So the filename might actually need to be more like:
---.
dupre-job-0-en.ogg
...huge download.
I'm honestly not sure how large it would be, but I know modern games often have full speech. Though, perhaps to accomodate this, they have far less dialog than U7. Marzo, I just saw your "Utlima 7 HD?" thread regarding an enhanced (HD) version which started out with some awsome graphics, but now also includes some great music imporvments. But, unlike the graphic update that requires everything to be updated before anything will work, voice can be rolled out as it becomes available. Maybe only major characters would be done (like in U8)...
Moreover, good quality voice acting is difficult and expensive
I agree.. which is percisely why I proposed to make a website geared toward making it as easy as possible for player's to contribute their own attempts. I'm certainly no expert, but I've seen the behind-the-scenes for voice acting, so I'm not expecting studio-quality stuff from A-list actors here... In fact, I can imagine some pretty low quality stuff in initial releases... But I suspect that, slowly, over time, some really fun, good quality, well-fitting voices would come through.
Using mp3 as the format for the voice: no chance at all
O I C... never mind the mp3 idea then... but perhaps there's an alternative... The music samples submitted by Ted from your "Utlima 7 HD?" thread are currently MP3's, but I'm not sure what compression they'd use if/when actually implemented. Since voice can generally have a lower bit-rate/smaller filesize, perhaps the same compression method would be acceptable!?

- Kory
Deceitful Dragon
marzo
Site Admin
Posts: 1925
Joined: Thu May 14, 2020 1:34 pm

Re: Full Speech!?

Post by marzo »

You're right... And I forgot to include the "page" of multi-"page" responses. So the filename might actually need to be more like:
---.
dupre-job-0-en.ogg
That would still fail; some conversations change for the same keyword if different game flags are set, or if you have certain items and such. Also, conversation is sometimes build from smaller blocks to include gender information or name, and many other things, such as spell names and prices (like buying spells, for example, or haggling in SI). Not to mention that dialog is not always keyed to any keyword (such as the initial greeting, which usually changes if you have met the NPC in question).

For what is worth, I am not dismissing the idea, I am merely pointing out that the problem is harder than it looks. The idea has been discussed in the past, but, I am too lazy to search for the threads right now.
Since voice can generally have a lower bit-rate/smaller filesize, perhaps the same compression method would be acceptable!?
Better alternatives to MP3 are Vorbis and Speex. They are both patent free, have open source implementations, and one of them (Vorbis) is already supported by Exult.
------
Marzo Sette Torres Junior
aka Geometrodynamic Dragon
[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
marzo
Site Admin
Posts: 1925
Joined: Thu May 14, 2020 1:34 pm

Re: Full Speech!?

Post by marzo »

You could always run the dialog through text to speech.
In addition to the issues you point out, you forgot that the synthetized voice would likely not have the 'proper' intonations in many (most?) cases where emotion is needed.
------
Marzo Sette Torres Junior
aka Geometrodynamic Dragon
[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
Kory

Re: Full Speech!?

Post by Kory »

some conversations change for the same keyword [and can] include gender information or name, and many other things, such as spell names and prices
I was looking at a sample uncomplied usecode file that had an if/else block based on "response"s ... but I suppose there could be sub conditions within those for flags... Is that typically how multiple responses for the same keyword work?

The bottom line is that there are a finite # of dialog blocks and a finite number of conditions. Perhaps too many variables for the usecode parser to dynamically determine a filename that matches the dialog though. ... ... otherwise you'd have some sort of wacky filename with a trailing string of stats, flags, item id's, etc... heh.... ---[0..n - seperated flag #'s or item id's].ogg

well shoot... I'm interested to see what was discussed previously... I'll search the forums some more to see what I can turn up... I also downloaded the latest snapshot of the code, but I think I'd need to be pointed in the general direction... If it is reasonbly doable, is there any interest? People got pretty excited about the proposition of 32-bit graphics... sounds like maybe speech isn't as cool...

- Kory
Deceitful Dragon
Madoc

Re: Full Speech!?

Post by Madoc »

What about copyright? It would certainly violate copyright if you'd offer all speech from Ultima as a text file download. Reading the speech out aloud and offering a voice download does not seem so different to me. Unless of course you can prove that the voice acting has become a different artwork of its own...

Another thing: The voting process that you imagine for all the volunteer voice actors would be doomed to fail. Reasons:

- There would not be many volunteers anyway. Imagine all people with a computer. Now, take away all that will never play Exult. (Which is quite a majority, I am afraid.) From the rest, take all away that do not own a microphone or cannot record their voice with the computer. Now, take all away that cannot produce sound of even mediocre quality. Take all away who do not speak English well enough. Then, take all away that do not have the time, ambition or self esteem to do it. The rest are the actual volunteers. They are not many. Imagine them being divided among all Ultima NPCs. You can be happy if you have one speaker per NPC (which you probably won't), therefore voting makes no sense.

- I would never record hours of speech, only to participate in a voting process that might result in my hour-long work to be discarded because I have not been chosen. No way.

- Imagine that you actually *have* been chosen to speak a voice. So you take on the work, and after weeks or months, you are finally done speaking the character. That would probably make you proud. Your voice gets incorporated into the game. A few months later, the community votes for another speaker for that NPC, and you are thrown out. That would really suck.

So my advice would be: no voting, you decide. You search for speakers for certain voices. You can make a list on a web site, showing which voices are still open. Applicants shall send three demo voice files to you, in which they speak some text that you choose. When you get an email from one applicant, you personally listen to the files and decide if you take that speaker or not. No voting.
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: Full Speech!?

Post by Malignant Manor »

I totally agree on the incredibly small chance of having passable speech soundbites added but it would be nice to have the option in the engine at least for engine improvement sakes.

maybe:

UI_play_speech(path/trackname); // folder starting at exult folder if no drive is selected.

Have speech tracks not play if speech is disabled.


Marzo, could you please e-mail me your modified usecode decompiler so that I can see how plausible this would even be to implement into the usecode itself. I've always been curious as to how much less annoying it would be to read and compile with ucc anyway.

Usecode implementation means shifting through and getting to compile properly a lot of functions and could easily introduce bugs. It does have an advantage of being able to properly select a sound file for anything, relatively easy for Marzo to implement, and allows page per page speech if wanted. Special functions like party say would have to be redone so they can instead just return an npc number.
Kory

Re: Full Speech!?

Post by Kory »

I was just looking at ucparse.yy and some other files... I'm not sure if the link to the source on the site is the latest/greatest... but, whatever the case, it does look like it would be an undertaking to track each conditional for a flag/item/sex/etc, sort them, and build a filename for each "converse" iteration (AND the initial "intro" speech). So I started thinking about the same approach Malignant Manor mentioned... but I didn't go too far because... well... Does exult use its own USECODE file? I was under the impression that it uses the original ultima7\static version...

- Kory
Deceitful Dragon
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: Full Speech!?

Post by Malignant Manor »

It uses the original usecode file. UCXT converts it to a partially UCC compilable, human readable file.

Using the UCC compiler, you basically have to rewrite most of the usecode file (just over 3 mb for BG and more than 4 1/2 for SI). I'm maybe 2/3 of the way through just copy/pasting the decompiled functions into a separate file and it is over 47k lines.

There is another compiler/decompiler that dumps the code in more of a binary setup. I'm not really sure how much you can change with it ie. adding Exult only intrinsics and am also unsure as to how hard it would be to add them. My guess is that it wouldn't be pretty.



Sample of UCXT output:

Code: Select all

extern var Func090A 0x90A ();
extern Func0875 0x875 (var var0000, var var0001);
extern Func092E 0x92E (var var0000);

Func0431 0x431 (var var0000)
{
	var var0001;
	var var0002;

	if (!(event == 0x0001)) goto labelFunc0431_0106;
	UI_show_npc_face(0xFFCF, 0x0000);
	UI_add_answer(["name", "job", "bye"]);
	var0000 = UI_part_of_day();
	var0001 = UI_get_schedule_type(UI_get_npc_object(0xFFCF));
	if (!(!gflags[0x00B2])) goto labelFunc0431_0049;
	message("You see a fighter with intense eyes and a serious disposition.");
	say();
	gflags[0x00B2] = true;
	goto labelFunc0431_004D;
	labelFunc0431_0049:
		message("\"Yes, Avatar?\" Denby asks.");
		say();
	labelFunc0431_004D:
		converse (0) atend labelFunc0431_0101;
		case "name" atend labelFunc0431_0063:;
		message("\"I am Denby.\"");
		say();
		UI_remove_answer("name");
	labelFunc0431_0063:
		case "job" atend labelFunc0431_007F:;
		message("\"I am a trainer. I specialize in a form of combat which relies on one's ability to use intelligence and physical ability to activate minor magical effects. But I am not a mage. I am a fighter.\"");
		say();
		UI_add_answer(["magical effects", "fighter", "train"]);
	labelFunc0431_007F:
		case "magical effects" atend labelFunc0431_009D:;
		message("\"For example, I simply teach a combination of physical and mental exercises which increases one's intelligence. This, in turn, gives one an advantage if one desires to practice magic.\"");
		say();
		if (!(!gflags[0x0003])) goto labelFunc0431_0096;
		message("\"Thou shouldst be aware, however, that magic is not working in Britannia these days. It is a dying phenomenon. No one understands why. Nevertheless, my training should increase any magic user's primary chances for casting a spell, as well as their fighting skill.\"");
		say();
	labelFunc0431_0096:
		UI_remove_answer("magical effects");
	labelFunc0431_009D:
		case "fighter" atend labelFunc0431_00B0:;
		message("\"Although I am a fighter, I have dedicated my life to peace. There has been too much fighting in the world as it is. Let history take care of the adversarial qualities which exist in man. I believe in using my skills as a deterrent.\"");
		say();
		UI_remove_answer("fighter");
	labelFunc0431_00B0:
		case "train" atend labelFunc0431_00F3:;
		if (!(var0001 == 0x0007)) goto labelFunc0431_00E8;
		message("\"My fee for training is 75 gold. Does this meet with the approval of thy purse strings?\"");
		say();
		if (!Func090A()) goto labelFunc0431_00E1;
		Func0875([0x0001, 0x0002, 0x0006], 0x004B);
		goto labelFunc0431_00E5;
	labelFunc0431_00E1:
		message("Denby bows. \"I am sorry my fee is too high for thee. Perhaps at another time thou wilt realize the value of my services.\"");
		say();
	labelFunc0431_00E5:
		goto labelFunc0431_00F3;
	labelFunc0431_00E8:
		message("\"Please return during daylight hours if thou dost wish to train.\"");
		say();
		UI_remove_answer("train");
	labelFunc0431_00F3:
		case "bye" atend labelFunc0431_00FE:;
		goto labelFunc0431_0101;
	labelFunc0431_00FE:
		goto labelFunc0431_004D;
	labelFunc0431_0101:
		break;
		message("Denby puts his palms together and bows.*");
		say();
	labelFunc0431_0106:
		if (!(event == 0x0000)) goto labelFunc0431_0114;
		Func092E(0xFFCF);
	labelFunc0431_0114:
		return;
}
marzo
Site Admin
Posts: 1925
Joined: Thu May 14, 2020 1:34 pm

Re: Full Speech!?

Post by marzo »

Marzo, could you please e-mail me your modified usecode decompiler so that I can see how plausible this would even be to implement into the usecode itself.
It is not in good enough shape to be sharing around yet. Heck, it is not in good enough shape to be called a decompiler yet :-)
I was just looking at ucparse.yy and some other files...
ucparsy.yy and all files in the same directory are for the usecode compiler; Exult itself does not use it. Usecode gets run by ucinternal.cc.
------
Marzo Sette Torres Junior
aka Geometrodynamic Dragon
[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: Full Speech!?

Post by Malignant Manor »

It is not in good enough shape to be sharing around yet. Heck, it is not in good enough shape to be called a decompiler yet :-)

I would still be interested in seeing the result compared to the current ucxt output. I'm hoping it would be slightly helpful in some of the horrible ucxt output but if you really don't want to share it; it is fine.
marzo
Site Admin
Posts: 1925
Joined: Thu May 14, 2020 1:34 pm

Re: Full Speech!?

Post by marzo »

I would still be interested in seeing the result compared to the current ucxt output.
For now, the only output it generates is a list of appropriate function names for all shapes, NPCs and spells, as well as a list of all usecode eggs, their locations and usecode functions. It still has no output of usecode, which is why I am not too keen on sharing it yet.
------
Marzo Sette Torres Junior
aka Geometrodynamic Dragon
[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
Bob The Cowboy

Re: Full Speech!?

Post by Bob The Cowboy »

I, for one, would be interested in seeing this, and definitely interested in contributing to it in the form of dialog readings. It would be a nice way to contribute to Exult since I lack the skill in graphic arts and I'm not sure my coding skills are up to par. I could also convince some people I know to do readings as well for other characters.
Locked